From 59ce389800703c1509810f19ab77c467531ab07f Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Mon, 27 Nov 2023 03:52:56 +0000 Subject: [PATCH] Regenerated Clients --- .../08ec06b7d51d438aad3520ffd9487a54.json | 8 + .../0dc7be6d346248608ebf408626d72ef8.json | 8 + .../110e7733dfdd488da7c2eedbd702c5f1.json | 8 + .../11e051cb4ada41a8a7a70d717a93c34c.json | 8 + .../13503e6b9b6546c29d1e79a5cd8ef97a.json | 8 + .../1b58fffa2d604f8e9976f76cbac20b36.json | 8 + .../1f988490666e42b9835a903aa299a431.json | 8 + .../22b7a889d2f8492aac6e46cce7d6d532.json | 8 + .../273c554cfc64487caa8eb4fc7438ffbf.json | 8 + .../28b92acaa6d945038d6efd00b0140e0a.json | 8 + .../28c9c20e0448482d81411f3191914af6.json | 8 + .../2a3b3de343f4463d97ba211b6f3f8586.json | 8 + .../2af54a03613d41f49fe0dbaa7f535763.json | 8 + .../3d6b2b8b5e3947b1890ac6e231a382cd.json | 8 + .../41575353444b40ffbf474f4155544f00.json | 13 + .../49cbdb1fd7ee4f80a0a8877b7a34775e.json | 8 + .../4fac0b90e31546a78834d0e003279d97.json | 8 + .../59de928df4dd4f60b548cfe456b58f67.json | 8 + .../81e0c6a4ef3d4ce28506082b5146278b.json | 8 + .../833b06857d48412a8f33aaa6bca6a9e8.json | 8 + .../8770fbe4afd64dfe9db2985720f73a2e.json | 8 + .../87efab46af3a403ba80e0ef1280bddb4.json | 8 + .../8c6c19cfa09b43f090407901af98c56b.json | 8 + .../8d79723dd9644f368a81ebbf00c27654.json | 8 + .../9229994609e84df0855047bf21b028f7.json | 8 + .../93cbf53ce38c4634b7530ddaf62f248c.json | 8 + .../9616d5951fea4e7bb084434ceb888e86.json | 8 + .../97fca4245e284e96b2cb45b18d342c38.json | 8 + .../9a837a175fe14781a853fdb43e982ae4.json | 8 + .../b5d1d8a315644f6cb9b3ad47bcd7d2ca.json | 8 + .../b9c2ec86901c42a59820ee0c3e34adc8.json | 8 + .../be394c000b5c421daea63df18df62b29.json | 8 + .../bfc3db4cc39d4a77b67318f9441716fb.json | 8 + .../c2072305efb04fd3b7718e013e8cf9d9.json | 8 + .../d3b15518237943c2a5e869adb8d1ad26.json | 8 + .../dcddb56f5f5d4ce89a25346ab338b236.json | 8 + .../f5a138093fc844cabbcfc17b0cc0245b.json | 8 + .../f9bff5111bfd4d6faa5bd32e589eef94.json | 8 + .../fa1013741bae408e843dcdd5875fe88e.json | 8 + .../api_op_CheckAccessNotGranted.go | 163 + .../accessanalyzer/api_op_CheckNoNewAccess.go | 166 + .../accessanalyzer/api_op_CreateAnalyzer.go | 15 +- service/accessanalyzer/api_op_GetFindingV2.go | 292 + .../accessanalyzer/api_op_ListFindingsV2.go | 249 + .../accessanalyzer/api_op_ValidatePolicy.go | 14 +- service/accessanalyzer/deserializers.go | 2018 +++- service/accessanalyzer/doc.go | 37 +- service/accessanalyzer/endpoints.go | 4 +- service/accessanalyzer/generated.json | 4 + service/accessanalyzer/serializers.go | 423 + service/accessanalyzer/types/enums.go | 86 +- service/accessanalyzer/types/errors.go | 52 + service/accessanalyzer/types/types.go | 288 +- .../types/types_exported_test.go | 52 + service/accessanalyzer/validators.go | 207 + service/amp/api_op_CreateScraper.go | 211 + service/amp/api_op_DeleteScraper.go | 186 + service/amp/api_op_DescribeScraper.go | 498 + .../api_op_GetDefaultScraperConfiguration.go | 131 + service/amp/api_op_ListScrapers.go | 237 + service/amp/deserializers.go | 2705 +++-- service/amp/endpoints.go | 2 +- service/amp/generated.json | 6 + service/amp/serializers.go | 482 + service/amp/types/enums.go | 29 + service/amp/types/types.go | 226 + service/amp/types/types_exported_test.go | 62 + service/amp/validators.go | 203 + .../internal/endpoints/endpoints.go | 8 + service/bcmdataexports/LICENSE.txt | 202 + service/bcmdataexports/api_client.go | 455 + service/bcmdataexports/api_client_test.go | 123 + service/bcmdataexports/api_op_CreateExport.go | 159 + service/bcmdataexports/api_op_DeleteExport.go | 136 + service/bcmdataexports/api_op_GetExecution.go | 151 + service/bcmdataexports/api_op_GetExport.go | 140 + service/bcmdataexports/api_op_GetTable.go | 157 + .../bcmdataexports/api_op_ListExecutions.go | 236 + service/bcmdataexports/api_op_ListExports.go | 227 + service/bcmdataexports/api_op_ListTables.go | 227 + .../api_op_ListTagsForResource.go | 147 + service/bcmdataexports/api_op_TagResource.go | 139 + .../bcmdataexports/api_op_UntagResource.go | 137 + service/bcmdataexports/api_op_UpdateExport.go | 143 + service/bcmdataexports/auth.go | 256 + service/bcmdataexports/deserializers.go | 3640 +++++++ service/bcmdataexports/doc.go | 11 + service/bcmdataexports/endpoints.go | 533 + .../bcmdataexports/endpoints_config_test.go | 139 + service/bcmdataexports/endpoints_test.go | 428 + service/bcmdataexports/generated.json | 44 + service/bcmdataexports/go.mod | 17 + service/bcmdataexports/go.sum | 4 + service/bcmdataexports/go_module_metadata.go | 6 + .../internal/endpoints/endpoints.go | 296 + .../internal/endpoints/endpoints_test.go | 11 + service/bcmdataexports/options.go | 219 + service/bcmdataexports/protocol_test.go | 3 + service/bcmdataexports/serializers.go | 1103 ++ service/bcmdataexports/types/enums.go | 177 + service/bcmdataexports/types/errors.go | 155 + service/bcmdataexports/types/types.go | 297 + service/bcmdataexports/validators.go | 602 + .../cloudtrail/api_op_DeleteEventDataStore.go | 11 +- .../cloudtrail/api_op_DisableFederation.go | 145 + service/cloudtrail/api_op_EnableFederation.go | 166 + .../cloudtrail/api_op_GetEventDataStore.go | 10 + .../cloudtrail/api_op_UpdateEventDataStore.go | 10 + service/cloudtrail/deserializers.go | 711 +- service/cloudtrail/generated.json | 2 + service/cloudtrail/serializers.go | 139 + service/cloudtrail/types/enums.go | 22 + service/cloudtrail/types/errors.go | 84 + service/cloudtrail/validators.go | 81 + .../cloudwatchlogs/api_op_CreateDelivery.go | 2 +- .../api_op_CreateLogAnomalyDetector.go | 193 + .../cloudwatchlogs/api_op_CreateLogGroup.go | 12 +- .../api_op_DeleteLogAnomalyDetector.go | 134 + .../api_op_DescribeLogGroups.go | 7 + .../api_op_GetLogAnomalyDetector.go | 175 + .../cloudwatchlogs/api_op_ListAnomalies.go | 240 + .../api_op_ListLogAnomalyDetectors.go | 237 + .../api_op_PutDeliveryDestination.go | 2 +- .../api_op_PutDeliveryDestinationPolicy.go | 2 +- .../api_op_PutDeliverySource.go | 2 +- .../cloudwatchlogs/api_op_UpdateAnomaly.go | 161 + .../api_op_UpdateLogAnomalyDetector.go | 157 + service/cloudwatchlogs/deserializers.go | 2614 ++++- service/cloudwatchlogs/generated.json | 7 + service/cloudwatchlogs/serializers.go | 608 ++ service/cloudwatchlogs/types/enums.go | 146 + service/cloudwatchlogs/types/types.go | 208 +- service/cloudwatchlogs/validators.go | 198 + .../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/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 ++ ...p_GetEffectiveRecommendationPreferences.go | 26 + .../api_op_PutRecommendationPreferences.go | 30 + service/computeoptimizer/deserializers.go | 1490 ++- service/computeoptimizer/endpoints.go | 2 +- service/computeoptimizer/serializers.go | 123 + service/computeoptimizer/types/enums.go | 480 +- service/computeoptimizer/types/types.go | 391 + service/configservice/deserializers.go | 227 + service/configservice/serializers.go | 74 + service/configservice/types/enums.go | 18 + service/configservice/types/types.go | 285 +- service/configservice/validators.go | 76 + .../controltower/api_op_CreateLandingZone.go | 158 + .../controltower/api_op_DeleteLandingZone.go | 142 + service/controltower/api_op_DisableControl.go | 7 +- service/controltower/api_op_EnableControl.go | 7 +- .../api_op_GetControlOperation.go | 3 +- .../controltower/api_op_GetEnabledControl.go | 4 +- service/controltower/api_op_GetLandingZone.go | 139 + .../api_op_GetLandingZoneOperation.go | 140 + .../api_op_ListEnabledControls.go | 10 +- .../controltower/api_op_ListLandingZones.go | 234 + .../api_op_ListTagsForResource.go | 2 +- .../controltower/api_op_ResetLandingZone.go | 142 + service/controltower/api_op_TagResource.go | 4 +- service/controltower/api_op_UntagResource.go | 4 +- .../controltower/api_op_UpdateLandingZone.go | 154 + service/controltower/deserializers.go | 1694 ++- service/controltower/doc.go | 51 +- service/controltower/document/doc.go | 66 + service/controltower/document/document.go | 34 + service/controltower/endpoints_test.go | 20 - service/controltower/generated.json | 11 + .../internal/document/document.go | 99 + .../internal/document/document_test.go | 11 + service/controltower/serializers.go | 573 + service/controltower/types/enums.go | 80 + service/controltower/types/errors.go | 5 +- service/controltower/types/types.go | 120 +- service/controltower/validators.go | 243 + service/costoptimizationhub/LICENSE.txt | 202 + service/costoptimizationhub/api_client.go | 455 + .../costoptimizationhub/api_client_test.go | 123 + .../api_op_GetPreferences.go | 134 + .../api_op_GetRecommendation.go | 210 + .../api_op_ListEnrollmentStatuses.go | 236 + .../api_op_ListRecommendationSummaries.go | 255 + .../api_op_ListRecommendations.go | 239 + .../api_op_UpdateEnrollmentStatus.go | 147 + .../api_op_UpdatePreferences.go | 140 + service/costoptimizationhub/auth.go | 256 + service/costoptimizationhub/deserializers.go | 5728 ++++++++++ service/costoptimizationhub/doc.go | 12 + service/costoptimizationhub/endpoints.go | 509 + .../endpoints_config_test.go | 139 + service/costoptimizationhub/endpoints_test.go | 856 ++ service/costoptimizationhub/generated.json | 40 + service/costoptimizationhub/go.mod | 17 + service/costoptimizationhub/go.sum | 4 + .../costoptimizationhub/go_module_metadata.go | 6 + .../internal/endpoints/endpoints.go | 306 + .../internal/endpoints/endpoints_test.go | 11 + service/costoptimizationhub/options.go | 219 + service/costoptimizationhub/protocol_test.go | 3 + service/costoptimizationhub/serializers.go | 760 ++ service/costoptimizationhub/types/enums.go | 202 + service/costoptimizationhub/types/errors.go | 145 + service/costoptimizationhub/types/types.go | 1050 ++ .../types/types_exported_test.go | 74 + service/costoptimizationhub/validators.go | 127 + service/detective/api_op_GetInvestigation.go | 175 + service/detective/api_op_ListIndicators.go | 169 + .../detective/api_op_ListInvestigations.go | 161 + .../detective/api_op_StartInvestigation.go | 154 + .../api_op_UpdateInvestigationState.go | 144 + service/detective/deserializers.go | 2959 +++-- service/detective/endpoints.go | 2 +- service/detective/generated.json | 5 + service/detective/serializers.go | 538 + service/detective/types/enums.go | 164 + service/detective/types/types.go | 276 + service/detective/validators.go | 291 + service/docdb/internal/endpoints/endpoints.go | 126 + service/ecs/api_op_PutAccountSetting.go | 14 +- .../ecs/api_op_PutAccountSettingDefault.go | 7 +- service/ecs/deserializers.go | 9 + service/ecs/types/enums.go | 20 + service/ecs/types/types.go | 6 + service/efs/api_op_CreateAccessPoint.go | 24 +- service/efs/api_op_CreateFileSystem.go | 58 +- service/efs/api_op_CreateMountTarget.go | 17 +- .../api_op_CreateReplicationConfiguration.go | 22 +- service/efs/api_op_DescribeBackupPolicy.go | 2 +- .../api_op_DescribeLifecycleConfiguration.go | 12 +- service/efs/api_op_DescribeMountTargets.go | 94 + ...pi_op_DescribeReplicationConfigurations.go | 94 + .../efs/api_op_PutLifecycleConfiguration.go | 59 +- service/efs/api_op_UpdateFileSystem.go | 12 +- service/efs/deserializers.go | 22 + service/efs/endpoints.go | 2 +- service/efs/serializers.go | 5 + service/efs/types/enums.go | 50 +- service/efs/types/types.go | 68 +- service/eks/api_op_CreateCluster.go | 20 +- .../api_op_CreateEksAnywhereSubscription.go | 5 +- .../api_op_CreatePodIdentityAssociation.go | 229 + .../api_op_DeleteEksAnywhereSubscription.go | 4 +- .../api_op_DeletePodIdentityAssociation.go | 145 + service/eks/api_op_DescribeAddonVersions.go | 12 +- .../api_op_DescribePodIdentityAssociation.go | 146 + service/eks/api_op_ListAddons.go | 11 +- .../api_op_ListEksAnywhereSubscriptions.go | 108 +- .../eks/api_op_ListIdentityProviderConfigs.go | 8 +- .../eks/api_op_ListPodIdentityAssociations.go | 278 + service/eks/api_op_UpdateClusterConfig.go | 9 +- .../api_op_UpdateEksAnywhereSubscription.go | 2 +- .../api_op_UpdatePodIdentityAssociation.go | 188 + service/eks/deserializers.go | 1301 ++- service/eks/generated.json | 5 + service/eks/serializers.go | 441 + service/eks/types/types.go | 91 +- service/eks/validators.go | 213 + service/eksauth/LICENSE.txt | 202 + service/eksauth/api_client.go | 454 + service/eksauth/api_client_test.go | 123 + .../api_op_AssumeRoleForPodIdentity.go | 176 + service/eksauth/auth.go | 256 + service/eksauth/deserializers.go | 1120 ++ service/eksauth/doc.go | 8 + service/eksauth/endpoints.go | 480 + service/eksauth/endpoints_config_test.go | 139 + service/eksauth/endpoints_test.go | 356 + service/eksauth/generated.json | 32 + service/eksauth/go.mod | 17 + service/eksauth/go.sum | 4 + service/eksauth/go_module_metadata.go | 6 + .../eksauth/internal/endpoints/endpoints.go | 296 + .../internal/endpoints/endpoints_test.go | 11 + service/eksauth/options.go | 219 + service/eksauth/protocol_test.go | 3 + service/eksauth/serializers.go | 102 + service/eksauth/types/errors.go | 249 + service/eksauth/types/types.go | 95 + service/eksauth/validators.go | 52 + .../elasticloadbalancingv2/api_op_AddTags.go | 6 +- .../api_op_AddTrustStoreRevocations.go | 140 + .../api_op_CreateListener.go | 3 + .../api_op_CreateTrustStore.go | 155 + .../api_op_DeleteTrustStore.go | 132 + .../api_op_DescribeTargetHealth.go | 3 + .../api_op_DescribeTrustStoreAssociations.go | 241 + .../api_op_DescribeTrustStoreRevocations.go | 245 + .../api_op_DescribeTrustStores.go | 237 + ...pi_op_GetTrustStoreCaCertificatesBundle.go | 137 + .../api_op_GetTrustStoreRevocationContent.go | 142 + .../api_op_ModifyListener.go | 3 + .../api_op_ModifyTrustStore.go | 151 + .../api_op_RemoveTrustStoreRevocations.go | 137 + .../elasticloadbalancingv2/deserializers.go | 9665 +++++++++++------ service/elasticloadbalancingv2/generated.json | 10 + service/elasticloadbalancingv2/serializers.go | 1080 +- service/elasticloadbalancingv2/types/enums.go | 89 + .../elasticloadbalancingv2/types/errors.go | 298 +- service/elasticloadbalancingv2/types/types.go | 133 +- service/elasticloadbalancingv2/validators.go | 374 + service/freetier/LICENSE.txt | 202 + service/freetier/api_client.go | 454 + service/freetier/api_client_test.go | 123 + service/freetier/api_op_GetFreeTierUsage.go | 241 + service/freetier/auth.go | 256 + service/freetier/deserializers.go | 637 ++ service/freetier/doc.go | 15 + service/freetier/endpoints.go | 593 + service/freetier/endpoints_config_test.go | 139 + service/freetier/endpoints_test.go | 482 + service/freetier/generated.json | 33 + service/freetier/go.mod | 17 + service/freetier/go.sum | 4 + service/freetier/go_module_metadata.go | 6 + .../freetier/internal/endpoints/endpoints.go | 296 + .../internal/endpoints/endpoints_test.go | 11 + service/freetier/options.go | 219 + service/freetier/protocol_test.go | 3 + service/freetier/serializers.go | 190 + service/freetier/types/enums.go | 55 + service/freetier/types/errors.go | 86 + service/freetier/types/types.go | 116 + service/freetier/validators.go | 122 + .../fsx/api_op_CopySnapshotAndUpdateVolume.go | 219 + service/fsx/api_op_CreateFileSystem.go | 11 +- .../fsx/api_op_CreateFileSystemFromBackup.go | 2 +- .../api_op_DescribeSharedVpcConfiguration.go | 132 + .../api_op_DisassociateFileSystemAliases.go | 4 +- service/fsx/api_op_UpdateFileSystem.go | 2 + .../api_op_UpdateSharedVpcConfiguration.go | 183 + service/fsx/deserializers.go | 676 ++ service/fsx/generated.json | 3 + service/fsx/serializers.go | 301 + service/fsx/types/enums.go | 50 +- service/fsx/types/types.go | 263 +- service/fsx/validators.go | 48 +- service/guardduty/deserializers.go | 310 + service/guardduty/doc.go | 37 +- service/guardduty/types/enums.go | 76 +- service/guardduty/types/types.go | 94 + .../iotfleetwise/api_op_GetDecoderManifest.go | 4 + .../api_op_GetEncryptionConfiguration.go | 2 +- service/iotfleetwise/deserializers.go | 748 +- service/iotfleetwise/endpoints.go | 2 +- service/iotfleetwise/serializers.go | 307 +- service/iotfleetwise/types/enums.go | 156 +- service/iotfleetwise/types/types.go | 287 +- .../iotfleetwise/types/types_exported_test.go | 52 + service/iotfleetwise/validators.go | 223 + ...akeFormationIdentityCenterConfiguration.go | 149 + ...akeFormationIdentityCenterConfiguration.go | 130 + ...akeFormationIdentityCenterConfiguration.go | 147 + .../api_op_SearchTablesByLFTags.go | 4 +- ...akeFormationIdentityCenterConfiguration.go | 141 + service/lakeformation/deserializers.go | 645 +- service/lakeformation/endpoints.go | 2 +- service/lakeformation/generated.json | 4 + service/lakeformation/serializers.go | 354 + service/lakeformation/types/enums.go | 36 + service/lakeformation/types/types.go | 22 +- service/lakeformation/validators.go | 100 + service/lexmodelsv2/api_op_CreateBotLocale.go | 8 + .../lexmodelsv2/api_op_CreateBotVersion.go | 10 +- .../lexmodelsv2/api_op_DescribeBotLocale.go | 4 + .../api_op_DescribeBotResourceGeneration.go | 188 + .../lexmodelsv2/api_op_GenerateBotElement.go | 164 + .../api_op_ListBotResourceGenerations.go | 267 + .../api_op_StartBotResourceGeneration.go | 179 + service/lexmodelsv2/api_op_UpdateBotLocale.go | 9 + service/lexmodelsv2/deserializers.go | 1530 ++- service/lexmodelsv2/generated.json | 4 + service/lexmodelsv2/serializers.go | 597 + service/lexmodelsv2/types/enums.go | 56 + service/lexmodelsv2/types/types.go | 152 + service/lexmodelsv2/validators.go | 369 + service/lexruntimev2/api_op_PutSession.go | 12 +- .../lexruntimev2/api_op_RecognizeUtterance.go | 3 +- service/lexruntimev2/deserializers.go | 9 + service/lexruntimev2/endpoints.go | 2 +- service/lexruntimev2/types/enums.go | 18 + service/lexruntimev2/types/types.go | 57 +- .../api_op_CreateAccessor.go | 26 +- .../managedblockchain/api_op_ListAccessors.go | 5 + service/managedblockchain/deserializers.go | 27 + service/managedblockchain/endpoints.go | 2 +- service/managedblockchain/serializers.go | 9 + service/managedblockchain/types/enums.go | 24 + service/managedblockchain/types/types.go | 15 +- .../neptune/internal/endpoints/endpoints.go | 126 + .../api_op_CreateBatchInferenceJob.go | 31 +- service/personalize/api_op_CreateDataset.go | 12 +- .../personalize/api_op_CreateDatasetGroup.go | 4 +- .../api_op_CreateDatasetImportJob.go | 4 + .../personalize/api_op_CreateEventTracker.go | 6 +- .../api_op_CreateSolutionVersion.go | 21 +- .../personalize/api_op_DeleteEventTracker.go | 5 +- service/personalize/api_op_ListDatasets.go | 4 +- service/personalize/api_op_UpdateCampaign.go | 13 +- service/personalize/deserializers.go | 126 + service/personalize/endpoints.go | 2 +- service/personalize/serializers.go | 48 + service/personalize/types/enums.go | 18 + service/personalize/types/types.go | 67 +- service/personalize/validators.go | 39 + .../api_op_PutActionInteractions.go | 147 + .../personalizeevents/api_op_PutActions.go | 141 + service/personalizeevents/api_op_PutEvents.go | 5 +- service/personalizeevents/api_op_PutItems.go | 2 +- service/personalizeevents/api_op_PutUsers.go | 2 +- service/personalizeevents/deserializers.go | 190 + service/personalizeevents/doc.go | 2 +- service/personalizeevents/endpoints.go | 2 +- service/personalizeevents/generated.json | 2 + service/personalizeevents/serializers.go | 272 + service/personalizeevents/types/types.go | 127 +- service/personalizeevents/validators.go | 165 + .../api_op_GetActionRecommendations.go | 170 + .../api_op_GetPersonalizedRanking.go | 12 +- .../api_op_GetRecommendations.go | 14 +- service/personalizeruntime/deserializers.go | 308 + service/personalizeruntime/generated.json | 1 + service/personalizeruntime/serializers.go | 138 + service/personalizeruntime/types/types.go | 17 + .../api_op_DeleteIdentityPropagationConfig.go | 150 + .../api_op_ListIdentityPropagationConfigs.go | 156 + .../api_op_UpdateIdentityPropagationConfig.go | 153 + service/quicksight/deserializers.go | 849 +- service/quicksight/generated.json | 3 + service/quicksight/serializers.go | 276 + service/quicksight/types/enums.go | 16 + service/quicksight/types/types.go | 29 + service/quicksight/validators.go | 123 + service/rds/internal/endpoints/endpoints.go | 126 + .../api_op_AssociateDataShareConsumer.go | 3 + service/redshift/api_op_AuthorizeDataShare.go | 3 + service/redshift/deserializers.go | 32 + service/redshift/serializers.go | 10 + service/redshift/types/types.go | 6 + service/repostspace/LICENSE.txt | 202 + service/repostspace/api_client.go | 454 + service/repostspace/api_client_test.go | 123 + service/repostspace/api_op_CreateSpace.go | 168 + service/repostspace/api_op_DeleteSpace.go | 132 + service/repostspace/api_op_DeregisterAdmin.go | 138 + service/repostspace/api_op_GetSpace.go | 221 + service/repostspace/api_op_ListSpaces.go | 232 + .../repostspace/api_op_ListTagsForResource.go | 138 + service/repostspace/api_op_RegisterAdmin.go | 137 + service/repostspace/api_op_SendInvites.go | 147 + service/repostspace/api_op_TagResource.go | 144 + service/repostspace/api_op_UntagResource.go | 137 + service/repostspace/api_op_UpdateSpace.go | 144 + service/repostspace/auth.go | 256 + service/repostspace/deserializers.go | 2681 +++++ service/repostspace/doc.go | 16 + service/repostspace/endpoints.go | 509 + service/repostspace/endpoints_config_test.go | 139 + service/repostspace/endpoints_test.go | 856 ++ service/repostspace/generated.json | 43 + service/repostspace/go.mod | 17 + service/repostspace/go.sum | 4 + service/repostspace/go_module_metadata.go | 6 + .../internal/endpoints/endpoints.go | 296 + .../internal/endpoints/endpoints_test.go | 11 + service/repostspace/options.go | 219 + service/repostspace/protocol_test.go | 3 + service/repostspace/serializers.go | 909 ++ service/repostspace/types/enums.go | 81 + service/repostspace/types/errors.go | 210 + service/repostspace/types/types.go | 106 + service/repostspace/validators.go | 427 + service/s3/api_op_AbortMultipartUpload.go | 1 + service/s3/api_op_CompleteMultipartUpload.go | 1 + service/s3/api_op_CreateMultipartUpload.go | 1 + service/s3/api_op_DeleteObject.go | 1 + service/s3/api_op_GetObject.go | 1 + service/s3/api_op_GetObjectAcl.go | 1 + service/s3/api_op_HeadObject.go | 1 + service/s3/api_op_ListMultipartUploads.go | 1 + service/s3/api_op_ListObjectVersions.go | 1 + service/s3/api_op_ListObjects.go | 1 + service/s3/api_op_ListObjectsV2.go | 1 + service/s3/api_op_ListParts.go | 1 + service/s3/api_op_PutObject.go | 1 + service/s3/api_op_PutObjectAcl.go | 1 + .../s3/api_op_PutObjectLockConfiguration.go | 5 +- service/s3/api_op_UploadPart.go | 1 + service/s3/endpoints.go | 14 + service/s3/endpoints_test.go | 494 +- ..._op_AssociateAccessGrantsIdentityCenter.go | 260 + service/s3control/api_op_CreateAccessGrant.go | 348 + .../api_op_CreateAccessGrantsInstance.go | 282 + .../api_op_CreateAccessGrantsLocation.go | 303 + service/s3control/api_op_DeleteAccessGrant.go | 250 + .../api_op_DeleteAccessGrantsInstance.go | 251 + ...eleteAccessGrantsInstanceResourcePolicy.go | 245 + .../api_op_DeleteAccessGrantsLocation.go | 255 + ...op_DissociateAccessGrantsIdentityCenter.go | 245 + service/s3control/api_op_GetAccessGrant.go | 296 + .../api_op_GetAccessGrantsInstance.go | 262 + ...api_op_GetAccessGrantsInstanceForPrefix.go | 258 + ...p_GetAccessGrantsInstanceResourcePolicy.go | 255 + .../api_op_GetAccessGrantsLocation.go | 277 + service/s3control/api_op_GetDataAccess.go | 294 + service/s3control/api_op_ListAccessGrants.go | 388 + .../api_op_ListAccessGrantsInstances.go | 354 + .../api_op_ListAccessGrantsLocations.go | 361 + .../s3control/api_op_ListTagsForResource.go | 17 +- ...p_PutAccessGrantsInstanceResourcePolicy.go | 263 + service/s3control/api_op_TagResource.go | 21 +- service/s3control/api_op_UntagResource.go | 21 +- .../api_op_UpdateAccessGrantsLocation.go | 288 + service/s3control/deserializers.go | 7692 +++++++++---- service/s3control/generated.json | 20 + service/s3control/serializers.go | 3272 ++++-- service/s3control/types/enums.go | 74 + service/s3control/types/types.go | 194 +- service/s3control/validators.go | 873 +- .../api_op_BatchGetSecretValue.go | 267 + .../secretsmanager/api_op_GetSecretValue.go | 5 +- service/secretsmanager/api_op_ListSecrets.go | 4 +- service/secretsmanager/deserializers.go | 403 + service/secretsmanager/generated.json | 1 + service/secretsmanager/serializers.go | 97 + service/secretsmanager/types/types.go | 55 +- .../api_op_GetSecurityControlDefinition.go | 144 + .../api_op_UpdateSecurityControl.go | 143 + service/securityhub/deserializers.go | 1538 +++ service/securityhub/generated.json | 3 + service/securityhub/serializers.go | 346 + service/securityhub/types/enums.go | 52 + service/securityhub/types/errors.go | 30 + service/securityhub/types/types.go | 446 +- .../securityhub/types/types_exported_test.go | 98 + service/securityhub/validators.go | 118 + service/sfn/api_op_DescribeExecution.go | 4 +- service/sfn/api_op_DescribeMapRun.go | 4 +- service/sfn/api_op_RedriveExecution.go | 20 +- service/sfn/api_op_TestState.go | 252 + service/sfn/deserializers.go | 451 + service/sfn/generated.json | 1 + service/sfn/serializers.go | 87 + service/sfn/types/enums.go | 42 + service/sfn/types/types.go | 97 +- service/sfn/validators.go | 42 + service/transcribe/deserializers.go | 45 + service/transcribe/endpoints.go | 6 +- service/transcribe/serializers.go | 19 + service/transcribe/types/enums.go | 206 +- service/transcribe/types/types.go | 20 + service/transcribe/validators.go | 20 + .../api_op_ModifyWorkspaceProperties.go | 5 +- service/workspaces/deserializers.go | 174 + service/workspaces/serializers.go | 10 + service/workspaces/types/enums.go | 18 + service/workspaces/types/types.go | 41 + service/workspaces/validators.go | 3 - service/workspacesthinclient/LICENSE.txt | 202 + service/workspacesthinclient/api_client.go | 471 + .../workspacesthinclient/api_client_test.go | 123 + .../api_op_CreateEnvironment.go | 241 + .../api_op_DeleteDevice.go | 208 + .../api_op_DeleteEnvironment.go | 208 + .../api_op_DeregisterDevice.go | 212 + .../workspacesthinclient/api_op_GetDevice.go | 167 + .../api_op_GetEnvironment.go | 167 + .../api_op_GetSoftwareSet.go | 167 + .../api_op_ListDevices.go | 269 + .../api_op_ListEnvironments.go | 270 + .../api_op_ListSoftwareSets.go | 270 + .../api_op_ListTagsForResource.go | 168 + .../api_op_TagResource.go | 167 + .../api_op_UntagResource.go | 168 + .../api_op_UpdateDevice.go | 181 + .../api_op_UpdateEnvironment.go | 191 + .../api_op_UpdateSoftwareSet.go | 168 + service/workspacesthinclient/auth.go | 256 + service/workspacesthinclient/deserializers.go | 4532 ++++++++ service/workspacesthinclient/doc.go | 21 + service/workspacesthinclient/endpoints.go | 509 + .../endpoints_config_test.go | 139 + .../workspacesthinclient/endpoints_test.go | 856 ++ service/workspacesthinclient/generated.json | 48 + service/workspacesthinclient/go.mod | 17 + service/workspacesthinclient/go.sum | 4 + .../go_module_metadata.go | 6 + .../internal/endpoints/endpoints.go | 296 + .../internal/endpoints/endpoints_test.go | 11 + service/workspacesthinclient/options.go | 223 + service/workspacesthinclient/protocol_test.go | 3 + service/workspacesthinclient/serializers.go | 1360 +++ service/workspacesthinclient/types/enums.go | 265 + service/workspacesthinclient/types/errors.go | 240 + service/workspacesthinclient/types/types.go | 378 + service/workspacesthinclient/validators.go | 526 + 616 files changed, 138871 insertions(+), 9944 deletions(-) create mode 100644 .changelog/08ec06b7d51d438aad3520ffd9487a54.json create mode 100644 .changelog/0dc7be6d346248608ebf408626d72ef8.json create mode 100644 .changelog/110e7733dfdd488da7c2eedbd702c5f1.json create mode 100644 .changelog/11e051cb4ada41a8a7a70d717a93c34c.json create mode 100644 .changelog/13503e6b9b6546c29d1e79a5cd8ef97a.json create mode 100644 .changelog/1b58fffa2d604f8e9976f76cbac20b36.json create mode 100644 .changelog/1f988490666e42b9835a903aa299a431.json create mode 100644 .changelog/22b7a889d2f8492aac6e46cce7d6d532.json create mode 100644 .changelog/273c554cfc64487caa8eb4fc7438ffbf.json create mode 100644 .changelog/28b92acaa6d945038d6efd00b0140e0a.json create mode 100644 .changelog/28c9c20e0448482d81411f3191914af6.json create mode 100644 .changelog/2a3b3de343f4463d97ba211b6f3f8586.json create mode 100644 .changelog/2af54a03613d41f49fe0dbaa7f535763.json create mode 100644 .changelog/3d6b2b8b5e3947b1890ac6e231a382cd.json create mode 100644 .changelog/41575353444b40ffbf474f4155544f00.json create mode 100644 .changelog/49cbdb1fd7ee4f80a0a8877b7a34775e.json create mode 100644 .changelog/4fac0b90e31546a78834d0e003279d97.json create mode 100644 .changelog/59de928df4dd4f60b548cfe456b58f67.json create mode 100644 .changelog/81e0c6a4ef3d4ce28506082b5146278b.json create mode 100644 .changelog/833b06857d48412a8f33aaa6bca6a9e8.json create mode 100644 .changelog/8770fbe4afd64dfe9db2985720f73a2e.json create mode 100644 .changelog/87efab46af3a403ba80e0ef1280bddb4.json create mode 100644 .changelog/8c6c19cfa09b43f090407901af98c56b.json create mode 100644 .changelog/8d79723dd9644f368a81ebbf00c27654.json create mode 100644 .changelog/9229994609e84df0855047bf21b028f7.json create mode 100644 .changelog/93cbf53ce38c4634b7530ddaf62f248c.json create mode 100644 .changelog/9616d5951fea4e7bb084434ceb888e86.json create mode 100644 .changelog/97fca4245e284e96b2cb45b18d342c38.json create mode 100644 .changelog/9a837a175fe14781a853fdb43e982ae4.json create mode 100644 .changelog/b5d1d8a315644f6cb9b3ad47bcd7d2ca.json create mode 100644 .changelog/b9c2ec86901c42a59820ee0c3e34adc8.json create mode 100644 .changelog/be394c000b5c421daea63df18df62b29.json create mode 100644 .changelog/bfc3db4cc39d4a77b67318f9441716fb.json create mode 100644 .changelog/c2072305efb04fd3b7718e013e8cf9d9.json create mode 100644 .changelog/d3b15518237943c2a5e869adb8d1ad26.json create mode 100644 .changelog/dcddb56f5f5d4ce89a25346ab338b236.json create mode 100644 .changelog/f5a138093fc844cabbcfc17b0cc0245b.json create mode 100644 .changelog/f9bff5111bfd4d6faa5bd32e589eef94.json create mode 100644 .changelog/fa1013741bae408e843dcdd5875fe88e.json create mode 100644 service/accessanalyzer/api_op_CheckAccessNotGranted.go create mode 100644 service/accessanalyzer/api_op_CheckNoNewAccess.go create mode 100644 service/accessanalyzer/api_op_GetFindingV2.go create mode 100644 service/accessanalyzer/api_op_ListFindingsV2.go create mode 100644 service/amp/api_op_CreateScraper.go create mode 100644 service/amp/api_op_DeleteScraper.go create mode 100644 service/amp/api_op_DescribeScraper.go create mode 100644 service/amp/api_op_GetDefaultScraperConfiguration.go create mode 100644 service/amp/api_op_ListScrapers.go create mode 100644 service/amp/types/types_exported_test.go create mode 100644 service/bcmdataexports/LICENSE.txt create mode 100644 service/bcmdataexports/api_client.go create mode 100644 service/bcmdataexports/api_client_test.go create mode 100644 service/bcmdataexports/api_op_CreateExport.go create mode 100644 service/bcmdataexports/api_op_DeleteExport.go create mode 100644 service/bcmdataexports/api_op_GetExecution.go create mode 100644 service/bcmdataexports/api_op_GetExport.go create mode 100644 service/bcmdataexports/api_op_GetTable.go create mode 100644 service/bcmdataexports/api_op_ListExecutions.go create mode 100644 service/bcmdataexports/api_op_ListExports.go create mode 100644 service/bcmdataexports/api_op_ListTables.go create mode 100644 service/bcmdataexports/api_op_ListTagsForResource.go create mode 100644 service/bcmdataexports/api_op_TagResource.go create mode 100644 service/bcmdataexports/api_op_UntagResource.go create mode 100644 service/bcmdataexports/api_op_UpdateExport.go create mode 100644 service/bcmdataexports/auth.go create mode 100644 service/bcmdataexports/deserializers.go create mode 100644 service/bcmdataexports/doc.go create mode 100644 service/bcmdataexports/endpoints.go create mode 100644 service/bcmdataexports/endpoints_config_test.go create mode 100644 service/bcmdataexports/endpoints_test.go create mode 100644 service/bcmdataexports/generated.json create mode 100644 service/bcmdataexports/go.mod create mode 100644 service/bcmdataexports/go.sum create mode 100644 service/bcmdataexports/go_module_metadata.go create mode 100644 service/bcmdataexports/internal/endpoints/endpoints.go create mode 100644 service/bcmdataexports/internal/endpoints/endpoints_test.go create mode 100644 service/bcmdataexports/options.go create mode 100644 service/bcmdataexports/protocol_test.go create mode 100644 service/bcmdataexports/serializers.go create mode 100644 service/bcmdataexports/types/enums.go create mode 100644 service/bcmdataexports/types/errors.go create mode 100644 service/bcmdataexports/types/types.go create mode 100644 service/bcmdataexports/validators.go create mode 100644 service/cloudtrail/api_op_DisableFederation.go create mode 100644 service/cloudtrail/api_op_EnableFederation.go create mode 100644 service/cloudwatchlogs/api_op_CreateLogAnomalyDetector.go create mode 100644 service/cloudwatchlogs/api_op_DeleteLogAnomalyDetector.go create mode 100644 service/cloudwatchlogs/api_op_GetLogAnomalyDetector.go create mode 100644 service/cloudwatchlogs/api_op_ListAnomalies.go create mode 100644 service/cloudwatchlogs/api_op_ListLogAnomalyDetectors.go create mode 100644 service/cloudwatchlogs/api_op_UpdateAnomaly.go create mode 100644 service/cloudwatchlogs/api_op_UpdateLogAnomalyDetector.go 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/controltower/api_op_CreateLandingZone.go create mode 100644 service/controltower/api_op_DeleteLandingZone.go create mode 100644 service/controltower/api_op_GetLandingZone.go create mode 100644 service/controltower/api_op_GetLandingZoneOperation.go create mode 100644 service/controltower/api_op_ListLandingZones.go create mode 100644 service/controltower/api_op_ResetLandingZone.go create mode 100644 service/controltower/api_op_UpdateLandingZone.go create mode 100644 service/controltower/document/doc.go create mode 100644 service/controltower/document/document.go create mode 100644 service/controltower/internal/document/document.go create mode 100644 service/controltower/internal/document/document_test.go create mode 100644 service/costoptimizationhub/LICENSE.txt create mode 100644 service/costoptimizationhub/api_client.go create mode 100644 service/costoptimizationhub/api_client_test.go create mode 100644 service/costoptimizationhub/api_op_GetPreferences.go create mode 100644 service/costoptimizationhub/api_op_GetRecommendation.go create mode 100644 service/costoptimizationhub/api_op_ListEnrollmentStatuses.go create mode 100644 service/costoptimizationhub/api_op_ListRecommendationSummaries.go create mode 100644 service/costoptimizationhub/api_op_ListRecommendations.go create mode 100644 service/costoptimizationhub/api_op_UpdateEnrollmentStatus.go create mode 100644 service/costoptimizationhub/api_op_UpdatePreferences.go create mode 100644 service/costoptimizationhub/auth.go create mode 100644 service/costoptimizationhub/deserializers.go create mode 100644 service/costoptimizationhub/doc.go create mode 100644 service/costoptimizationhub/endpoints.go create mode 100644 service/costoptimizationhub/endpoints_config_test.go create mode 100644 service/costoptimizationhub/endpoints_test.go create mode 100644 service/costoptimizationhub/generated.json create mode 100644 service/costoptimizationhub/go.mod create mode 100644 service/costoptimizationhub/go.sum create mode 100644 service/costoptimizationhub/go_module_metadata.go create mode 100644 service/costoptimizationhub/internal/endpoints/endpoints.go create mode 100644 service/costoptimizationhub/internal/endpoints/endpoints_test.go create mode 100644 service/costoptimizationhub/options.go create mode 100644 service/costoptimizationhub/protocol_test.go create mode 100644 service/costoptimizationhub/serializers.go create mode 100644 service/costoptimizationhub/types/enums.go create mode 100644 service/costoptimizationhub/types/errors.go create mode 100644 service/costoptimizationhub/types/types.go create mode 100644 service/costoptimizationhub/types/types_exported_test.go create mode 100644 service/costoptimizationhub/validators.go create mode 100644 service/detective/api_op_GetInvestigation.go create mode 100644 service/detective/api_op_ListIndicators.go create mode 100644 service/detective/api_op_ListInvestigations.go create mode 100644 service/detective/api_op_StartInvestigation.go create mode 100644 service/detective/api_op_UpdateInvestigationState.go create mode 100644 service/eks/api_op_CreatePodIdentityAssociation.go create mode 100644 service/eks/api_op_DeletePodIdentityAssociation.go create mode 100644 service/eks/api_op_DescribePodIdentityAssociation.go create mode 100644 service/eks/api_op_ListPodIdentityAssociations.go create mode 100644 service/eks/api_op_UpdatePodIdentityAssociation.go create mode 100644 service/eksauth/LICENSE.txt create mode 100644 service/eksauth/api_client.go create mode 100644 service/eksauth/api_client_test.go create mode 100644 service/eksauth/api_op_AssumeRoleForPodIdentity.go create mode 100644 service/eksauth/auth.go create mode 100644 service/eksauth/deserializers.go create mode 100644 service/eksauth/doc.go create mode 100644 service/eksauth/endpoints.go create mode 100644 service/eksauth/endpoints_config_test.go create mode 100644 service/eksauth/endpoints_test.go create mode 100644 service/eksauth/generated.json create mode 100644 service/eksauth/go.mod create mode 100644 service/eksauth/go.sum create mode 100644 service/eksauth/go_module_metadata.go create mode 100644 service/eksauth/internal/endpoints/endpoints.go create mode 100644 service/eksauth/internal/endpoints/endpoints_test.go create mode 100644 service/eksauth/options.go create mode 100644 service/eksauth/protocol_test.go create mode 100644 service/eksauth/serializers.go create mode 100644 service/eksauth/types/errors.go create mode 100644 service/eksauth/types/types.go create mode 100644 service/eksauth/validators.go create mode 100644 service/elasticloadbalancingv2/api_op_AddTrustStoreRevocations.go create mode 100644 service/elasticloadbalancingv2/api_op_CreateTrustStore.go create mode 100644 service/elasticloadbalancingv2/api_op_DeleteTrustStore.go create mode 100644 service/elasticloadbalancingv2/api_op_DescribeTrustStoreAssociations.go create mode 100644 service/elasticloadbalancingv2/api_op_DescribeTrustStoreRevocations.go create mode 100644 service/elasticloadbalancingv2/api_op_DescribeTrustStores.go create mode 100644 service/elasticloadbalancingv2/api_op_GetTrustStoreCaCertificatesBundle.go create mode 100644 service/elasticloadbalancingv2/api_op_GetTrustStoreRevocationContent.go create mode 100644 service/elasticloadbalancingv2/api_op_ModifyTrustStore.go create mode 100644 service/elasticloadbalancingv2/api_op_RemoveTrustStoreRevocations.go create mode 100644 service/freetier/LICENSE.txt create mode 100644 service/freetier/api_client.go create mode 100644 service/freetier/api_client_test.go create mode 100644 service/freetier/api_op_GetFreeTierUsage.go create mode 100644 service/freetier/auth.go create mode 100644 service/freetier/deserializers.go create mode 100644 service/freetier/doc.go create mode 100644 service/freetier/endpoints.go create mode 100644 service/freetier/endpoints_config_test.go create mode 100644 service/freetier/endpoints_test.go create mode 100644 service/freetier/generated.json create mode 100644 service/freetier/go.mod create mode 100644 service/freetier/go.sum create mode 100644 service/freetier/go_module_metadata.go create mode 100644 service/freetier/internal/endpoints/endpoints.go create mode 100644 service/freetier/internal/endpoints/endpoints_test.go create mode 100644 service/freetier/options.go create mode 100644 service/freetier/protocol_test.go create mode 100644 service/freetier/serializers.go create mode 100644 service/freetier/types/enums.go create mode 100644 service/freetier/types/errors.go create mode 100644 service/freetier/types/types.go create mode 100644 service/freetier/validators.go create mode 100644 service/fsx/api_op_CopySnapshotAndUpdateVolume.go create mode 100644 service/fsx/api_op_DescribeSharedVpcConfiguration.go create mode 100644 service/fsx/api_op_UpdateSharedVpcConfiguration.go create mode 100644 service/lakeformation/api_op_CreateLakeFormationIdentityCenterConfiguration.go create mode 100644 service/lakeformation/api_op_DeleteLakeFormationIdentityCenterConfiguration.go create mode 100644 service/lakeformation/api_op_DescribeLakeFormationIdentityCenterConfiguration.go create mode 100644 service/lakeformation/api_op_UpdateLakeFormationIdentityCenterConfiguration.go create mode 100644 service/lexmodelsv2/api_op_DescribeBotResourceGeneration.go create mode 100644 service/lexmodelsv2/api_op_GenerateBotElement.go create mode 100644 service/lexmodelsv2/api_op_ListBotResourceGenerations.go create mode 100644 service/lexmodelsv2/api_op_StartBotResourceGeneration.go create mode 100644 service/personalizeevents/api_op_PutActionInteractions.go create mode 100644 service/personalizeevents/api_op_PutActions.go create mode 100644 service/personalizeruntime/api_op_GetActionRecommendations.go create mode 100644 service/quicksight/api_op_DeleteIdentityPropagationConfig.go create mode 100644 service/quicksight/api_op_ListIdentityPropagationConfigs.go create mode 100644 service/quicksight/api_op_UpdateIdentityPropagationConfig.go create mode 100644 service/repostspace/LICENSE.txt create mode 100644 service/repostspace/api_client.go create mode 100644 service/repostspace/api_client_test.go create mode 100644 service/repostspace/api_op_CreateSpace.go create mode 100644 service/repostspace/api_op_DeleteSpace.go create mode 100644 service/repostspace/api_op_DeregisterAdmin.go create mode 100644 service/repostspace/api_op_GetSpace.go create mode 100644 service/repostspace/api_op_ListSpaces.go create mode 100644 service/repostspace/api_op_ListTagsForResource.go create mode 100644 service/repostspace/api_op_RegisterAdmin.go create mode 100644 service/repostspace/api_op_SendInvites.go create mode 100644 service/repostspace/api_op_TagResource.go create mode 100644 service/repostspace/api_op_UntagResource.go create mode 100644 service/repostspace/api_op_UpdateSpace.go create mode 100644 service/repostspace/auth.go create mode 100644 service/repostspace/deserializers.go create mode 100644 service/repostspace/doc.go create mode 100644 service/repostspace/endpoints.go create mode 100644 service/repostspace/endpoints_config_test.go create mode 100644 service/repostspace/endpoints_test.go create mode 100644 service/repostspace/generated.json create mode 100644 service/repostspace/go.mod create mode 100644 service/repostspace/go.sum create mode 100644 service/repostspace/go_module_metadata.go create mode 100644 service/repostspace/internal/endpoints/endpoints.go create mode 100644 service/repostspace/internal/endpoints/endpoints_test.go create mode 100644 service/repostspace/options.go create mode 100644 service/repostspace/protocol_test.go create mode 100644 service/repostspace/serializers.go create mode 100644 service/repostspace/types/enums.go create mode 100644 service/repostspace/types/errors.go create mode 100644 service/repostspace/types/types.go create mode 100644 service/repostspace/validators.go create mode 100644 service/s3control/api_op_AssociateAccessGrantsIdentityCenter.go create mode 100644 service/s3control/api_op_CreateAccessGrant.go create mode 100644 service/s3control/api_op_CreateAccessGrantsInstance.go create mode 100644 service/s3control/api_op_CreateAccessGrantsLocation.go create mode 100644 service/s3control/api_op_DeleteAccessGrant.go create mode 100644 service/s3control/api_op_DeleteAccessGrantsInstance.go create mode 100644 service/s3control/api_op_DeleteAccessGrantsInstanceResourcePolicy.go create mode 100644 service/s3control/api_op_DeleteAccessGrantsLocation.go create mode 100644 service/s3control/api_op_DissociateAccessGrantsIdentityCenter.go create mode 100644 service/s3control/api_op_GetAccessGrant.go create mode 100644 service/s3control/api_op_GetAccessGrantsInstance.go create mode 100644 service/s3control/api_op_GetAccessGrantsInstanceForPrefix.go create mode 100644 service/s3control/api_op_GetAccessGrantsInstanceResourcePolicy.go create mode 100644 service/s3control/api_op_GetAccessGrantsLocation.go create mode 100644 service/s3control/api_op_GetDataAccess.go create mode 100644 service/s3control/api_op_ListAccessGrants.go create mode 100644 service/s3control/api_op_ListAccessGrantsInstances.go create mode 100644 service/s3control/api_op_ListAccessGrantsLocations.go create mode 100644 service/s3control/api_op_PutAccessGrantsInstanceResourcePolicy.go create mode 100644 service/s3control/api_op_UpdateAccessGrantsLocation.go create mode 100644 service/secretsmanager/api_op_BatchGetSecretValue.go create mode 100644 service/securityhub/api_op_GetSecurityControlDefinition.go create mode 100644 service/securityhub/api_op_UpdateSecurityControl.go create mode 100644 service/securityhub/types/types_exported_test.go create mode 100644 service/sfn/api_op_TestState.go create mode 100644 service/workspacesthinclient/LICENSE.txt create mode 100644 service/workspacesthinclient/api_client.go create mode 100644 service/workspacesthinclient/api_client_test.go create mode 100644 service/workspacesthinclient/api_op_CreateEnvironment.go create mode 100644 service/workspacesthinclient/api_op_DeleteDevice.go create mode 100644 service/workspacesthinclient/api_op_DeleteEnvironment.go create mode 100644 service/workspacesthinclient/api_op_DeregisterDevice.go create mode 100644 service/workspacesthinclient/api_op_GetDevice.go create mode 100644 service/workspacesthinclient/api_op_GetEnvironment.go create mode 100644 service/workspacesthinclient/api_op_GetSoftwareSet.go create mode 100644 service/workspacesthinclient/api_op_ListDevices.go create mode 100644 service/workspacesthinclient/api_op_ListEnvironments.go create mode 100644 service/workspacesthinclient/api_op_ListSoftwareSets.go create mode 100644 service/workspacesthinclient/api_op_ListTagsForResource.go create mode 100644 service/workspacesthinclient/api_op_TagResource.go create mode 100644 service/workspacesthinclient/api_op_UntagResource.go create mode 100644 service/workspacesthinclient/api_op_UpdateDevice.go create mode 100644 service/workspacesthinclient/api_op_UpdateEnvironment.go create mode 100644 service/workspacesthinclient/api_op_UpdateSoftwareSet.go create mode 100644 service/workspacesthinclient/auth.go create mode 100644 service/workspacesthinclient/deserializers.go create mode 100644 service/workspacesthinclient/doc.go create mode 100644 service/workspacesthinclient/endpoints.go create mode 100644 service/workspacesthinclient/endpoints_config_test.go create mode 100644 service/workspacesthinclient/endpoints_test.go create mode 100644 service/workspacesthinclient/generated.json create mode 100644 service/workspacesthinclient/go.mod create mode 100644 service/workspacesthinclient/go.sum create mode 100644 service/workspacesthinclient/go_module_metadata.go create mode 100644 service/workspacesthinclient/internal/endpoints/endpoints.go create mode 100644 service/workspacesthinclient/internal/endpoints/endpoints_test.go create mode 100644 service/workspacesthinclient/options.go create mode 100644 service/workspacesthinclient/protocol_test.go create mode 100644 service/workspacesthinclient/serializers.go create mode 100644 service/workspacesthinclient/types/enums.go create mode 100644 service/workspacesthinclient/types/errors.go create mode 100644 service/workspacesthinclient/types/types.go create mode 100644 service/workspacesthinclient/validators.go diff --git a/.changelog/08ec06b7d51d438aad3520ffd9487a54.json b/.changelog/08ec06b7d51d438aad3520ffd9487a54.json new file mode 100644 index 00000000000..22c0dd5376d --- /dev/null +++ b/.changelog/08ec06b7d51d438aad3520ffd9487a54.json @@ -0,0 +1,8 @@ +{ + "id": "08ec06b7-d51d-438a-ad35-20ffd9487a54", + "type": "feature", + "description": "This release enables AWS Compute Optimizer to analyze and generate recommendations with customization and discounts preferences.", + "modules": [ + "service/computeoptimizer" + ] +} \ No newline at end of file diff --git a/.changelog/0dc7be6d346248608ebf408626d72ef8.json b/.changelog/0dc7be6d346248608ebf408626d72ef8.json new file mode 100644 index 00000000000..38990b81ecd --- /dev/null +++ b/.changelog/0dc7be6d346248608ebf408626d72ef8.json @@ -0,0 +1,8 @@ +{ + "id": "0dc7be6d-3462-4860-8ebf-408626d72ef8", + "type": "feature", + "description": "Initial release of Amazon WorkSpaces Thin Client", + "modules": [ + "service/workspacesthinclient" + ] +} \ No newline at end of file diff --git a/.changelog/110e7733dfdd488da7c2eedbd702c5f1.json b/.changelog/110e7733dfdd488da7c2eedbd702c5f1.json new file mode 100644 index 00000000000..cd66a00d21e --- /dev/null +++ b/.changelog/110e7733dfdd488da7c2eedbd702c5f1.json @@ -0,0 +1,8 @@ +{ + "id": "110e7733-dfdd-488d-a7c2-eedbd702c5f1", + "type": "feature", + "description": "This release introduces new generative AI features in AWS Lex: Assisted Slot Resolution, Descriptive Bot Building, and Sample Utterance Generation. These features leverage large language models available through Amazon Bedrock to improve the bot builder and customer experiences.", + "modules": [ + "service/lexmodelsv2" + ] +} \ No newline at end of file diff --git a/.changelog/11e051cb4ada41a8a7a70d717a93c34c.json b/.changelog/11e051cb4ada41a8a7a70d717a93c34c.json new file mode 100644 index 00000000000..b02ee5acad9 --- /dev/null +++ b/.changelog/11e051cb4ada41a8a7a70d717a93c34c.json @@ -0,0 +1,8 @@ +{ + "id": "11e051cb-4ada-41a8-a7a7-0d717a93c34c", + "type": "feature", + "description": "CloudTrail Lake now supports federating event data stores. giving users the ability to run queries against their event data using Amazon Athena.", + "modules": [ + "service/cloudtrail" + ] +} \ No newline at end of file diff --git a/.changelog/13503e6b9b6546c29d1e79a5cd8ef97a.json b/.changelog/13503e6b9b6546c29d1e79a5cd8ef97a.json new file mode 100644 index 00000000000..9f8c61bc74e --- /dev/null +++ b/.changelog/13503e6b9b6546c29d1e79a5cd8ef97a.json @@ -0,0 +1,8 @@ +{ + "id": "13503e6b-9b65-46c2-9d1e-79a5cd8ef97a", + "type": "feature", + "description": "AWS IoT FleetWise introduces new APIs for vision system data, such as data collected from cameras, radars, and lidars. You can now model and decode complex data types.", + "modules": [ + "service/iotfleetwise" + ] +} \ No newline at end of file diff --git a/.changelog/1b58fffa2d604f8e9976f76cbac20b36.json b/.changelog/1b58fffa2d604f8e9976f76cbac20b36.json new file mode 100644 index 00000000000..3ea2670e32f --- /dev/null +++ b/.changelog/1b58fffa2d604f8e9976f76cbac20b36.json @@ -0,0 +1,8 @@ +{ + "id": "1b58fffa-2d60-4f8e-9976-f76cbac20b36", + "type": "feature", + "description": "IAM Access Analyzer now continuously monitors IAM roles and users in your AWS account or organization to generate findings for unused access. Additionally, IAM Access Analyzer now provides custom policy checks to validate that IAM policies adhere to your security standards ahead of deployments.", + "modules": [ + "service/accessanalyzer" + ] +} \ No newline at end of file diff --git a/.changelog/1f988490666e42b9835a903aa299a431.json b/.changelog/1f988490666e42b9835a903aa299a431.json new file mode 100644 index 00000000000..4a1150856f8 --- /dev/null +++ b/.changelog/1f988490666e42b9835a903aa299a431.json @@ -0,0 +1,8 @@ +{ + "id": "1f988490-666e-42b9-835a-903aa299a431", + "type": "feature", + "description": "Introduce Amazon S3 Access Grants, a new S3 access control feature that maps identities in directories such as Active Directory, or AWS Identity and Access Management (IAM) Principals, to datasets in S3.", + "modules": [ + "service/s3control" + ] +} \ No newline at end of file diff --git a/.changelog/22b7a889d2f8492aac6e46cce7d6d532.json b/.changelog/22b7a889d2f8492aac6e46cce7d6d532.json new file mode 100644 index 00000000000..bd901ddefc3 --- /dev/null +++ b/.changelog/22b7a889d2f8492aac6e46cce7d6d532.json @@ -0,0 +1,8 @@ +{ + "id": "22b7a889-d2f8-492a-ac6e-46cce7d6d532", + "type": "feature", + "description": "Enables metadata in recommendations, recommendations with themes, and next best action recommendations", + "modules": [ + "service/personalize" + ] +} \ No newline at end of file diff --git a/.changelog/273c554cfc64487caa8eb4fc7438ffbf.json b/.changelog/273c554cfc64487caa8eb4fc7438ffbf.json new file mode 100644 index 00000000000..abc05dcb105 --- /dev/null +++ b/.changelog/273c554cfc64487caa8eb4fc7438ffbf.json @@ -0,0 +1,8 @@ +{ + "id": "273c554c-fc64-487c-aa8e-b4fc7438ffbf", + "type": "feature", + "description": "Added new APIs in Detective to support resource investigations", + "modules": [ + "service/detective" + ] +} \ No newline at end of file diff --git a/.changelog/28b92acaa6d945038d6efd00b0140e0a.json b/.changelog/28b92acaa6d945038d6efd00b0140e0a.json new file mode 100644 index 00000000000..f109ab71373 --- /dev/null +++ b/.changelog/28b92acaa6d945038d6efd00b0140e0a.json @@ -0,0 +1,8 @@ +{ + "id": "28b92aca-a6d9-4503-8d6e-fd00b0140e0a", + "type": "feature", + "description": "Add APIs to create and manage a landing zone.", + "modules": [ + "service/controltower" + ] +} \ No newline at end of file diff --git a/.changelog/28c9c20e0448482d81411f3191914af6.json b/.changelog/28c9c20e0448482d81411f3191914af6.json new file mode 100644 index 00000000000..f3cc1433be8 --- /dev/null +++ b/.changelog/28c9c20e0448482d81411f3191914af6.json @@ -0,0 +1,8 @@ +{ + "id": "28c9c20e-0448-482d-8141-1f3191914af6", + "type": "feature", + "description": "Adding new params - Key and Prefix, to S3 API operations for supporting S3 Access Grants. Note - These updates will not change any of the existing S3 API functionality.", + "modules": [ + "service/s3" + ] +} \ No newline at end of file diff --git a/.changelog/2a3b3de343f4463d97ba211b6f3f8586.json b/.changelog/2a3b3de343f4463d97ba211b6f3f8586.json new file mode 100644 index 00000000000..2cdecf76d23 --- /dev/null +++ b/.changelog/2a3b3de343f4463d97ba211b6f3f8586.json @@ -0,0 +1,8 @@ +{ + "id": "2a3b3de3-43f4-463d-97ba-211b6f3f8586", + "type": "feature", + "description": "This is the initial SDK release for the AWS Free Tier GetFreeTierUsage API", + "modules": [ + "service/freetier" + ] +} \ No newline at end of file diff --git a/.changelog/2af54a03613d41f49fe0dbaa7f535763.json b/.changelog/2af54a03613d41f49fe0dbaa7f535763.json new file mode 100644 index 00000000000..c2d6d5bd5b1 --- /dev/null +++ b/.changelog/2af54a03613d41f49fe0dbaa7f535763.json @@ -0,0 +1,8 @@ +{ + "id": "2af54a03-613d-41f4-9fe0-dbaa7f535763", + "type": "feature", + "description": "Adds and updates APIs to support customizable security controls. This feature allows Security Hub customers to provide custom parameters for security controls. With this release, findings for controls that support custom parameters will include the parameters used to generate the findings.", + "modules": [ + "service/securityhub" + ] +} \ No newline at end of file diff --git a/.changelog/3d6b2b8b5e3947b1890ac6e231a382cd.json b/.changelog/3d6b2b8b5e3947b1890ac6e231a382cd.json new file mode 100644 index 00000000000..b07c78ea611 --- /dev/null +++ b/.changelog/3d6b2b8b5e3947b1890ac6e231a382cd.json @@ -0,0 +1,8 @@ +{ + "id": "3d6b2b8b-5e39-47b1-890a-c6e231a382cd", + "type": "feature", + "description": "Support Periodic Recording for Configuration Recorder", + "modules": [ + "service/configservice" + ] +} \ No newline at end of file diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..adcb5d4124b --- /dev/null +++ b/.changelog/41575353444b40ffbf474f4155544f00.json @@ -0,0 +1,13 @@ +{ + "id": "41575353-444b-40ff-bf47-4f4155544f00", + "type": "release", + "description": "New AWS service client module", + "modules": [ + "service/bcmdataexports", + "service/costoptimizationhub", + "service/eksauth", + "service/freetier", + "service/repostspace", + "service/workspacesthinclient" + ] +} \ No newline at end of file diff --git a/.changelog/49cbdb1fd7ee4f80a0a8877b7a34775e.json b/.changelog/49cbdb1fd7ee4f80a0a8877b7a34775e.json new file mode 100644 index 00000000000..7d2fc77099a --- /dev/null +++ b/.changelog/49cbdb1fd7ee4f80a0a8877b7a34775e.json @@ -0,0 +1,8 @@ +{ + "id": "49cbdb1f-d7ee-4f80-a0a8-877b7a34775e", + "type": "feature", + "description": "This release launches new APIs for trusted identity propagation setup and supports creating datasources using trusted identity propagation as authentication method for QuickSight accounts configured with IAM Identity Center.", + "modules": [ + "service/quicksight" + ] +} \ No newline at end of file diff --git a/.changelog/4fac0b90e31546a78834d0e003279d97.json b/.changelog/4fac0b90e31546a78834d0e003279d97.json new file mode 100644 index 00000000000..c5ffe48bad7 --- /dev/null +++ b/.changelog/4fac0b90e31546a78834d0e003279d97.json @@ -0,0 +1,8 @@ +{ + "id": "4fac0b90-e315-46a7-8834-d0e003279d97", + "type": "feature", + "description": "This release enables both mutual authentication (mTLS), and Automatic Target Weights (ATW) for Application Load Balancers.", + "modules": [ + "service/elasticloadbalancingv2" + ] +} \ No newline at end of file diff --git a/.changelog/59de928df4dd4f60b548cfe456b58f67.json b/.changelog/59de928df4dd4f60b548cfe456b58f67.json new file mode 100644 index 00000000000..e5f5188eab1 --- /dev/null +++ b/.changelog/59de928df4dd4f60b548cfe456b58f67.json @@ -0,0 +1,8 @@ +{ + "id": "59de928d-f4dd-4f60-b548-cfe456b58f67", + "type": "feature", + "description": "Add support for Runtime Monitoring for ECS and ECS-EC2.", + "modules": [ + "service/guardduty" + ] +} \ No newline at end of file diff --git a/.changelog/81e0c6a4ef3d4ce28506082b5146278b.json b/.changelog/81e0c6a4ef3d4ce28506082b5146278b.json new file mode 100644 index 00000000000..a88dbd5ab5a --- /dev/null +++ b/.changelog/81e0c6a4ef3d4ce28506082b5146278b.json @@ -0,0 +1,8 @@ +{ + "id": "81e0c6a4-ef3d-4ce2-8506-082b5146278b", + "type": "feature", + "description": "Adding support for EFS Archive lifecycle configuration.", + "modules": [ + "service/efs" + ] +} \ No newline at end of file diff --git a/.changelog/833b06857d48412a8f33aaa6bca6a9e8.json b/.changelog/833b06857d48412a8f33aaa6bca6a9e8.json new file mode 100644 index 00000000000..f3597dfe5db --- /dev/null +++ b/.changelog/833b06857d48412a8f33aaa6bca6a9e8.json @@ -0,0 +1,8 @@ +{ + "id": "833b0685-7d48-412a-8f33-aaa6bca6a9e8", + "type": "feature", + "description": "This release introduces support for interpretationSource in the runtime service response.", + "modules": [ + "service/lexruntimev2" + ] +} \ No newline at end of file diff --git a/.changelog/8770fbe4afd64dfe9db2985720f73a2e.json b/.changelog/8770fbe4afd64dfe9db2985720f73a2e.json new file mode 100644 index 00000000000..5d5c644bdaf --- /dev/null +++ b/.changelog/8770fbe4afd64dfe9db2985720f73a2e.json @@ -0,0 +1,8 @@ +{ + "id": "8770fbe4-afd6-4dfe-9db2-985720f73a2e", + "type": "feature", + "description": "Added APIs to Create, Update, Get, List and Delete LogAnomalyDetectors and List and Update Anomalies in Detector. Added LogGroupClass attribute for LogGroups to classify loggroup as Standard loggroup with all capabilities or InfrequentAccess loggroup with limited capabilities.", + "modules": [ + "service/cloudwatchlogs" + ] +} \ No newline at end of file diff --git a/.changelog/87efab46af3a403ba80e0ef1280bddb4.json b/.changelog/87efab46af3a403ba80e0ef1280bddb4.json new file mode 100644 index 00000000000..4573936785e --- /dev/null +++ b/.changelog/87efab46af3a403ba80e0ef1280bddb4.json @@ -0,0 +1,8 @@ +{ + "id": "87efab46-af3a-403b-a80e-0ef1280bddb4", + "type": "feature", + "description": "This release adds support for EKS Pod Identity feature. EKS Pod Identity makes it easy for customers to obtain IAM permissions for the applications running in their EKS clusters.", + "modules": [ + "service/eks" + ] +} \ No newline at end of file diff --git a/.changelog/8c6c19cfa09b43f090407901af98c56b.json b/.changelog/8c6c19cfa09b43f090407901af98c56b.json new file mode 100644 index 00000000000..f857ddbbb01 --- /dev/null +++ b/.changelog/8c6c19cfa09b43f090407901af98c56b.json @@ -0,0 +1,8 @@ +{ + "id": "8c6c19cf-a09b-43f0-9040-7901af98c56b", + "type": "feature", + "description": "Users can create, read, update, delete Exports of billing and cost management data. Users can get details of Export Executions and details of Tables for exporting. Tagging support is provided for Exports", + "modules": [ + "service/bcmdataexports" + ] +} \ No newline at end of file diff --git a/.changelog/8d79723dd9644f368a81ebbf00c27654.json b/.changelog/8d79723dd9644f368a81ebbf00c27654.json new file mode 100644 index 00000000000..a4dcc4034a4 --- /dev/null +++ b/.changelog/8d79723dd9644f368a81ebbf00c27654.json @@ -0,0 +1,8 @@ +{ + "id": "8d79723d-d964-4f36-8a81-ebbf00c27654", + "type": "feature", + "description": "Initial release of AWS re:Post Private", + "modules": [ + "service/repostspace" + ] +} \ No newline at end of file diff --git a/.changelog/9229994609e84df0855047bf21b028f7.json b/.changelog/9229994609e84df0855047bf21b028f7.json new file mode 100644 index 00000000000..4b145fc189a --- /dev/null +++ b/.changelog/9229994609e84df0855047bf21b028f7.json @@ -0,0 +1,8 @@ +{ + "id": "92299946-09e8-4df0-8550-47bf21b028f7", + "type": "feature", + "description": "This release adds support for EKS Pod Identity feature. EKS Pod Identity makes it easy for customers to obtain IAM permissions for their applications running in the EKS clusters.", + "modules": [ + "service/eksauth" + ] +} \ No newline at end of file diff --git a/.changelog/93cbf53ce38c4634b7530ddaf62f248c.json b/.changelog/93cbf53ce38c4634b7530ddaf62f248c.json new file mode 100644 index 00000000000..a5cf7169e8b --- /dev/null +++ b/.changelog/93cbf53ce38c4634b7530ddaf62f248c.json @@ -0,0 +1,8 @@ +{ + "id": "93cbf53c-e38c-4634-b753-0ddaf62f248c", + "type": "feature", + "description": "This release adds support for transcriptions from audio sources in 64 new languages and introduces generative call summarization in Transcribe Call Analytics (Post call)", + "modules": [ + "service/transcribe" + ] +} \ No newline at end of file diff --git a/.changelog/9616d5951fea4e7bb084434ceb888e86.json b/.changelog/9616d5951fea4e7bb084434ceb888e86.json new file mode 100644 index 00000000000..0a9f33fe0af --- /dev/null +++ b/.changelog/9616d5951fea4e7bb084434ceb888e86.json @@ -0,0 +1,8 @@ +{ + "id": "9616d595-1fea-4e7b-b084-434ceb888e86", + "type": "feature", + "description": "Adds a new 'type' property to the Setting structure. Adds a new AccountSetting - guardDutyActivate for ECS.", + "modules": [ + "service/ecs" + ] +} \ No newline at end of file diff --git a/.changelog/97fca4245e284e96b2cb45b18d342c38.json b/.changelog/97fca4245e284e96b2cb45b18d342c38.json new file mode 100644 index 00000000000..dce6660a74e --- /dev/null +++ b/.changelog/97fca4245e284e96b2cb45b18d342c38.json @@ -0,0 +1,8 @@ +{ + "id": "97fca424-5e28-4e96-b2cb-45b18d342c38", + "type": "feature", + "description": "Enables metadata in recommendations and next best action recommendations", + "modules": [ + "service/personalizeruntime" + ] +} \ No newline at end of file diff --git a/.changelog/9a837a175fe14781a853fdb43e982ae4.json b/.changelog/9a837a175fe14781a853fdb43e982ae4.json new file mode 100644 index 00000000000..6eb1ec1c361 --- /dev/null +++ b/.changelog/9a837a175fe14781a853fdb43e982ae4.json @@ -0,0 +1,8 @@ +{ + "id": "9a837a17-5fe1-4781-a853-fdb43e982ae4", + "type": "feature", + "description": "This release adds four new APIs \"DescribeLakeFormationIdentityCenterConfiguration\", \"CreateLakeFormationIdentityCenterConfiguration\", \"DescribeLakeFormationIdentityCenterConfiguration\", and \"DeleteLakeFormationIdentityCenterConfiguration\", and also updates the corresponding documentation.", + "modules": [ + "service/lakeformation" + ] +} \ No newline at end of file diff --git a/.changelog/b5d1d8a315644f6cb9b3ad47bcd7d2ca.json b/.changelog/b5d1d8a315644f6cb9b3ad47bcd7d2ca.json new file mode 100644 index 00000000000..28d6142f5cd --- /dev/null +++ b/.changelog/b5d1d8a315644f6cb9b3ad47bcd7d2ca.json @@ -0,0 +1,8 @@ +{ + "id": "b5d1d8a3-1564-4f6c-b9b3-ad47bcd7d2ca", + "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/b9c2ec86901c42a59820ee0c3e34adc8.json b/.changelog/b9c2ec86901c42a59820ee0c3e34adc8.json new file mode 100644 index 00000000000..a0e681bb086 --- /dev/null +++ b/.changelog/b9c2ec86901c42a59820ee0c3e34adc8.json @@ -0,0 +1,8 @@ +{ + "id": "b9c2ec86-901c-42a5-9820-ee0c3e34adc8", + "type": "feature", + "description": "Add optional NetworkType property to Accessor APIs", + "modules": [ + "service/managedblockchain" + ] +} \ No newline at end of file diff --git a/.changelog/be394c000b5c421daea63df18df62b29.json b/.changelog/be394c000b5c421daea63df18df62b29.json new file mode 100644 index 00000000000..fcc0ae5c9ec --- /dev/null +++ b/.changelog/be394c000b5c421daea63df18df62b29.json @@ -0,0 +1,8 @@ +{ + "id": "be394c00-0b5c-421d-aea6-3df18df62b29", + "type": "feature", + "description": "This release adds support for the Amazon Managed Service for Prometheus collector, a fully managed, agentless Prometheus metrics scraping capability.", + "modules": [ + "service/amp" + ] +} \ No newline at end of file diff --git a/.changelog/bfc3db4cc39d4a77b67318f9441716fb.json b/.changelog/bfc3db4cc39d4a77b67318f9441716fb.json new file mode 100644 index 00000000000..ff6195c26de --- /dev/null +++ b/.changelog/bfc3db4cc39d4a77b67318f9441716fb.json @@ -0,0 +1,8 @@ +{ + "id": "bfc3db4c-c39d-4a77-b673-18f9441716fb", + "type": "feature", + "description": "Added support for FSx for ONTAP scale-out file systems and FlexGroup volumes. Added the HAPairs field and ThroughputCapacityPerHAPair for filesystem. Added AggregateConfiguration (containing Aggregates and ConstituentsPerAggregate) and SizeInBytes for volume.", + "modules": [ + "service/fsx" + ] +} \ No newline at end of file diff --git a/.changelog/c2072305efb04fd3b7718e013e8cf9d9.json b/.changelog/c2072305efb04fd3b7718e013e8cf9d9.json new file mode 100644 index 00000000000..b380f9b6d32 --- /dev/null +++ b/.changelog/c2072305efb04fd3b7718e013e8cf9d9.json @@ -0,0 +1,8 @@ +{ + "id": "c2072305-efb0-4fd3-b771-8e013e8cf9d9", + "type": "feature", + "description": "This release launches Cost Optimization Hub, a new AWS Billing and Cost Management feature that helps you consolidate and prioritize cost optimization recommendations across your AWS Organizations member accounts and AWS Regions, so that you can get the most out of your AWS spend.", + "modules": [ + "service/costoptimizationhub" + ] +} \ No newline at end of file diff --git a/.changelog/d3b15518237943c2a5e869adb8d1ad26.json b/.changelog/d3b15518237943c2a5e869adb8d1ad26.json new file mode 100644 index 00000000000..2d5c86a3b58 --- /dev/null +++ b/.changelog/d3b15518237943c2a5e869adb8d1ad26.json @@ -0,0 +1,8 @@ +{ + "id": "d3b15518-2379-43c2-a5e8-69adb8d1ad26", + "type": "feature", + "description": "AWS Secrets Manager has released the BatchGetSecretValue API, which allows customers to fetch up to 20 Secrets with a single request using a list of secret names or filters.", + "modules": [ + "service/secretsmanager" + ] +} \ No newline at end of file diff --git a/.changelog/dcddb56f5f5d4ce89a25346ab338b236.json b/.changelog/dcddb56f5f5d4ce89a25346ab338b236.json new file mode 100644 index 00000000000..e2fec77f747 --- /dev/null +++ b/.changelog/dcddb56f5f5d4ce89a25346ab338b236.json @@ -0,0 +1,8 @@ +{ + "id": "dcddb56f-5f5d-4ce8-9a25-346ab338b236", + "type": "feature", + "description": "The release introduces Multi-Region Resilience one-way data replication that allows you to replicate data from your primary WorkSpace to a standby WorkSpace in another AWS Region. DescribeWorkspaces now returns the status of data replication.", + "modules": [ + "service/workspaces" + ] +} \ No newline at end of file diff --git a/.changelog/f5a138093fc844cabbcfc17b0cc0245b.json b/.changelog/f5a138093fc844cabbcfc17b0cc0245b.json new file mode 100644 index 00000000000..4ae21d0f23a --- /dev/null +++ b/.changelog/f5a138093fc844cabbcfc17b0cc0245b.json @@ -0,0 +1,8 @@ +{ + "id": "f5a13809-3fc8-44ca-bbcf-c17b0cc0245b", + "type": "feature", + "description": "Adds new TestState operation which accepts the definition of a single state and executes it. You can test a state without creating a state machine or updating an existing state machine.", + "modules": [ + "service/sfn" + ] +} \ No newline at end of file diff --git a/.changelog/f9bff5111bfd4d6faa5bd32e589eef94.json b/.changelog/f9bff5111bfd4d6faa5bd32e589eef94.json new file mode 100644 index 00000000000..85b008c9d8a --- /dev/null +++ b/.changelog/f9bff5111bfd4d6faa5bd32e589eef94.json @@ -0,0 +1,8 @@ +{ + "id": "f9bff511-1bfd-4d6f-aa5b-d32e589eef94", + "type": "feature", + "description": "This release adds support for multi-data warehouse writes through data sharing.", + "modules": [ + "service/redshift" + ] +} \ No newline at end of file diff --git a/.changelog/fa1013741bae408e843dcdd5875fe88e.json b/.changelog/fa1013741bae408e843dcdd5875fe88e.json new file mode 100644 index 00000000000..5e80ae1cb4b --- /dev/null +++ b/.changelog/fa1013741bae408e843dcdd5875fe88e.json @@ -0,0 +1,8 @@ +{ + "id": "fa101374-1bae-408e-843d-cdd5875fe88e", + "type": "feature", + "description": "This release enables PutActions and PutActionInteractions", + "modules": [ + "service/personalizeevents" + ] +} \ No newline at end of file diff --git a/service/accessanalyzer/api_op_CheckAccessNotGranted.go b/service/accessanalyzer/api_op_CheckAccessNotGranted.go new file mode 100644 index 00000000000..e9dff1db524 --- /dev/null +++ b/service/accessanalyzer/api_op_CheckAccessNotGranted.go @@ -0,0 +1,163 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package accessanalyzer + +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/accessanalyzer/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Checks whether the specified access isn't allowed by a policy. +func (c *Client) CheckAccessNotGranted(ctx context.Context, params *CheckAccessNotGrantedInput, optFns ...func(*Options)) (*CheckAccessNotGrantedOutput, error) { + if params == nil { + params = &CheckAccessNotGrantedInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CheckAccessNotGranted", params, optFns, c.addOperationCheckAccessNotGrantedMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CheckAccessNotGrantedOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CheckAccessNotGrantedInput struct { + + // An access object containing the permissions that shouldn't be granted by the + // specified policy. + // + // This member is required. + Access []types.Access + + // The JSON policy document to use as the content for the policy. + // + // This member is required. + PolicyDocument *string + + // The type of policy. Identity policies grant permissions to IAM principals. + // Identity policies include managed and inline policies for IAM roles, users, and + // groups. Resource policies grant permissions on Amazon Web Services resources. + // Resource policies include trust policies for IAM roles and bucket policies for + // Amazon S3 buckets. You can provide a generic input such as identity policy or + // resource policy or a specific input such as managed policy or Amazon S3 bucket + // policy. + // + // This member is required. + PolicyType types.AccessCheckPolicyType + + noSmithyDocumentSerde +} + +type CheckAccessNotGrantedOutput struct { + + // The message indicating whether the specified access is allowed. + Message *string + + // A description of the reasoning of the result. + Reasons []types.ReasonSummary + + // The result of the check for whether the access is allowed. If the result is PASS + // , the specified policy doesn't allow any of the specified permissions in the + // access object. If the result is FAIL , the specified policy might allow some or + // all of the permissions in the access object. + Result types.CheckAccessNotGrantedResult + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCheckAccessNotGrantedMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCheckAccessNotGranted{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCheckAccessNotGranted{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CheckAccessNotGranted"); 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 = addOpCheckAccessNotGrantedValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCheckAccessNotGranted(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_opCheckAccessNotGranted(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CheckAccessNotGranted", + } +} diff --git a/service/accessanalyzer/api_op_CheckNoNewAccess.go b/service/accessanalyzer/api_op_CheckNoNewAccess.go new file mode 100644 index 00000000000..9b9b6d0d18d --- /dev/null +++ b/service/accessanalyzer/api_op_CheckNoNewAccess.go @@ -0,0 +1,166 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package accessanalyzer + +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/accessanalyzer/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Checks whether new access is allowed for an updated policy when compared to the +// existing policy. You can find examples for reference policies and learn how to +// set up and run a custom policy check for new access in the IAM Access Analyzer +// custom policy checks samples (https://github.com/aws-samples/iam-access-analyzer-custom-policy-check-samples) +// repository on GitHub. The reference policies in this repository are meant to be +// passed to the existingPolicyDocument request parameter. +func (c *Client) CheckNoNewAccess(ctx context.Context, params *CheckNoNewAccessInput, optFns ...func(*Options)) (*CheckNoNewAccessOutput, error) { + if params == nil { + params = &CheckNoNewAccessInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CheckNoNewAccess", params, optFns, c.addOperationCheckNoNewAccessMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CheckNoNewAccessOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CheckNoNewAccessInput struct { + + // The JSON policy document to use as the content for the existing policy. + // + // This member is required. + ExistingPolicyDocument *string + + // The JSON policy document to use as the content for the updated policy. + // + // This member is required. + NewPolicyDocument *string + + // The type of policy to compare. Identity policies grant permissions to IAM + // principals. Identity policies include managed and inline policies for IAM roles, + // users, and groups. Resource policies grant permissions on Amazon Web Services + // resources. Resource policies include trust policies for IAM roles and bucket + // policies for Amazon S3 buckets. You can provide a generic input such as identity + // policy or resource policy or a specific input such as managed policy or Amazon + // S3 bucket policy. + // + // This member is required. + PolicyType types.AccessCheckPolicyType + + noSmithyDocumentSerde +} + +type CheckNoNewAccessOutput struct { + + // The message indicating whether the updated policy allows new access. + Message *string + + // A description of the reasoning of the result. + Reasons []types.ReasonSummary + + // The result of the check for new access. If the result is PASS , no new access is + // allowed by the updated policy. If the result is FAIL , the updated policy might + // allow new access. + Result types.CheckNoNewAccessResult + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCheckNoNewAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCheckNoNewAccess{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCheckNoNewAccess{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CheckNoNewAccess"); 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 = addOpCheckNoNewAccessValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCheckNoNewAccess(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_opCheckNoNewAccess(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CheckNoNewAccess", + } +} diff --git a/service/accessanalyzer/api_op_CreateAnalyzer.go b/service/accessanalyzer/api_op_CreateAnalyzer.go index c541f71bdf5..e0597d8dc1d 100644 --- a/service/accessanalyzer/api_op_CreateAnalyzer.go +++ b/service/accessanalyzer/api_op_CreateAnalyzer.go @@ -36,9 +36,10 @@ type CreateAnalyzerInput struct { // This member is required. AnalyzerName *string - // The type of analyzer to create. Only ACCOUNT and ORGANIZATION analyzers are - // supported. You can create only one analyzer per account per Region. You can - // create up to 5 analyzers per organization per Region. + // The type of analyzer to create. Only ACCOUNT , ORGANIZATION , + // ACCOUNT_UNUSED_ACCESS , and ORGANIZTAION_UNUSED_ACCESS analyzers are supported. + // You can create only one analyzer per account per Region. You can create up to 5 + // analyzers per organization per Region. // // This member is required. Type types.Type @@ -50,7 +51,13 @@ type CreateAnalyzerInput struct { // A client token. ClientToken *string - // The tags to apply to the analyzer. + // Specifies the configuration of the analyzer. If the analyzer is an unused + // access analyzer, the specified scope of unused access is used for the + // configuration. If the analyzer is an external access analyzer, this field is not + // used. + Configuration types.AnalyzerConfiguration + + // An array of key-value pairs to apply to the analyzer. Tags map[string]string noSmithyDocumentSerde diff --git a/service/accessanalyzer/api_op_GetFindingV2.go b/service/accessanalyzer/api_op_GetFindingV2.go new file mode 100644 index 00000000000..574bf92a9f9 --- /dev/null +++ b/service/accessanalyzer/api_op_GetFindingV2.go @@ -0,0 +1,292 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package accessanalyzer + +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/accessanalyzer/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about the specified finding. +func (c *Client) GetFindingV2(ctx context.Context, params *GetFindingV2Input, optFns ...func(*Options)) (*GetFindingV2Output, error) { + if params == nil { + params = &GetFindingV2Input{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetFindingV2", params, optFns, c.addOperationGetFindingV2Middlewares) + if err != nil { + return nil, err + } + + out := result.(*GetFindingV2Output) + out.ResultMetadata = metadata + return out, nil +} + +type GetFindingV2Input struct { + + // The ARN of the analyzer (https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources) + // that generated the finding. + // + // This member is required. + AnalyzerArn *string + + // The ID of the finding to retrieve. + // + // This member is required. + Id *string + + // The maximum number of results to return in the response. + MaxResults *int32 + + // A token used for pagination of results returned. + NextToken *string + + noSmithyDocumentSerde +} + +type GetFindingV2Output struct { + + // The time at which the resource-based policy or IAM entity that generated the + // finding was analyzed. + // + // This member is required. + AnalyzedAt *time.Time + + // The time at which the finding was created. + // + // This member is required. + CreatedAt *time.Time + + // A localized message that explains the finding and provides guidance on how to + // address it. + // + // This member is required. + FindingDetails []types.FindingDetails + + // The ID of the finding to retrieve. + // + // This member is required. + Id *string + + // Tye Amazon Web Services account ID that owns the resource. + // + // This member is required. + ResourceOwnerAccount *string + + // The type of the resource identified in the finding. + // + // This member is required. + ResourceType types.ResourceType + + // The status of the finding. + // + // This member is required. + Status types.FindingStatus + + // The time at which the finding was updated. + // + // This member is required. + UpdatedAt *time.Time + + // An error. + Error *string + + // The type of the finding. For external access analyzers, the type is + // ExternalAccess . For unused access analyzers, the type can be UnusedIAMRole , + // UnusedIAMUserAccessKey , UnusedIAMUserPassword , or UnusedPermission . + FindingType types.FindingType + + // A token used for pagination of results returned. + NextToken *string + + // The resource that generated the finding. + Resource *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetFindingV2Middlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetFindingV2{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetFindingV2{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetFindingV2"); 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 = addOpGetFindingV2ValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFindingV2(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 +} + +// GetFindingV2APIClient is a client that implements the GetFindingV2 operation. +type GetFindingV2APIClient interface { + GetFindingV2(context.Context, *GetFindingV2Input, ...func(*Options)) (*GetFindingV2Output, error) +} + +var _ GetFindingV2APIClient = (*Client)(nil) + +// GetFindingV2PaginatorOptions is the paginator options for GetFindingV2 +type GetFindingV2PaginatorOptions struct { + // The maximum number of results to return in the response. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// GetFindingV2Paginator is a paginator for GetFindingV2 +type GetFindingV2Paginator struct { + options GetFindingV2PaginatorOptions + client GetFindingV2APIClient + params *GetFindingV2Input + nextToken *string + firstPage bool +} + +// NewGetFindingV2Paginator returns a new GetFindingV2Paginator +func NewGetFindingV2Paginator(client GetFindingV2APIClient, params *GetFindingV2Input, optFns ...func(*GetFindingV2PaginatorOptions)) *GetFindingV2Paginator { + if params == nil { + params = &GetFindingV2Input{} + } + + options := GetFindingV2PaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &GetFindingV2Paginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetFindingV2Paginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetFindingV2 page. +func (p *GetFindingV2Paginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetFindingV2Output, 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.GetFindingV2(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_opGetFindingV2(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetFindingV2", + } +} diff --git a/service/accessanalyzer/api_op_ListFindingsV2.go b/service/accessanalyzer/api_op_ListFindingsV2.go new file mode 100644 index 00000000000..0dcf9211188 --- /dev/null +++ b/service/accessanalyzer/api_op_ListFindingsV2.go @@ -0,0 +1,249 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package accessanalyzer + +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/accessanalyzer/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of findings generated by the specified analyzer. To learn +// about filter keys that you can use to retrieve a list of findings, see IAM +// Access Analyzer filter keys (https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-filter-keys.html) +// in the IAM User Guide. +func (c *Client) ListFindingsV2(ctx context.Context, params *ListFindingsV2Input, optFns ...func(*Options)) (*ListFindingsV2Output, error) { + if params == nil { + params = &ListFindingsV2Input{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListFindingsV2", params, optFns, c.addOperationListFindingsV2Middlewares) + if err != nil { + return nil, err + } + + out := result.(*ListFindingsV2Output) + out.ResultMetadata = metadata + return out, nil +} + +type ListFindingsV2Input struct { + + // The ARN of the analyzer (https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources) + // to retrieve findings from. + // + // This member is required. + AnalyzerArn *string + + // A filter to match for the findings to return. + Filter map[string]types.Criterion + + // The maximum number of results to return in the response. + MaxResults *int32 + + // A token used for pagination of results returned. + NextToken *string + + // The criteria used to sort. + Sort *types.SortCriteria + + noSmithyDocumentSerde +} + +type ListFindingsV2Output struct { + + // A list of findings retrieved from the analyzer that match the filter criteria + // specified, if any. + // + // This member is required. + Findings []types.FindingSummaryV2 + + // A token used for pagination of results returned. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListFindingsV2Middlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListFindingsV2{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListFindingsV2{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListFindingsV2"); 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 = addOpListFindingsV2ValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFindingsV2(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 +} + +// ListFindingsV2APIClient is a client that implements the ListFindingsV2 +// operation. +type ListFindingsV2APIClient interface { + ListFindingsV2(context.Context, *ListFindingsV2Input, ...func(*Options)) (*ListFindingsV2Output, error) +} + +var _ ListFindingsV2APIClient = (*Client)(nil) + +// ListFindingsV2PaginatorOptions is the paginator options for ListFindingsV2 +type ListFindingsV2PaginatorOptions struct { + // The maximum number of results to return in the response. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListFindingsV2Paginator is a paginator for ListFindingsV2 +type ListFindingsV2Paginator struct { + options ListFindingsV2PaginatorOptions + client ListFindingsV2APIClient + params *ListFindingsV2Input + nextToken *string + firstPage bool +} + +// NewListFindingsV2Paginator returns a new ListFindingsV2Paginator +func NewListFindingsV2Paginator(client ListFindingsV2APIClient, params *ListFindingsV2Input, optFns ...func(*ListFindingsV2PaginatorOptions)) *ListFindingsV2Paginator { + if params == nil { + params = &ListFindingsV2Input{} + } + + options := ListFindingsV2PaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListFindingsV2Paginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFindingsV2Paginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListFindingsV2 page. +func (p *ListFindingsV2Paginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFindingsV2Output, 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.ListFindingsV2(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_opListFindingsV2(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListFindingsV2", + } +} diff --git a/service/accessanalyzer/api_op_ValidatePolicy.go b/service/accessanalyzer/api_op_ValidatePolicy.go index 14aa780c9bf..5279a2ed925 100644 --- a/service/accessanalyzer/api_op_ValidatePolicy.go +++ b/service/accessanalyzer/api_op_ValidatePolicy.go @@ -40,13 +40,13 @@ type ValidatePolicyInput struct { // The type of policy to validate. Identity policies grant permissions to IAM // principals. Identity policies include managed and inline policies for IAM roles, - // users, and groups. They also include service-control policies (SCPs) that are - // attached to an Amazon Web Services organization, organizational unit (OU), or an - // account. Resource policies grant permissions on Amazon Web Services resources. - // Resource policies include trust policies for IAM roles and bucket policies for - // Amazon S3 buckets. You can provide a generic input such as identity policy or - // resource policy or a specific input such as managed policy or Amazon S3 bucket - // policy. + // users, and groups. Resource policies grant permissions on Amazon Web Services + // resources. Resource policies include trust policies for IAM roles and bucket + // policies for Amazon S3 buckets. You can provide a generic input such as identity + // policy or resource policy or a specific input such as managed policy or Amazon + // S3 bucket policy. Service control policies (SCPs) are a type of organization + // policy attached to an Amazon Web Services organization, organizational unit + // (OU), or an account. // // This member is required. PolicyType types.PolicyType diff --git a/service/accessanalyzer/deserializers.go b/service/accessanalyzer/deserializers.go index 53f9ce11d85..766b15d3562 100644 --- a/service/accessanalyzer/deserializers.go +++ b/service/accessanalyzer/deserializers.go @@ -214,14 +214,14 @@ func awsRestjson1_deserializeOpErrorCancelPolicyGeneration(response *smithyhttp. } } -type awsRestjson1_deserializeOpCreateAccessPreview struct { +type awsRestjson1_deserializeOpCheckAccessNotGranted struct { } -func (*awsRestjson1_deserializeOpCreateAccessPreview) ID() string { +func (*awsRestjson1_deserializeOpCheckAccessNotGranted) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateAccessPreview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCheckAccessNotGranted) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -235,9 +235,9 @@ func (m *awsRestjson1_deserializeOpCreateAccessPreview) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateAccessPreview(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCheckAccessNotGranted(response, &metadata) } - output := &CreateAccessPreviewOutput{} + output := &CheckAccessNotGrantedOutput{} out.Result = output var buff [1024]byte @@ -258,7 +258,7 @@ func (m *awsRestjson1_deserializeOpCreateAccessPreview) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateAccessPreviewOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCheckAccessNotGrantedOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -271,7 +271,7 @@ func (m *awsRestjson1_deserializeOpCreateAccessPreview) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateAccessPreview(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCheckAccessNotGranted(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -315,21 +315,18 @@ func awsRestjson1_deserializeOpErrorCreateAccessPreview(response *smithyhttp.Res case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnprocessableEntityException", errorCode): + return awsRestjson1_deserializeErrorUnprocessableEntityException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -343,7 +340,7 @@ func awsRestjson1_deserializeOpErrorCreateAccessPreview(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentCreateAccessPreviewOutput(v **CreateAccessPreviewOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCheckAccessNotGrantedOutput(v **CheckAccessNotGrantedOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -356,22 +353,36 @@ func awsRestjson1_deserializeOpDocumentCreateAccessPreviewOutput(v **CreateAcces return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateAccessPreviewOutput + var sv *CheckAccessNotGrantedOutput if *v == nil { - sv = &CreateAccessPreviewOutput{} + sv = &CheckAccessNotGrantedOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "id": + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AccessPreviewId to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Id = ptr.String(jtv) + sv.Message = ptr.String(jtv) + } + + case "reasons": + if err := awsRestjson1_deserializeDocumentReasonSummaryList(&sv.Reasons, value); err != nil { + return err + } + + case "result": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CheckAccessNotGrantedResult to be of type string, got %T instead", value) + } + sv.Result = types.CheckAccessNotGrantedResult(jtv) } default: @@ -383,14 +394,14 @@ func awsRestjson1_deserializeOpDocumentCreateAccessPreviewOutput(v **CreateAcces return nil } -type awsRestjson1_deserializeOpCreateAnalyzer struct { +type awsRestjson1_deserializeOpCheckNoNewAccess struct { } -func (*awsRestjson1_deserializeOpCreateAnalyzer) ID() string { +func (*awsRestjson1_deserializeOpCheckNoNewAccess) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateAnalyzer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCheckNoNewAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -404,9 +415,9 @@ func (m *awsRestjson1_deserializeOpCreateAnalyzer) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateAnalyzer(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCheckNoNewAccess(response, &metadata) } - output := &CreateAnalyzerOutput{} + output := &CheckNoNewAccessOutput{} out.Result = output var buff [1024]byte @@ -427,7 +438,7 @@ func (m *awsRestjson1_deserializeOpCreateAnalyzer) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateAnalyzerOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCheckNoNewAccessOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -440,7 +451,7 @@ func (m *awsRestjson1_deserializeOpCreateAnalyzer) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateAnalyzer(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCheckNoNewAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -484,18 +495,18 @@ func awsRestjson1_deserializeOpErrorCreateAnalyzer(response *smithyhttp.Response case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnprocessableEntityException", errorCode): + return awsRestjson1_deserializeErrorUnprocessableEntityException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -509,7 +520,7 @@ func awsRestjson1_deserializeOpErrorCreateAnalyzer(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentCreateAnalyzerOutput(v **CreateAnalyzerOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCheckNoNewAccessOutput(v **CheckNoNewAccessOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -522,22 +533,36 @@ func awsRestjson1_deserializeOpDocumentCreateAnalyzerOutput(v **CreateAnalyzerOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateAnalyzerOutput + var sv *CheckNoNewAccessOutput if *v == nil { - sv = &CreateAnalyzerOutput{} + sv = &CheckNoNewAccessOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "arn": + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AnalyzerArn to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Arn = ptr.String(jtv) + sv.Message = ptr.String(jtv) + } + + case "reasons": + if err := awsRestjson1_deserializeDocumentReasonSummaryList(&sv.Reasons, value); err != nil { + return err + } + + case "result": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CheckNoNewAccessResult to be of type string, got %T instead", value) + } + sv.Result = types.CheckNoNewAccessResult(jtv) } default: @@ -549,14 +574,14 @@ func awsRestjson1_deserializeOpDocumentCreateAnalyzerOutput(v **CreateAnalyzerOu return nil } -type awsRestjson1_deserializeOpCreateArchiveRule struct { +type awsRestjson1_deserializeOpCreateAccessPreview struct { } -func (*awsRestjson1_deserializeOpCreateArchiveRule) ID() string { +func (*awsRestjson1_deserializeOpCreateAccessPreview) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateArchiveRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateAccessPreview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -570,21 +595,43 @@ func (m *awsRestjson1_deserializeOpCreateArchiveRule) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateArchiveRule(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateAccessPreview(response, &metadata) } - output := &CreateArchiveRuleOutput{} + output := &CreateAccessPreviewOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentCreateAccessPreviewOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateArchiveRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateAccessPreview(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -656,14 +703,54 @@ func awsRestjson1_deserializeOpErrorCreateArchiveRule(response *smithyhttp.Respo } } -type awsRestjson1_deserializeOpDeleteAnalyzer struct { +func awsRestjson1_deserializeOpDocumentCreateAccessPreviewOutput(v **CreateAccessPreviewOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateAccessPreviewOutput + if *v == nil { + sv = &CreateAccessPreviewOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessPreviewId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteAnalyzer) ID() string { +type awsRestjson1_deserializeOpCreateAnalyzer struct { +} + +func (*awsRestjson1_deserializeOpCreateAnalyzer) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteAnalyzer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateAnalyzer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -677,21 +764,43 @@ func (m *awsRestjson1_deserializeOpDeleteAnalyzer) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteAnalyzer(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateAnalyzer(response, &metadata) } - output := &DeleteAnalyzerOutput{} + output := &CreateAnalyzerOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentCreateAnalyzerOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteAnalyzer(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateAnalyzer(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -735,11 +844,14 @@ func awsRestjson1_deserializeOpErrorDeleteAnalyzer(response *smithyhttp.Response case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -757,14 +869,54 @@ func awsRestjson1_deserializeOpErrorDeleteAnalyzer(response *smithyhttp.Response } } -type awsRestjson1_deserializeOpDeleteArchiveRule struct { +func awsRestjson1_deserializeOpDocumentCreateAnalyzerOutput(v **CreateAnalyzerOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateAnalyzerOutput + if *v == nil { + sv = &CreateAnalyzerOutput{} + } 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 AnalyzerArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteArchiveRule) ID() string { +type awsRestjson1_deserializeOpCreateArchiveRule struct { +} + +func (*awsRestjson1_deserializeOpCreateArchiveRule) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteArchiveRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateArchiveRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -778,9 +930,9 @@ func (m *awsRestjson1_deserializeOpDeleteArchiveRule) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteArchiveRule(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateArchiveRule(response, &metadata) } - output := &DeleteArchiveRuleOutput{} + output := &CreateArchiveRuleOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -792,7 +944,7 @@ func (m *awsRestjson1_deserializeOpDeleteArchiveRule) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteArchiveRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateArchiveRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -836,12 +988,18 @@ func awsRestjson1_deserializeOpErrorDeleteArchiveRule(response *smithyhttp.Respo case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -858,14 +1016,14 @@ func awsRestjson1_deserializeOpErrorDeleteArchiveRule(response *smithyhttp.Respo } } -type awsRestjson1_deserializeOpGetAccessPreview struct { +type awsRestjson1_deserializeOpDeleteAnalyzer struct { } -func (*awsRestjson1_deserializeOpGetAccessPreview) ID() string { +func (*awsRestjson1_deserializeOpDeleteAnalyzer) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAccessPreview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAnalyzer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -879,9 +1037,211 @@ func (m *awsRestjson1_deserializeOpGetAccessPreview) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAccessPreview(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAnalyzer(response, &metadata) } - output := &GetAccessPreviewOutput{} + output := &DeleteAnalyzerOutput{} + 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_deserializeOpErrorDeleteAnalyzer(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteArchiveRule struct { +} + +func (*awsRestjson1_deserializeOpDeleteArchiveRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteArchiveRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteArchiveRule(response, &metadata) + } + output := &DeleteArchiveRuleOutput{} + 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_deserializeOpErrorDeleteArchiveRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetAccessPreview struct { +} + +func (*awsRestjson1_deserializeOpGetAccessPreview) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetAccessPreview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetAccessPreview(response, &metadata) + } + output := &GetAccessPreviewOutput{} out.Result = output var buff [1024]byte @@ -1653,14 +2013,14 @@ func awsRestjson1_deserializeOpDocumentGetFindingOutput(v **GetFindingOutput, va return nil } -type awsRestjson1_deserializeOpGetGeneratedPolicy struct { +type awsRestjson1_deserializeOpGetFindingV2 struct { } -func (*awsRestjson1_deserializeOpGetGeneratedPolicy) ID() string { +func (*awsRestjson1_deserializeOpGetFindingV2) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetGeneratedPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetFindingV2) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1674,9 +2034,9 @@ func (m *awsRestjson1_deserializeOpGetGeneratedPolicy) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetGeneratedPolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetFindingV2(response, &metadata) } - output := &GetGeneratedPolicyOutput{} + output := &GetFindingV2Output{} out.Result = output var buff [1024]byte @@ -1697,7 +2057,7 @@ func (m *awsRestjson1_deserializeOpGetGeneratedPolicy) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetGeneratedPolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetFindingV2Output(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1710,7 +2070,7 @@ func (m *awsRestjson1_deserializeOpGetGeneratedPolicy) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetGeneratedPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetFindingV2(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1757,6 +2117,9 @@ func awsRestjson1_deserializeOpErrorGetGeneratedPolicy(response *smithyhttp.Resp 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) @@ -1773,7 +2136,7 @@ func awsRestjson1_deserializeOpErrorGetGeneratedPolicy(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentGetGeneratedPolicyOutput(v **GetGeneratedPolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetFindingV2Output(v **GetFindingV2Output, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1786,31 +2149,298 @@ func awsRestjson1_deserializeOpDocumentGetGeneratedPolicyOutput(v **GetGenerated return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetGeneratedPolicyOutput + var sv *GetFindingV2Output if *v == nil { - sv = &GetGeneratedPolicyOutput{} + sv = &GetFindingV2Output{} } else { sv = *v } for key, value := range shape { switch key { - case "generatedPolicyResult": - if err := awsRestjson1_deserializeDocumentGeneratedPolicyResult(&sv.GeneratedPolicyResult, value); err != nil { - return err + case "analyzedAt": + 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.AnalyzedAt = ptr.Time(t) } - case "jobDetails": - if err := awsRestjson1_deserializeDocumentJobDetails(&sv.JobDetails, value); err != nil { - return err + 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) } - default: - _, _ = key, value + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Error = ptr.String(jtv) + } - } - } - *v = sv + case "findingDetails": + if err := awsRestjson1_deserializeDocumentFindingDetailsList(&sv.FindingDetails, value); err != nil { + return err + } + + case "findingType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FindingType to be of type string, got %T instead", value) + } + sv.FindingType = types.FindingType(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FindingId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "resource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Resource = ptr.String(jtv) + } + + case "resourceOwnerAccount": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceOwnerAccount = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = types.ResourceType(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FindingStatus to be of type string, got %T instead", value) + } + sv.Status = types.FindingStatus(jtv) + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetGeneratedPolicy struct { +} + +func (*awsRestjson1_deserializeOpGetGeneratedPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetGeneratedPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetGeneratedPolicy(response, &metadata) + } + output := &GetGeneratedPolicyOutput{} + 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_deserializeOpDocumentGetGeneratedPolicyOutput(&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_deserializeOpErrorGetGeneratedPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentGetGeneratedPolicyOutput(v **GetGeneratedPolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetGeneratedPolicyOutput + if *v == nil { + sv = &GetGeneratedPolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "generatedPolicyResult": + if err := awsRestjson1_deserializeDocumentGeneratedPolicyResult(&sv.GeneratedPolicyResult, value); err != nil { + return err + } + + case "jobDetails": + if err := awsRestjson1_deserializeDocumentJobDetails(&sv.JobDetails, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv return nil } @@ -2819,14 +3449,14 @@ func awsRestjson1_deserializeOpDocumentListFindingsOutput(v **ListFindingsOutput return nil } -type awsRestjson1_deserializeOpListPolicyGenerations struct { +type awsRestjson1_deserializeOpListFindingsV2 struct { } -func (*awsRestjson1_deserializeOpListPolicyGenerations) ID() string { +func (*awsRestjson1_deserializeOpListFindingsV2) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPolicyGenerations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListFindingsV2) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2840,9 +3470,9 @@ func (m *awsRestjson1_deserializeOpListPolicyGenerations) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPolicyGenerations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListFindingsV2(response, &metadata) } - output := &ListPolicyGenerationsOutput{} + output := &ListFindingsV2Output{} out.Result = output var buff [1024]byte @@ -2863,7 +3493,7 @@ func (m *awsRestjson1_deserializeOpListPolicyGenerations) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPolicyGenerationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListFindingsV2Output(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2876,7 +3506,7 @@ func (m *awsRestjson1_deserializeOpListPolicyGenerations) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPolicyGenerations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListFindingsV2(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2923,6 +3553,9 @@ func awsRestjson1_deserializeOpErrorListPolicyGenerations(response *smithyhttp.R 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) @@ -2939,7 +3572,172 @@ func awsRestjson1_deserializeOpErrorListPolicyGenerations(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentListPolicyGenerationsOutput(v **ListPolicyGenerationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListFindingsV2Output(v **ListFindingsV2Output, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListFindingsV2Output + if *v == nil { + sv = &ListFindingsV2Output{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "findings": + if err := awsRestjson1_deserializeDocumentFindingsListV2(&sv.Findings, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListPolicyGenerations struct { +} + +func (*awsRestjson1_deserializeOpListPolicyGenerations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListPolicyGenerations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListPolicyGenerations(response, &metadata) + } + output := &ListPolicyGenerationsOutput{} + 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_deserializeOpDocumentListPolicyGenerationsOutput(&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_deserializeOpErrorListPolicyGenerations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentListPolicyGenerationsOutput(v **ListPolicyGenerationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4111,6 +4909,42 @@ func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.R return output } +func awsRestjson1_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidParameterException{} + 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_deserializeDocumentInvalidParameterException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceNotFoundException{} var buff [1024]byte @@ -4223,6 +5057,42 @@ func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Respo return output } +func awsRestjson1_deserializeErrorUnprocessableEntityException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.UnprocessableEntityException{} + 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_deserializeDocumentUnprocessableEntityException(&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 @@ -5034,7 +5904,7 @@ func awsRestjson1_deserializeDocumentAnalyzedResourceSummary(v **types.AnalyzedR return nil } -func awsRestjson1_deserializeDocumentAnalyzersList(v *[]types.AnalyzerSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentAnalyzerConfiguration(v *types.AnalyzerConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5042,28 +5912,68 @@ func awsRestjson1_deserializeDocumentAnalyzersList(v *[]types.AnalyzerSummary, v 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.AnalyzerSummary - if *v == nil { - cv = []types.AnalyzerSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.AnalyzerSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentAnalyzerSummary(&destAddr, value); err != nil { - return err + var uv types.AnalyzerConfiguration +loop: + for key, value := range shape { + if value == nil { + continue } - col = *destAddr - cv = append(cv, col) + switch key { + case "unusedAccess": + var mv types.UnusedAccessConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentUnusedAccessConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AnalyzerConfigurationMemberUnusedAccess{Value: mv} + break loop - } + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentAnalyzersList(v *[]types.AnalyzerSummary, 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.AnalyzerSummary + if *v == nil { + cv = []types.AnalyzerSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AnalyzerSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAnalyzerSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } *v = cv return nil } @@ -5099,6 +6009,11 @@ func awsRestjson1_deserializeDocumentAnalyzerSummary(v **types.AnalyzerSummary, sv.Arn = ptr.String(jtv) } + case "configuration": + if err := awsRestjson1_deserializeDocumentAnalyzerConfiguration(&sv.Configuration, value); err != nil { + return err + } + case "createdAt": if value != nil { jtv, ok := value.(string) @@ -5872,6 +6787,66 @@ func awsRestjson1_deserializeDocumentEfsFileSystemConfiguration(v **types.EfsFil return nil } +func awsRestjson1_deserializeDocumentExternalAccessDetails(v **types.ExternalAccessDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ExternalAccessDetails + if *v == nil { + sv = &types.ExternalAccessDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "action": + if err := awsRestjson1_deserializeDocumentActionList(&sv.Action, value); err != nil { + return err + } + + case "condition": + if err := awsRestjson1_deserializeDocumentConditionKeyMap(&sv.Condition, value); err != nil { + return err + } + + case "isPublic": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsPublic = ptr.Bool(jtv) + } + + case "principal": + if err := awsRestjson1_deserializeDocumentPrincipalMap(&sv.Principal, value); err != nil { + return err + } + + case "sources": + if err := awsRestjson1_deserializeDocumentFindingSourceList(&sv.Sources, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentFilterCriteriaMap(v *map[string]types.Criterion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6060,6 +7035,118 @@ func awsRestjson1_deserializeDocumentFinding(v **types.Finding, value interface{ return nil } +func awsRestjson1_deserializeDocumentFindingDetails(v *types.FindingDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.FindingDetails +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "externalAccessDetails": + var mv types.ExternalAccessDetails + destAddr := &mv + if err := awsRestjson1_deserializeDocumentExternalAccessDetails(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FindingDetailsMemberExternalAccessDetails{Value: mv} + break loop + + case "unusedIamRoleDetails": + var mv types.UnusedIamRoleDetails + destAddr := &mv + if err := awsRestjson1_deserializeDocumentUnusedIamRoleDetails(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FindingDetailsMemberUnusedIamRoleDetails{Value: mv} + break loop + + case "unusedIamUserAccessKeyDetails": + var mv types.UnusedIamUserAccessKeyDetails + destAddr := &mv + if err := awsRestjson1_deserializeDocumentUnusedIamUserAccessKeyDetails(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FindingDetailsMemberUnusedIamUserAccessKeyDetails{Value: mv} + break loop + + case "unusedIamUserPasswordDetails": + var mv types.UnusedIamUserPasswordDetails + destAddr := &mv + if err := awsRestjson1_deserializeDocumentUnusedIamUserPasswordDetails(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FindingDetailsMemberUnusedIamUserPasswordDetails{Value: mv} + break loop + + case "unusedPermissionDetails": + var mv types.UnusedPermissionDetails + destAddr := &mv + if err := awsRestjson1_deserializeDocumentUnusedPermissionDetails(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.FindingDetailsMemberUnusedPermissionDetails{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentFindingDetailsList(v *[]types.FindingDetails, 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.FindingDetails + if *v == nil { + cv = []types.FindingDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FindingDetails + if err := awsRestjson1_deserializeDocumentFindingDetails(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentFindingsList(v *[]types.FindingSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6094,6 +7181,40 @@ func awsRestjson1_deserializeDocumentFindingsList(v *[]types.FindingSummary, val return nil } +func awsRestjson1_deserializeDocumentFindingsListV2(v *[]types.FindingSummaryV2, 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.FindingSummaryV2 + if *v == nil { + cv = []types.FindingSummaryV2{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FindingSummaryV2 + destAddr := &col + if err := awsRestjson1_deserializeDocumentFindingSummaryV2(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentFindingSource(v **types.FindingSource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6375,7 +7496,7 @@ func awsRestjson1_deserializeDocumentFindingSummary(v **types.FindingSummary, va return nil } -func awsRestjson1_deserializeDocumentGeneratedPolicy(v **types.GeneratedPolicy, value interface{}) error { +func awsRestjson1_deserializeDocumentFindingSummaryV2(v **types.FindingSummaryV2, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6388,35 +7509,168 @@ func awsRestjson1_deserializeDocumentGeneratedPolicy(v **types.GeneratedPolicy, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.GeneratedPolicy + var sv *types.FindingSummaryV2 if *v == nil { - sv = &types.GeneratedPolicy{} + sv = &types.FindingSummaryV2{} } else { sv = *v } for key, value := range shape { switch key { - case "policy": + case "analyzedAt": 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 Timestamp to be of type string, got %T instead", value) } - sv.Policy = ptr.String(jtv) + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.AnalyzedAt = ptr.Time(t) } - default: - _, _ = key, value + 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) + } - } - } - *v = sv - return nil -} + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Error = ptr.String(jtv) + } -func awsRestjson1_deserializeDocumentGeneratedPolicyList(v *[]types.GeneratedPolicy, value interface{}) error { - if v == nil { + case "findingType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FindingType to be of type string, got %T instead", value) + } + sv.FindingType = types.FindingType(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FindingId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "resource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Resource = ptr.String(jtv) + } + + case "resourceOwnerAccount": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceOwnerAccount = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = types.ResourceType(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FindingStatus to be of type string, got %T instead", value) + } + sv.Status = types.FindingStatus(jtv) + } + + case "updatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGeneratedPolicy(v **types.GeneratedPolicy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.GeneratedPolicy + if *v == nil { + sv = &types.GeneratedPolicy{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "policy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGeneratedPolicyList(v *[]types.GeneratedPolicy, value interface{}) error { + if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { @@ -6668,6 +7922,46 @@ func awsRestjson1_deserializeDocumentInternetConfiguration(v **types.InternetCon return nil } +func awsRestjson1_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidParameterException + if *v == nil { + sv = &types.InvalidParameterException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentJobDetails(v **types.JobDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7856,6 +9150,102 @@ func awsRestjson1_deserializeDocumentRdsDbSnapshotConfiguration(v **types.RdsDbS return nil } +func awsRestjson1_deserializeDocumentReasonSummary(v **types.ReasonSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ReasonSummary + if *v == nil { + sv = &types.ReasonSummary{} + } 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 String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "statementId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.StatementId = ptr.String(jtv) + } + + case "statementIndex": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.StatementIndex = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentReasonSummaryList(v *[]types.ReasonSummary, 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.ReasonSummary + if *v == nil { + cv = []types.ReasonSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ReasonSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentReasonSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentRegionList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8756,6 +10146,376 @@ func awsRestjson1_deserializeDocumentTrailPropertiesList(v *[]types.TrailPropert return nil } +func awsRestjson1_deserializeDocumentUnprocessableEntityException(v **types.UnprocessableEntityException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UnprocessableEntityException + if *v == nil { + sv = &types.UnprocessableEntityException{} + } 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_deserializeDocumentUnusedAccessConfiguration(v **types.UnusedAccessConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UnusedAccessConfiguration + if *v == nil { + sv = &types.UnusedAccessConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "unusedAccessAge": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.UnusedAccessAge = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUnusedAction(v **types.UnusedAction, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UnusedAction + if *v == nil { + sv = &types.UnusedAction{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "action": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Action = ptr.String(jtv) + } + + case "lastAccessed": + 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.LastAccessed = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUnusedActionList(v *[]types.UnusedAction, 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.UnusedAction + if *v == nil { + cv = []types.UnusedAction{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.UnusedAction + destAddr := &col + if err := awsRestjson1_deserializeDocumentUnusedAction(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentUnusedIamRoleDetails(v **types.UnusedIamRoleDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UnusedIamRoleDetails + if *v == nil { + sv = &types.UnusedIamRoleDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "lastAccessed": + 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.LastAccessed = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUnusedIamUserAccessKeyDetails(v **types.UnusedIamUserAccessKeyDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UnusedIamUserAccessKeyDetails + if *v == nil { + sv = &types.UnusedIamUserAccessKeyDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accessKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AccessKeyId = ptr.String(jtv) + } + + case "lastAccessed": + 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.LastAccessed = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUnusedIamUserPasswordDetails(v **types.UnusedIamUserPasswordDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UnusedIamUserPasswordDetails + if *v == nil { + sv = &types.UnusedIamUserPasswordDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "lastAccessed": + 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.LastAccessed = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUnusedPermissionDetails(v **types.UnusedPermissionDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UnusedPermissionDetails + if *v == nil { + sv = &types.UnusedPermissionDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "actions": + if err := awsRestjson1_deserializeDocumentUnusedActionList(&sv.Actions, value); err != nil { + return err + } + + case "lastAccessed": + 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.LastAccessed = ptr.Time(t) + } + + case "serviceNamespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceNamespace = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentValidatePolicyFinding(v **types.ValidatePolicyFinding, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/accessanalyzer/doc.go b/service/accessanalyzer/doc.go index 8567f53d30e..728e9ecd1a3 100644 --- a/service/accessanalyzer/doc.go +++ b/service/accessanalyzer/doc.go @@ -3,17 +3,28 @@ // Package accessanalyzer provides the API client, operations, and parameter types // for Access Analyzer. // -// Identity and Access Management Access Analyzer helps identify potential -// resource-access risks by enabling you to identify any policies that grant access -// to an external principal. It does this by using logic-based reasoning to analyze -// resource-based policies in your Amazon Web Services environment. An external -// principal can be another Amazon Web Services account, a root user, an IAM user -// or role, a federated user, an Amazon Web Services service, or an anonymous user. -// You can also use IAM Access Analyzer to preview and validate public and -// cross-account access to your resources before deploying permissions changes. -// This guide describes the Identity and Access Management Access Analyzer -// operations that you can call programmatically. For general information about IAM -// Access Analyzer, see Identity and Access Management Access Analyzer (https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html) -// in the IAM User Guide. To start using IAM Access Analyzer, you first need to -// create an analyzer. +// Identity and Access Management Access Analyzer helps you to set, verify, and +// refine your IAM policies by providing a suite of capabilities. Its features +// include findings for external and unused access, basic and custom policy checks +// for validating policies, and policy generation to generate fine-grained +// policies. To start using IAM Access Analyzer to identify external or unused +// access, you first need to create an analyzer. External access analyzers help +// identify potential risks of accessing resources by enabling you to identify any +// resource policies that grant access to an external principal. It does this by +// using logic-based reasoning to analyze resource-based policies in your Amazon +// Web Services environment. An external principal can be another Amazon Web +// Services account, a root user, an IAM user or role, a federated user, an Amazon +// Web Services service, or an anonymous user. You can also use IAM Access Analyzer +// to preview public and cross-account access to your resources before deploying +// permissions changes. Unused access analyzers help identify potential identity +// access risks by enabling you to identify unused IAM roles, unused access keys, +// unused console passwords, and IAM principals with unused service and +// action-level permissions. Beyond findings, IAM Access Analyzer provides basic +// and custom policy checks to validate IAM policies before deploying permissions +// changes. You can use policy generation to refine permissions by attaching a +// policy generated using access activity logged in CloudTrail logs. This guide +// describes the IAM Access Analyzer operations that you can call programmatically. +// For general information about IAM Access Analyzer, see Identity and Access +// Management Access Analyzer (https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html) +// in the IAM User Guide. package accessanalyzer diff --git a/service/accessanalyzer/endpoints.go b/service/accessanalyzer/endpoints.go index d6dbac4285e..a9c6242d84f 100644 --- a/service/accessanalyzer/endpoints.go +++ b/service/accessanalyzer/endpoints.go @@ -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://access-analyzer.") diff --git a/service/accessanalyzer/generated.json b/service/accessanalyzer/generated.json index e71a8cddd9f..0e767ba0fe7 100644 --- a/service/accessanalyzer/generated.json +++ b/service/accessanalyzer/generated.json @@ -11,6 +11,8 @@ "api_client_test.go", "api_op_ApplyArchiveRule.go", "api_op_CancelPolicyGeneration.go", + "api_op_CheckAccessNotGranted.go", + "api_op_CheckNoNewAccess.go", "api_op_CreateAccessPreview.go", "api_op_CreateAnalyzer.go", "api_op_CreateArchiveRule.go", @@ -21,6 +23,7 @@ "api_op_GetAnalyzer.go", "api_op_GetArchiveRule.go", "api_op_GetFinding.go", + "api_op_GetFindingV2.go", "api_op_GetGeneratedPolicy.go", "api_op_ListAccessPreviewFindings.go", "api_op_ListAccessPreviews.go", @@ -28,6 +31,7 @@ "api_op_ListAnalyzers.go", "api_op_ListArchiveRules.go", "api_op_ListFindings.go", + "api_op_ListFindingsV2.go", "api_op_ListPolicyGenerations.go", "api_op_ListTagsForResource.go", "api_op_StartPolicyGeneration.go", diff --git a/service/accessanalyzer/serializers.go b/service/accessanalyzer/serializers.go index 0364720b126..8e5ed76c576 100644 --- a/service/accessanalyzer/serializers.go +++ b/service/accessanalyzer/serializers.go @@ -165,6 +165,178 @@ func awsRestjson1_serializeOpHttpBindingsCancelPolicyGenerationInput(v *CancelPo return nil } +type awsRestjson1_serializeOpCheckAccessNotGranted struct { +} + +func (*awsRestjson1_serializeOpCheckAccessNotGranted) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCheckAccessNotGranted) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CheckAccessNotGrantedInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/policy/check-access-not-granted") + 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_serializeOpDocumentCheckAccessNotGrantedInput(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_serializeOpHttpBindingsCheckAccessNotGrantedInput(v *CheckAccessNotGrantedInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCheckAccessNotGrantedInput(v *CheckAccessNotGrantedInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Access != nil { + ok := object.Key("access") + if err := awsRestjson1_serializeDocumentAccessList(v.Access, ok); err != nil { + return err + } + } + + if v.PolicyDocument != nil { + ok := object.Key("policyDocument") + ok.String(*v.PolicyDocument) + } + + if len(v.PolicyType) > 0 { + ok := object.Key("policyType") + ok.String(string(v.PolicyType)) + } + + return nil +} + +type awsRestjson1_serializeOpCheckNoNewAccess struct { +} + +func (*awsRestjson1_serializeOpCheckNoNewAccess) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCheckNoNewAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CheckNoNewAccessInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/policy/check-no-new-access") + 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_serializeOpDocumentCheckNoNewAccessInput(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_serializeOpHttpBindingsCheckNoNewAccessInput(v *CheckNoNewAccessInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCheckNoNewAccessInput(v *CheckNoNewAccessInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExistingPolicyDocument != nil { + ok := object.Key("existingPolicyDocument") + ok.String(*v.ExistingPolicyDocument) + } + + if v.NewPolicyDocument != nil { + ok := object.Key("newPolicyDocument") + ok.String(*v.NewPolicyDocument) + } + + if len(v.PolicyType) > 0 { + ok := object.Key("policyType") + ok.String(string(v.PolicyType)) + } + + return nil +} + type awsRestjson1_serializeOpCreateAccessPreview struct { } @@ -336,6 +508,13 @@ func awsRestjson1_serializeOpDocumentCreateAnalyzerInput(v *CreateAnalyzerInput, ok.String(*v.ClientToken) } + if v.Configuration != nil { + ok := object.Key("configuration") + if err := awsRestjson1_serializeDocumentAnalyzerConfiguration(v.Configuration, ok); err != nil { + return err + } + } + if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { @@ -939,6 +1118,83 @@ func awsRestjson1_serializeOpHttpBindingsGetFindingInput(v *GetFindingInput, enc return nil } +type awsRestjson1_serializeOpGetFindingV2 struct { +} + +func (*awsRestjson1_serializeOpGetFindingV2) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetFindingV2) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetFindingV2Input) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/findingv2/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetFindingV2Input(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_serializeOpHttpBindingsGetFindingV2Input(v *GetFindingV2Input, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AnalyzerArn != nil { + encoder.SetQuery("analyzerArn").String(*v.AnalyzerArn) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpGetGeneratedPolicy struct { } @@ -1515,6 +1771,105 @@ func awsRestjson1_serializeOpDocumentListFindingsInput(v *ListFindingsInput, val return nil } +type awsRestjson1_serializeOpListFindingsV2 struct { +} + +func (*awsRestjson1_serializeOpListFindingsV2) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListFindingsV2) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListFindingsV2Input) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/findingv2") + 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_serializeOpDocumentListFindingsV2Input(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_serializeOpHttpBindingsListFindingsV2Input(v *ListFindingsV2Input, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListFindingsV2Input(v *ListFindingsV2Input, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AnalyzerArn != nil { + ok := object.Key("analyzerArn") + ok.String(*v.AnalyzerArn) + } + + if v.Filter != nil { + ok := object.Key("filter") + if err := awsRestjson1_serializeDocumentFilterCriteriaMap(v.Filter, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.Sort != nil { + ok := object.Key("sort") + if err := awsRestjson1_serializeDocumentSortCriteria(v.Sort, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpListPolicyGenerations struct { } @@ -2286,6 +2641,33 @@ func awsRestjson1_serializeOpDocumentValidatePolicyInput(v *ValidatePolicyInput, return nil } +func awsRestjson1_serializeDocumentAccess(v *types.Access, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Actions != nil { + ok := object.Key("actions") + if err := awsRestjson1_serializeDocumentActionsList(v.Actions, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAccessList(v []types.Access, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAccess(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentAclGrantee(v types.AclGrantee, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2306,6 +2688,35 @@ func awsRestjson1_serializeDocumentAclGrantee(v types.AclGrantee, value smithyjs return nil } +func awsRestjson1_serializeDocumentActionsList(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_serializeDocumentAnalyzerConfiguration(v types.AnalyzerConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.AnalyzerConfigurationMemberUnusedAccess: + av := object.Key("unusedAccess") + if err := awsRestjson1_serializeDocumentUnusedAccessConfiguration(&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_serializeDocumentCloudTrailDetails(v *types.CloudTrailDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3137,6 +3548,18 @@ func awsRestjson1_serializeDocumentTrailList(v []types.Trail, value smithyjson.V return nil } +func awsRestjson1_serializeDocumentUnusedAccessConfiguration(v *types.UnusedAccessConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.UnusedAccessAge != nil { + ok := object.Key("unusedAccessAge") + ok.Integer(*v.UnusedAccessAge) + } + + return nil +} + func awsRestjson1_serializeDocumentValueList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/accessanalyzer/types/enums.go b/service/accessanalyzer/types/enums.go index a7ae42b723c..c488c1a8aa4 100644 --- a/service/accessanalyzer/types/enums.go +++ b/service/accessanalyzer/types/enums.go @@ -2,6 +2,24 @@ package types +type AccessCheckPolicyType string + +// Enum values for AccessCheckPolicyType +const ( + AccessCheckPolicyTypeIdentityPolicy AccessCheckPolicyType = "IDENTITY_POLICY" + AccessCheckPolicyTypeResourcePolicy AccessCheckPolicyType = "RESOURCE_POLICY" +) + +// Values returns all known values for AccessCheckPolicyType. 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 (AccessCheckPolicyType) Values() []AccessCheckPolicyType { + return []AccessCheckPolicyType{ + "IDENTITY_POLICY", + "RESOURCE_POLICY", + } +} + type AccessPreviewStatus string // Enum values for AccessPreviewStatus @@ -87,6 +105,42 @@ func (AnalyzerStatus) Values() []AnalyzerStatus { } } +type CheckAccessNotGrantedResult string + +// Enum values for CheckAccessNotGrantedResult +const ( + CheckAccessNotGrantedResultPass CheckAccessNotGrantedResult = "PASS" + CheckAccessNotGrantedResultFail CheckAccessNotGrantedResult = "FAIL" +) + +// Values returns all known values for CheckAccessNotGrantedResult. 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 (CheckAccessNotGrantedResult) Values() []CheckAccessNotGrantedResult { + return []CheckAccessNotGrantedResult{ + "PASS", + "FAIL", + } +} + +type CheckNoNewAccessResult string + +// Enum values for CheckNoNewAccessResult +const ( + CheckNoNewAccessResultPass CheckNoNewAccessResult = "PASS" + CheckNoNewAccessResultFail CheckNoNewAccessResult = "FAIL" +) + +// Values returns all known values for CheckNoNewAccessResult. 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 (CheckNoNewAccessResult) Values() []CheckNoNewAccessResult { + return []CheckNoNewAccessResult{ + "PASS", + "FAIL", + } +} + type FindingChangeType string // Enum values for FindingChangeType @@ -167,6 +221,30 @@ func (FindingStatusUpdate) Values() []FindingStatusUpdate { } } +type FindingType string + +// Enum values for FindingType +const ( + FindingTypeExternalAccess FindingType = "ExternalAccess" + FindingTypeUnusedIamRole FindingType = "UnusedIAMRole" + FindingTypeUnusedIamUserAccessKey FindingType = "UnusedIAMUserAccessKey" + FindingTypeUnusedIamUserPassword FindingType = "UnusedIAMUserPassword" + FindingTypeUnusedPermission FindingType = "UnusedPermission" +) + +// Values returns all known values for FindingType. 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 (FindingType) Values() []FindingType { + return []FindingType{ + "ExternalAccess", + "UnusedIAMRole", + "UnusedIAMUserAccessKey", + "UnusedIAMUserPassword", + "UnusedPermission", + } +} + type JobErrorCode string // Enum values for JobErrorCode @@ -391,8 +469,10 @@ type Type string // Enum values for Type const ( - TypeAccount Type = "ACCOUNT" - TypeOrganization Type = "ORGANIZATION" + TypeAccount Type = "ACCOUNT" + TypeOrganization Type = "ORGANIZATION" + TypeAccountUnusedAccess Type = "ACCOUNT_UNUSED_ACCESS" + TypeOrganizationUnusedAccess Type = "ORGANIZATION_UNUSED_ACCESS" ) // Values returns all known values for Type. Note that this can be expanded in the @@ -402,6 +482,8 @@ func (Type) Values() []Type { return []Type{ "ACCOUNT", "ORGANIZATION", + "ACCOUNT_UNUSED_ACCESS", + "ORGANIZATION_UNUSED_ACCESS", } } diff --git a/service/accessanalyzer/types/errors.go b/service/accessanalyzer/types/errors.go index 637017efe6f..7731b99fc0b 100644 --- a/service/accessanalyzer/types/errors.go +++ b/service/accessanalyzer/types/errors.go @@ -90,6 +90,32 @@ func (e *InternalServerException) ErrorCode() string { } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } +// The specified parameter is invalid. +type InvalidParameterException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidParameterException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidParameterException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidParameterException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The specified resource could not be found. type ResourceNotFoundException struct { Message *string @@ -176,6 +202,32 @@ func (e *ThrottlingException) ErrorCode() string { } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The specified entity could not be processed. +type UnprocessableEntityException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *UnprocessableEntityException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnprocessableEntityException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnprocessableEntityException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnprocessableEntityException" + } + return *e.ErrorCodeOverride +} +func (e *UnprocessableEntityException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // Validation exception error. type ValidationException struct { Message *string diff --git a/service/accessanalyzer/types/types.go b/service/accessanalyzer/types/types.go index ca09c9ab686..8e12fecdeec 100644 --- a/service/accessanalyzer/types/types.go +++ b/service/accessanalyzer/types/types.go @@ -7,6 +7,18 @@ import ( "time" ) +// Contains information about actions that define permissions to check against a +// policy. +type Access struct { + + // A list of actions for the access permissions. + // + // This member is required. + Actions []string + + noSmithyDocumentSerde +} + // Contains information about an access preview. type AccessPreview struct { @@ -289,6 +301,27 @@ type AnalyzedResourceSummary struct { noSmithyDocumentSerde } +// Contains information about the configuration of an unused access analyzer for +// an Amazon Web Services organization or account. +// +// The following types satisfy this interface: +// +// AnalyzerConfigurationMemberUnusedAccess +type AnalyzerConfiguration interface { + isAnalyzerConfiguration() +} + +// Specifies the configuration of an unused access analyzer for an Amazon Web +// Services organization or account. External access analyzers do not support any +// configuration. +type AnalyzerConfigurationMemberUnusedAccess struct { + Value UnusedAccessConfiguration + + noSmithyDocumentSerde +} + +func (*AnalyzerConfigurationMemberUnusedAccess) isAnalyzerConfiguration() {} + // Contains information about the analyzer. type AnalyzerSummary struct { @@ -323,6 +356,9 @@ type AnalyzerSummary struct { // This member is required. Type Type + // Specifies whether the analyzer is an external access or unused access analyzer. + Configuration AnalyzerConfiguration + // The resource that was most recently analyzed by the analyzer. LastResourceAnalyzed *string @@ -652,6 +688,32 @@ type EfsFileSystemConfiguration struct { noSmithyDocumentSerde } +// Contains information about an external access finding. +type ExternalAccessDetails struct { + + // The condition in the analyzed policy statement that resulted in an external + // access finding. + // + // This member is required. + Condition map[string]string + + // The action in the analyzed policy statement that an external principal has + // permission to use. + Action []string + + // Specifies whether the external access finding is public. + IsPublic *bool + + // The external principal that has access to a resource within the zone of trust. + Principal map[string]string + + // The sources of the external access finding. This indicates how the access that + // generated the finding is granted. It is populated for Amazon S3 bucket findings. + Sources []FindingSource + + noSmithyDocumentSerde +} + // Contains information about a finding. type Finding struct { @@ -706,7 +768,7 @@ type Finding struct { // the resource. IsPublic *bool - // The external principal that access to a resource within the zone of trust. + // The external principal that has access to a resource within the zone of trust. Principal map[string]string // The resource that an external principal has access to. @@ -719,6 +781,69 @@ type Finding struct { noSmithyDocumentSerde } +// Contains information about an external access or unused access finding. Only +// one parameter can be used in a FindingDetails object. +// +// The following types satisfy this interface: +// +// FindingDetailsMemberExternalAccessDetails +// FindingDetailsMemberUnusedIamRoleDetails +// FindingDetailsMemberUnusedIamUserAccessKeyDetails +// FindingDetailsMemberUnusedIamUserPasswordDetails +// FindingDetailsMemberUnusedPermissionDetails +type FindingDetails interface { + isFindingDetails() +} + +// The details for an external access analyzer finding. +type FindingDetailsMemberExternalAccessDetails struct { + Value ExternalAccessDetails + + noSmithyDocumentSerde +} + +func (*FindingDetailsMemberExternalAccessDetails) isFindingDetails() {} + +// The details for an unused access analyzer finding with an unused IAM role +// finding type. +type FindingDetailsMemberUnusedIamRoleDetails struct { + Value UnusedIamRoleDetails + + noSmithyDocumentSerde +} + +func (*FindingDetailsMemberUnusedIamRoleDetails) isFindingDetails() {} + +// The details for an unused access analyzer finding with an unused IAM user +// access key finding type. +type FindingDetailsMemberUnusedIamUserAccessKeyDetails struct { + Value UnusedIamUserAccessKeyDetails + + noSmithyDocumentSerde +} + +func (*FindingDetailsMemberUnusedIamUserAccessKeyDetails) isFindingDetails() {} + +// The details for an unused access analyzer finding with an unused IAM user +// password finding type. +type FindingDetailsMemberUnusedIamUserPasswordDetails struct { + Value UnusedIamUserPasswordDetails + + noSmithyDocumentSerde +} + +func (*FindingDetailsMemberUnusedIamUserPasswordDetails) isFindingDetails() {} + +// The details for an unused access analyzer finding with an unused permission +// finding type. +type FindingDetailsMemberUnusedPermissionDetails struct { + Value UnusedPermissionDetails + + noSmithyDocumentSerde +} + +func (*FindingDetailsMemberUnusedPermissionDetails) isFindingDetails() {} + // The source of the finding. This indicates how the access that generated the // finding is granted. It is populated for Amazon S3 bucket findings. type FindingSource struct { @@ -817,6 +942,57 @@ type FindingSummary struct { noSmithyDocumentSerde } +// Contains information about a finding. +type FindingSummaryV2 struct { + + // The time at which the resource-based policy or IAM entity that generated the + // finding was analyzed. + // + // This member is required. + AnalyzedAt *time.Time + + // The time at which the finding was created. + // + // This member is required. + CreatedAt *time.Time + + // The ID of the finding. + // + // This member is required. + Id *string + + // The Amazon Web Services account ID that owns the resource. + // + // This member is required. + ResourceOwnerAccount *string + + // The type of the resource that the external principal has access to. + // + // This member is required. + ResourceType ResourceType + + // The status of the finding. + // + // This member is required. + Status FindingStatus + + // The time at which the finding was most recently updated. + // + // This member is required. + UpdatedAt *time.Time + + // The error that resulted in an Error finding. + Error *string + + // The type of the external access or unused access finding. + FindingType FindingType + + // The resource that the external principal has access to. + Resource *string + + noSmithyDocumentSerde +} + // Contains the text for the generated policy. type GeneratedPolicy struct { @@ -1317,6 +1493,22 @@ type RdsDbSnapshotConfiguration struct { noSmithyDocumentSerde } +// Contains information about the reasoning why a check for access passed or +// failed. +type ReasonSummary struct { + + // A description of the reasoning of a result of checking for access. + Description *string + + // The identifier for the reason statement. + StatementId *string + + // The index number of the reason statement. + StatementIndex *int32 + + noSmithyDocumentSerde +} + // The configuration for an Amazon S3 access point or multi-region access point // for the bucket. You can propose up to 10 access points or multi-region access // points per bucket. If the proposed Amazon S3 access point configuration is for @@ -1588,6 +1780,98 @@ type TrailProperties struct { noSmithyDocumentSerde } +// Contains information about an unused access analyzer. +type UnusedAccessConfiguration struct { + + // The specified access age in days for which to generate findings for unused + // access. For example, if you specify 90 days, the analyzer will generate findings + // for IAM entities within the accounts of the selected organization for any access + // that hasn't been used in 90 or more days since the analyzer's last scan. You can + // choose a value between 1 and 180 days. + UnusedAccessAge *int32 + + noSmithyDocumentSerde +} + +// Contains information about an unused access finding for an action. IAM Access +// Analyzer charges for unused access analysis based on the number of IAM roles and +// users analyzed per month. For more details on pricing, see IAM Access Analyzer +// pricing (https://aws.amazon.com/iam/access-analyzer/pricing) . +type UnusedAction struct { + + // The action for which the unused access finding was generated. + // + // This member is required. + Action *string + + // The time at which the action was last accessed. + LastAccessed *time.Time + + noSmithyDocumentSerde +} + +// Contains information about an unused access finding for an IAM role. IAM Access +// Analyzer charges for unused access analysis based on the number of IAM roles and +// users analyzed per month. For more details on pricing, see IAM Access Analyzer +// pricing (https://aws.amazon.com/iam/access-analyzer/pricing) . +type UnusedIamRoleDetails struct { + + // The time at which the role was last accessed. + LastAccessed *time.Time + + noSmithyDocumentSerde +} + +// Contains information about an unused access finding for an IAM user access key. +// IAM Access Analyzer charges for unused access analysis based on the number of +// IAM roles and users analyzed per month. For more details on pricing, see IAM +// Access Analyzer pricing (https://aws.amazon.com/iam/access-analyzer/pricing) . +type UnusedIamUserAccessKeyDetails struct { + + // The ID of the access key for which the unused access finding was generated. + // + // This member is required. + AccessKeyId *string + + // The time at which the access key was last accessed. + LastAccessed *time.Time + + noSmithyDocumentSerde +} + +// Contains information about an unused access finding for an IAM user password. +// IAM Access Analyzer charges for unused access analysis based on the number of +// IAM roles and users analyzed per month. For more details on pricing, see IAM +// Access Analyzer pricing (https://aws.amazon.com/iam/access-analyzer/pricing) . +type UnusedIamUserPasswordDetails struct { + + // The time at which the password was last accessed. + LastAccessed *time.Time + + noSmithyDocumentSerde +} + +// Contains information about an unused access finding for a permission. IAM +// Access Analyzer charges for unused access analysis based on the number of IAM +// roles and users analyzed per month. For more details on pricing, see IAM Access +// Analyzer pricing (https://aws.amazon.com/iam/access-analyzer/pricing) . +type UnusedPermissionDetails struct { + + // The namespace of the Amazon Web Services service that contains the unused + // actions. + // + // This member is required. + ServiceNamespace *string + + // A list of unused actions for which the unused access finding was generated. + Actions []UnusedAction + + // The time at which the permission last accessed. + LastAccessed *time.Time + + noSmithyDocumentSerde +} + // A finding in a policy. Each finding is an actionable recommendation that can be // used to improve the policy. type ValidatePolicyFinding struct { @@ -1669,7 +1953,9 @@ type UnknownUnionMember struct { } func (*UnknownUnionMember) isAclGrantee() {} +func (*UnknownUnionMember) isAnalyzerConfiguration() {} func (*UnknownUnionMember) isConfiguration() {} +func (*UnknownUnionMember) isFindingDetails() {} func (*UnknownUnionMember) isNetworkOriginConfiguration() {} func (*UnknownUnionMember) isPathElement() {} func (*UnknownUnionMember) isRdsDbClusterSnapshotAttributeValue() {} diff --git a/service/accessanalyzer/types/types_exported_test.go b/service/accessanalyzer/types/types_exported_test.go index 4841e7c0e30..8eba53efa35 100644 --- a/service/accessanalyzer/types/types_exported_test.go +++ b/service/accessanalyzer/types/types_exported_test.go @@ -29,6 +29,24 @@ func ExampleAclGrantee_outputUsage() { var _ *string var _ *string +func ExampleAnalyzerConfiguration_outputUsage() { + var union types.AnalyzerConfiguration + // type switches can be used to check the union value + switch v := union.(type) { + case *types.AnalyzerConfigurationMemberUnusedAccess: + _ = v.Value // Value is types.UnusedAccessConfiguration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.UnusedAccessConfiguration + func ExampleConfiguration_outputUsage() { var union types.Configuration // type switches can be used to check the union value @@ -87,6 +105,40 @@ var _ *types.S3BucketConfiguration var _ *types.KmsKeyConfiguration var _ *types.EbsSnapshotConfiguration +func ExampleFindingDetails_outputUsage() { + var union types.FindingDetails + // type switches can be used to check the union value + switch v := union.(type) { + case *types.FindingDetailsMemberExternalAccessDetails: + _ = v.Value // Value is types.ExternalAccessDetails + + case *types.FindingDetailsMemberUnusedIamRoleDetails: + _ = v.Value // Value is types.UnusedIamRoleDetails + + case *types.FindingDetailsMemberUnusedIamUserAccessKeyDetails: + _ = v.Value // Value is types.UnusedIamUserAccessKeyDetails + + case *types.FindingDetailsMemberUnusedIamUserPasswordDetails: + _ = v.Value // Value is types.UnusedIamUserPasswordDetails + + case *types.FindingDetailsMemberUnusedPermissionDetails: + _ = v.Value // Value is types.UnusedPermissionDetails + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.ExternalAccessDetails +var _ *types.UnusedIamRoleDetails +var _ *types.UnusedPermissionDetails +var _ *types.UnusedIamUserAccessKeyDetails +var _ *types.UnusedIamUserPasswordDetails + func ExampleNetworkOriginConfiguration_outputUsage() { var union types.NetworkOriginConfiguration // type switches can be used to check the union value diff --git a/service/accessanalyzer/validators.go b/service/accessanalyzer/validators.go index 1c7dfb32c82..c0b5976e60f 100644 --- a/service/accessanalyzer/validators.go +++ b/service/accessanalyzer/validators.go @@ -50,6 +50,46 @@ func (m *validateOpCancelPolicyGeneration) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpCheckAccessNotGranted struct { +} + +func (*validateOpCheckAccessNotGranted) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCheckAccessNotGranted) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CheckAccessNotGrantedInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCheckAccessNotGrantedInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCheckNoNewAccess struct { +} + +func (*validateOpCheckNoNewAccess) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCheckNoNewAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CheckNoNewAccessInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCheckNoNewAccessInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateAccessPreview struct { } @@ -250,6 +290,26 @@ func (m *validateOpGetFinding) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpGetFindingV2 struct { +} + +func (*validateOpGetFindingV2) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetFindingV2) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetFindingV2Input) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetFindingV2Input(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetGeneratedPolicy struct { } @@ -370,6 +430,26 @@ func (m *validateOpListFindings) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpListFindingsV2 struct { +} + +func (*validateOpListFindingsV2) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListFindingsV2) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListFindingsV2Input) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListFindingsV2Input(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -538,6 +618,14 @@ func addOpCancelPolicyGenerationValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpCancelPolicyGeneration{}, middleware.After) } +func addOpCheckAccessNotGrantedValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCheckAccessNotGranted{}, middleware.After) +} + +func addOpCheckNoNewAccessValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCheckNoNewAccess{}, middleware.After) +} + func addOpCreateAccessPreviewValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateAccessPreview{}, middleware.After) } @@ -578,6 +666,10 @@ func addOpGetFindingValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetFinding{}, middleware.After) } +func addOpGetFindingV2ValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetFindingV2{}, middleware.After) +} + func addOpGetGeneratedPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetGeneratedPolicy{}, middleware.After) } @@ -602,6 +694,10 @@ func addOpListFindingsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListFindings{}, middleware.After) } +func addOpListFindingsV2ValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListFindingsV2{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -634,6 +730,38 @@ func addOpValidatePolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpValidatePolicy{}, middleware.After) } +func validateAccess(v *types.Access) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Access"} + if v.Actions == nil { + invalidParams.Add(smithy.NewErrParamRequired("Actions")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateAccessList(v []types.Access) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AccessList"} + for i := range v { + if err := validateAccess(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateCloudTrailDetails(v *types.CloudTrailDetails) error { if v == nil { return nil @@ -1024,6 +1152,52 @@ func validateOpCancelPolicyGenerationInput(v *CancelPolicyGenerationInput) error } } +func validateOpCheckAccessNotGrantedInput(v *CheckAccessNotGrantedInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CheckAccessNotGrantedInput"} + if v.PolicyDocument == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyDocument")) + } + if v.Access == nil { + invalidParams.Add(smithy.NewErrParamRequired("Access")) + } else if v.Access != nil { + if err := validateAccessList(v.Access); err != nil { + invalidParams.AddNested("Access", err.(smithy.InvalidParamsError)) + } + } + if len(v.PolicyType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("PolicyType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCheckNoNewAccessInput(v *CheckNoNewAccessInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CheckNoNewAccessInput"} + if v.NewPolicyDocument == nil { + invalidParams.Add(smithy.NewErrParamRequired("NewPolicyDocument")) + } + if v.ExistingPolicyDocument == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExistingPolicyDocument")) + } + if len(v.PolicyType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("PolicyType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateAccessPreviewInput(v *CreateAccessPreviewInput) error { if v == nil { return nil @@ -1210,6 +1384,24 @@ func validateOpGetFindingInput(v *GetFindingInput) error { } } +func validateOpGetFindingV2Input(v *GetFindingV2Input) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetFindingV2Input"} + if v.AnalyzerArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AnalyzerArn")) + } + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetGeneratedPolicyInput(v *GetGeneratedPolicyInput) error { if v == nil { return nil @@ -1303,6 +1495,21 @@ func validateOpListFindingsInput(v *ListFindingsInput) error { } } +func validateOpListFindingsV2Input(v *ListFindingsV2Input) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListFindingsV2Input"} + if v.AnalyzerArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AnalyzerArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil diff --git a/service/amp/api_op_CreateScraper.go b/service/amp/api_op_CreateScraper.go new file mode 100644 index 00000000000..f0232dc5705 --- /dev/null +++ b/service/amp/api_op_CreateScraper.go @@ -0,0 +1,211 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amp + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/amp/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Create a scraper. +func (c *Client) CreateScraper(ctx context.Context, params *CreateScraperInput, optFns ...func(*Options)) (*CreateScraperOutput, error) { + if params == nil { + params = &CreateScraperInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateScraper", params, optFns, c.addOperationCreateScraperMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateScraperOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents the input of a CreateScraper operation. +type CreateScraperInput struct { + + // The destination that the scraper will be producing metrics to. + // + // This member is required. + Destination types.Destination + + // The configuration used to create the scraper. + // + // This member is required. + ScrapeConfiguration types.ScrapeConfiguration + + // The source that the scraper will be discovering and collecting metrics from. + // + // This member is required. + Source types.Source + + // An optional user-assigned alias for this scraper. This alias is for user + // reference and does not need to be unique. + Alias *string + + // Optional, unique, case-sensitive, user-provided identifier to ensure the + // idempotency of the request. + ClientToken *string + + // Optional, user-provided tags for this scraper. + Tags map[string]string + + noSmithyDocumentSerde +} + +// Represents the output of a CreateScraper operation. +type CreateScraperOutput struct { + + // The ARN of the scraper that was just created. + // + // This member is required. + Arn *string + + // The generated ID of the scraper that was just created. + // + // This member is required. + ScraperId *string + + // The status of the scraper that was just created (usually CREATING). + // + // This member is required. + Status *types.ScraperStatus + + // The tags of this scraper. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateScraperMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateScraper{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateScraper{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateScraper"); 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_opCreateScraperMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateScraperValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateScraper(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_initializeOpCreateScraper struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateScraper) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateScraper) 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.(*CreateScraperInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateScraperInput ") + } + + 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_opCreateScraperMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateScraper{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateScraper(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateScraper", + } +} diff --git a/service/amp/api_op_DeleteScraper.go b/service/amp/api_op_DeleteScraper.go new file mode 100644 index 00000000000..8c8bf1f643b --- /dev/null +++ b/service/amp/api_op_DeleteScraper.go @@ -0,0 +1,186 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amp + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/amp/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a scraper. +func (c *Client) DeleteScraper(ctx context.Context, params *DeleteScraperInput, optFns ...func(*Options)) (*DeleteScraperOutput, error) { + if params == nil { + params = &DeleteScraperInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteScraper", params, optFns, c.addOperationDeleteScraperMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteScraperOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents the input of a DeleteScraper operation. +type DeleteScraperInput struct { + + // The ID of the scraper to delete. + // + // This member is required. + ScraperId *string + + // Optional, unique, case-sensitive, user-provided identifier to ensure the + // idempotency of the request. + ClientToken *string + + noSmithyDocumentSerde +} + +// Represents the output of a DeleteScraper operation. +type DeleteScraperOutput struct { + + // The ID of the scraper that was deleted. + // + // This member is required. + ScraperId *string + + // The status of the scraper that is being deleted. + // + // This member is required. + Status *types.ScraperStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteScraperMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteScraper{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteScraper{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteScraper"); 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_opDeleteScraperMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteScraperValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteScraper(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_initializeOpDeleteScraper struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteScraper) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteScraper) 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.(*DeleteScraperInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteScraperInput ") + } + + 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_opDeleteScraperMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteScraper{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteScraper(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteScraper", + } +} diff --git a/service/amp/api_op_DescribeScraper.go b/service/amp/api_op_DescribeScraper.go new file mode 100644 index 00000000000..db740da495a --- /dev/null +++ b/service/amp/api_op_DescribeScraper.go @@ -0,0 +1,498 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amp + +import ( + "context" + "errors" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/amp/types" + "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + smithywaiter "github.com/aws/smithy-go/waiter" + "github.com/jmespath/go-jmespath" + "time" +) + +// Describe an existing scraper. +func (c *Client) DescribeScraper(ctx context.Context, params *DescribeScraperInput, optFns ...func(*Options)) (*DescribeScraperOutput, error) { + if params == nil { + params = &DescribeScraperInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeScraper", params, optFns, c.addOperationDescribeScraperMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeScraperOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents the input of a DescribeScraper operation. +type DescribeScraperInput struct { + + // The IDs of the scraper to describe. + // + // This member is required. + ScraperId *string + + noSmithyDocumentSerde +} + +// Represents the output of a DescribeScraper operation. +type DescribeScraperOutput struct { + + // The properties of the selected scrapers. + // + // This member is required. + Scraper *types.ScraperDescription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeScraperMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeScraper{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeScraper{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeScraper"); 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 = addOpDescribeScraperValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeScraper(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 +} + +// DescribeScraperAPIClient is a client that implements the DescribeScraper +// operation. +type DescribeScraperAPIClient interface { + DescribeScraper(context.Context, *DescribeScraperInput, ...func(*Options)) (*DescribeScraperOutput, error) +} + +var _ DescribeScraperAPIClient = (*Client)(nil) + +// ScraperActiveWaiterOptions are waiter options for ScraperActiveWaiter +type ScraperActiveWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // ScraperActiveWaiter will use default minimum delay of 2 seconds. Note that + // MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, ScraperActiveWaiter will use default max delay of 120 seconds. Note + // that MaxDelay must resolve to value greater than or equal to the MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. By + // default service-modeled logic will populate this option. This option can thus be + // used to define a custom waiter state with fall-back to service-modeled waiter + // state mutators.The function returns an error in case of a failure state. In case + // of retry state, this function returns a bool value of true and nil error, while + // in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeScraperInput, *DescribeScraperOutput, error) (bool, error) +} + +// ScraperActiveWaiter defines the waiters for ScraperActive +type ScraperActiveWaiter struct { + client DescribeScraperAPIClient + + options ScraperActiveWaiterOptions +} + +// NewScraperActiveWaiter constructs a ScraperActiveWaiter. +func NewScraperActiveWaiter(client DescribeScraperAPIClient, optFns ...func(*ScraperActiveWaiterOptions)) *ScraperActiveWaiter { + options := ScraperActiveWaiterOptions{} + options.MinDelay = 2 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = scraperActiveStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &ScraperActiveWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for ScraperActive waiter. The maxWaitDur is the +// maximum wait duration the waiter will wait. The maxWaitDur is required and must +// be greater than zero. +func (w *ScraperActiveWaiter) Wait(ctx context.Context, params *DescribeScraperInput, maxWaitDur time.Duration, optFns ...func(*ScraperActiveWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for ScraperActive waiter and returns +// the output of the successful operation. The maxWaitDur is the maximum wait +// duration the waiter will wait. The maxWaitDur is required and must be greater +// than zero. +func (w *ScraperActiveWaiter) WaitForOutput(ctx context.Context, params *DescribeScraperInput, maxWaitDur time.Duration, optFns ...func(*ScraperActiveWaiterOptions)) (*DescribeScraperOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeScraper(ctx, params, func(o *Options) { + o.APIOptions = append(o.APIOptions, apiOptions...) + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for ScraperActive waiter") +} + +func scraperActiveStateRetryable(ctx context.Context, input *DescribeScraperInput, output *DescribeScraperOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("scraper.status.statusCode", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "ACTIVE" + value, ok := pathValue.(types.ScraperStatusCode) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.ScraperStatusCode value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, nil + } + } + + if err == nil { + pathValue, err := jmespath.Search("scraper.status.statusCode", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "CREATION_FAILED" + value, ok := pathValue.(types.ScraperStatusCode) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.ScraperStatusCode value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + return true, nil +} + +// ScraperDeletedWaiterOptions are waiter options for ScraperDeletedWaiter +type ScraperDeletedWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // ScraperDeletedWaiter will use default minimum delay of 2 seconds. Note that + // MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, ScraperDeletedWaiter will use default max delay of 120 seconds. + // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. By + // default service-modeled logic will populate this option. This option can thus be + // used to define a custom waiter state with fall-back to service-modeled waiter + // state mutators.The function returns an error in case of a failure state. In case + // of retry state, this function returns a bool value of true and nil error, while + // in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeScraperInput, *DescribeScraperOutput, error) (bool, error) +} + +// ScraperDeletedWaiter defines the waiters for ScraperDeleted +type ScraperDeletedWaiter struct { + client DescribeScraperAPIClient + + options ScraperDeletedWaiterOptions +} + +// NewScraperDeletedWaiter constructs a ScraperDeletedWaiter. +func NewScraperDeletedWaiter(client DescribeScraperAPIClient, optFns ...func(*ScraperDeletedWaiterOptions)) *ScraperDeletedWaiter { + options := ScraperDeletedWaiterOptions{} + options.MinDelay = 2 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = scraperDeletedStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &ScraperDeletedWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for ScraperDeleted waiter. The maxWaitDur is the +// maximum wait duration the waiter will wait. The maxWaitDur is required and must +// be greater than zero. +func (w *ScraperDeletedWaiter) Wait(ctx context.Context, params *DescribeScraperInput, maxWaitDur time.Duration, optFns ...func(*ScraperDeletedWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for ScraperDeleted waiter and returns +// the output of the successful operation. The maxWaitDur is the maximum wait +// duration the waiter will wait. The maxWaitDur is required and must be greater +// than zero. +func (w *ScraperDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeScraperInput, maxWaitDur time.Duration, optFns ...func(*ScraperDeletedWaiterOptions)) (*DescribeScraperOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeScraper(ctx, params, func(o *Options) { + o.APIOptions = append(o.APIOptions, apiOptions...) + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for ScraperDeleted waiter") +} + +func scraperDeletedStateRetryable(ctx context.Context, input *DescribeScraperInput, output *DescribeScraperOutput, err error) (bool, error) { + + if err != nil { + var errorType *types.ResourceNotFoundException + if errors.As(err, &errorType) { + return false, nil + } + } + + if err == nil { + pathValue, err := jmespath.Search("scraper.status.statusCode", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "DELETION_FAILED" + value, ok := pathValue.(types.ScraperStatusCode) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.ScraperStatusCode value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + return true, nil +} + +func newServiceMetadataMiddleware_opDescribeScraper(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeScraper", + } +} diff --git a/service/amp/api_op_GetDefaultScraperConfiguration.go b/service/amp/api_op_GetDefaultScraperConfiguration.go new file mode 100644 index 00000000000..b32c7e5de55 --- /dev/null +++ b/service/amp/api_op_GetDefaultScraperConfiguration.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amp + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets a default configuration. +func (c *Client) GetDefaultScraperConfiguration(ctx context.Context, params *GetDefaultScraperConfigurationInput, optFns ...func(*Options)) (*GetDefaultScraperConfigurationOutput, error) { + if params == nil { + params = &GetDefaultScraperConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDefaultScraperConfiguration", params, optFns, c.addOperationGetDefaultScraperConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDefaultScraperConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents the input of a GetDefaultScraperConfiguration operation. +type GetDefaultScraperConfigurationInput struct { + noSmithyDocumentSerde +} + +// Represents the output of a GetDefaultScraperConfiguration operation. +type GetDefaultScraperConfigurationOutput struct { + + // The default configuration. + // + // This member is required. + Configuration []byte + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetDefaultScraperConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDefaultScraperConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDefaultScraperConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetDefaultScraperConfiguration"); 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_opGetDefaultScraperConfiguration(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_opGetDefaultScraperConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetDefaultScraperConfiguration", + } +} diff --git a/service/amp/api_op_ListScrapers.go b/service/amp/api_op_ListScrapers.go new file mode 100644 index 00000000000..c44bd47ef0c --- /dev/null +++ b/service/amp/api_op_ListScrapers.go @@ -0,0 +1,237 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amp + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/amp/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all scrapers in a customer account, including scrapers being created or +// deleted. You may provide filters to return a more specific list of results. +func (c *Client) ListScrapers(ctx context.Context, params *ListScrapersInput, optFns ...func(*Options)) (*ListScrapersOutput, error) { + if params == nil { + params = &ListScrapersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListScrapers", params, optFns, c.addOperationListScrapersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListScrapersOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents the input of a ListScrapers operation. +type ListScrapersInput struct { + + // A list of scraper filters. + Filters map[string][]string + + // Maximum results to return in response (default=100, maximum=1000). + MaxResults *int32 + + // Pagination token to request the next page in a paginated list. This token is + // obtained from the output of the previous ListScrapers request. + NextToken *string + + noSmithyDocumentSerde +} + +// Represents the output of a ListScrapers operation. +type ListScrapersOutput struct { + + // The list of scrapers, filtered down if a set of filters was provided in the + // request. + // + // This member is required. + Scrapers []types.ScraperSummary + + // Pagination token to use when requesting the next page in this list. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListScrapersMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListScrapers{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListScrapers{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListScrapers"); 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_opListScrapers(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 +} + +// ListScrapersAPIClient is a client that implements the ListScrapers operation. +type ListScrapersAPIClient interface { + ListScrapers(context.Context, *ListScrapersInput, ...func(*Options)) (*ListScrapersOutput, error) +} + +var _ ListScrapersAPIClient = (*Client)(nil) + +// ListScrapersPaginatorOptions is the paginator options for ListScrapers +type ListScrapersPaginatorOptions struct { + // Maximum results to return in response (default=100, maximum=1000). + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListScrapersPaginator is a paginator for ListScrapers +type ListScrapersPaginator struct { + options ListScrapersPaginatorOptions + client ListScrapersAPIClient + params *ListScrapersInput + nextToken *string + firstPage bool +} + +// NewListScrapersPaginator returns a new ListScrapersPaginator +func NewListScrapersPaginator(client ListScrapersAPIClient, params *ListScrapersInput, optFns ...func(*ListScrapersPaginatorOptions)) *ListScrapersPaginator { + if params == nil { + params = &ListScrapersInput{} + } + + options := ListScrapersPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListScrapersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListScrapersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListScrapers page. +func (p *ListScrapersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListScrapersOutput, 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.ListScrapers(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_opListScrapers(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListScrapers", + } +} diff --git a/service/amp/deserializers.go b/service/amp/deserializers.go index f63fcb53d4a..088a8f6e77d 100644 --- a/service/amp/deserializers.go +++ b/service/amp/deserializers.go @@ -531,14 +531,14 @@ func awsRestjson1_deserializeOpDocumentCreateRuleGroupsNamespaceOutput(v **Creat return nil } -type awsRestjson1_deserializeOpCreateWorkspace struct { +type awsRestjson1_deserializeOpCreateScraper struct { } -func (*awsRestjson1_deserializeOpCreateWorkspace) ID() string { +func (*awsRestjson1_deserializeOpCreateScraper) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateWorkspace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateScraper) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -552,9 +552,9 @@ func (m *awsRestjson1_deserializeOpCreateWorkspace) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateWorkspace(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateScraper(response, &metadata) } - output := &CreateWorkspaceOutput{} + output := &CreateScraperOutput{} out.Result = output var buff [1024]byte @@ -575,7 +575,7 @@ func (m *awsRestjson1_deserializeOpCreateWorkspace) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateScraperOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -588,7 +588,7 @@ func (m *awsRestjson1_deserializeOpCreateWorkspace) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateWorkspace(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateScraper(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -638,6 +638,9 @@ func awsRestjson1_deserializeOpErrorCreateWorkspace(response *smithyhttp.Respons case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) @@ -657,7 +660,7 @@ func awsRestjson1_deserializeOpErrorCreateWorkspace(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(v **CreateWorkspaceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateScraperOutput(v **CreateScraperOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -670,9 +673,9 @@ func awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(v **CreateWorkspace return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateWorkspaceOutput + var sv *CreateScraperOutput if *v == nil { - sv = &CreateWorkspaceOutput{} + sv = &CreateScraperOutput{} } else { sv = *v } @@ -683,13 +686,22 @@ func awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(v **CreateWorkspace if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected WorkspaceArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ScraperArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } + case "scraperId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScraperId to be of type string, got %T instead", value) + } + sv.ScraperId = ptr.String(jtv) + } + case "status": - if err := awsRestjson1_deserializeDocumentWorkspaceStatus(&sv.Status, value); err != nil { + if err := awsRestjson1_deserializeDocumentScraperStatus(&sv.Status, value); err != nil { return err } @@ -698,15 +710,6 @@ func awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(v **CreateWorkspace return err } - case "workspaceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkspaceId to be of type string, got %T instead", value) - } - sv.WorkspaceId = ptr.String(jtv) - } - default: _, _ = key, value @@ -716,14 +719,14 @@ func awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(v **CreateWorkspace return nil } -type awsRestjson1_deserializeOpDeleteAlertManagerDefinition struct { +type awsRestjson1_deserializeOpCreateWorkspace struct { } -func (*awsRestjson1_deserializeOpDeleteAlertManagerDefinition) ID() string { +func (*awsRestjson1_deserializeOpCreateWorkspace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteAlertManagerDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateWorkspace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -737,21 +740,43 @@ func (m *awsRestjson1_deserializeOpDeleteAlertManagerDefinition) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteAlertManagerDefinition(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateWorkspace(response, &metadata) } - output := &DeleteAlertManagerDefinitionOutput{} + output := &CreateWorkspaceOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteAlertManagerDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateWorkspace(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -801,8 +826,8 @@ func awsRestjson1_deserializeOpErrorDeleteAlertManagerDefinition(response *smith case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -820,14 +845,73 @@ func awsRestjson1_deserializeOpErrorDeleteAlertManagerDefinition(response *smith } } -type awsRestjson1_deserializeOpDeleteLoggingConfiguration struct { +func awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(v **CreateWorkspaceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateWorkspaceOutput + if *v == nil { + sv = &CreateWorkspaceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkspaceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentWorkspaceStatus(&sv.Status, value); err != nil { + return err + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "workspaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkspaceId to be of type string, got %T instead", value) + } + sv.WorkspaceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteLoggingConfiguration) ID() string { +type awsRestjson1_deserializeOpDeleteAlertManagerDefinition struct { +} + +func (*awsRestjson1_deserializeOpDeleteAlertManagerDefinition) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAlertManagerDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -841,9 +925,9 @@ func (m *awsRestjson1_deserializeOpDeleteLoggingConfiguration) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteLoggingConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAlertManagerDefinition(response, &metadata) } - output := &DeleteLoggingConfigurationOutput{} + output := &DeleteAlertManagerDefinitionOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -855,7 +939,7 @@ func (m *awsRestjson1_deserializeOpDeleteLoggingConfiguration) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAlertManagerDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -908,6 +992,9 @@ func awsRestjson1_deserializeOpErrorDeleteLoggingConfiguration(response *smithyh 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) @@ -921,14 +1008,14 @@ func awsRestjson1_deserializeOpErrorDeleteLoggingConfiguration(response *smithyh } } -type awsRestjson1_deserializeOpDeleteRuleGroupsNamespace struct { +type awsRestjson1_deserializeOpDeleteLoggingConfiguration struct { } -func (*awsRestjson1_deserializeOpDeleteRuleGroupsNamespace) ID() string { +func (*awsRestjson1_deserializeOpDeleteLoggingConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteRuleGroupsNamespace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -942,9 +1029,9 @@ func (m *awsRestjson1_deserializeOpDeleteRuleGroupsNamespace) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteRuleGroupsNamespace(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteLoggingConfiguration(response, &metadata) } - output := &DeleteRuleGroupsNamespaceOutput{} + output := &DeleteLoggingConfigurationOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -956,7 +1043,7 @@ func (m *awsRestjson1_deserializeOpDeleteRuleGroupsNamespace) HandleDeserialize( return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteRuleGroupsNamespace(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1009,9 +1096,6 @@ func awsRestjson1_deserializeOpErrorDeleteRuleGroupsNamespace(response *smithyht 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) @@ -1025,14 +1109,14 @@ func awsRestjson1_deserializeOpErrorDeleteRuleGroupsNamespace(response *smithyht } } -type awsRestjson1_deserializeOpDeleteWorkspace struct { +type awsRestjson1_deserializeOpDeleteRuleGroupsNamespace struct { } -func (*awsRestjson1_deserializeOpDeleteWorkspace) ID() string { +func (*awsRestjson1_deserializeOpDeleteRuleGroupsNamespace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteWorkspace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteRuleGroupsNamespace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1046,9 +1130,9 @@ func (m *awsRestjson1_deserializeOpDeleteWorkspace) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteWorkspace(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteRuleGroupsNamespace(response, &metadata) } - output := &DeleteWorkspaceOutput{} + output := &DeleteRuleGroupsNamespaceOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1060,7 +1144,7 @@ func (m *awsRestjson1_deserializeOpDeleteWorkspace) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteWorkspace(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteRuleGroupsNamespace(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1129,14 +1213,14 @@ func awsRestjson1_deserializeOpErrorDeleteWorkspace(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpDescribeAlertManagerDefinition struct { +type awsRestjson1_deserializeOpDeleteScraper struct { } -func (*awsRestjson1_deserializeOpDescribeAlertManagerDefinition) ID() string { +func (*awsRestjson1_deserializeOpDeleteScraper) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeAlertManagerDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteScraper) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1150,9 +1234,9 @@ func (m *awsRestjson1_deserializeOpDescribeAlertManagerDefinition) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAlertManagerDefinition(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteScraper(response, &metadata) } - output := &DescribeAlertManagerDefinitionOutput{} + output := &DeleteScraperOutput{} out.Result = output var buff [1024]byte @@ -1173,7 +1257,7 @@ func (m *awsRestjson1_deserializeOpDescribeAlertManagerDefinition) HandleDeseria return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeAlertManagerDefinitionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteScraperOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1186,7 +1270,7 @@ func (m *awsRestjson1_deserializeOpDescribeAlertManagerDefinition) HandleDeseria return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeAlertManagerDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteScraper(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1230,6 +1314,9 @@ func awsRestjson1_deserializeOpErrorDescribeAlertManagerDefinition(response *smi 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) @@ -1252,7 +1339,7 @@ func awsRestjson1_deserializeOpErrorDescribeAlertManagerDefinition(response *smi } } -func awsRestjson1_deserializeOpDocumentDescribeAlertManagerDefinitionOutput(v **DescribeAlertManagerDefinitionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteScraperOutput(v **DeleteScraperOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1265,17 +1352,26 @@ func awsRestjson1_deserializeOpDocumentDescribeAlertManagerDefinitionOutput(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeAlertManagerDefinitionOutput + var sv *DeleteScraperOutput if *v == nil { - sv = &DescribeAlertManagerDefinitionOutput{} + sv = &DeleteScraperOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "alertManagerDefinition": - if err := awsRestjson1_deserializeDocumentAlertManagerDefinitionDescription(&sv.AlertManagerDefinition, value); err != nil { + case "scraperId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScraperId to be of type string, got %T instead", value) + } + sv.ScraperId = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentScraperStatus(&sv.Status, value); err != nil { return err } @@ -1288,14 +1384,14 @@ func awsRestjson1_deserializeOpDocumentDescribeAlertManagerDefinitionOutput(v ** return nil } -type awsRestjson1_deserializeOpDescribeLoggingConfiguration struct { +type awsRestjson1_deserializeOpDeleteWorkspace struct { } -func (*awsRestjson1_deserializeOpDescribeLoggingConfiguration) ID() string { +func (*awsRestjson1_deserializeOpDeleteWorkspace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteWorkspace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1309,43 +1405,21 @@ func (m *awsRestjson1_deserializeOpDescribeLoggingConfiguration) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeLoggingConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteWorkspace(response, &metadata) } - output := &DescribeLoggingConfigurationOutput{} + output := &DeleteWorkspaceOutput{} 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_deserializeOpDocumentDescribeLoggingConfigurationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteWorkspace(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1389,12 +1463,18 @@ func awsRestjson1_deserializeOpErrorDescribeLoggingConfiguration(response *smith 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) @@ -1408,50 +1488,14 @@ func awsRestjson1_deserializeOpErrorDescribeLoggingConfiguration(response *smith } } -func awsRestjson1_deserializeOpDocumentDescribeLoggingConfigurationOutput(v **DescribeLoggingConfigurationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } +type awsRestjson1_deserializeOpDescribeAlertManagerDefinition struct { +} - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } +func (*awsRestjson1_deserializeOpDescribeAlertManagerDefinition) ID() string { + return "OperationDeserializer" +} - var sv *DescribeLoggingConfigurationOutput - if *v == nil { - sv = &DescribeLoggingConfigurationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "loggingConfiguration": - if err := awsRestjson1_deserializeDocumentLoggingConfigurationMetadata(&sv.LoggingConfiguration, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeRuleGroupsNamespace struct { -} - -func (*awsRestjson1_deserializeOpDescribeRuleGroupsNamespace) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeRuleGroupsNamespace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeAlertManagerDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1465,9 +1509,9 @@ func (m *awsRestjson1_deserializeOpDescribeRuleGroupsNamespace) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeRuleGroupsNamespace(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAlertManagerDefinition(response, &metadata) } - output := &DescribeRuleGroupsNamespaceOutput{} + output := &DescribeAlertManagerDefinitionOutput{} out.Result = output var buff [1024]byte @@ -1488,7 +1532,7 @@ func (m *awsRestjson1_deserializeOpDescribeRuleGroupsNamespace) HandleDeserializ return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeRuleGroupsNamespaceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeAlertManagerDefinitionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1501,7 +1545,7 @@ func (m *awsRestjson1_deserializeOpDescribeRuleGroupsNamespace) HandleDeserializ return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeRuleGroupsNamespace(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeAlertManagerDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1567,7 +1611,7 @@ func awsRestjson1_deserializeOpErrorDescribeRuleGroupsNamespace(response *smithy } } -func awsRestjson1_deserializeOpDocumentDescribeRuleGroupsNamespaceOutput(v **DescribeRuleGroupsNamespaceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeAlertManagerDefinitionOutput(v **DescribeAlertManagerDefinitionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1580,17 +1624,17 @@ func awsRestjson1_deserializeOpDocumentDescribeRuleGroupsNamespaceOutput(v **Des return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeRuleGroupsNamespaceOutput + var sv *DescribeAlertManagerDefinitionOutput if *v == nil { - sv = &DescribeRuleGroupsNamespaceOutput{} + sv = &DescribeAlertManagerDefinitionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ruleGroupsNamespace": - if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceDescription(&sv.RuleGroupsNamespace, value); err != nil { + case "alertManagerDefinition": + if err := awsRestjson1_deserializeDocumentAlertManagerDefinitionDescription(&sv.AlertManagerDefinition, value); err != nil { return err } @@ -1603,14 +1647,14 @@ func awsRestjson1_deserializeOpDocumentDescribeRuleGroupsNamespaceOutput(v **Des return nil } -type awsRestjson1_deserializeOpDescribeWorkspace struct { +type awsRestjson1_deserializeOpDescribeLoggingConfiguration struct { } -func (*awsRestjson1_deserializeOpDescribeWorkspace) ID() string { +func (*awsRestjson1_deserializeOpDescribeLoggingConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeWorkspace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1624,9 +1668,9 @@ func (m *awsRestjson1_deserializeOpDescribeWorkspace) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeWorkspace(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeLoggingConfiguration(response, &metadata) } - output := &DescribeWorkspaceOutput{} + output := &DescribeLoggingConfigurationOutput{} out.Result = output var buff [1024]byte @@ -1647,7 +1691,7 @@ func (m *awsRestjson1_deserializeOpDescribeWorkspace) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeWorkspaceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeLoggingConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1660,7 +1704,7 @@ func (m *awsRestjson1_deserializeOpDescribeWorkspace) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeWorkspace(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1710,9 +1754,6 @@ func awsRestjson1_deserializeOpErrorDescribeWorkspace(response *smithyhttp.Respo 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) @@ -1726,7 +1767,7 @@ func awsRestjson1_deserializeOpErrorDescribeWorkspace(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentDescribeWorkspaceOutput(v **DescribeWorkspaceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeLoggingConfigurationOutput(v **DescribeLoggingConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1739,17 +1780,17 @@ func awsRestjson1_deserializeOpDocumentDescribeWorkspaceOutput(v **DescribeWorks return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeWorkspaceOutput + var sv *DescribeLoggingConfigurationOutput if *v == nil { - sv = &DescribeWorkspaceOutput{} + sv = &DescribeLoggingConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "workspace": - if err := awsRestjson1_deserializeDocumentWorkspaceDescription(&sv.Workspace, value); err != nil { + case "loggingConfiguration": + if err := awsRestjson1_deserializeDocumentLoggingConfigurationMetadata(&sv.LoggingConfiguration, value); err != nil { return err } @@ -1762,14 +1803,14 @@ func awsRestjson1_deserializeOpDocumentDescribeWorkspaceOutput(v **DescribeWorks return nil } -type awsRestjson1_deserializeOpListRuleGroupsNamespaces struct { +type awsRestjson1_deserializeOpDescribeRuleGroupsNamespace struct { } -func (*awsRestjson1_deserializeOpListRuleGroupsNamespaces) ID() string { +func (*awsRestjson1_deserializeOpDescribeRuleGroupsNamespace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListRuleGroupsNamespaces) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeRuleGroupsNamespace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1783,9 +1824,9 @@ func (m *awsRestjson1_deserializeOpListRuleGroupsNamespaces) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListRuleGroupsNamespaces(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeRuleGroupsNamespace(response, &metadata) } - output := &ListRuleGroupsNamespacesOutput{} + output := &DescribeRuleGroupsNamespaceOutput{} out.Result = output var buff [1024]byte @@ -1806,7 +1847,7 @@ func (m *awsRestjson1_deserializeOpListRuleGroupsNamespaces) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListRuleGroupsNamespacesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeRuleGroupsNamespaceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1819,7 +1860,7 @@ func (m *awsRestjson1_deserializeOpListRuleGroupsNamespaces) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListRuleGroupsNamespaces(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeRuleGroupsNamespace(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1885,7 +1926,7 @@ func awsRestjson1_deserializeOpErrorListRuleGroupsNamespaces(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentListRuleGroupsNamespacesOutput(v **ListRuleGroupsNamespacesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeRuleGroupsNamespaceOutput(v **DescribeRuleGroupsNamespaceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1898,26 +1939,17 @@ func awsRestjson1_deserializeOpDocumentListRuleGroupsNamespacesOutput(v **ListRu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListRuleGroupsNamespacesOutput + var sv *DescribeRuleGroupsNamespaceOutput if *v == nil { - sv = &ListRuleGroupsNamespacesOutput{} + sv = &DescribeRuleGroupsNamespaceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "ruleGroupsNamespaces": - if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummaryList(&sv.RuleGroupsNamespaces, value); err != nil { + case "ruleGroupsNamespace": + if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceDescription(&sv.RuleGroupsNamespace, value); err != nil { return err } @@ -1930,14 +1962,14 @@ func awsRestjson1_deserializeOpDocumentListRuleGroupsNamespacesOutput(v **ListRu return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpDescribeScraper struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpDescribeScraper) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeScraper) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1951,9 +1983,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_deserializeOpErrorDescribeScraper(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &DescribeScraperOutput{} out.Result = output var buff [1024]byte @@ -1974,7 +2006,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeScraperOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1987,7 +2019,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeScraper(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2053,7 +2085,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeScraperOutput(v **DescribeScraperOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2066,17 +2098,17 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *DescribeScraperOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &DescribeScraperOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "scraper": + if err := awsRestjson1_deserializeDocumentScraperDescription(&sv.Scraper, value); err != nil { return err } @@ -2089,14 +2121,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpListWorkspaces struct { +type awsRestjson1_deserializeOpDescribeWorkspace struct { } -func (*awsRestjson1_deserializeOpListWorkspaces) ID() string { +func (*awsRestjson1_deserializeOpDescribeWorkspace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListWorkspaces) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeWorkspace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2110,9 +2142,9 @@ func (m *awsRestjson1_deserializeOpListWorkspaces) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListWorkspaces(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeWorkspace(response, &metadata) } - output := &ListWorkspacesOutput{} + output := &DescribeWorkspaceOutput{} out.Result = output var buff [1024]byte @@ -2133,7 +2165,7 @@ func (m *awsRestjson1_deserializeOpListWorkspaces) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListWorkspacesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeWorkspaceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2146,7 +2178,7 @@ func (m *awsRestjson1_deserializeOpListWorkspaces) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListWorkspaces(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeWorkspace(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2193,6 +2225,9 @@ func awsRestjson1_deserializeOpErrorListWorkspaces(response *smithyhttp.Response 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) @@ -2209,7 +2244,7 @@ func awsRestjson1_deserializeOpErrorListWorkspaces(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListWorkspacesOutput(v **ListWorkspacesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeWorkspaceOutput(v **DescribeWorkspaceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2222,26 +2257,17 @@ func awsRestjson1_deserializeOpDocumentListWorkspacesOutput(v **ListWorkspacesOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListWorkspacesOutput + var sv *DescribeWorkspaceOutput if *v == nil { - sv = &ListWorkspacesOutput{} + sv = &DescribeWorkspaceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "workspaces": - if err := awsRestjson1_deserializeDocumentWorkspaceSummaryList(&sv.Workspaces, value); err != nil { + case "workspace": + if err := awsRestjson1_deserializeDocumentWorkspaceDescription(&sv.Workspace, value); err != nil { return err } @@ -2254,14 +2280,14 @@ func awsRestjson1_deserializeOpDocumentListWorkspacesOutput(v **ListWorkspacesOu return nil } -type awsRestjson1_deserializeOpPutAlertManagerDefinition struct { +type awsRestjson1_deserializeOpGetDefaultScraperConfiguration struct { } -func (*awsRestjson1_deserializeOpPutAlertManagerDefinition) ID() string { +func (*awsRestjson1_deserializeOpGetDefaultScraperConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutAlertManagerDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetDefaultScraperConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2275,9 +2301,9 @@ func (m *awsRestjson1_deserializeOpPutAlertManagerDefinition) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutAlertManagerDefinition(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetDefaultScraperConfiguration(response, &metadata) } - output := &PutAlertManagerDefinitionOutput{} + output := &GetDefaultScraperConfigurationOutput{} out.Result = output var buff [1024]byte @@ -2298,7 +2324,7 @@ func (m *awsRestjson1_deserializeOpPutAlertManagerDefinition) HandleDeserialize( return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutAlertManagerDefinitionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetDefaultScraperConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2311,7 +2337,7 @@ func (m *awsRestjson1_deserializeOpPutAlertManagerDefinition) HandleDeserialize( return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutAlertManagerDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetDefaultScraperConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.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,24 +2381,12 @@ func awsRestjson1_deserializeOpErrorPutAlertManagerDefinition(response *smithyht case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2383,7 +2397,7 @@ func awsRestjson1_deserializeOpErrorPutAlertManagerDefinition(response *smithyht } } -func awsRestjson1_deserializeOpDocumentPutAlertManagerDefinitionOutput(v **PutAlertManagerDefinitionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetDefaultScraperConfigurationOutput(v **GetDefaultScraperConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2396,18 +2410,26 @@ func awsRestjson1_deserializeOpDocumentPutAlertManagerDefinitionOutput(v **PutAl return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutAlertManagerDefinitionOutput + var sv *GetDefaultScraperConfigurationOutput if *v == nil { - sv = &PutAlertManagerDefinitionOutput{} + sv = &GetDefaultScraperConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "status": - if err := awsRestjson1_deserializeDocumentAlertManagerDefinitionStatus(&sv.Status, value); err != nil { - return err + case "configuration": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Blob to be []byte, got %T instead", value) + } + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode Blob, %w", err) + } + sv.Configuration = dv } default: @@ -2419,14 +2441,14 @@ func awsRestjson1_deserializeOpDocumentPutAlertManagerDefinitionOutput(v **PutAl return nil } -type awsRestjson1_deserializeOpPutRuleGroupsNamespace struct { +type awsRestjson1_deserializeOpListRuleGroupsNamespaces struct { } -func (*awsRestjson1_deserializeOpPutRuleGroupsNamespace) ID() string { +func (*awsRestjson1_deserializeOpListRuleGroupsNamespaces) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutRuleGroupsNamespace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListRuleGroupsNamespaces) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2440,9 +2462,9 @@ func (m *awsRestjson1_deserializeOpPutRuleGroupsNamespace) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutRuleGroupsNamespace(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListRuleGroupsNamespaces(response, &metadata) } - output := &PutRuleGroupsNamespaceOutput{} + output := &ListRuleGroupsNamespacesOutput{} out.Result = output var buff [1024]byte @@ -2463,7 +2485,7 @@ func (m *awsRestjson1_deserializeOpPutRuleGroupsNamespace) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutRuleGroupsNamespaceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListRuleGroupsNamespacesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2476,7 +2498,7 @@ func (m *awsRestjson1_deserializeOpPutRuleGroupsNamespace) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutRuleGroupsNamespace(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListRuleGroupsNamespaces(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2520,18 +2542,12 @@ func awsRestjson1_deserializeOpErrorPutRuleGroupsNamespace(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -2548,7 +2564,7 @@ func awsRestjson1_deserializeOpErrorPutRuleGroupsNamespace(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentPutRuleGroupsNamespaceOutput(v **PutRuleGroupsNamespaceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListRuleGroupsNamespacesOutput(v **ListRuleGroupsNamespacesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2561,40 +2577,26 @@ func awsRestjson1_deserializeOpDocumentPutRuleGroupsNamespaceOutput(v **PutRuleG return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutRuleGroupsNamespaceOutput + var sv *ListRuleGroupsNamespacesOutput if *v == nil { - sv = &PutRuleGroupsNamespaceOutput{} + sv = &ListRuleGroupsNamespacesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RuleGroupsNamespaceArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "name": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RuleGroupsNamespaceName to be of type string, got %T instead", value) + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) - } - - case "status": - if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceStatus(&sv.Status, value); err != nil { - return err + sv.NextToken = ptr.String(jtv) } - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "ruleGroupsNamespaces": + if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummaryList(&sv.RuleGroupsNamespaces, value); err != nil { return err } @@ -2607,14 +2609,14 @@ func awsRestjson1_deserializeOpDocumentPutRuleGroupsNamespaceOutput(v **PutRuleG return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpListScrapers struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpListScrapers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListScrapers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2628,22 +2630,50 @@ 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_deserializeOpErrorListScrapers(response, &metadata) } - output := &TagResourceOutput{} + output := &ListScrapersOutput{} out.Result = output - return out, metadata, err -} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) -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()) + body := io.TeeReader(response.Body, ringBuffer) - errorCode := "UnknownError" + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + 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_deserializeOpDocumentListScrapersOutput(&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_deserializeOpErrorListScrapers(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") @@ -2683,9 +2713,6 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m 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) @@ -2702,14 +2729,59 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUntagResource struct { +func awsRestjson1_deserializeOpDocumentListScrapersOutput(v **ListScrapersOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListScrapersOutput + if *v == nil { + sv = &ListScrapersOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "scrapers": + if err := awsRestjson1_deserializeDocumentScraperSummaryList(&sv.Scrapers, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUntagResource) ID() string { +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUntagResource) 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) @@ -2723,15 +2795,43 @@ func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &UntagResourceOutput{} + 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_deserializeOpErrorUntagResource(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)} @@ -2797,14 +2897,50 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateLoggingConfiguration struct { +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 } -func (*awsRestjson1_deserializeOpUpdateLoggingConfiguration) ID() string { +type awsRestjson1_deserializeOpListWorkspaces struct { +} + +func (*awsRestjson1_deserializeOpListWorkspaces) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListWorkspaces) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2818,9 +2954,9 @@ func (m *awsRestjson1_deserializeOpUpdateLoggingConfiguration) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateLoggingConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListWorkspaces(response, &metadata) } - output := &UpdateLoggingConfigurationOutput{} + output := &ListWorkspacesOutput{} out.Result = output var buff [1024]byte @@ -2841,7 +2977,7 @@ func (m *awsRestjson1_deserializeOpUpdateLoggingConfiguration) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateLoggingConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListWorkspacesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2854,7 +2990,7 @@ func (m *awsRestjson1_deserializeOpUpdateLoggingConfiguration) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListWorkspaces(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2898,14 +3034,11 @@ func awsRestjson1_deserializeOpErrorUpdateLoggingConfiguration(response *smithyh 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) @@ -2920,7 +3053,7 @@ func awsRestjson1_deserializeOpErrorUpdateLoggingConfiguration(response *smithyh } } -func awsRestjson1_deserializeOpDocumentUpdateLoggingConfigurationOutput(v **UpdateLoggingConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListWorkspacesOutput(v **ListWorkspacesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2933,17 +3066,26 @@ func awsRestjson1_deserializeOpDocumentUpdateLoggingConfigurationOutput(v **Upda return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateLoggingConfigurationOutput + var sv *ListWorkspacesOutput if *v == nil { - sv = &UpdateLoggingConfigurationOutput{} + sv = &ListWorkspacesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "status": - if err := awsRestjson1_deserializeDocumentLoggingConfigurationStatus(&sv.Status, value); err != nil { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "workspaces": + if err := awsRestjson1_deserializeDocumentWorkspaceSummaryList(&sv.Workspaces, value); err != nil { return err } @@ -2956,14 +3098,14 @@ func awsRestjson1_deserializeOpDocumentUpdateLoggingConfigurationOutput(v **Upda return nil } -type awsRestjson1_deserializeOpUpdateWorkspaceAlias struct { +type awsRestjson1_deserializeOpPutAlertManagerDefinition struct { } -func (*awsRestjson1_deserializeOpUpdateWorkspaceAlias) ID() string { +func (*awsRestjson1_deserializeOpPutAlertManagerDefinition) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateWorkspaceAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpPutAlertManagerDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2977,21 +3119,43 @@ func (m *awsRestjson1_deserializeOpUpdateWorkspaceAlias) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateWorkspaceAlias(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorPutAlertManagerDefinition(response, &metadata) } - output := &UpdateWorkspaceAliasOutput{} + output := &PutAlertManagerDefinitionOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentPutAlertManagerDefinitionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateWorkspaceAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorPutAlertManagerDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3063,44 +3227,73 @@ func awsRestjson1_deserializeOpErrorUpdateWorkspaceAlias(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { +func awsRestjson1_deserializeOpDocumentPutAlertManagerDefinitionOutput(v **PutAlertManagerDefinitionOutput, value interface{}) error { if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - vv, err := strconv.ParseInt(headerValues[0], 0, 32) - if err != nil { - return err - } - v.RetryAfterSeconds = ptr.Int32(int32(vv)) + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - return nil -} -func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { - if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) + var sv *PutAlertManagerDefinitionOutput + if *v == nil { + sv = &PutAlertManagerDefinitionOutput{} + } else { + sv = *v } - if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - vv, err := strconv.ParseInt(headerValues[0], 0, 32) - if err != nil { - return err + for key, value := range shape { + switch key { + case "status": + if err := awsRestjson1_deserializeDocumentAlertManagerDefinitionStatus(&sv.Status, value); err != nil { + return err + } + + default: + _, _ = key, value + } - v.RetryAfterSeconds = ptr.Int32(int32(vv)) } - + *v = sv return nil } -func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.AccessDeniedException{} + +type awsRestjson1_deserializeOpPutRuleGroupsNamespace struct { +} + +func (*awsRestjson1_deserializeOpPutRuleGroupsNamespace) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutRuleGroupsNamespace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutRuleGroupsNamespace(response, &metadata) + } + output := &PutRuleGroupsNamespaceOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -3111,36 +3304,45 @@ func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Res Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentPutRuleGroupsNamespaceOutput(&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_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ConflictException{} +func awsRestjson1_deserializeOpErrorPutRuleGroupsNamespace(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + 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{ @@ -3150,73 +3352,157 @@ func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Respons return err } - err := awsRestjson1_deserializeDocumentConflictException(&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("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) +func awsRestjson1_deserializeOpDocumentPutRuleGroupsNamespaceOutput(v **PutRuleGroupsNamespaceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - return output -} + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } -func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InternalServerException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + var sv *PutRuleGroupsNamespaceOutput + if *v == nil { + sv = &PutRuleGroupsNamespaceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleGroupsNamespaceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleGroupsNamespaceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceStatus(&sv.Status, value); err != nil { + return err + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value - 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_deserializeDocumentInternalServerException(&output, shape) +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 { - var snapshot 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)} + } - if err := awsRestjson1_deserializeOpHttpBindingsInternalServerException(output, response); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } + output := &TagResourceOutput{} + out.Result = output - return output + return out, metadata, err } -func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} +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() - 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{ @@ -3226,33 +3512,92 @@ func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp 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(), + 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 err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) +type awsRestjson1_deserializeOpUntagResource struct { +} - return output +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" } -func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceQuotaExceededException{} +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() - 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{ @@ -3262,29 +3607,71 @@ func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithy return err } - err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&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("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 err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) +type awsRestjson1_deserializeOpUpdateLoggingConfiguration struct { +} - return output +func (*awsRestjson1_deserializeOpUpdateLoggingConfiguration) ID() string { + return "OperationDeserializer" } -func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ThrottlingException{} +func (m *awsRestjson1_deserializeOpUpdateLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateLoggingConfiguration(response, &metadata) + } + output := &UpdateLoggingConfigurationOutput{} + 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{} @@ -3295,40 +3682,45 @@ func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Respo Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentUpdateLoggingConfigurationOutput(&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 out, metadata, err +} - if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} +func awsRestjson1_deserializeOpErrorUpdateLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } + errorBody := bytes.NewReader(errorBuffer.Bytes()) - return output -} + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } -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 { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -3338,24 +3730,834 @@ func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Respo return err } - err := awsRestjson1_deserializeDocumentValidationException(&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("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateLoggingConfigurationOutput(v **UpdateLoggingConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - errorBody.Seek(0, io.SeekStart) + var sv *UpdateLoggingConfigurationOutput + if *v == nil { + sv = &UpdateLoggingConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "status": + if err := awsRestjson1_deserializeDocumentLoggingConfigurationStatus(&sv.Status, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateWorkspaceAlias struct { +} + +func (*awsRestjson1_deserializeOpUpdateWorkspaceAlias) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateWorkspaceAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateWorkspaceAlias(response, &metadata) + } + output := &UpdateWorkspaceAliasOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateWorkspaceAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + 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) + + if err := awsRestjson1_deserializeOpHttpBindingsInternalServerException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_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_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + 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_deserializeDocumentAlertManagerDefinitionDescription(v **types.AlertManagerDefinitionDescription, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AlertManagerDefinitionDescription + if *v == nil { + sv = &types.AlertManagerDefinitionDescription{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "data": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AlertManagerDefinitionData to be []byte, got %T instead", value) + } + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode AlertManagerDefinitionData, %w", err) + } + sv.Data = dv + } + + case "modifiedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "status": + if err := awsRestjson1_deserializeDocumentAlertManagerDefinitionStatus(&sv.Status, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAlertManagerDefinitionStatus(v **types.AlertManagerDefinitionStatus, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AlertManagerDefinitionStatus + if *v == nil { + sv = &types.AlertManagerDefinitionStatus{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "statusCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AlertManagerDefinitionStatusCode to be of type string, got %T instead", value) + } + sv.StatusCode = types.AlertManagerDefinitionStatusCode(jtv) + } + + case "statusReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.StatusReason = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAmpConfiguration(v **types.AmpConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AmpConfiguration + if *v == nil { + sv = &types.AmpConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "workspaceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkspaceArn to be of type string, got %T instead", value) + } + sv.WorkspaceArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDestination(v *types.Destination, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.Destination +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "ampConfiguration": + var mv types.AmpConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentAmpConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.DestinationMemberAmpConfiguration{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentEksConfiguration(v **types.EksConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EksConfiguration + if *v == nil { + sv = &types.EksConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "clusterArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClusterArn to be of type string, got %T instead", value) + } + sv.ClusterArn = ptr.String(jtv) + } + + case "securityGroupIds": + if err := awsRestjson1_deserializeDocumentSecurityGroupIds(&sv.SecurityGroupIds, value); err != nil { + return err + } + + case "subnetIds": + if err := awsRestjson1_deserializeDocumentSubnetIds(&sv.SubnetIds, value); err != nil { + return err + } + + default: + _, _ = key, value - return output + } + } + *v = sv + return nil } -func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3368,9 +4570,9 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccessDeniedException + var sv *types.InternalServerException if *v == nil { - sv = &types.AccessDeniedException{} + sv = &types.InternalServerException{} } else { sv = *v } @@ -3386,6 +4588,19 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie sv.Message = ptr.String(jtv) } + case "retryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = ptr.Int32(int32(i64)) + } + default: _, _ = key, value @@ -3395,7 +4610,7 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } -func awsRestjson1_deserializeDocumentAlertManagerDefinitionDescription(v **types.AlertManagerDefinitionDescription, value interface{}) error { +func awsRestjson1_deserializeDocumentLoggingConfigurationMetadata(v **types.LoggingConfigurationMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3408,9 +4623,9 @@ func awsRestjson1_deserializeDocumentAlertManagerDefinitionDescription(v **types return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AlertManagerDefinitionDescription + var sv *types.LoggingConfigurationMetadata if *v == nil { - sv = &types.AlertManagerDefinitionDescription{} + sv = &types.LoggingConfigurationMetadata{} } else { sv = *v } @@ -3433,17 +4648,13 @@ func awsRestjson1_deserializeDocumentAlertManagerDefinitionDescription(v **types } } - case "data": + case "logGroupArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AlertManagerDefinitionData to be []byte, got %T instead", value) - } - dv, err := base64.StdEncoding.DecodeString(jtv) - if err != nil { - return fmt.Errorf("failed to base64 decode AlertManagerDefinitionData, %w", err) + return fmt.Errorf("expected LogGroupArn to be of type string, got %T instead", value) } - sv.Data = dv + sv.LogGroupArn = ptr.String(jtv) } case "modifiedAt": @@ -3463,10 +4674,19 @@ func awsRestjson1_deserializeDocumentAlertManagerDefinitionDescription(v **types } case "status": - if err := awsRestjson1_deserializeDocumentAlertManagerDefinitionStatus(&sv.Status, value); err != nil { + if err := awsRestjson1_deserializeDocumentLoggingConfigurationStatus(&sv.Status, value); err != nil { return err } + case "workspace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkspaceId to be of type string, got %T instead", value) + } + sv.Workspace = ptr.String(jtv) + } + default: _, _ = key, value @@ -3476,7 +4696,7 @@ func awsRestjson1_deserializeDocumentAlertManagerDefinitionDescription(v **types return nil } -func awsRestjson1_deserializeDocumentAlertManagerDefinitionStatus(v **types.AlertManagerDefinitionStatus, value interface{}) error { +func awsRestjson1_deserializeDocumentLoggingConfigurationStatus(v **types.LoggingConfigurationStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3489,9 +4709,9 @@ func awsRestjson1_deserializeDocumentAlertManagerDefinitionStatus(v **types.Aler return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AlertManagerDefinitionStatus + var sv *types.LoggingConfigurationStatus if *v == nil { - sv = &types.AlertManagerDefinitionStatus{} + sv = &types.LoggingConfigurationStatus{} } else { sv = *v } @@ -3502,9 +4722,9 @@ func awsRestjson1_deserializeDocumentAlertManagerDefinitionStatus(v **types.Aler if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AlertManagerDefinitionStatusCode to be of type string, got %T instead", value) + return fmt.Errorf("expected LoggingConfigurationStatusCode to be of type string, got %T instead", value) } - sv.StatusCode = types.AlertManagerDefinitionStatusCode(jtv) + sv.StatusCode = types.LoggingConfigurationStatusCode(jtv) } case "statusReason": @@ -3525,7 +4745,7 @@ func awsRestjson1_deserializeDocumentAlertManagerDefinitionStatus(v **types.Aler return nil } -func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3538,9 +4758,9 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ConflictException + var sv *types.ResourceNotFoundException if *v == nil { - sv = &types.ConflictException{} + sv = &types.ResourceNotFoundException{} } else { sv = *v } @@ -3583,7 +4803,7 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } -func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { +func awsRestjson1_deserializeDocumentRuleGroupsNamespaceDescription(v **types.RuleGroupsNamespaceDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3596,68 +4816,24 @@ func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InternalServerException + var sv *types.RuleGroupsNamespaceDescription if *v == nil { - sv = &types.InternalServerException{} + sv = &types.RuleGroupsNamespaceDescription{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "retryAfterSeconds": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected RuleGroupsNamespaceArn to be of type string, got %T instead", value) } - sv.RetryAfterSeconds = ptr.Int32(int32(i64)) + sv.Arn = ptr.String(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentLoggingConfigurationMetadata(v **types.LoggingConfigurationMetadata, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.LoggingConfigurationMetadata - if *v == nil { - sv = &types.LoggingConfigurationMetadata{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { case "createdAt": if value != nil { switch jtv := value.(type) { @@ -3674,13 +4850,17 @@ func awsRestjson1_deserializeDocumentLoggingConfigurationMetadata(v **types.Logg } } - case "logGroupArn": + case "data": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LogGroupArn to be of type string, got %T instead", value) + return fmt.Errorf("expected RuleGroupsNamespaceData to be []byte, got %T instead", value) } - sv.LogGroupArn = ptr.String(jtv) + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode RuleGroupsNamespaceData, %w", err) + } + sv.Data = dv } case "modifiedAt": @@ -3699,18 +4879,23 @@ func awsRestjson1_deserializeDocumentLoggingConfigurationMetadata(v **types.Logg } } - case "status": - if err := awsRestjson1_deserializeDocumentLoggingConfigurationStatus(&sv.Status, value); err != nil { - return err - } - - case "workspace": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected WorkspaceId to be of type string, got %T instead", value) + return fmt.Errorf("expected RuleGroupsNamespaceName to be of type string, got %T instead", value) } - sv.Workspace = ptr.String(jtv) + sv.Name = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceStatus(&sv.Status, value); err != nil { + return err + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err } default: @@ -3722,7 +4907,7 @@ func awsRestjson1_deserializeDocumentLoggingConfigurationMetadata(v **types.Logg return nil } -func awsRestjson1_deserializeDocumentLoggingConfigurationStatus(v **types.LoggingConfigurationStatus, value interface{}) error { +func awsRestjson1_deserializeDocumentRuleGroupsNamespaceStatus(v **types.RuleGroupsNamespaceStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3735,9 +4920,9 @@ func awsRestjson1_deserializeDocumentLoggingConfigurationStatus(v **types.Loggin return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LoggingConfigurationStatus + var sv *types.RuleGroupsNamespaceStatus if *v == nil { - sv = &types.LoggingConfigurationStatus{} + sv = &types.RuleGroupsNamespaceStatus{} } else { sv = *v } @@ -3748,9 +4933,9 @@ func awsRestjson1_deserializeDocumentLoggingConfigurationStatus(v **types.Loggin if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LoggingConfigurationStatusCode to be of type string, got %T instead", value) + return fmt.Errorf("expected RuleGroupsNamespaceStatusCode to be of type string, got %T instead", value) } - sv.StatusCode = types.LoggingConfigurationStatusCode(jtv) + sv.StatusCode = types.RuleGroupsNamespaceStatusCode(jtv) } case "statusReason": @@ -3771,7 +4956,98 @@ func awsRestjson1_deserializeDocumentLoggingConfigurationStatus(v **types.Loggin return nil } -func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { +func awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummary(v **types.RuleGroupsNamespaceSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RuleGroupsNamespaceSummary + if *v == nil { + sv = &types.RuleGroupsNamespaceSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleGroupsNamespaceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "modifiedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleGroupsNamespaceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceStatus(&sv.Status, value); err != nil { + return err + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummaryList(v *[]types.RuleGroupsNamespaceSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3779,57 +5055,79 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc 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.ResourceNotFoundException + var cv []types.RuleGroupsNamespaceSummary if *v == nil { - sv = &types.ResourceNotFoundException{} + cv = []types.RuleGroupsNamespaceSummary{} } else { - sv = *v + cv = *v + } + + for _, value := range shape { + var col types.RuleGroupsNamespaceSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentScrapeConfiguration(v *types.ScrapeConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.ScrapeConfiguration +loop: for key, value := range shape { + if value == nil { + continue + } 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 "resourceId": + case "configurationBlob": + var mv []byte 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 Blob to be []byte, got %T instead", value) } - sv.ResourceId = ptr.String(jtv) - } - - case "resourceType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode Blob, %w", err) } - sv.ResourceType = ptr.String(jtv) + mv = dv } + uv = &types.ScrapeConfigurationMemberConfigurationBlob{Value: mv} + break loop default: - _, _ = key, value + uv = &types.UnknownUnionMember{Tag: key} + break loop } } - *v = sv + *v = uv return nil } -func awsRestjson1_deserializeDocumentRuleGroupsNamespaceDescription(v **types.RuleGroupsNamespaceDescription, value interface{}) error { +func awsRestjson1_deserializeDocumentScraperDescription(v **types.ScraperDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3842,20 +5140,29 @@ func awsRestjson1_deserializeDocumentRuleGroupsNamespaceDescription(v **types.Ru return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RuleGroupsNamespaceDescription + var sv *types.ScraperDescription if *v == nil { - sv = &types.RuleGroupsNamespaceDescription{} + sv = &types.ScraperDescription{} } else { sv = *v } for key, value := range shape { switch key { + case "alias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScraperAlias to be of type string, got %T instead", value) + } + sv.Alias = ptr.String(jtv) + } + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RuleGroupsNamespaceArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ScraperArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } @@ -3876,20 +5183,12 @@ func awsRestjson1_deserializeDocumentRuleGroupsNamespaceDescription(v **types.Ru } } - case "data": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RuleGroupsNamespaceData to be []byte, got %T instead", value) - } - dv, err := base64.StdEncoding.DecodeString(jtv) - if err != nil { - return fmt.Errorf("failed to base64 decode RuleGroupsNamespaceData, %w", err) - } - sv.Data = dv + case "destination": + if err := awsRestjson1_deserializeDocumentDestination(&sv.Destination, value); err != nil { + return err } - case "modifiedAt": + case "lastModifiedAt": if value != nil { switch jtv := value.(type) { case json.Number: @@ -3897,7 +5196,7 @@ func awsRestjson1_deserializeDocumentRuleGroupsNamespaceDescription(v **types.Ru if err != nil { return err } - sv.ModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.LastModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -3905,20 +5204,48 @@ func awsRestjson1_deserializeDocumentRuleGroupsNamespaceDescription(v **types.Ru } } - case "name": + case "roleArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RuleGroupsNamespaceName to be of type string, got %T instead", value) + return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.RoleArn = ptr.String(jtv) + } + + case "scrapeConfiguration": + if err := awsRestjson1_deserializeDocumentScrapeConfiguration(&sv.ScrapeConfiguration, value); err != nil { + return err + } + + case "scraperId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScraperId to be of type string, got %T instead", value) + } + sv.ScraperId = ptr.String(jtv) + } + + case "source": + if err := awsRestjson1_deserializeDocumentSource(&sv.Source, value); err != nil { + return err } case "status": - if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceStatus(&sv.Status, value); err != nil { + if err := awsRestjson1_deserializeDocumentScraperStatus(&sv.Status, value); err != nil { return err } + case "statusReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StatusReason to be of type string, got %T instead", value) + } + sv.StatusReason = ptr.String(jtv) + } + case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err @@ -3933,7 +5260,7 @@ func awsRestjson1_deserializeDocumentRuleGroupsNamespaceDescription(v **types.Ru return nil } -func awsRestjson1_deserializeDocumentRuleGroupsNamespaceStatus(v **types.RuleGroupsNamespaceStatus, value interface{}) error { +func awsRestjson1_deserializeDocumentScraperStatus(v **types.ScraperStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3946,9 +5273,9 @@ func awsRestjson1_deserializeDocumentRuleGroupsNamespaceStatus(v **types.RuleGro return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RuleGroupsNamespaceStatus + var sv *types.ScraperStatus if *v == nil { - sv = &types.RuleGroupsNamespaceStatus{} + sv = &types.ScraperStatus{} } else { sv = *v } @@ -3959,18 +5286,9 @@ func awsRestjson1_deserializeDocumentRuleGroupsNamespaceStatus(v **types.RuleGro if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RuleGroupsNamespaceStatusCode to be of type string, got %T instead", value) - } - sv.StatusCode = types.RuleGroupsNamespaceStatusCode(jtv) - } - - case "statusReason": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected ScraperStatusCode to be of type string, got %T instead", value) } - sv.StatusReason = ptr.String(jtv) + sv.StatusCode = types.ScraperStatusCode(jtv) } default: @@ -3982,7 +5300,7 @@ func awsRestjson1_deserializeDocumentRuleGroupsNamespaceStatus(v **types.RuleGro return nil } -func awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummary(v **types.RuleGroupsNamespaceSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentScraperSummary(v **types.ScraperSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3995,20 +5313,29 @@ func awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummary(v **types.RuleGr return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RuleGroupsNamespaceSummary + var sv *types.ScraperSummary if *v == nil { - sv = &types.RuleGroupsNamespaceSummary{} + sv = &types.ScraperSummary{} } else { sv = *v } for key, value := range shape { switch key { + case "alias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScraperAlias to be of type string, got %T instead", value) + } + sv.Alias = ptr.String(jtv) + } + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RuleGroupsNamespaceArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ScraperArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } @@ -4029,7 +5356,12 @@ func awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummary(v **types.RuleGr } } - case "modifiedAt": + case "destination": + if err := awsRestjson1_deserializeDocumentDestination(&sv.Destination, value); err != nil { + return err + } + + case "lastModifiedAt": if value != nil { switch jtv := value.(type) { case json.Number: @@ -4037,7 +5369,7 @@ func awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummary(v **types.RuleGr if err != nil { return err } - sv.ModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.LastModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -4045,20 +5377,43 @@ func awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummary(v **types.RuleGr } } - case "name": + case "roleArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RuleGroupsNamespaceName to be of type string, got %T instead", value) + return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.RoleArn = ptr.String(jtv) + } + + case "scraperId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScraperId to be of type string, got %T instead", value) + } + sv.ScraperId = ptr.String(jtv) + } + + case "source": + if err := awsRestjson1_deserializeDocumentSource(&sv.Source, value); err != nil { + return err } case "status": - if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceStatus(&sv.Status, value); err != nil { + if err := awsRestjson1_deserializeDocumentScraperStatus(&sv.Status, value); err != nil { return err } + case "statusReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StatusReason to be of type string, got %T instead", value) + } + sv.StatusReason = ptr.String(jtv) + } + case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err @@ -4073,7 +5428,7 @@ func awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummary(v **types.RuleGr return nil } -func awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummaryList(v *[]types.RuleGroupsNamespaceSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentScraperSummaryList(v *[]types.ScraperSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4086,17 +5441,17 @@ func awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummaryList(v *[]types.R return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.RuleGroupsNamespaceSummary + var cv []types.ScraperSummary if *v == nil { - cv = []types.RuleGroupsNamespaceSummary{} + cv = []types.ScraperSummary{} } else { cv = *v } for _, value := range shape { - var col types.RuleGroupsNamespaceSummary + var col types.ScraperSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentScraperSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -4107,6 +5462,42 @@ func awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummaryList(v *[]types.R return nil } +func awsRestjson1_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 awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4183,6 +5574,82 @@ func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.Ser return nil } +func awsRestjson1_deserializeDocumentSource(v *types.Source, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.Source +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "eksConfiguration": + var mv types.EksConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentEksConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.SourceMemberEksConfiguration{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_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 awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/amp/endpoints.go b/service/amp/endpoints.go index 86bc5abeb58..8d80154d1f3 100644 --- a/service/amp/endpoints.go +++ b/service/amp/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://aps-fips.") diff --git a/service/amp/generated.json b/service/amp/generated.json index 808e2bd6a4d..6adbb2293db 100644 --- a/service/amp/generated.json +++ b/service/amp/generated.json @@ -13,16 +13,21 @@ "api_op_CreateAlertManagerDefinition.go", "api_op_CreateLoggingConfiguration.go", "api_op_CreateRuleGroupsNamespace.go", + "api_op_CreateScraper.go", "api_op_CreateWorkspace.go", "api_op_DeleteAlertManagerDefinition.go", "api_op_DeleteLoggingConfiguration.go", "api_op_DeleteRuleGroupsNamespace.go", + "api_op_DeleteScraper.go", "api_op_DeleteWorkspace.go", "api_op_DescribeAlertManagerDefinition.go", "api_op_DescribeLoggingConfiguration.go", "api_op_DescribeRuleGroupsNamespace.go", + "api_op_DescribeScraper.go", "api_op_DescribeWorkspace.go", + "api_op_GetDefaultScraperConfiguration.go", "api_op_ListRuleGroupsNamespaces.go", + "api_op_ListScrapers.go", "api_op_ListTagsForResource.go", "api_op_ListWorkspaces.go", "api_op_PutAlertManagerDefinition.go", @@ -46,6 +51,7 @@ "types/enums.go", "types/errors.go", "types/types.go", + "types/types_exported_test.go", "validators.go" ], "go": "1.15", diff --git a/service/amp/serializers.go b/service/amp/serializers.go index 7f00d7a7d34..72fbd28a3c8 100644 --- a/service/amp/serializers.go +++ b/service/amp/serializers.go @@ -6,6 +6,7 @@ import ( "bytes" "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/amp/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" @@ -304,6 +305,114 @@ func awsRestjson1_serializeOpDocumentCreateRuleGroupsNamespaceInput(v *CreateRul return nil } +type awsRestjson1_serializeOpCreateScraper struct { +} + +func (*awsRestjson1_serializeOpCreateScraper) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateScraper) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateScraperInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/scrapers") + 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_serializeOpDocumentCreateScraperInput(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_serializeOpHttpBindingsCreateScraperInput(v *CreateScraperInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateScraperInput(v *CreateScraperInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Alias != nil { + ok := object.Key("alias") + ok.String(*v.Alias) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Destination != nil { + ok := object.Key("destination") + if err := awsRestjson1_serializeDocumentDestination(v.Destination, ok); err != nil { + return err + } + } + + if v.ScrapeConfiguration != nil { + ok := object.Key("scrapeConfiguration") + if err := awsRestjson1_serializeDocumentScrapeConfiguration(v.ScrapeConfiguration, ok); err != nil { + return err + } + } + + if v.Source != nil { + ok := object.Key("source") + if err := awsRestjson1_serializeDocumentSource(v.Source, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateWorkspace struct { } @@ -607,6 +716,75 @@ func awsRestjson1_serializeOpHttpBindingsDeleteRuleGroupsNamespaceInput(v *Delet return nil } +type awsRestjson1_serializeOpDeleteScraper struct { +} + +func (*awsRestjson1_serializeOpDeleteScraper) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteScraper) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteScraperInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/scrapers/{scraperId}") + 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_serializeOpHttpBindingsDeleteScraperInput(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_serializeOpHttpBindingsDeleteScraperInput(v *DeleteScraperInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ClientToken != nil { + encoder.SetQuery("clientToken").String(*v.ClientToken) + } + + if v.ScraperId == nil || len(*v.ScraperId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member scraperId must not be empty")} + } + if v.ScraperId != nil { + if err := encoder.SetURI("scraperId").String(*v.ScraperId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteWorkspace struct { } @@ -880,6 +1058,71 @@ func awsRestjson1_serializeOpHttpBindingsDescribeRuleGroupsNamespaceInput(v *Des return nil } +type awsRestjson1_serializeOpDescribeScraper struct { +} + +func (*awsRestjson1_serializeOpDescribeScraper) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeScraper) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeScraperInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/scrapers/{scraperId}") + 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_serializeOpHttpBindingsDescribeScraperInput(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_serializeOpHttpBindingsDescribeScraperInput(v *DescribeScraperInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ScraperId == nil || len(*v.ScraperId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member scraperId must not be empty")} + } + if v.ScraperId != nil { + if err := encoder.SetURI("scraperId").String(*v.ScraperId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDescribeWorkspace struct { } @@ -945,6 +1188,58 @@ func awsRestjson1_serializeOpHttpBindingsDescribeWorkspaceInput(v *DescribeWorks return nil } +type awsRestjson1_serializeOpGetDefaultScraperConfiguration struct { +} + +func (*awsRestjson1_serializeOpGetDefaultScraperConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetDefaultScraperConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDefaultScraperConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/scraperconfiguration") + 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 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_serializeOpHttpBindingsGetDefaultScraperConfigurationInput(v *GetDefaultScraperConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + type awsRestjson1_serializeOpListRuleGroupsNamespaces struct { } @@ -1022,6 +1317,81 @@ func awsRestjson1_serializeOpHttpBindingsListRuleGroupsNamespacesInput(v *ListRu return nil } +type awsRestjson1_serializeOpListScrapers struct { +} + +func (*awsRestjson1_serializeOpListScrapers) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListScrapers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListScrapersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/scrapers") + 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_serializeOpHttpBindingsListScrapersInput(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_serializeOpHttpBindingsListScrapersInput(v *ListScrapersInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Filters != nil { + for qkey, qvalue := range v.Filters { + if encoder.HasQuery(qkey) { + continue + } + for i := range qvalue { + encoder.AddQuery(qkey).String(qvalue[i]) + } + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListTagsForResource struct { } @@ -1697,6 +2067,118 @@ func awsRestjson1_serializeOpDocumentUpdateWorkspaceAliasInput(v *UpdateWorkspac return nil } +func awsRestjson1_serializeDocumentAmpConfiguration(v *types.AmpConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.WorkspaceArn != nil { + ok := object.Key("workspaceArn") + ok.String(*v.WorkspaceArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentDestination(v types.Destination, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.DestinationMemberAmpConfiguration: + av := object.Key("ampConfiguration") + if err := awsRestjson1_serializeDocumentAmpConfiguration(&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_serializeDocumentEksConfiguration(v *types.EksConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClusterArn != nil { + ok := object.Key("clusterArn") + ok.String(*v.ClusterArn) + } + + if v.SecurityGroupIds != nil { + ok := object.Key("securityGroupIds") + if err := awsRestjson1_serializeDocumentSecurityGroupIds(v.SecurityGroupIds, ok); err != nil { + return err + } + } + + if v.SubnetIds != nil { + ok := object.Key("subnetIds") + if err := awsRestjson1_serializeDocumentSubnetIds(v.SubnetIds, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentScrapeConfiguration(v types.ScrapeConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.ScrapeConfigurationMemberConfigurationBlob: + av := object.Key("configurationBlob") + av.Base64EncodeBytes(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentSecurityGroupIds(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_serializeDocumentSource(v types.Source, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.SourceMemberEksConfiguration: + av := object.Key("eksConfiguration") + if err := awsRestjson1_serializeDocumentEksConfiguration(&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_serializeDocumentSubnetIds(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_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/amp/types/enums.go b/service/amp/types/enums.go index b70542b1596..8bf4b70e3fa 100644 --- a/service/amp/types/enums.go +++ b/service/amp/types/enums.go @@ -113,6 +113,35 @@ func (RuleGroupsNamespaceStatusCode) Values() []RuleGroupsNamespaceStatusCode { } } +type ScraperStatusCode string + +// Enum values for ScraperStatusCode +const ( + // Scraper is being created. Deletion is disallowed until status is ACTIVE. + ScraperStatusCodeCreating ScraperStatusCode = "CREATING" + // Scraper has been created and is usable. + ScraperStatusCodeActive ScraperStatusCode = "ACTIVE" + // Scraper is being deleted. Deletions are allowed only when status is ACTIVE. + ScraperStatusCodeDeleting ScraperStatusCode = "DELETING" + // Scraper creation failed. + ScraperStatusCodeCreationFailed ScraperStatusCode = "CREATION_FAILED" + // Scraper deletion failed. + ScraperStatusCodeDeletionFailed ScraperStatusCode = "DELETION_FAILED" +) + +// Values returns all known values for ScraperStatusCode. 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 (ScraperStatusCode) Values() []ScraperStatusCode { + return []ScraperStatusCode{ + "CREATING", + "ACTIVE", + "DELETING", + "CREATION_FAILED", + "DELETION_FAILED", + } +} + type ValidationExceptionReason string // Enum values for ValidationExceptionReason diff --git a/service/amp/types/types.go b/service/amp/types/types.go index fefa5eb3ede..f638129f821 100644 --- a/service/amp/types/types.go +++ b/service/amp/types/types.go @@ -47,6 +47,54 @@ type AlertManagerDefinitionStatus struct { noSmithyDocumentSerde } +// A representation of an AMP destination. +type AmpConfiguration struct { + + // The ARN of an AMP workspace. + // + // This member is required. + WorkspaceArn *string + + noSmithyDocumentSerde +} + +// A representation of a destination that a scraper can produce metrics to. +// +// The following types satisfy this interface: +// +// DestinationMemberAmpConfiguration +type Destination interface { + isDestination() +} + +// A representation of an AMP destination. +type DestinationMemberAmpConfiguration struct { + Value AmpConfiguration + + noSmithyDocumentSerde +} + +func (*DestinationMemberAmpConfiguration) isDestination() {} + +// A representation of an EKS source. +type EksConfiguration struct { + + // The ARN of an EKS cluster. + // + // This member is required. + ClusterArn *string + + // A list of subnet IDs specified for VPC configuration. + // + // This member is required. + SubnetIds []string + + // A list of security group IDs specified for VPC configuration. + SecurityGroupIds []string + + noSmithyDocumentSerde +} + // Represents the properties of a logging configuration metadata. type LoggingConfigurationMetadata struct { @@ -179,6 +227,171 @@ type RuleGroupsNamespaceSummary struct { noSmithyDocumentSerde } +// A representation of a Prometheus configuration file. +// +// The following types satisfy this interface: +// +// ScrapeConfigurationMemberConfigurationBlob +type ScrapeConfiguration interface { + isScrapeConfiguration() +} + +// Binary data representing a Prometheus configuration file. +type ScrapeConfigurationMemberConfigurationBlob struct { + Value []byte + + noSmithyDocumentSerde +} + +func (*ScrapeConfigurationMemberConfigurationBlob) isScrapeConfiguration() {} + +// Represents the properties of a scraper. +type ScraperDescription struct { + + // The Amazon Resource Name (ARN) of this scraper. + // + // This member is required. + Arn *string + + // The time when the scraper was created. + // + // This member is required. + CreatedAt *time.Time + + // The destination that the scraper is producing metrics to. + // + // This member is required. + Destination Destination + + // The time when the scraper was last modified. + // + // This member is required. + LastModifiedAt *time.Time + + // The Amazon Resource Name (ARN) of the IAM role that provides permissions for + // the scraper to dsicover, collect, and produce metrics on your behalf. + // + // This member is required. + RoleArn *string + + // The configuration used to create the scraper. + // + // This member is required. + ScrapeConfiguration ScrapeConfiguration + + // Unique string identifying this scraper. + // + // This member is required. + ScraperId *string + + // The source that the scraper is discovering and collecting metrics from. + // + // This member is required. + Source Source + + // The status of this scraper. + // + // This member is required. + Status *ScraperStatus + + // Alias of this scraper. + Alias *string + + // The reason for failure if any. + StatusReason *string + + // The tags of this scraper. + Tags map[string]string + + noSmithyDocumentSerde +} + +// Represents the status of a scraper. +type ScraperStatus struct { + + // Status code of this scraper. + // + // This member is required. + StatusCode ScraperStatusCode + + noSmithyDocumentSerde +} + +// Represents a summary of the properties of a scraper. +type ScraperSummary struct { + + // The Amazon Resource Name (ARN) of this scraper. + // + // This member is required. + Arn *string + + // The time when the scraper was created. + // + // This member is required. + CreatedAt *time.Time + + // The destination that the scraper is producing metrics to. + // + // This member is required. + Destination Destination + + // The time when the scraper was last modified. + // + // This member is required. + LastModifiedAt *time.Time + + // The Amazon Resource Name (ARN) of the IAM role that provides permissions for + // the scraper to dsicover, collect, and produce metrics on your behalf. + // + // This member is required. + RoleArn *string + + // Unique string identifying this scraper. + // + // This member is required. + ScraperId *string + + // The source that the scraper is discovering and collecting metrics from. + // + // This member is required. + Source Source + + // The status of this scraper. + // + // This member is required. + Status *ScraperStatus + + // Alias of this scraper. + Alias *string + + // The reason for failure if any. + StatusReason *string + + // The tags of this scraper. + Tags map[string]string + + noSmithyDocumentSerde +} + +// A representation of a source that a scraper can discover and collect metrics +// from. +// +// The following types satisfy this interface: +// +// SourceMemberEksConfiguration +type Source interface { + isSource() +} + +// A representation of an EKS source. +type SourceMemberEksConfiguration struct { + Value EksConfiguration + + noSmithyDocumentSerde +} + +func (*SourceMemberEksConfiguration) isSource() {} + // Stores information about a field passed inside a request that resulted in an // exception. type ValidationExceptionField struct { @@ -275,3 +488,16 @@ type WorkspaceSummary 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) isDestination() {} +func (*UnknownUnionMember) isScrapeConfiguration() {} +func (*UnknownUnionMember) isSource() {} diff --git a/service/amp/types/types_exported_test.go b/service/amp/types/types_exported_test.go new file mode 100644 index 00000000000..62cd9e398a5 --- /dev/null +++ b/service/amp/types/types_exported_test.go @@ -0,0 +1,62 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/amp/types" +) + +func ExampleDestination_outputUsage() { + var union types.Destination + // type switches can be used to check the union value + switch v := union.(type) { + case *types.DestinationMemberAmpConfiguration: + _ = v.Value // Value is types.AmpConfiguration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.AmpConfiguration + +func ExampleScrapeConfiguration_outputUsage() { + var union types.ScrapeConfiguration + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ScrapeConfigurationMemberConfigurationBlob: + _ = v.Value // Value is []byte + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ []byte + +func ExampleSource_outputUsage() { + var union types.Source + // type switches can be used to check the union value + switch v := union.(type) { + case *types.SourceMemberEksConfiguration: + _ = v.Value // Value is types.EksConfiguration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.EksConfiguration diff --git a/service/amp/validators.go b/service/amp/validators.go index f179512acd3..ca33d90a2a0 100644 --- a/service/amp/validators.go +++ b/service/amp/validators.go @@ -5,6 +5,7 @@ package amp import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/amp/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) @@ -69,6 +70,26 @@ func (m *validateOpCreateRuleGroupsNamespace) HandleInitialize(ctx context.Conte return next.HandleInitialize(ctx, in) } +type validateOpCreateScraper struct { +} + +func (*validateOpCreateScraper) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateScraper) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateScraperInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateScraperInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteAlertManagerDefinition struct { } @@ -129,6 +150,26 @@ func (m *validateOpDeleteRuleGroupsNamespace) HandleInitialize(ctx context.Conte return next.HandleInitialize(ctx, in) } +type validateOpDeleteScraper struct { +} + +func (*validateOpDeleteScraper) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteScraper) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteScraperInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteScraperInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteWorkspace struct { } @@ -209,6 +250,26 @@ func (m *validateOpDescribeRuleGroupsNamespace) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpDescribeScraper struct { +} + +func (*validateOpDescribeScraper) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeScraper) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeScraperInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeScraperInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeWorkspace struct { } @@ -401,6 +462,10 @@ func addOpCreateRuleGroupsNamespaceValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpCreateRuleGroupsNamespace{}, middleware.After) } +func addOpCreateScraperValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateScraper{}, middleware.After) +} + func addOpDeleteAlertManagerDefinitionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAlertManagerDefinition{}, middleware.After) } @@ -413,6 +478,10 @@ func addOpDeleteRuleGroupsNamespaceValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpDeleteRuleGroupsNamespace{}, middleware.After) } +func addOpDeleteScraperValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteScraper{}, middleware.After) +} + func addOpDeleteWorkspaceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteWorkspace{}, middleware.After) } @@ -429,6 +498,10 @@ func addOpDescribeRuleGroupsNamespaceValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpDescribeRuleGroupsNamespace{}, middleware.After) } +func addOpDescribeScraperValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeScraper{}, middleware.After) +} + func addOpDescribeWorkspaceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeWorkspace{}, middleware.After) } @@ -465,6 +538,77 @@ func addOpUpdateWorkspaceAliasValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpUpdateWorkspaceAlias{}, middleware.After) } +func validateAmpConfiguration(v *types.AmpConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AmpConfiguration"} + if v.WorkspaceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkspaceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateDestination(v types.Destination) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Destination"} + switch uv := v.(type) { + case *types.DestinationMemberAmpConfiguration: + if err := validateAmpConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[ampConfiguration]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEksConfiguration(v *types.EksConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EksConfiguration"} + if v.ClusterArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) + } + if v.SubnetIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("SubnetIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSource(v types.Source) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Source"} + switch uv := v.(type) { + case *types.SourceMemberEksConfiguration: + if err := validateEksConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[eksConfiguration]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateAlertManagerDefinitionInput(v *CreateAlertManagerDefinitionInput) error { if v == nil { return nil @@ -522,6 +666,35 @@ func validateOpCreateRuleGroupsNamespaceInput(v *CreateRuleGroupsNamespaceInput) } } +func validateOpCreateScraperInput(v *CreateScraperInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateScraperInput"} + if v.ScrapeConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScrapeConfiguration")) + } + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } else if v.Source != nil { + if err := validateSource(v.Source); err != nil { + invalidParams.AddNested("Source", err.(smithy.InvalidParamsError)) + } + } + if v.Destination == nil { + invalidParams.Add(smithy.NewErrParamRequired("Destination")) + } else if v.Destination != nil { + if err := validateDestination(v.Destination); err != nil { + invalidParams.AddNested("Destination", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteAlertManagerDefinitionInput(v *DeleteAlertManagerDefinitionInput) error { if v == nil { return nil @@ -570,6 +743,21 @@ func validateOpDeleteRuleGroupsNamespaceInput(v *DeleteRuleGroupsNamespaceInput) } } +func validateOpDeleteScraperInput(v *DeleteScraperInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteScraperInput"} + if v.ScraperId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScraperId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteWorkspaceInput(v *DeleteWorkspaceInput) error { if v == nil { return nil @@ -633,6 +821,21 @@ func validateOpDescribeRuleGroupsNamespaceInput(v *DescribeRuleGroupsNamespaceIn } } +func validateOpDescribeScraperInput(v *DescribeScraperInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeScraperInput"} + if v.ScraperId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScraperId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeWorkspaceInput(v *DescribeWorkspaceInput) error { if v == nil { return nil diff --git a/service/arczonalshift/internal/endpoints/endpoints.go b/service/arczonalshift/internal/endpoints/endpoints.go index ed5a273b9ba..8ffb75f8ed7 100644 --- a/service/arczonalshift/internal/endpoints/endpoints.go +++ b/service/arczonalshift/internal/endpoints/endpoints.go @@ -386,5 +386,13 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{}, + }, }, } diff --git a/service/bcmdataexports/LICENSE.txt b/service/bcmdataexports/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/bcmdataexports/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/bcmdataexports/api_client.go b/service/bcmdataexports/api_client.go new file mode 100644 index 00000000000..66c87aad96c --- /dev/null +++ b/service/bcmdataexports/api_client.go @@ -0,0 +1,455 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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 = "BCM Data Exports" +const ServiceAPIVersion = "2023-11-26" + +// Client provides the API client to make operations call for AWS Billing and Cost +// Management Data Exports. +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, "bcmdataexports", 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/bcmdataexports/api_client_test.go b/service/bcmdataexports/api_client_test.go new file mode 100644 index 00000000000..dda81b2b43d --- /dev/null +++ b/service/bcmdataexports/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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/bcmdataexports/api_op_CreateExport.go b/service/bcmdataexports/api_op_CreateExport.go new file mode 100644 index 00000000000..10bea9feb27 --- /dev/null +++ b/service/bcmdataexports/api_op_CreateExport.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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/bcmdataexports/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a data export and specifies the data query, the delivery preference, +// and any optional resource tags. A DataQuery consists of both a QueryStatement +// and TableConfigurations . The QueryStatement is an SQL statement. Data Exports +// only supports a limited subset of the SQL syntax. For more information on the +// SQL syntax that is supported, see Data query (https://docs.aws.amazon.com/cur/latest/userguide/de-data-query.html) +// . To view the available tables and columns, see the Data Exports table +// dictionary (https://docs.aws.amazon.com/cur/latest/userguide/de-table-dictionary.html) +// . The TableConfigurations is a collection of specified TableProperties for the +// table being queried in the QueryStatement . TableProperties are additional +// configurations you can provide to change the data and schema of a table. Each +// table can have different TableProperties. However, tables are not required to +// have any TableProperties. Each table property has a default value that it +// assumes if not specified. For more information on table configurations, see +// Data query (https://docs.aws.amazon.com/cur/latest/userguide/de-data-query.html) +// . To view the table properties available for each table, see the Data Exports +// table dictionary (https://docs.aws.amazon.com/cur/latest/userguide/de-table-dictionary.html) +// or use the ListTables API to get a response of all tables and their available +// properties. +func (c *Client) CreateExport(ctx context.Context, params *CreateExportInput, optFns ...func(*Options)) (*CreateExportOutput, error) { + if params == nil { + params = &CreateExportInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateExport", params, optFns, c.addOperationCreateExportMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateExportOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateExportInput struct { + + // The details of the export, including data query, name, description, and + // destination configuration. + // + // This member is required. + Export *types.Export + + // An optional list of tags to associate with the specified export. Each tag + // consists of a key and a value, and each key must be unique for the resource. + ResourceTags []types.ResourceTag + + noSmithyDocumentSerde +} + +type CreateExportOutput struct { + + // The Amazon Resource Name (ARN) for this export. + ExportArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateExportMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateExport{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateExport{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateExport"); 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 = addOpCreateExportValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateExport(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_opCreateExport(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateExport", + } +} diff --git a/service/bcmdataexports/api_op_DeleteExport.go b/service/bcmdataexports/api_op_DeleteExport.go new file mode 100644 index 00000000000..0cb073ab0f3 --- /dev/null +++ b/service/bcmdataexports/api_op_DeleteExport.go @@ -0,0 +1,136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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 existing data export. +func (c *Client) DeleteExport(ctx context.Context, params *DeleteExportInput, optFns ...func(*Options)) (*DeleteExportOutput, error) { + if params == nil { + params = &DeleteExportInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteExport", params, optFns, c.addOperationDeleteExportMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteExportOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteExportInput struct { + + // The Amazon Resource Name (ARN) for this export. + // + // This member is required. + ExportArn *string + + noSmithyDocumentSerde +} + +type DeleteExportOutput struct { + + // The Amazon Resource Name (ARN) for this export. + ExportArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteExportMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteExport{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteExport{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteExport"); 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 = addOpDeleteExportValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteExport(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_opDeleteExport(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteExport", + } +} diff --git a/service/bcmdataexports/api_op_GetExecution.go b/service/bcmdataexports/api_op_GetExecution.go new file mode 100644 index 00000000000..200360fcb47 --- /dev/null +++ b/service/bcmdataexports/api_op_GetExecution.go @@ -0,0 +1,151 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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/bcmdataexports/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Exports data based on the source data update. +func (c *Client) GetExecution(ctx context.Context, params *GetExecutionInput, optFns ...func(*Options)) (*GetExecutionOutput, error) { + if params == nil { + params = &GetExecutionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetExecution", params, optFns, c.addOperationGetExecutionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetExecutionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetExecutionInput struct { + + // The ID for this specific execution. + // + // This member is required. + ExecutionId *string + + // The Amazon Resource Name (ARN) of the Export object that generated this + // specific execution. + // + // This member is required. + ExportArn *string + + noSmithyDocumentSerde +} + +type GetExecutionOutput struct { + + // The ID for this specific execution. + ExecutionId *string + + // The status of this specific execution. + ExecutionStatus *types.ExecutionStatus + + // The export data for this specific execution. This export data is a snapshot + // from when the execution was generated. The data could be different from the + // current export data if the export was updated since the execution was generated. + Export *types.Export + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetExecution{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetExecution{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetExecution"); 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 = addOpGetExecutionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetExecution(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_opGetExecution(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetExecution", + } +} diff --git a/service/bcmdataexports/api_op_GetExport.go b/service/bcmdataexports/api_op_GetExport.go new file mode 100644 index 00000000000..7fe6d81265f --- /dev/null +++ b/service/bcmdataexports/api_op_GetExport.go @@ -0,0 +1,140 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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/bcmdataexports/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Views the definition of an existing data export. +func (c *Client) GetExport(ctx context.Context, params *GetExportInput, optFns ...func(*Options)) (*GetExportOutput, error) { + if params == nil { + params = &GetExportInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetExport", params, optFns, c.addOperationGetExportMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetExportOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetExportInput struct { + + // The Amazon Resource Name (ARN) for this export. + // + // This member is required. + ExportArn *string + + noSmithyDocumentSerde +} + +type GetExportOutput struct { + + // The data for this specific export. + Export *types.Export + + // The status of this specific export. + ExportStatus *types.ExportStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetExportMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetExport{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetExport{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetExport"); 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 = addOpGetExportValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetExport(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_opGetExport(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetExport", + } +} diff --git a/service/bcmdataexports/api_op_GetTable.go b/service/bcmdataexports/api_op_GetTable.go new file mode 100644 index 00000000000..0e02c757b4c --- /dev/null +++ b/service/bcmdataexports/api_op_GetTable.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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/bcmdataexports/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the metadata for the specified table and table properties. This +// includes the list of columns in the table schema, their data types, and column +// descriptions. +func (c *Client) GetTable(ctx context.Context, params *GetTableInput, optFns ...func(*Options)) (*GetTableOutput, error) { + if params == nil { + params = &GetTableInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetTable", params, optFns, c.addOperationGetTableMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetTableOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetTableInput struct { + + // The name of the table. + // + // This member is required. + TableName *string + + // TableProperties are additional configurations you can provide to change the + // data and schema of a table. Each table can have different TableProperties. + // Tables are not required to have any TableProperties. Each table property has a + // default value that it assumes if not specified. + TableProperties map[string]string + + noSmithyDocumentSerde +} + +type GetTableOutput struct { + + // The table description. + Description *string + + // The schema of the table. + Schema []types.Column + + // The name of the table. + TableName *string + + // TableProperties are additional configurations you can provide to change the + // data and schema of a table. Each table can have different TableProperties. + // Tables are not required to have any TableProperties. Each table property has a + // default value that it assumes if not specified. + TableProperties map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetTableMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetTable{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetTable{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetTable"); 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 = addOpGetTableValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTable(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_opGetTable(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetTable", + } +} diff --git a/service/bcmdataexports/api_op_ListExecutions.go b/service/bcmdataexports/api_op_ListExecutions.go new file mode 100644 index 00000000000..6c70dc23df3 --- /dev/null +++ b/service/bcmdataexports/api_op_ListExecutions.go @@ -0,0 +1,236 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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/bcmdataexports/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the historical executions for the export. +func (c *Client) ListExecutions(ctx context.Context, params *ListExecutionsInput, optFns ...func(*Options)) (*ListExecutionsOutput, error) { + if params == nil { + params = &ListExecutionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListExecutions", params, optFns, c.addOperationListExecutionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListExecutionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListExecutionsInput struct { + + // The Amazon Resource Name (ARN) for this export. + // + // This member is required. + ExportArn *string + + // The maximum number of objects that are returned for the request. + MaxResults *int32 + + // The token to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListExecutionsOutput struct { + + // The list of executions. + Executions []types.ExecutionReference + + // The token to retrieve the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListExecutions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListExecutions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListExecutions"); 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 = addOpListExecutionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListExecutions(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 +} + +// ListExecutionsAPIClient is a client that implements the ListExecutions +// operation. +type ListExecutionsAPIClient interface { + ListExecutions(context.Context, *ListExecutionsInput, ...func(*Options)) (*ListExecutionsOutput, error) +} + +var _ ListExecutionsAPIClient = (*Client)(nil) + +// ListExecutionsPaginatorOptions is the paginator options for ListExecutions +type ListExecutionsPaginatorOptions struct { + // The maximum number of objects that are returned for the request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListExecutionsPaginator is a paginator for ListExecutions +type ListExecutionsPaginator struct { + options ListExecutionsPaginatorOptions + client ListExecutionsAPIClient + params *ListExecutionsInput + nextToken *string + firstPage bool +} + +// NewListExecutionsPaginator returns a new ListExecutionsPaginator +func NewListExecutionsPaginator(client ListExecutionsAPIClient, params *ListExecutionsInput, optFns ...func(*ListExecutionsPaginatorOptions)) *ListExecutionsPaginator { + if params == nil { + params = &ListExecutionsInput{} + } + + options := ListExecutionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListExecutionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListExecutions page. +func (p *ListExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExecutionsOutput, 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.ListExecutions(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_opListExecutions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListExecutions", + } +} diff --git a/service/bcmdataexports/api_op_ListExports.go b/service/bcmdataexports/api_op_ListExports.go new file mode 100644 index 00000000000..cc540038ec8 --- /dev/null +++ b/service/bcmdataexports/api_op_ListExports.go @@ -0,0 +1,227 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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/bcmdataexports/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all data export definitions. +func (c *Client) ListExports(ctx context.Context, params *ListExportsInput, optFns ...func(*Options)) (*ListExportsOutput, error) { + if params == nil { + params = &ListExportsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListExports", params, optFns, c.addOperationListExportsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListExportsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListExportsInput struct { + + // The maximum number of objects that are returned for the request. + MaxResults *int32 + + // The token to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListExportsOutput struct { + + // The details of the exports, including name and export status. + Exports []types.ExportReference + + // The token to retrieve the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListExportsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListExports{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListExports{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListExports"); 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_opListExports(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 +} + +// ListExportsAPIClient is a client that implements the ListExports operation. +type ListExportsAPIClient interface { + ListExports(context.Context, *ListExportsInput, ...func(*Options)) (*ListExportsOutput, error) +} + +var _ ListExportsAPIClient = (*Client)(nil) + +// ListExportsPaginatorOptions is the paginator options for ListExports +type ListExportsPaginatorOptions struct { + // The maximum number of objects that are returned for the request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListExportsPaginator is a paginator for ListExports +type ListExportsPaginator struct { + options ListExportsPaginatorOptions + client ListExportsAPIClient + params *ListExportsInput + nextToken *string + firstPage bool +} + +// NewListExportsPaginator returns a new ListExportsPaginator +func NewListExportsPaginator(client ListExportsAPIClient, params *ListExportsInput, optFns ...func(*ListExportsPaginatorOptions)) *ListExportsPaginator { + if params == nil { + params = &ListExportsInput{} + } + + options := ListExportsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListExportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListExportsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListExports page. +func (p *ListExportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExportsOutput, 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.ListExports(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_opListExports(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListExports", + } +} diff --git a/service/bcmdataexports/api_op_ListTables.go b/service/bcmdataexports/api_op_ListTables.go new file mode 100644 index 00000000000..84d9349204e --- /dev/null +++ b/service/bcmdataexports/api_op_ListTables.go @@ -0,0 +1,227 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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/bcmdataexports/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all available tables in data exports. +func (c *Client) ListTables(ctx context.Context, params *ListTablesInput, optFns ...func(*Options)) (*ListTablesOutput, error) { + if params == nil { + params = &ListTablesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTables", params, optFns, c.addOperationListTablesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTablesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTablesInput struct { + + // The maximum number of objects that are returned for the request. + MaxResults *int32 + + // The token to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListTablesOutput struct { + + // The token to retrieve the next set of results. + NextToken *string + + // The list of tables. + Tables []types.Table + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTablesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTables{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTables{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListTables"); 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_opListTables(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 +} + +// ListTablesAPIClient is a client that implements the ListTables operation. +type ListTablesAPIClient interface { + ListTables(context.Context, *ListTablesInput, ...func(*Options)) (*ListTablesOutput, error) +} + +var _ ListTablesAPIClient = (*Client)(nil) + +// ListTablesPaginatorOptions is the paginator options for ListTables +type ListTablesPaginatorOptions struct { + // The maximum number of objects that are returned for the request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListTablesPaginator is a paginator for ListTables +type ListTablesPaginator struct { + options ListTablesPaginatorOptions + client ListTablesAPIClient + params *ListTablesInput + nextToken *string + firstPage bool +} + +// NewListTablesPaginator returns a new ListTablesPaginator +func NewListTablesPaginator(client ListTablesAPIClient, params *ListTablesInput, optFns ...func(*ListTablesPaginatorOptions)) *ListTablesPaginator { + if params == nil { + params = &ListTablesInput{} + } + + options := ListTablesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTablesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListTables page. +func (p *ListTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTablesOutput, 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.ListTables(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_opListTables(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListTables", + } +} diff --git a/service/bcmdataexports/api_op_ListTagsForResource.go b/service/bcmdataexports/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..d0baa8b14dc --- /dev/null +++ b/service/bcmdataexports/api_op_ListTagsForResource.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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/bcmdataexports/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List tags associated with an existing data export. +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The unique identifier for the resource. + // + // This member is required. + ResourceArn *string + + // The maximum number of objects that are returned for the request. + MaxResults *int32 + + // The token to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // The token to retrieve the next set of results. + NextToken *string + + // An optional list of tags to associate with the specified export. Each tag + // consists of a key and a value, and each key must be unique for the resource. + ResourceTags []types.ResourceTag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(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_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListTagsForResource", + } +} diff --git a/service/bcmdataexports/api_op_TagResource.go b/service/bcmdataexports/api_op_TagResource.go new file mode 100644 index 00000000000..1379cbaf324 --- /dev/null +++ b/service/bcmdataexports/api_op_TagResource.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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/bcmdataexports/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds tags for an existing data export definition. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The unique identifier for the resource. + // + // This member is required. + ResourceArn *string + + // The tags to associate with the resource. Each tag consists of a key and a + // value, and each key must be unique for the resource. + // + // This member is required. + ResourceTags []types.ResourceTag + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(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_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "TagResource", + } +} diff --git a/service/bcmdataexports/api_op_UntagResource.go b/service/bcmdataexports/api_op_UntagResource.go new file mode 100644 index 00000000000..f6dbfc6a40b --- /dev/null +++ b/service/bcmdataexports/api_op_UntagResource.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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 tags associated with an existing data export definition. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The unique identifier for the resource. + // + // This member is required. + ResourceArn *string + + // The tag keys that are associated with the resource ARN. + // + // This member is required. + ResourceTagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(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_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UntagResource", + } +} diff --git a/service/bcmdataexports/api_op_UpdateExport.go b/service/bcmdataexports/api_op_UpdateExport.go new file mode 100644 index 00000000000..b1fb153b1ff --- /dev/null +++ b/service/bcmdataexports/api_op_UpdateExport.go @@ -0,0 +1,143 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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/bcmdataexports/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates an existing data export by overwriting all export parameters. All +// export parameters must be provided in the UpdateExport request. +func (c *Client) UpdateExport(ctx context.Context, params *UpdateExportInput, optFns ...func(*Options)) (*UpdateExportOutput, error) { + if params == nil { + params = &UpdateExportInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateExport", params, optFns, c.addOperationUpdateExportMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateExportOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateExportInput struct { + + // The name and query details for the export. + // + // This member is required. + Export *types.Export + + // The Amazon Resource Name (ARN) for this export. + // + // This member is required. + ExportArn *string + + noSmithyDocumentSerde +} + +type UpdateExportOutput struct { + + // The Amazon Resource Name (ARN) for this export. + ExportArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateExportMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateExport{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateExport{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateExport"); 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 = addOpUpdateExportValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateExport(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_opUpdateExport(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateExport", + } +} diff --git a/service/bcmdataexports/auth.go b/service/bcmdataexports/auth.go new file mode 100644 index 00000000000..e90115e65d2 --- /dev/null +++ b/service/bcmdataexports/auth.go @@ -0,0 +1,256 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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, "bcm-data-exports") + 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/bcmdataexports/deserializers.go b/service/bcmdataexports/deserializers.go new file mode 100644 index 00000000000..568973d94bd --- /dev/null +++ b/service/bcmdataexports/deserializers.go @@ -0,0 +1,3640 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/bcmdataexports/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strings" +) + +type awsAwsjson11_deserializeOpCreateExport struct { +} + +func (*awsAwsjson11_deserializeOpCreateExport) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateExport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreateExport(response, &metadata) + } + output := &CreateExportOutput{} + 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_deserializeOpDocumentCreateExportOutput(&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_deserializeOpErrorCreateExport(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDeleteExport struct { +} + +func (*awsAwsjson11_deserializeOpDeleteExport) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteExport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteExport(response, &metadata) + } + output := &DeleteExportOutput{} + 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_deserializeOpDocumentDeleteExportOutput(&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_deserializeOpErrorDeleteExport(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetExecution struct { +} + +func (*awsAwsjson11_deserializeOpGetExecution) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetExecution(response, &metadata) + } + output := &GetExecutionOutput{} + 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_deserializeOpDocumentGetExecutionOutput(&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_deserializeOpErrorGetExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetExport struct { +} + +func (*awsAwsjson11_deserializeOpGetExport) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetExport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetExport(response, &metadata) + } + output := &GetExportOutput{} + 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_deserializeOpDocumentGetExportOutput(&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_deserializeOpErrorGetExport(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetTable struct { +} + +func (*awsAwsjson11_deserializeOpGetTable) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetTable) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetTable(response, &metadata) + } + output := &GetTableOutput{} + 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_deserializeOpDocumentGetTableOutput(&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_deserializeOpErrorGetTable(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListExecutions struct { +} + +func (*awsAwsjson11_deserializeOpListExecutions) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListExecutions(response, &metadata) + } + output := &ListExecutionsOutput{} + 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_deserializeOpDocumentListExecutionsOutput(&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_deserializeOpErrorListExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListExports struct { +} + +func (*awsAwsjson11_deserializeOpListExports) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListExports) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListExports(response, &metadata) + } + output := &ListExportsOutput{} + 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_deserializeOpDocumentListExportsOutput(&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_deserializeOpErrorListExports(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListTables struct { +} + +func (*awsAwsjson11_deserializeOpListTables) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListTables) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListTables(response, &metadata) + } + output := &ListTablesOutput{} + 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_deserializeOpDocumentListTablesOutput(&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_deserializeOpErrorListTables(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListTagsForResource struct { +} + +func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + 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_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 = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_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("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpTagResource struct { +} + +func (*awsAwsjson11_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + 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_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 awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUntagResource struct { +} + +func (*awsAwsjson11_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + 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_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 awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateExport struct { +} + +func (*awsAwsjson11_deserializeOpUpdateExport) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateExport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateExport(response, &metadata) + } + output := &UpdateExportOutput{} + 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_deserializeOpDocumentUpdateExportOutput(&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_deserializeOpErrorUpdateExport(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson11_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 := awsAwsjson11_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 awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ResourceNotFoundException{} + err := awsAwsjson11_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ServiceQuotaExceededException{} + err := awsAwsjson11_deserializeDocumentServiceQuotaExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ThrottlingException{} + err := awsAwsjson11_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ValidationException{} + err := awsAwsjson11_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeDocumentColumn(v **types.Column, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Column + if *v == nil { + sv = &types.Column{} + } 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 GenericString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString 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 GenericString to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentColumnList(v *[]types.Column, 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.Column + if *v == nil { + cv = []types.Column{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Column + destAddr := &col + if err := awsAwsjson11_deserializeDocumentColumn(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentDataQuery(v **types.DataQuery, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DataQuery + if *v == nil { + sv = &types.DataQuery{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "QueryStatement": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryStatement to be of type string, got %T instead", value) + } + sv.QueryStatement = ptr.String(jtv) + } + + case "TableConfigurations": + if err := awsAwsjson11_deserializeDocumentTableConfigurations(&sv.TableConfigurations, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDestinationConfigurations(v **types.DestinationConfigurations, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DestinationConfigurations + if *v == nil { + sv = &types.DestinationConfigurations{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "S3Destination": + if err := awsAwsjson11_deserializeDocumentS3Destination(&sv.S3Destination, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentExecutionReference(v **types.ExecutionReference, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ExecutionReference + if *v == nil { + sv = &types.ExecutionReference{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ExecutionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.ExecutionId = ptr.String(jtv) + } + + case "ExecutionStatus": + if err := awsAwsjson11_deserializeDocumentExecutionStatus(&sv.ExecutionStatus, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentExecutionReferenceList(v *[]types.ExecutionReference, 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.ExecutionReference + if *v == nil { + cv = []types.ExecutionReference{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ExecutionReference + destAddr := &col + if err := awsAwsjson11_deserializeDocumentExecutionReference(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentExecutionStatus(v **types.ExecutionStatus, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ExecutionStatus + if *v == nil { + sv = &types.ExecutionStatus{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CompletedAt": + 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.CompletedAt = ptr.Time(t) + } + + 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 "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 "StatusCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExecutionStatusCode to be of type string, got %T instead", value) + } + sv.StatusCode = types.ExecutionStatusCode(jtv) + } + + case "StatusReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExecutionStatusReason to be of type string, got %T instead", value) + } + sv.StatusReason = types.ExecutionStatusReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentExport(v **types.Export, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Export + if *v == nil { + sv = &types.Export{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DataQuery": + if err := awsAwsjson11_deserializeDocumentDataQuery(&sv.DataQuery, value); err != nil { + return err + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "DestinationConfigurations": + if err := awsAwsjson11_deserializeDocumentDestinationConfigurations(&sv.DestinationConfigurations, value); err != nil { + return err + } + + case "ExportArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ExportArn = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExportName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "RefreshCadence": + if err := awsAwsjson11_deserializeDocumentRefreshCadence(&sv.RefreshCadence, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentExportReference(v **types.ExportReference, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ExportReference + if *v == nil { + sv = &types.ExportReference{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ExportArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ExportArn = ptr.String(jtv) + } + + case "ExportName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExportName to be of type string, got %T instead", value) + } + sv.ExportName = ptr.String(jtv) + } + + case "ExportStatus": + if err := awsAwsjson11_deserializeDocumentExportStatus(&sv.ExportStatus, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentExportReferenceList(v *[]types.ExportReference, 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.ExportReference + if *v == nil { + cv = []types.ExportReference{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ExportReference + destAddr := &col + if err := awsAwsjson11_deserializeDocumentExportReference(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentExportStatus(v **types.ExportStatus, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ExportStatus + if *v == nil { + sv = &types.ExportStatus{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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 "LastRefreshedAt": + 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.LastRefreshedAt = ptr.Time(t) + } + + 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 "StatusCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExportStatusCode to be of type string, got %T instead", value) + } + sv.StatusCode = types.ExportStatusCode(jtv) + } + + case "StatusReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExecutionStatusReason to be of type string, got %T instead", value) + } + sv.StatusReason = types.ExecutionStatusReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentGenericStringList(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 GenericString to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_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 GenericString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRefreshCadence(v **types.RefreshCadence, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RefreshCadence + if *v == nil { + sv = &types.RefreshCadence{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Frequency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FrequencyOption to be of type string, got %T instead", value) + } + sv.Frequency = types.FrequencyOption(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "ResourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourceTag(v **types.ResourceTag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceTag + if *v == nil { + sv = &types.ResourceTag{} + } 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 ResourceTagKey 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 ResourceTagValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourceTagList(v *[]types.ResourceTag, 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.ResourceTag + if *v == nil { + cv = []types.ResourceTag{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResourceTag + destAddr := &col + if err := awsAwsjson11_deserializeDocumentResourceTag(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentS3Destination(v **types.S3Destination, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.S3Destination + if *v == nil { + sv = &types.S3Destination{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "S3Bucket": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.S3Bucket = ptr.String(jtv) + } + + case "S3OutputConfigurations": + if err := awsAwsjson11_deserializeDocumentS3OutputConfigurations(&sv.S3OutputConfigurations, value); err != nil { + return err + } + + case "S3Prefix": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.S3Prefix = ptr.String(jtv) + } + + case "S3Region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.S3Region = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentS3OutputConfigurations(v **types.S3OutputConfigurations, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.S3OutputConfigurations + if *v == nil { + sv = &types.S3OutputConfigurations{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Compression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CompressionOption to be of type string, got %T instead", value) + } + sv.Compression = types.CompressionOption(jtv) + } + + case "Format": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FormatOption to be of type string, got %T instead", value) + } + sv.Format = types.FormatOption(jtv) + } + + case "OutputType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected S3OutputType to be of type string, got %T instead", value) + } + sv.OutputType = types.S3OutputType(jtv) + } + + case "Overwrite": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OverwriteOption to be of type string, got %T instead", value) + } + sv.Overwrite = types.OverwriteOption(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "QuotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "ResourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + case "ServiceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentTable(v **types.Table, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Table + if *v == nil { + sv = &types.Table{} + } 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 GenericString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "TableName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TableName to be of type string, got %T instead", value) + } + sv.TableName = ptr.String(jtv) + } + + case "TableProperties": + if err := awsAwsjson11_deserializeDocumentTablePropertyDescriptionList(&sv.TableProperties, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentTableConfigurations(v *map[string]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]map[string]string + if *v == nil { + mv = map[string]map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal map[string]string + mapVar := parsedVal + if err := awsAwsjson11_deserializeDocumentTableProperties(&mapVar, value); err != nil { + return err + } + parsedVal = mapVar + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsAwsjson11_deserializeDocumentTableList(v *[]types.Table, 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.Table + if *v == nil { + cv = []types.Table{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Table + destAddr := &col + if err := awsAwsjson11_deserializeDocumentTable(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentTableProperties(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 GenericString to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsAwsjson11_deserializeDocumentTablePropertyDescription(v **types.TablePropertyDescription, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TablePropertyDescription + if *v == nil { + sv = &types.TablePropertyDescription{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DefaultValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.DefaultValue = ptr.String(jtv) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ValidValues": + if err := awsAwsjson11_deserializeDocumentGenericStringList(&sv.ValidValues, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentTablePropertyDescriptionList(v *[]types.TablePropertyDescription, 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.TablePropertyDescription + if *v == nil { + cv = []types.TablePropertyDescription{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TablePropertyDescription + destAddr := &col + if err := awsAwsjson11_deserializeDocumentTablePropertyDescription(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "QuotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "ServiceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.ServiceCode = 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 "Fields": + if err := awsAwsjson11_deserializeDocumentValidationExceptionFieldList(&sv.Fields, value); err != nil { + return err + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "Reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.ValidationExceptionReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationExceptionField + if *v == nil { + sv = &types.ValidationExceptionField{} + } 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 GenericString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, 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.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsAwsjson11_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeOpDocumentCreateExportOutput(v **CreateExportOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateExportOutput + if *v == nil { + sv = &CreateExportOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ExportArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ExportArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDeleteExportOutput(v **DeleteExportOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteExportOutput + if *v == nil { + sv = &DeleteExportOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ExportArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ExportArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetExecutionOutput(v **GetExecutionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetExecutionOutput + if *v == nil { + sv = &GetExecutionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ExecutionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.ExecutionId = ptr.String(jtv) + } + + case "ExecutionStatus": + if err := awsAwsjson11_deserializeDocumentExecutionStatus(&sv.ExecutionStatus, value); err != nil { + return err + } + + case "Export": + if err := awsAwsjson11_deserializeDocumentExport(&sv.Export, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetExportOutput(v **GetExportOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetExportOutput + if *v == nil { + sv = &GetExportOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Export": + if err := awsAwsjson11_deserializeDocumentExport(&sv.Export, value); err != nil { + return err + } + + case "ExportStatus": + if err := awsAwsjson11_deserializeDocumentExportStatus(&sv.ExportStatus, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetTableOutput(v **GetTableOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetTableOutput + if *v == nil { + sv = &GetTableOutput{} + } 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 GenericString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Schema": + if err := awsAwsjson11_deserializeDocumentColumnList(&sv.Schema, value); err != nil { + return err + } + + case "TableName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TableName to be of type string, got %T instead", value) + } + sv.TableName = ptr.String(jtv) + } + + case "TableProperties": + if err := awsAwsjson11_deserializeDocumentTableProperties(&sv.TableProperties, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListExecutionsOutput(v **ListExecutionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListExecutionsOutput + if *v == nil { + sv = &ListExecutionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Executions": + if err := awsAwsjson11_deserializeDocumentExecutionReferenceList(&sv.Executions, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListExportsOutput(v **ListExportsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListExportsOutput + if *v == nil { + sv = &ListExportsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Exports": + if err := awsAwsjson11_deserializeDocumentExportReferenceList(&sv.Exports, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListTablesOutput(v **ListTablesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTablesOutput + if *v == nil { + sv = &ListTablesOutput{} + } 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 NextPageToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "Tables": + if err := awsAwsjson11_deserializeDocumentTableList(&sv.Tables, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_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 "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ResourceTags": + if err := awsAwsjson11_deserializeDocumentResourceTagList(&sv.ResourceTags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *TagResourceOutput + if *v == nil { + sv = &TagResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UntagResourceOutput + if *v == nil { + sv = &UntagResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentUpdateExportOutput(v **UpdateExportOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateExportOutput + if *v == nil { + sv = &UpdateExportOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ExportArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ExportArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/bcmdataexports/doc.go b/service/bcmdataexports/doc.go new file mode 100644 index 00000000000..7fdba615c77 --- /dev/null +++ b/service/bcmdataexports/doc.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package bcmdataexports provides the API client, operations, and parameter types +// for AWS Billing and Cost Management Data Exports. +// +// You can use the Data Exports API to create customized exports from multiple +// Amazon Web Services cost management and billing datasets, such as cost and usage +// data and cost optimization recommendations. The Data Exports API provides the +// following endpoint: +// - https://bcm-data-exports.us-east-1.api.aws +package bcmdataexports diff --git a/service/bcmdataexports/endpoints.go b/service/bcmdataexports/endpoints.go new file mode 100644 index 00000000000..8a2abd0dc44 --- /dev/null +++ b/service/bcmdataexports/endpoints.go @@ -0,0 +1,533 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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/bcmdataexports/internal/endpoints" + smithy "github.com/aws/smithy-go" + 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 = "bcm-data-exports" + } + 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_BCM_DATA_EXPORTS") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "BCM Data Exports", 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, 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.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.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) + } + _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") + } + 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 _PartitionResult.Name == "aws" { + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://bcm-data-exports-fips.") + out.WriteString(_Region) + out.WriteString(".api.aws") + 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") + } + uriString := "https://bcm-data-exports.us-east-1.api.aws" + + 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{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "bcm-data-exports") + smithyhttp.SetSigV4ASigningName(&sp, "bcm-data-exports") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if true == _PartitionResult.SupportsDualStack { + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://bcm-data-exports-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 is enabled but this partition does not support FIPS") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://bcm-data-exports.") + 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 + } + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://bcm-data-exports-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") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://bcm-data-exports.") + 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.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/bcmdataexports/endpoints_config_test.go b/service/bcmdataexports/endpoints_config_test.go new file mode 100644 index 00000000000..e61255af58d --- /dev/null +++ b/service/bcmdataexports/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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-bcm-data-exports.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-bcm-data-exports.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-bcm-data-exports.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-bcm-data-exports.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-bcm-data-exports.dev", + expectURL: aws.String("https://env-bcm-data-exports.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-bcm-data-exports.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-bcm-data-exports.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-bcm-data-exports.dev", + expectURL: aws.String("http://config-bcm-data-exports.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-bcm-data-exports.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-bcm-data-exports.dev", + clientEndpoint: aws.String("https://client-bcm-data-exports.dev"), + expectURL: aws.String("https://client-bcm-data-exports.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_BCM_DATA_EXPORTS", 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/bcmdataexports/endpoints_test.go b/service/bcmdataexports/endpoints_test.go new file mode 100644 index 00000000000..d76ede7892b --- /dev/null +++ b/service/bcmdataexports/endpoints_test.go @@ -0,0 +1,428 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +import ( + "context" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/google/go-cmp/cmp" + "net/http" + "net/url" + "strings" + "testing" +) + +// For region aws-global with FIPS disabled and DualStack enabled +func TestEndpointCase0(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("aws-global"), + UseFIPS: 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://bcm-data-exports.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "bcm-data-exports") + smithyhttp.SetSigV4ASigningName(&sp, "bcm-data-exports") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + } + + 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 enabled +func TestEndpointCase1(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: 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://bcm-data-exports-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 disabled and DualStack enabled +func TestEndpointCase2(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: 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://bcm-data-exports.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "bcm-data-exports") + smithyhttp.SetSigV4ASigningName(&sp, "bcm-data-exports") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + } + + 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 TestEndpointCase3(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: 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://bcm-data-exports-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 disabled and DualStack enabled +func TestEndpointCase4(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: 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://bcm-data-exports.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 us-gov-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase5(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: 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://bcm-data-exports-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 disabled and DualStack enabled +func TestEndpointCase6(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: 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://bcm-data-exports.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 custom endpoint with region set and fips disabled and dualstack disabled +func TestEndpointCase7(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: 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 TestEndpointCase8(t *testing.T) { + var params = EndpointParameters{ + UseFIPS: 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 TestEndpointCase9(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: 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: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// Missing region +func TestEndpointCase10(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/bcmdataexports/generated.json b/service/bcmdataexports/generated.json new file mode 100644 index 00000000000..ec28f2b9933 --- /dev/null +++ b/service/bcmdataexports/generated.json @@ -0,0 +1,44 @@ +{ + "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_CreateExport.go", + "api_op_DeleteExport.go", + "api_op_GetExecution.go", + "api_op_GetExport.go", + "api_op_GetTable.go", + "api_op_ListExecutions.go", + "api_op_ListExports.go", + "api_op_ListTables.go", + "api_op_ListTagsForResource.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateExport.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/bcmdataexports", + "unstable": false +} diff --git a/service/bcmdataexports/go.mod b/service/bcmdataexports/go.mod new file mode 100644 index 00000000000..d3a0e543197 --- /dev/null +++ b/service/bcmdataexports/go.mod @@ -0,0 +1,17 @@ +module github.com/aws/aws-sdk-go-v2/service/bcmdataexports + +go 1.19 + +require ( + github.com/aws/aws-sdk-go-v2 v1.23.1 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4 + 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/bcmdataexports/go.sum b/service/bcmdataexports/go.sum new file mode 100644 index 00000000000..42e4fc806b4 --- /dev/null +++ b/service/bcmdataexports/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/bcmdataexports/go_module_metadata.go b/service/bcmdataexports/go_module_metadata.go new file mode 100644 index 00000000000..68d2df18688 --- /dev/null +++ b/service/bcmdataexports/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package bcmdataexports + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/bcmdataexports/internal/endpoints/endpoints.go b/service/bcmdataexports/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..7f4e28e2af2 --- /dev/null +++ b/service/bcmdataexports/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 BCM Data Exports 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: "bcm-data-exports.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "bcm-data-exports-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "bcm-data-exports-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "bcm-data-exports.{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: "bcm-data-exports.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "bcm-data-exports-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "bcm-data-exports-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "bcm-data-exports.{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: "bcm-data-exports-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "bcm-data-exports.{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: "bcm-data-exports-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "bcm-data-exports.{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: "bcm-data-exports-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "bcm-data-exports.{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: "bcm-data-exports-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "bcm-data-exports.{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: "bcm-data-exports.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "bcm-data-exports-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "bcm-data-exports-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "bcm-data-exports.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/bcmdataexports/internal/endpoints/endpoints_test.go b/service/bcmdataexports/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/bcmdataexports/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/bcmdataexports/options.go b/service/bcmdataexports/options.go new file mode 100644 index 00000000000..f3c5cafe320 --- /dev/null +++ b/service/bcmdataexports/options.go @@ -0,0 +1,219 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +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/bcmdataexports/protocol_test.go b/service/bcmdataexports/protocol_test.go new file mode 100644 index 00000000000..80b388e95cd --- /dev/null +++ b/service/bcmdataexports/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports diff --git a/service/bcmdataexports/serializers.go b/service/bcmdataexports/serializers.go new file mode 100644 index 00000000000..2ac01d049ba --- /dev/null +++ b/service/bcmdataexports/serializers.go @@ -0,0 +1,1103 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/bcmdataexports/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "path" +) + +type awsAwsjson11_serializeOpCreateExport struct { +} + +func (*awsAwsjson11_serializeOpCreateExport) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateExport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateExportInput) + _ = 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("AWSBillingAndCostManagementDataExports.CreateExport") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateExportInput(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_serializeOpDeleteExport struct { +} + +func (*awsAwsjson11_serializeOpDeleteExport) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteExport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteExportInput) + _ = 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("AWSBillingAndCostManagementDataExports.DeleteExport") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteExportInput(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_serializeOpGetExecution struct { +} + +func (*awsAwsjson11_serializeOpGetExecution) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetExecutionInput) + _ = 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("AWSBillingAndCostManagementDataExports.GetExecution") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetExecutionInput(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_serializeOpGetExport struct { +} + +func (*awsAwsjson11_serializeOpGetExport) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetExport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetExportInput) + _ = 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("AWSBillingAndCostManagementDataExports.GetExport") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetExportInput(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_serializeOpGetTable struct { +} + +func (*awsAwsjson11_serializeOpGetTable) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetTable) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetTableInput) + _ = 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("AWSBillingAndCostManagementDataExports.GetTable") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetTableInput(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_serializeOpListExecutions struct { +} + +func (*awsAwsjson11_serializeOpListExecutions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListExecutions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListExecutionsInput) + _ = 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("AWSBillingAndCostManagementDataExports.ListExecutions") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListExecutionsInput(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_serializeOpListExports struct { +} + +func (*awsAwsjson11_serializeOpListExports) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListExports) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListExportsInput) + _ = 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("AWSBillingAndCostManagementDataExports.ListExports") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListExportsInput(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_serializeOpListTables struct { +} + +func (*awsAwsjson11_serializeOpListTables) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListTables) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTablesInput) + _ = 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("AWSBillingAndCostManagementDataExports.ListTables") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListTablesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListTagsForResource struct { +} + +func (*awsAwsjson11_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSBillingAndCostManagementDataExports.ListTagsForResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpTagResource struct { +} + +func (*awsAwsjson11_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSBillingAndCostManagementDataExports.TagResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpUntagResource struct { +} + +func (*awsAwsjson11_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSBillingAndCostManagementDataExports.UntagResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpUpdateExport struct { +} + +func (*awsAwsjson11_serializeOpUpdateExport) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateExport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateExportInput) + _ = 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("AWSBillingAndCostManagementDataExports.UpdateExport") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateExportInput(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_serializeDocumentDataQuery(v *types.DataQuery, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.QueryStatement != nil { + ok := object.Key("QueryStatement") + ok.String(*v.QueryStatement) + } + + if v.TableConfigurations != nil { + ok := object.Key("TableConfigurations") + if err := awsAwsjson11_serializeDocumentTableConfigurations(v.TableConfigurations, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentDestinationConfigurations(v *types.DestinationConfigurations, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.S3Destination != nil { + ok := object.Key("S3Destination") + if err := awsAwsjson11_serializeDocumentS3Destination(v.S3Destination, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentExport(v *types.Export, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DataQuery != nil { + ok := object.Key("DataQuery") + if err := awsAwsjson11_serializeDocumentDataQuery(v.DataQuery, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.DestinationConfigurations != nil { + ok := object.Key("DestinationConfigurations") + if err := awsAwsjson11_serializeDocumentDestinationConfigurations(v.DestinationConfigurations, ok); err != nil { + return err + } + } + + if v.ExportArn != nil { + ok := object.Key("ExportArn") + ok.String(*v.ExportArn) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.RefreshCadence != nil { + ok := object.Key("RefreshCadence") + if err := awsAwsjson11_serializeDocumentRefreshCadence(v.RefreshCadence, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentRefreshCadence(v *types.RefreshCadence, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Frequency) > 0 { + ok := object.Key("Frequency") + ok.String(string(v.Frequency)) + } + + return nil +} + +func awsAwsjson11_serializeDocumentResourceTag(v *types.ResourceTag, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsAwsjson11_serializeDocumentResourceTagKeyList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentResourceTagList(v []types.ResourceTag, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentResourceTag(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentS3Destination(v *types.S3Destination, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.S3Bucket != nil { + ok := object.Key("S3Bucket") + ok.String(*v.S3Bucket) + } + + if v.S3OutputConfigurations != nil { + ok := object.Key("S3OutputConfigurations") + if err := awsAwsjson11_serializeDocumentS3OutputConfigurations(v.S3OutputConfigurations, ok); err != nil { + return err + } + } + + if v.S3Prefix != nil { + ok := object.Key("S3Prefix") + ok.String(*v.S3Prefix) + } + + if v.S3Region != nil { + ok := object.Key("S3Region") + ok.String(*v.S3Region) + } + + return nil +} + +func awsAwsjson11_serializeDocumentS3OutputConfigurations(v *types.S3OutputConfigurations, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Compression) > 0 { + ok := object.Key("Compression") + ok.String(string(v.Compression)) + } + + if len(v.Format) > 0 { + ok := object.Key("Format") + ok.String(string(v.Format)) + } + + if len(v.OutputType) > 0 { + ok := object.Key("OutputType") + ok.String(string(v.OutputType)) + } + + if len(v.Overwrite) > 0 { + ok := object.Key("Overwrite") + ok.String(string(v.Overwrite)) + } + + return nil +} + +func awsAwsjson11_serializeDocumentTableConfigurations(v map[string]map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + if vv := v[key]; vv == nil { + continue + } + if err := awsAwsjson11_serializeDocumentTableProperties(v[key], om); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentTableProperties(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 awsAwsjson11_serializeOpDocumentCreateExportInput(v *CreateExportInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Export != nil { + ok := object.Key("Export") + if err := awsAwsjson11_serializeDocumentExport(v.Export, ok); err != nil { + return err + } + } + + if v.ResourceTags != nil { + ok := object.Key("ResourceTags") + if err := awsAwsjson11_serializeDocumentResourceTagList(v.ResourceTags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDeleteExportInput(v *DeleteExportInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExportArn != nil { + ok := object.Key("ExportArn") + ok.String(*v.ExportArn) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetExecutionInput(v *GetExecutionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExecutionId != nil { + ok := object.Key("ExecutionId") + ok.String(*v.ExecutionId) + } + + if v.ExportArn != nil { + ok := object.Key("ExportArn") + ok.String(*v.ExportArn) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetExportInput(v *GetExportInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExportArn != nil { + ok := object.Key("ExportArn") + ok.String(*v.ExportArn) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetTableInput(v *GetTableInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TableName != nil { + ok := object.Key("TableName") + ok.String(*v.TableName) + } + + if v.TableProperties != nil { + ok := object.Key("TableProperties") + if err := awsAwsjson11_serializeDocumentTableProperties(v.TableProperties, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentListExecutionsInput(v *ListExecutionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExportArn != nil { + ok := object.Key("ExportArn") + ok.String(*v.ExportArn) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentListExportsInput(v *ListExportsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentListTablesInput(v *ListTablesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + + if v.ResourceTags != nil { + ok := object.Key("ResourceTags") + if err := awsAwsjson11_serializeDocumentResourceTagList(v.ResourceTags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + + if v.ResourceTagKeys != nil { + ok := object.Key("ResourceTagKeys") + if err := awsAwsjson11_serializeDocumentResourceTagKeyList(v.ResourceTagKeys, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentUpdateExportInput(v *UpdateExportInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Export != nil { + ok := object.Key("Export") + if err := awsAwsjson11_serializeDocumentExport(v.Export, ok); err != nil { + return err + } + } + + if v.ExportArn != nil { + ok := object.Key("ExportArn") + ok.String(*v.ExportArn) + } + + return nil +} diff --git a/service/bcmdataexports/types/enums.go b/service/bcmdataexports/types/enums.go new file mode 100644 index 00000000000..fb19b6806f3 --- /dev/null +++ b/service/bcmdataexports/types/enums.go @@ -0,0 +1,177 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type CompressionOption string + +// Enum values for CompressionOption +const ( + CompressionOptionGzip CompressionOption = "GZIP" + CompressionOptionParquet CompressionOption = "PARQUET" +) + +// Values returns all known values for CompressionOption. 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 (CompressionOption) Values() []CompressionOption { + return []CompressionOption{ + "GZIP", + "PARQUET", + } +} + +type ExecutionStatusCode string + +// Enum values for ExecutionStatusCode +const ( + ExecutionStatusCodeInitiationInProcess ExecutionStatusCode = "INITIATION_IN_PROCESS" + ExecutionStatusCodeQueryQueued ExecutionStatusCode = "QUERY_QUEUED" + ExecutionStatusCodeQueryInProcess ExecutionStatusCode = "QUERY_IN_PROCESS" + ExecutionStatusCodeQueryFailure ExecutionStatusCode = "QUERY_FAILURE" + ExecutionStatusCodeDeliveryInProcess ExecutionStatusCode = "DELIVERY_IN_PROCESS" + ExecutionStatusCodeDeliverySuccess ExecutionStatusCode = "DELIVERY_SUCCESS" + ExecutionStatusCodeDeliveryFailure ExecutionStatusCode = "DELIVERY_FAILURE" +) + +// Values returns all known values for ExecutionStatusCode. 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 (ExecutionStatusCode) Values() []ExecutionStatusCode { + return []ExecutionStatusCode{ + "INITIATION_IN_PROCESS", + "QUERY_QUEUED", + "QUERY_IN_PROCESS", + "QUERY_FAILURE", + "DELIVERY_IN_PROCESS", + "DELIVERY_SUCCESS", + "DELIVERY_FAILURE", + } +} + +type ExecutionStatusReason string + +// Enum values for ExecutionStatusReason +const ( + ExecutionStatusReasonInsufficientPermission ExecutionStatusReason = "INSUFFICIENT_PERMISSION" + ExecutionStatusReasonBillOwnerChanged ExecutionStatusReason = "BILL_OWNER_CHANGED" + ExecutionStatusReasonInternalFailure ExecutionStatusReason = "INTERNAL_FAILURE" +) + +// Values returns all known values for ExecutionStatusReason. 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 (ExecutionStatusReason) Values() []ExecutionStatusReason { + return []ExecutionStatusReason{ + "INSUFFICIENT_PERMISSION", + "BILL_OWNER_CHANGED", + "INTERNAL_FAILURE", + } +} + +type ExportStatusCode string + +// Enum values for ExportStatusCode +const ( + ExportStatusCodeHealthy ExportStatusCode = "HEALTHY" + ExportStatusCodeUnhealthy ExportStatusCode = "UNHEALTHY" +) + +// Values returns all known values for ExportStatusCode. 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 (ExportStatusCode) Values() []ExportStatusCode { + return []ExportStatusCode{ + "HEALTHY", + "UNHEALTHY", + } +} + +type FormatOption string + +// Enum values for FormatOption +const ( + FormatOptionTextOrCsv FormatOption = "TEXT_OR_CSV" + FormatOptionParquet FormatOption = "PARQUET" +) + +// Values returns all known values for FormatOption. 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 (FormatOption) Values() []FormatOption { + return []FormatOption{ + "TEXT_OR_CSV", + "PARQUET", + } +} + +type FrequencyOption string + +// Enum values for FrequencyOption +const ( + FrequencyOptionSynchronous FrequencyOption = "SYNCHRONOUS" +) + +// Values returns all known values for FrequencyOption. 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 (FrequencyOption) Values() []FrequencyOption { + return []FrequencyOption{ + "SYNCHRONOUS", + } +} + +type OverwriteOption string + +// Enum values for OverwriteOption +const ( + OverwriteOptionCreateNewReport OverwriteOption = "CREATE_NEW_REPORT" + OverwriteOptionOverwriteReport OverwriteOption = "OVERWRITE_REPORT" +) + +// Values returns all known values for OverwriteOption. 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 (OverwriteOption) Values() []OverwriteOption { + return []OverwriteOption{ + "CREATE_NEW_REPORT", + "OVERWRITE_REPORT", + } +} + +type S3OutputType string + +// Enum values for S3OutputType +const ( + S3OutputTypeCustom S3OutputType = "CUSTOM" +) + +// Values returns all known values for S3OutputType. 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 (S3OutputType) Values() []S3OutputType { + return []S3OutputType{ + "CUSTOM", + } +} + +type ValidationExceptionReason string + +// Enum values for ValidationExceptionReason +const ( + ValidationExceptionReasonUnknownOperation ValidationExceptionReason = "unknownOperation" + ValidationExceptionReasonCannotParse ValidationExceptionReason = "cannotParse" + ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "fieldValidationFailed" + ValidationExceptionReasonOther ValidationExceptionReason = "other" +) + +// Values returns all known values for ValidationExceptionReason. 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 (ValidationExceptionReason) Values() []ValidationExceptionReason { + return []ValidationExceptionReason{ + "unknownOperation", + "cannotParse", + "fieldValidationFailed", + "other", + } +} diff --git a/service/bcmdataexports/types/errors.go b/service/bcmdataexports/types/errors.go new file mode 100644 index 00000000000..0b8ad9926ca --- /dev/null +++ b/service/bcmdataexports/types/errors.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// An error on the server occurred during the processing of your request. 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 specified Amazon Resource Name (ARN) in the request doesn't exist. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType *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 } + +// You've reached the limit on the number of resources you can create, or exceeded +// the size of an individual resource. +type ServiceQuotaExceededException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType *string + QuotaCode *string + ServiceCode *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceQuotaExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied due to request throttling. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + QuotaCode *string + ServiceCode *string + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The input fails to satisfy the constraints specified by an Amazon Web Services +// service. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + Reason ValidationExceptionReason + Fields []ValidationExceptionField + + 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/bcmdataexports/types/types.go b/service/bcmdataexports/types/types.go new file mode 100644 index 00000000000..1d5fb4adaa6 --- /dev/null +++ b/service/bcmdataexports/types/types.go @@ -0,0 +1,297 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// Includes basic information for a data column such as its description, name, and +// type. +type Column struct { + + // The description for a column. + Description *string + + // The column name. + Name *string + + // The kind of data a column stores. + Type *string + + noSmithyDocumentSerde +} + +// The SQL query of column selections and row filters from the data table you want. +type DataQuery struct { + + // The query statement. + // + // This member is required. + QueryStatement *string + + // The table configuration. + TableConfigurations map[string]map[string]string + + noSmithyDocumentSerde +} + +// The destinations used for data exports. +type DestinationConfigurations struct { + + // An object that describes the destination of the data exports file. + // + // This member is required. + S3Destination *S3Destination + + noSmithyDocumentSerde +} + +// The reference for the data export update. +type ExecutionReference struct { + + // The ID for this specific execution. + // + // This member is required. + ExecutionId *string + + // The status of this specific execution. + // + // This member is required. + ExecutionStatus *ExecutionStatus + + noSmithyDocumentSerde +} + +// The status of the execution. +type ExecutionStatus struct { + + // The time when the execution was completed. + CompletedAt *time.Time + + // The time when the execution was created. + CreatedAt *time.Time + + // The time when the execution was last updated. + LastUpdatedAt *time.Time + + // The code for the status of the execution. + StatusCode ExecutionStatusCode + + // The reason for the failed status. + StatusReason ExecutionStatusReason + + noSmithyDocumentSerde +} + +// The details that are available for an export. +type Export struct { + + // The data query for this specific data export. + // + // This member is required. + DataQuery *DataQuery + + // The destination configuration for this specific data export. + // + // This member is required. + DestinationConfigurations *DestinationConfigurations + + // The name of this specific data export. + // + // This member is required. + Name *string + + // The cadence for Amazon Web Services to update the export in your S3 bucket. + // + // This member is required. + RefreshCadence *RefreshCadence + + // The description for this specific data export. + Description *string + + // The Amazon Resource Name (ARN) for this export. + ExportArn *string + + noSmithyDocumentSerde +} + +// The reference details for a given export. +type ExportReference struct { + + // The Amazon Resource Name (ARN) for this export. + // + // This member is required. + ExportArn *string + + // The name of this specific data export. + // + // This member is required. + ExportName *string + + // The status of this specific data export. + // + // This member is required. + ExportStatus *ExportStatus + + noSmithyDocumentSerde +} + +// The status of the data export. +type ExportStatus struct { + + // The timestamp of when the export was created. + CreatedAt *time.Time + + // The timestamp of when the export was last generated. + LastRefreshedAt *time.Time + + // The timestamp of when the export was updated. + LastUpdatedAt *time.Time + + // The status code for the request. + StatusCode ExportStatusCode + + // The description for the status code. + StatusReason ExecutionStatusReason + + noSmithyDocumentSerde +} + +// The cadence for Amazon Web Services to update the data export in your S3 bucket. +type RefreshCadence struct { + + // The frequency that data exports are updated. The export refreshes each time the + // source data updates, up to three times daily. + // + // This member is required. + Frequency FrequencyOption + + noSmithyDocumentSerde +} + +// The tag structure that contains a tag key and value. +type ResourceTag struct { + + // The key that's associated with the tag. + // + // This member is required. + Key *string + + // The value that's associated with the tag. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name +// and object keys of a data exports file. +type S3Destination struct { + + // The name of the Amazon S3 bucket used as the destination of a data export file. + // + // This member is required. + S3Bucket *string + + // The output configuration for the data export. + // + // This member is required. + S3OutputConfigurations *S3OutputConfigurations + + // The S3 path prefix you want prepended to the name of your data export. + // + // This member is required. + S3Prefix *string + + // The S3 bucket Region. + // + // This member is required. + S3Region *string + + noSmithyDocumentSerde +} + +// The compression type, file format, and overwrite preference for the data export. +type S3OutputConfigurations struct { + + // The compression type for the data export. + // + // This member is required. + Compression CompressionOption + + // The file format for the data export. + // + // This member is required. + Format FormatOption + + // The output type for the data export. + // + // This member is required. + OutputType S3OutputType + + // The rule to follow when generating a version of the data export file. You have + // the choice to overwrite the previous version or to be delivered in addition to + // the previous versions. Overwriting exports can save on Amazon S3 storage costs. + // Creating new export versions allows you to track the changes in cost and usage + // data over time. + // + // This member is required. + Overwrite OverwriteOption + + noSmithyDocumentSerde +} + +// The details for the data export table. +type Table struct { + + // The description for the table. + Description *string + + // The name of the table. + TableName *string + + // The properties for the table. + TableProperties []TablePropertyDescription + + noSmithyDocumentSerde +} + +// The properties for the data export table. +type TablePropertyDescription struct { + + // The default value for the table. + DefaultValue *string + + // The description for the table. + Description *string + + // The name of the table. + Name *string + + // The valid values for the table. + ValidValues []string + + noSmithyDocumentSerde +} + +// The input failed to meet the constraints specified by the Amazon Web Services +// service in a specified field. +type ValidationExceptionField struct { + + // A message with the reason for the validation exception error. + // + // This member is required. + Message *string + + // The field name where the invalid entry was detected. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/bcmdataexports/validators.go b/service/bcmdataexports/validators.go new file mode 100644 index 00000000000..12970e5652d --- /dev/null +++ b/service/bcmdataexports/validators.go @@ -0,0 +1,602 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/bcmdataexports/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCreateExport struct { +} + +func (*validateOpCreateExport) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateExport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateExportInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateExportInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteExport struct { +} + +func (*validateOpDeleteExport) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteExport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteExportInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteExportInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetExecution struct { +} + +func (*validateOpGetExecution) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetExecutionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetExecutionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetExport struct { +} + +func (*validateOpGetExport) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetExport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetExportInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetExportInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetTable struct { +} + +func (*validateOpGetTable) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetTableInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetTableInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListExecutions struct { +} + +func (*validateOpListExecutions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListExecutionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListExecutionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateExport struct { +} + +func (*validateOpUpdateExport) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateExport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateExportInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateExportInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateExportValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateExport{}, middleware.After) +} + +func addOpDeleteExportValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteExport{}, middleware.After) +} + +func addOpGetExecutionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetExecution{}, middleware.After) +} + +func addOpGetExportValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetExport{}, middleware.After) +} + +func addOpGetTableValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetTable{}, middleware.After) +} + +func addOpListExecutionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListExecutions{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + +func addOpUpdateExportValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateExport{}, middleware.After) +} + +func validateDataQuery(v *types.DataQuery) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DataQuery"} + if v.QueryStatement == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueryStatement")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateDestinationConfigurations(v *types.DestinationConfigurations) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DestinationConfigurations"} + if v.S3Destination == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3Destination")) + } else if v.S3Destination != nil { + if err := validateS3Destination(v.S3Destination); err != nil { + invalidParams.AddNested("S3Destination", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateExport(v *types.Export) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Export"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.DataQuery == nil { + invalidParams.Add(smithy.NewErrParamRequired("DataQuery")) + } else if v.DataQuery != nil { + if err := validateDataQuery(v.DataQuery); err != nil { + invalidParams.AddNested("DataQuery", err.(smithy.InvalidParamsError)) + } + } + if v.DestinationConfigurations == nil { + invalidParams.Add(smithy.NewErrParamRequired("DestinationConfigurations")) + } else if v.DestinationConfigurations != nil { + if err := validateDestinationConfigurations(v.DestinationConfigurations); err != nil { + invalidParams.AddNested("DestinationConfigurations", err.(smithy.InvalidParamsError)) + } + } + if v.RefreshCadence == nil { + invalidParams.Add(smithy.NewErrParamRequired("RefreshCadence")) + } else if v.RefreshCadence != nil { + if err := validateRefreshCadence(v.RefreshCadence); err != nil { + invalidParams.AddNested("RefreshCadence", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRefreshCadence(v *types.RefreshCadence) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RefreshCadence"} + if len(v.Frequency) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Frequency")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateResourceTag(v *types.ResourceTag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResourceTag"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateResourceTagList(v []types.ResourceTag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResourceTagList"} + for i := range v { + if err := validateResourceTag(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateS3Destination(v *types.S3Destination) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "S3Destination"} + if v.S3Bucket == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3Bucket")) + } + if v.S3Prefix == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3Prefix")) + } + if v.S3Region == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3Region")) + } + if v.S3OutputConfigurations == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3OutputConfigurations")) + } else if v.S3OutputConfigurations != nil { + if err := validateS3OutputConfigurations(v.S3OutputConfigurations); err != nil { + invalidParams.AddNested("S3OutputConfigurations", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateS3OutputConfigurations(v *types.S3OutputConfigurations) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "S3OutputConfigurations"} + if len(v.OutputType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("OutputType")) + } + if len(v.Format) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Format")) + } + if len(v.Compression) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Compression")) + } + if len(v.Overwrite) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Overwrite")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateExportInput(v *CreateExportInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateExportInput"} + if v.Export == nil { + invalidParams.Add(smithy.NewErrParamRequired("Export")) + } else if v.Export != nil { + if err := validateExport(v.Export); err != nil { + invalidParams.AddNested("Export", err.(smithy.InvalidParamsError)) + } + } + if v.ResourceTags != nil { + if err := validateResourceTagList(v.ResourceTags); err != nil { + invalidParams.AddNested("ResourceTags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteExportInput(v *DeleteExportInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteExportInput"} + if v.ExportArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExportArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetExecutionInput(v *GetExecutionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetExecutionInput"} + if v.ExportArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExportArn")) + } + if v.ExecutionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExecutionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetExportInput(v *GetExportInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetExportInput"} + if v.ExportArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExportArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetTableInput(v *GetTableInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetTableInput"} + if v.TableName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TableName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListExecutionsInput(v *ListExecutionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListExecutionsInput"} + if v.ExportArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExportArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.ResourceTags == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceTags")) + } else if v.ResourceTags != nil { + if err := validateResourceTagList(v.ResourceTags); err != nil { + invalidParams.AddNested("ResourceTags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.ResourceTagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceTagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateExportInput(v *UpdateExportInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateExportInput"} + if v.ExportArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExportArn")) + } + if v.Export == nil { + invalidParams.Add(smithy.NewErrParamRequired("Export")) + } else if v.Export != nil { + if err := validateExport(v.Export); err != nil { + invalidParams.AddNested("Export", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/cloudtrail/api_op_DeleteEventDataStore.go b/service/cloudtrail/api_op_DeleteEventDataStore.go index 9d0b80eca8d..6ebbac1d8c6 100644 --- a/service/cloudtrail/api_op_DeleteEventDataStore.go +++ b/service/cloudtrail/api_op_DeleteEventDataStore.go @@ -15,11 +15,12 @@ import ( // event data store ARN. After you run DeleteEventDataStore , the event data store // enters a PENDING_DELETION state, and is automatically deleted after a wait // period of seven days. TerminationProtectionEnabled must be set to False on the -// event data store; this operation cannot work if TerminationProtectionEnabled is -// True . After you run DeleteEventDataStore on an event data store, you cannot -// run ListQueries , DescribeQuery , or GetQueryResults on queries that are using -// an event data store in a PENDING_DELETION state. An event data store in the -// PENDING_DELETION state does not incur costs. +// event data store and the FederationStatus must be DISABLED . You cannot delete +// an event data store if TerminationProtectionEnabled is True or the +// FederationStatus is ENABLED . After you run DeleteEventDataStore on an event +// data store, you cannot run ListQueries , DescribeQuery , or GetQueryResults on +// queries that are using an event data store in a PENDING_DELETION state. An +// event data store in the PENDING_DELETION state does not incur costs. func (c *Client) DeleteEventDataStore(ctx context.Context, params *DeleteEventDataStoreInput, optFns ...func(*Options)) (*DeleteEventDataStoreOutput, error) { if params == nil { params = &DeleteEventDataStoreInput{} diff --git a/service/cloudtrail/api_op_DisableFederation.go b/service/cloudtrail/api_op_DisableFederation.go new file mode 100644 index 00000000000..e0663ec0a5d --- /dev/null +++ b/service/cloudtrail/api_op_DisableFederation.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudtrail + +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/cloudtrail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Disables Lake query federation on the specified event data store. When you +// disable federation, CloudTrail removes the metadata associated with the +// federated event data store in the Glue Data Catalog and removes registration for +// the federation role ARN and event data store in Lake Formation. No CloudTrail +// Lake data is deleted when you disable federation. +func (c *Client) DisableFederation(ctx context.Context, params *DisableFederationInput, optFns ...func(*Options)) (*DisableFederationOutput, error) { + if params == nil { + params = &DisableFederationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisableFederation", params, optFns, c.addOperationDisableFederationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisableFederationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisableFederationInput struct { + + // The ARN (or ID suffix of the ARN) of the event data store for which you want to + // disable Lake query federation. + // + // This member is required. + EventDataStore *string + + noSmithyDocumentSerde +} + +type DisableFederationOutput struct { + + // The ARN of the event data store for which you disabled Lake query federation. + EventDataStoreArn *string + + // The federation status. + FederationStatus types.FederationStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDisableFederationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisableFederation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisableFederation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DisableFederation"); 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 = addOpDisableFederationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableFederation(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_opDisableFederation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DisableFederation", + } +} diff --git a/service/cloudtrail/api_op_EnableFederation.go b/service/cloudtrail/api_op_EnableFederation.go new file mode 100644 index 00000000000..604deff07ab --- /dev/null +++ b/service/cloudtrail/api_op_EnableFederation.go @@ -0,0 +1,166 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudtrail + +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/cloudtrail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Enables Lake query federation on the specified event data store. Federating an +// event data store lets you view the metadata associated with the event data store +// in the Glue Data Catalog (https://docs.aws.amazon.com/glue/latest/dg/components-overview.html#data-catalog-intro) +// and run SQL queries against your event data using Amazon Athena. The table +// metadata stored in the Glue Data Catalog lets the Athena query engine know how +// to find, read, and process the data that you want to query. When you enable Lake +// query federation, CloudTrail creates a federated database named aws:cloudtrail +// (if the database doesn't already exist) and a federated table in the Glue Data +// Catalog. The event data store ID is used for the table name. CloudTrail +// registers the role ARN and event data store in Lake Formation (https://docs.aws.amazon.com/lake-formation/latest/dg/how-it-works.html) +// , the service responsible for revoking or granting permissions to the federated +// resources in the Glue Data Catalog. For more information about Lake query +// federation, see Federate an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-federation.html) +// . +func (c *Client) EnableFederation(ctx context.Context, params *EnableFederationInput, optFns ...func(*Options)) (*EnableFederationOutput, error) { + if params == nil { + params = &EnableFederationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "EnableFederation", params, optFns, c.addOperationEnableFederationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*EnableFederationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type EnableFederationInput struct { + + // The ARN (or ID suffix of the ARN) of the event data store for which you want to + // enable Lake query federation. + // + // This member is required. + EventDataStore *string + + // The ARN of the federation role to use for the event data store. Amazon Web + // Services services like Lake Formation use this federation role to access data + // for the federated event data store. The federation role must exist in your + // account and provide the required minimum permissions (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-federation.html#query-federation-permissions-role) + // . + // + // This member is required. + FederationRoleArn *string + + noSmithyDocumentSerde +} + +type EnableFederationOutput struct { + + // The ARN of the event data store for which you enabled Lake query federation. + EventDataStoreArn *string + + // The ARN of the federation role. + FederationRoleArn *string + + // The federation status. + FederationStatus types.FederationStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationEnableFederationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpEnableFederation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpEnableFederation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "EnableFederation"); 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 = addOpEnableFederationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableFederation(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_opEnableFederation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "EnableFederation", + } +} diff --git a/service/cloudtrail/api_op_GetEventDataStore.go b/service/cloudtrail/api_op_GetEventDataStore.go index ba1c9a4daec..6a694429673 100644 --- a/service/cloudtrail/api_op_GetEventDataStore.go +++ b/service/cloudtrail/api_op_GetEventDataStore.go @@ -55,6 +55,16 @@ type GetEventDataStoreOutput struct { // The event data store Amazon Resource Number (ARN). EventDataStoreArn *string + // If Lake query federation is enabled, provides the ARN of the federation role + // used to access the resources for the federated event data store. + FederationRoleArn *string + + // Indicates the Lake query federation (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-federation.html) + // status. The status is ENABLED if Lake query federation is enabled, or DISABLED + // if Lake query federation is disabled. You cannot delete an event data store if + // the FederationStatus is ENABLED . + FederationStatus types.FederationStatus + // Specifies the KMS key ID that encrypts the events delivered by CloudTrail. The // value is a fully specified ARN to a KMS key in the following format. // arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 diff --git a/service/cloudtrail/api_op_UpdateEventDataStore.go b/service/cloudtrail/api_op_UpdateEventDataStore.go index 332da481c53..293cedba35d 100644 --- a/service/cloudtrail/api_op_UpdateEventDataStore.go +++ b/service/cloudtrail/api_op_UpdateEventDataStore.go @@ -138,6 +138,16 @@ type UpdateEventDataStoreOutput struct { // The ARN of the event data store. EventDataStoreArn *string + // If Lake query federation is enabled, provides the ARN of the federation role + // used to access the resources for the federated event data store. + FederationRoleArn *string + + // Indicates the Lake query federation (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-federation.html) + // status. The status is ENABLED if Lake query federation is enabled, or DISABLED + // if Lake query federation is disabled. You cannot delete an event data store if + // the FederationStatus is ENABLED . + FederationStatus types.FederationStatus + // Specifies the KMS key ID that encrypts the events delivered by CloudTrail. The // value is a fully specified ARN to a KMS key in the following format. // arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 diff --git a/service/cloudtrail/deserializers.go b/service/cloudtrail/deserializers.go index 97681254777..ec859e5a7ca 100644 --- a/service/cloudtrail/deserializers.go +++ b/service/cloudtrail/deserializers.go @@ -1045,9 +1045,15 @@ func awsAwsjson11_deserializeOpErrorDeleteEventDataStore(response *smithyhttp.Re case strings.EqualFold("ChannelExistsForEDSException", errorCode): return awsAwsjson11_deserializeErrorChannelExistsForEDSException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("EventDataStoreARNInvalidException", errorCode): return awsAwsjson11_deserializeErrorEventDataStoreARNInvalidException(response, errorBody) + case strings.EqualFold("EventDataStoreFederationEnabledException", errorCode): + return awsAwsjson11_deserializeErrorEventDataStoreFederationEnabledException(response, errorBody) + case strings.EqualFold("EventDataStoreHasOngoingImportException", errorCode): return awsAwsjson11_deserializeErrorEventDataStoreHasOngoingImportException(response, errorBody) @@ -1748,6 +1754,309 @@ func awsAwsjson11_deserializeOpErrorDescribeTrails(response *smithyhttp.Response } } +type awsAwsjson11_deserializeOpDisableFederation struct { +} + +func (*awsAwsjson11_deserializeOpDisableFederation) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDisableFederation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDisableFederation(response, &metadata) + } + output := &DisableFederationOutput{} + 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_deserializeOpDocumentDisableFederationOutput(&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_deserializeOpErrorDisableFederation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("CloudTrailAccessNotEnabledException", errorCode): + return awsAwsjson11_deserializeErrorCloudTrailAccessNotEnabledException(response, errorBody) + + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("EventDataStoreARNInvalidException", errorCode): + return awsAwsjson11_deserializeErrorEventDataStoreARNInvalidException(response, errorBody) + + case strings.EqualFold("EventDataStoreNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEventDataStoreNotFoundException(response, errorBody) + + case strings.EqualFold("InactiveEventDataStoreException", errorCode): + return awsAwsjson11_deserializeErrorInactiveEventDataStoreException(response, errorBody) + + case strings.EqualFold("InsufficientDependencyServiceAccessPermissionException", errorCode): + return awsAwsjson11_deserializeErrorInsufficientDependencyServiceAccessPermissionException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("NoManagementAccountSLRExistsException", errorCode): + return awsAwsjson11_deserializeErrorNoManagementAccountSLRExistsException(response, errorBody) + + case strings.EqualFold("NotOrganizationMasterAccountException", errorCode): + return awsAwsjson11_deserializeErrorNotOrganizationMasterAccountException(response, errorBody) + + case strings.EqualFold("OperationNotPermittedException", errorCode): + return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) + + case strings.EqualFold("OrganizationNotInAllFeaturesModeException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotInAllFeaturesModeException(response, errorBody) + + case strings.EqualFold("OrganizationsNotInUseException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationsNotInUseException(response, errorBody) + + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpEnableFederation struct { +} + +func (*awsAwsjson11_deserializeOpEnableFederation) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpEnableFederation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorEnableFederation(response, &metadata) + } + output := &EnableFederationOutput{} + 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_deserializeOpDocumentEnableFederationOutput(&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_deserializeOpErrorEnableFederation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("CloudTrailAccessNotEnabledException", errorCode): + return awsAwsjson11_deserializeErrorCloudTrailAccessNotEnabledException(response, errorBody) + + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("EventDataStoreARNInvalidException", errorCode): + return awsAwsjson11_deserializeErrorEventDataStoreARNInvalidException(response, errorBody) + + case strings.EqualFold("EventDataStoreFederationEnabledException", errorCode): + return awsAwsjson11_deserializeErrorEventDataStoreFederationEnabledException(response, errorBody) + + case strings.EqualFold("EventDataStoreNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEventDataStoreNotFoundException(response, errorBody) + + case strings.EqualFold("InactiveEventDataStoreException", errorCode): + return awsAwsjson11_deserializeErrorInactiveEventDataStoreException(response, errorBody) + + case strings.EqualFold("InsufficientDependencyServiceAccessPermissionException", errorCode): + return awsAwsjson11_deserializeErrorInsufficientDependencyServiceAccessPermissionException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("NoManagementAccountSLRExistsException", errorCode): + return awsAwsjson11_deserializeErrorNoManagementAccountSLRExistsException(response, errorBody) + + case strings.EqualFold("NotOrganizationMasterAccountException", errorCode): + return awsAwsjson11_deserializeErrorNotOrganizationMasterAccountException(response, errorBody) + + case strings.EqualFold("OperationNotPermittedException", errorCode): + return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) + + case strings.EqualFold("OrganizationNotInAllFeaturesModeException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotInAllFeaturesModeException(response, errorBody) + + case strings.EqualFold("OrganizationsNotInUseException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationsNotInUseException(response, errorBody) + + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpGetChannel struct { } @@ -6374,6 +6683,41 @@ func awsAwsjson11_deserializeOpErrorUpdateTrail(response *smithyhttp.Response, m } } +func awsAwsjson11_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.AccessDeniedException{} + err := awsAwsjson11_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson11_deserializeErrorAccountHasOngoingImportException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6812,8 +7156,78 @@ func awsAwsjson11_deserializeErrorCloudTrailInvalidClientTokenIdException(respon return err } - output := &types.CloudTrailInvalidClientTokenIdException{} - err := awsAwsjson11_deserializeDocumentCloudTrailInvalidClientTokenIdException(&output, shape) + output := &types.CloudTrailInvalidClientTokenIdException{} + err := awsAwsjson11_deserializeDocumentCloudTrailInvalidClientTokenIdException(&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_deserializeErrorCloudWatchLogsDeliveryUnavailableException(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.CloudWatchLogsDeliveryUnavailableException{} + err := awsAwsjson11_deserializeDocumentCloudWatchLogsDeliveryUnavailableException(&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_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 := awsAwsjson11_deserializeDocumentConcurrentModificationException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6829,7 +7243,7 @@ func awsAwsjson11_deserializeErrorCloudTrailInvalidClientTokenIdException(respon return output } -func awsAwsjson11_deserializeErrorCloudWatchLogsDeliveryUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6847,8 +7261,8 @@ func awsAwsjson11_deserializeErrorCloudWatchLogsDeliveryUnavailableException(res return err } - output := &types.CloudWatchLogsDeliveryUnavailableException{} - err := awsAwsjson11_deserializeDocumentCloudWatchLogsDeliveryUnavailableException(&output, shape) + output := &types.ConflictException{} + err := awsAwsjson11_deserializeDocumentConflictException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6864,7 +7278,7 @@ func awsAwsjson11_deserializeErrorCloudWatchLogsDeliveryUnavailableException(res return output } -func awsAwsjson11_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorDelegatedAdminAccountLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6882,8 +7296,8 @@ func awsAwsjson11_deserializeErrorConflictException(response *smithyhttp.Respons return err } - output := &types.ConflictException{} - err := awsAwsjson11_deserializeDocumentConflictException(&output, shape) + output := &types.DelegatedAdminAccountLimitExceededException{} + err := awsAwsjson11_deserializeDocumentDelegatedAdminAccountLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6899,7 +7313,7 @@ func awsAwsjson11_deserializeErrorConflictException(response *smithyhttp.Respons return output } -func awsAwsjson11_deserializeErrorDelegatedAdminAccountLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorEventDataStoreAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6917,8 +7331,8 @@ func awsAwsjson11_deserializeErrorDelegatedAdminAccountLimitExceededException(re return err } - output := &types.DelegatedAdminAccountLimitExceededException{} - err := awsAwsjson11_deserializeDocumentDelegatedAdminAccountLimitExceededException(&output, shape) + output := &types.EventDataStoreAlreadyExistsException{} + err := awsAwsjson11_deserializeDocumentEventDataStoreAlreadyExistsException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6934,7 +7348,7 @@ func awsAwsjson11_deserializeErrorDelegatedAdminAccountLimitExceededException(re return output } -func awsAwsjson11_deserializeErrorEventDataStoreAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorEventDataStoreARNInvalidException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6952,8 +7366,8 @@ func awsAwsjson11_deserializeErrorEventDataStoreAlreadyExistsException(response return err } - output := &types.EventDataStoreAlreadyExistsException{} - err := awsAwsjson11_deserializeDocumentEventDataStoreAlreadyExistsException(&output, shape) + output := &types.EventDataStoreARNInvalidException{} + err := awsAwsjson11_deserializeDocumentEventDataStoreARNInvalidException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6969,7 +7383,7 @@ func awsAwsjson11_deserializeErrorEventDataStoreAlreadyExistsException(response return output } -func awsAwsjson11_deserializeErrorEventDataStoreARNInvalidException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorEventDataStoreFederationEnabledException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6987,8 +7401,8 @@ func awsAwsjson11_deserializeErrorEventDataStoreARNInvalidException(response *sm return err } - output := &types.EventDataStoreARNInvalidException{} - err := awsAwsjson11_deserializeDocumentEventDataStoreARNInvalidException(&output, shape) + output := &types.EventDataStoreFederationEnabledException{} + err := awsAwsjson11_deserializeDocumentEventDataStoreFederationEnabledException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -9174,6 +9588,46 @@ func awsAwsjson11_deserializeErrorUnsupportedOperationException(response *smithy return output } +func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentAccountHasOngoingImportException(v **types.AccountHasOngoingImportException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10000,6 +10454,46 @@ func awsAwsjson11_deserializeDocumentCloudWatchLogsDeliveryUnavailableException( return nil } +func awsAwsjson11_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 awsAwsjson11_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10608,6 +11102,46 @@ func awsAwsjson11_deserializeDocumentEventDataStoreARNInvalidException(v **types return nil } +func awsAwsjson11_deserializeDocumentEventDataStoreFederationEnabledException(v **types.EventDataStoreFederationEnabledException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EventDataStoreFederationEnabledException + if *v == nil { + sv = &types.EventDataStoreFederationEnabledException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentEventDataStoreHasOngoingImportException(v **types.EventDataStoreHasOngoingImportException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15761,6 +16295,113 @@ func awsAwsjson11_deserializeOpDocumentDescribeTrailsOutput(v **DescribeTrailsOu return nil } +func awsAwsjson11_deserializeOpDocumentDisableFederationOutput(v **DisableFederationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DisableFederationOutput + if *v == nil { + sv = &DisableFederationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EventDataStoreArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventDataStoreArn to be of type string, got %T instead", value) + } + sv.EventDataStoreArn = ptr.String(jtv) + } + + case "FederationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FederationStatus to be of type string, got %T instead", value) + } + sv.FederationStatus = types.FederationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentEnableFederationOutput(v **EnableFederationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *EnableFederationOutput + if *v == nil { + sv = &EnableFederationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EventDataStoreArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventDataStoreArn to be of type string, got %T instead", value) + } + sv.EventDataStoreArn = ptr.String(jtv) + } + + case "FederationRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FederationRoleArn to be of type string, got %T instead", value) + } + sv.FederationRoleArn = ptr.String(jtv) + } + + case "FederationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FederationStatus to be of type string, got %T instead", value) + } + sv.FederationStatus = types.FederationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentGetChannelOutput(v **GetChannelOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15895,6 +16536,24 @@ func awsAwsjson11_deserializeOpDocumentGetEventDataStoreOutput(v **GetEventDataS sv.EventDataStoreArn = ptr.String(jtv) } + case "FederationRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FederationRoleArn to be of type string, got %T instead", value) + } + sv.FederationRoleArn = ptr.String(jtv) + } + + case "FederationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FederationStatus to be of type string, got %T instead", value) + } + sv.FederationStatus = types.FederationStatus(jtv) + } + case "KmsKeyId": if value != nil { jtv, ok := value.(string) @@ -17928,6 +18587,24 @@ func awsAwsjson11_deserializeOpDocumentUpdateEventDataStoreOutput(v **UpdateEven sv.EventDataStoreArn = ptr.String(jtv) } + case "FederationRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FederationRoleArn to be of type string, got %T instead", value) + } + sv.FederationRoleArn = ptr.String(jtv) + } + + case "FederationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FederationStatus to be of type string, got %T instead", value) + } + sv.FederationStatus = types.FederationStatus(jtv) + } + case "KmsKeyId": if value != nil { jtv, ok := value.(string) diff --git a/service/cloudtrail/generated.json b/service/cloudtrail/generated.json index 508b356a59b..cd4b82b762a 100644 --- a/service/cloudtrail/generated.json +++ b/service/cloudtrail/generated.json @@ -21,6 +21,8 @@ "api_op_DeregisterOrganizationDelegatedAdmin.go", "api_op_DescribeQuery.go", "api_op_DescribeTrails.go", + "api_op_DisableFederation.go", + "api_op_EnableFederation.go", "api_op_GetChannel.go", "api_op_GetEventDataStore.go", "api_op_GetEventSelectors.go", diff --git a/service/cloudtrail/serializers.go b/service/cloudtrail/serializers.go index 19f8830f053..f9746e098de 100644 --- a/service/cloudtrail/serializers.go +++ b/service/cloudtrail/serializers.go @@ -676,6 +676,116 @@ func (m *awsAwsjson11_serializeOpDescribeTrails) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDisableFederation struct { +} + +func (*awsAwsjson11_serializeOpDisableFederation) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDisableFederation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisableFederationInput) + _ = 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("CloudTrail_20131101.DisableFederation") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDisableFederationInput(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_serializeOpEnableFederation struct { +} + +func (*awsAwsjson11_serializeOpEnableFederation) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpEnableFederation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*EnableFederationInput) + _ = 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("CloudTrail_20131101.EnableFederation") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentEnableFederationInput(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_serializeOpGetChannel struct { } @@ -3246,6 +3356,35 @@ func awsAwsjson11_serializeOpDocumentDescribeTrailsInput(v *DescribeTrailsInput, return nil } +func awsAwsjson11_serializeOpDocumentDisableFederationInput(v *DisableFederationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EventDataStore != nil { + ok := object.Key("EventDataStore") + ok.String(*v.EventDataStore) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentEnableFederationInput(v *EnableFederationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EventDataStore != nil { + ok := object.Key("EventDataStore") + ok.String(*v.EventDataStore) + } + + if v.FederationRoleArn != nil { + ok := object.Key("FederationRoleArn") + ok.String(*v.FederationRoleArn) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetChannelInput(v *GetChannelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/cloudtrail/types/enums.go b/service/cloudtrail/types/enums.go index f4c417cfdae..26af3c4c99a 100644 --- a/service/cloudtrail/types/enums.go +++ b/service/cloudtrail/types/enums.go @@ -112,6 +112,28 @@ func (EventDataStoreStatus) Values() []EventDataStoreStatus { } } +type FederationStatus string + +// Enum values for FederationStatus +const ( + FederationStatusEnabling FederationStatus = "ENABLING" + FederationStatusEnabled FederationStatus = "ENABLED" + FederationStatusDisabling FederationStatus = "DISABLING" + FederationStatusDisabled FederationStatus = "DISABLED" +) + +// Values returns all known values for FederationStatus. 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 (FederationStatus) Values() []FederationStatus { + return []FederationStatus{ + "ENABLING", + "ENABLED", + "DISABLING", + "DISABLED", + } +} + type ImportFailureStatus string // Enum values for ImportFailureStatus diff --git a/service/cloudtrail/types/errors.go b/service/cloudtrail/types/errors.go index 2646ba01309..be0c03a1c28 100644 --- a/service/cloudtrail/types/errors.go +++ b/service/cloudtrail/types/errors.go @@ -7,6 +7,32 @@ 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 } + // This exception is thrown when you start a new import and a previous import is // still in progress. type AccountHasOngoingImportException struct { @@ -398,6 +424,34 @@ func (e *CloudWatchLogsDeliveryUnavailableException) ErrorFault() smithy.ErrorFa return smithy.FaultClient } +// You are trying to update a resource when another request is in progress. Allow +// sufficient wait time for the previous request to complete, then retry your +// request. +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 } + // This exception is thrown when the specified resource is not ready for an // operation. This can occur when you try to run an operation on a resource before // CloudTrail has time to fully load the resource, or because another operation is @@ -512,6 +566,36 @@ func (e *EventDataStoreARNInvalidException) ErrorCode() string { } func (e *EventDataStoreARNInvalidException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// You cannot delete the event data store because Lake query federation is +// enabled. To delete the event data store, run the DisableFederation operation to +// disable Lake query federation on the event data store. +type EventDataStoreFederationEnabledException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *EventDataStoreFederationEnabledException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *EventDataStoreFederationEnabledException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *EventDataStoreFederationEnabledException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "EventDataStoreFederationEnabledException" + } + return *e.ErrorCodeOverride +} +func (e *EventDataStoreFederationEnabledException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + // This exception is thrown when you try to update or delete an event data store // that currently has an import in progress. type EventDataStoreHasOngoingImportException struct { diff --git a/service/cloudtrail/validators.go b/service/cloudtrail/validators.go index 76a32400c82..bddada23f99 100644 --- a/service/cloudtrail/validators.go +++ b/service/cloudtrail/validators.go @@ -210,6 +210,46 @@ func (m *validateOpDeregisterOrganizationDelegatedAdmin) HandleInitialize(ctx co return next.HandleInitialize(ctx, in) } +type validateOpDisableFederation struct { +} + +func (*validateOpDisableFederation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisableFederation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisableFederationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisableFederationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpEnableFederation struct { +} + +func (*validateOpEnableFederation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpEnableFederation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*EnableFederationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpEnableFederationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetChannel struct { } @@ -790,6 +830,14 @@ func addOpDeregisterOrganizationDelegatedAdminValidationMiddleware(stack *middle return stack.Initialize.Add(&validateOpDeregisterOrganizationDelegatedAdmin{}, middleware.After) } +func addOpDisableFederationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisableFederation{}, middleware.After) +} + +func addOpEnableFederationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpEnableFederation{}, middleware.After) +} + func addOpGetChannelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetChannel{}, middleware.After) } @@ -1298,6 +1346,39 @@ func validateOpDeregisterOrganizationDelegatedAdminInput(v *DeregisterOrganizati } } +func validateOpDisableFederationInput(v *DisableFederationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisableFederationInput"} + if v.EventDataStore == nil { + invalidParams.Add(smithy.NewErrParamRequired("EventDataStore")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpEnableFederationInput(v *EnableFederationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EnableFederationInput"} + if v.EventDataStore == nil { + invalidParams.Add(smithy.NewErrParamRequired("EventDataStore")) + } + if v.FederationRoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("FederationRoleArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetChannelInput(v *GetChannelInput) error { if v == nil { return nil diff --git a/service/cloudwatchlogs/api_op_CreateDelivery.go b/service/cloudwatchlogs/api_op_CreateDelivery.go index 3d17028f56e..4feedcd71dd 100644 --- a/service/cloudwatchlogs/api_op_CreateDelivery.go +++ b/service/cloudwatchlogs/api_op_CreateDelivery.go @@ -16,7 +16,7 @@ import ( // source and a logical delivery destination that you have already created. Only // some Amazon Web Services services support being configured as a delivery source // using this operation. These services are listed as Supported [V2 Permissions] in -// the table at Enabling logging from Amazon Web Services services. (https://docs.aws.amazon.com/ AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-vended-logs-permissions) +// the table at Enabling logging from Amazon Web Services services. (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html) // A delivery destination can represent a log group in CloudWatch Logs, an Amazon // S3 bucket, or a delivery stream in Kinesis Data Firehose. To configure logs // delivery between a supported Amazon Web Services service and a destination, you diff --git a/service/cloudwatchlogs/api_op_CreateLogAnomalyDetector.go b/service/cloudwatchlogs/api_op_CreateLogAnomalyDetector.go new file mode 100644 index 00000000000..fb82b513a6d --- /dev/null +++ b/service/cloudwatchlogs/api_op_CreateLogAnomalyDetector.go @@ -0,0 +1,193 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +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/cloudwatchlogs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an anomaly detector that regularly scans one or more log groups and +// look for patterns and anomalies in the logs. An anomaly detector can help +// surface issues by automatically discovering anomalies in your log event traffic. +// An anomaly detector uses machine learning algorithms to scan log events and find +// patterns. A pattern is a shared text structure that recurs among your log +// fields. Patterns provide a useful tool for analyzing large sets of logs because +// a large number of log events can often be compressed into a few patterns. The +// anomaly detector uses pattern recognition to find anomalies , which are unusual +// log events. It uses the evaluationFrequency to compare current log events and +// patterns with trained baselines. Fields within a pattern are called tokens. +// Fields that vary within a pattern, such as a request ID or timestamp, are +// referred to as dynamic tokens and represented by <> . The following is an +// example of a pattern: [INFO] Request time: < > ms This pattern represents log +// events like [INFO] Request time: 327 ms and other similar log events that +// differ only by the number, in this csse 327. When the pattern is displayed, the +// different numbers are replaced by <*> Any parts of log events that are masked +// as sensitive data are not scanned for anomalies. For more information about +// masking sensitive data, see Help protect sensitive log data with masking (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html) +// . +func (c *Client) CreateLogAnomalyDetector(ctx context.Context, params *CreateLogAnomalyDetectorInput, optFns ...func(*Options)) (*CreateLogAnomalyDetectorOutput, error) { + if params == nil { + params = &CreateLogAnomalyDetectorInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateLogAnomalyDetector", params, optFns, c.addOperationCreateLogAnomalyDetectorMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateLogAnomalyDetectorOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateLogAnomalyDetectorInput struct { + + // An array containing the ARNs of the log groups that this anomaly detector will + // watch. You must specify at least one ARN. + // + // This member is required. + LogGroupArnList []string + + // The number of days to have visibility on an anomaly. After this time period has + // elapsed for an anomaly, it will be automatically baselined and the anomaly + // detector will treat new occurrences of a similar anomaly as normal. Therefore, + // if you do not correct the cause of an anomaly during the time period specified + // in anomalyVisibilityTime , it will be considered normal going forward and will + // not be detected as an anomaly. + AnomalyVisibilityTime *int64 + + // A name for this anomaly detector. + DetectorName *string + + // Specifies how often the anomaly detector is to run and look for anomalies. Set + // this value according to the frequency that the log group receives new logs. For + // example, if the log group receives new log events every 10 minutes, then 15 + // minutes might be a good setting for evaluationFrequency . + EvaluationFrequency types.EvaluationFrequency + + // You can use this parameter to limit the anomaly detection model to examine only + // log events that match the pattern you specify here. For more information, see + // Filter and Pattern Syntax (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html) + // . + FilterPattern *string + + // Optionally assigns a KMS key to secure this anomaly detector and its findings. + // If a key is assigned, the anomalies found and the model used by this detector + // are encrypted at rest with the key. If a key is assigned to an anomaly detector, + // a user must have permissions for both this key and for the anomaly detector to + // retrieve information about the anomalies that it finds. For more information + // about using a KMS key and to see the required IAM policy, see Use a KMS key + // with an anomaly detector (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/LogsAnomalyDetection-KMS.html) + // . + KmsKeyId *string + + // An optional list of key-value pairs to associate with the resource. For more + // information about tagging, see Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateLogAnomalyDetectorOutput struct { + + // The ARN of the log anomaly detector that you just created. + AnomalyDetectorArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateLogAnomalyDetectorMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateLogAnomalyDetector{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateLogAnomalyDetector{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateLogAnomalyDetector"); 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 = addOpCreateLogAnomalyDetectorValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLogAnomalyDetector(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_opCreateLogAnomalyDetector(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateLogAnomalyDetector", + } +} diff --git a/service/cloudwatchlogs/api_op_CreateLogGroup.go b/service/cloudwatchlogs/api_op_CreateLogGroup.go index 7c88a299860..b4fa818ba3a 100644 --- a/service/cloudwatchlogs/api_op_CreateLogGroup.go +++ b/service/cloudwatchlogs/api_op_CreateLogGroup.go @@ -7,6 +7,7 @@ import ( "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -50,7 +51,7 @@ func (c *Client) CreateLogGroup(ctx context.Context, params *CreateLogGroupInput type CreateLogGroupInput struct { - // The name of the log group. + // A name for the log group. // // This member is required. LogGroupName *string @@ -60,6 +61,15 @@ type CreateLogGroupInput struct { // . KmsKeyId *string + // Use this parameter to specify the log group class for this log group. There are + // two classes: + // - The Standard log class supports all CloudWatch Logs features. + // - The Infrequent Access log class supports a subset of CloudWatch Logs + // features and incurs lower costs. + // If you omit this parameter, the default of STANDARD is used. For details about + // the features supported by each class, see Log classes (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html) + LogGroupClass types.LogGroupClass + // The key-value pairs to use for the tags. You can grant users access to certain // log groups while preventing them from accessing other log groups. To do so, tag // your groups and use IAM policies that refer to those tags. To assign tags when diff --git a/service/cloudwatchlogs/api_op_DeleteLogAnomalyDetector.go b/service/cloudwatchlogs/api_op_DeleteLogAnomalyDetector.go new file mode 100644 index 00000000000..c565489e069 --- /dev/null +++ b/service/cloudwatchlogs/api_op_DeleteLogAnomalyDetector.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +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 specified CloudWatch Logs anomaly detector. +func (c *Client) DeleteLogAnomalyDetector(ctx context.Context, params *DeleteLogAnomalyDetectorInput, optFns ...func(*Options)) (*DeleteLogAnomalyDetectorOutput, error) { + if params == nil { + params = &DeleteLogAnomalyDetectorInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteLogAnomalyDetector", params, optFns, c.addOperationDeleteLogAnomalyDetectorMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteLogAnomalyDetectorOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteLogAnomalyDetectorInput struct { + + // The ARN of the anomaly detector to delete. You can find the ARNs of log anomaly + // detectors in your account by using the ListLogAnomalyDetectors (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListLogAnomalyDetectors.html) + // operation. + // + // This member is required. + AnomalyDetectorArn *string + + noSmithyDocumentSerde +} + +type DeleteLogAnomalyDetectorOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteLogAnomalyDetectorMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteLogAnomalyDetector{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteLogAnomalyDetector{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteLogAnomalyDetector"); 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 = addOpDeleteLogAnomalyDetectorValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLogAnomalyDetector(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_opDeleteLogAnomalyDetector(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteLogAnomalyDetector", + } +} diff --git a/service/cloudwatchlogs/api_op_DescribeLogGroups.go b/service/cloudwatchlogs/api_op_DescribeLogGroups.go index 8a6aefa0d88..ae2e087e9f9 100644 --- a/service/cloudwatchlogs/api_op_DescribeLogGroups.go +++ b/service/cloudwatchlogs/api_op_DescribeLogGroups.go @@ -56,6 +56,13 @@ type DescribeLogGroupsInput struct { // is up to 50 items. Limit *int32 + // Specifies the log group class for this log group. There are two classes: + // - The Standard log class supports all CloudWatch Logs features. + // - The Infrequent Access log class supports a subset of CloudWatch Logs + // features and incurs lower costs. + // For details about the features supported by each class, see Log classes (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html) + LogGroupClass types.LogGroupClass + // If you specify a string for this parameter, the operation returns only log // groups that have names that match the string based on a case-sensitive substring // search. For example, if you specify Foo , log groups named FooBar , aws/Foo , diff --git a/service/cloudwatchlogs/api_op_GetLogAnomalyDetector.go b/service/cloudwatchlogs/api_op_GetLogAnomalyDetector.go new file mode 100644 index 00000000000..063b39544d6 --- /dev/null +++ b/service/cloudwatchlogs/api_op_GetLogAnomalyDetector.go @@ -0,0 +1,175 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +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/cloudwatchlogs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves information about the log anomaly detector that you specify. +func (c *Client) GetLogAnomalyDetector(ctx context.Context, params *GetLogAnomalyDetectorInput, optFns ...func(*Options)) (*GetLogAnomalyDetectorOutput, error) { + if params == nil { + params = &GetLogAnomalyDetectorInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetLogAnomalyDetector", params, optFns, c.addOperationGetLogAnomalyDetectorMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetLogAnomalyDetectorOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetLogAnomalyDetectorInput struct { + + // The ARN of the anomaly detector to retrieve information about. You can find the + // ARNs of log anomaly detectors in your account by using the + // ListLogAnomalyDetectors (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListLogAnomalyDetectors.html) + // operation. + // + // This member is required. + AnomalyDetectorArn *string + + noSmithyDocumentSerde +} + +type GetLogAnomalyDetectorOutput struct { + + // Specifies whether the anomaly detector is currently active. To change its + // status, use the enabled parameter in the UpdateLogAnomalyDetector (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_UpdateLogAnomalyDetector.html) + // operation. + AnomalyDetectorStatus types.AnomalyDetectorStatus + + // The number of days used as the life cycle of anomalies. After this time, + // anomalies are automatically baselined and the anomaly detector model will treat + // new occurrences of similar event as normal. + AnomalyVisibilityTime *int64 + + // The date and time when this anomaly detector was created. + CreationTimeStamp int64 + + // The name of the log anomaly detector + DetectorName *string + + // Specifies how often the anomaly detector runs and look for anomalies. Set this + // value according to the frequency that the log group receives new logs. For + // example, if the log group receives new log events every 10 minutes, then setting + // evaluationFrequency to FIFTEEN_MIN might be appropriate. + EvaluationFrequency types.EvaluationFrequency + + // A symbolic description of how CloudWatch Logs should interpret the data in each + // log event. For example, a log event can contain timestamps, IP addresses, + // strings, and so on. You use the filter pattern to specify what to look for in + // the log event message. + FilterPattern *string + + // The ID of the KMS key assigned to this anomaly detector, if any. + KmsKeyId *string + + // The date and time when this anomaly detector was most recently modified. + LastModifiedTimeStamp int64 + + // An array of structures, where each structure contains the ARN of a log group + // associated with this anomaly detector. + LogGroupArnList []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetLogAnomalyDetectorMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetLogAnomalyDetector{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetLogAnomalyDetector{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetLogAnomalyDetector"); 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 = addOpGetLogAnomalyDetectorValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLogAnomalyDetector(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_opGetLogAnomalyDetector(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetLogAnomalyDetector", + } +} diff --git a/service/cloudwatchlogs/api_op_ListAnomalies.go b/service/cloudwatchlogs/api_op_ListAnomalies.go new file mode 100644 index 00000000000..39618bb7aed --- /dev/null +++ b/service/cloudwatchlogs/api_op_ListAnomalies.go @@ -0,0 +1,240 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +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/cloudwatchlogs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of anomalies that log anomaly detectors have found. For details +// about the structure format of each anomaly object that is returned, see the +// example in this section. +func (c *Client) ListAnomalies(ctx context.Context, params *ListAnomaliesInput, optFns ...func(*Options)) (*ListAnomaliesOutput, error) { + if params == nil { + params = &ListAnomaliesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAnomalies", params, optFns, c.addOperationListAnomaliesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAnomaliesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAnomaliesInput struct { + + // Use this to optionally limit the results to only the anomalies found by a + // certain anomaly detector. + AnomalyDetectorArn *string + + // The maximum number of items to return. If you don't specify a value, the + // default maximum value of 50 items is used. + Limit *int32 + + // The token for the next set of items to return. The token expires after 24 hours. + NextToken *string + + // You can specify this parameter if you want to the operation to return only + // anomalies that are currently either suppressed or unsuppressed. + SuppressionState types.SuppressionState + + noSmithyDocumentSerde +} + +type ListAnomaliesOutput struct { + + // An array of structures, where each structure contains information about one + // anomaly that a log anomaly detector has found. + Anomalies []types.Anomaly + + // The token for the next set of items to return. The token expires after 24 hours. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAnomaliesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAnomalies{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAnomalies{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAnomalies"); 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_opListAnomalies(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 +} + +// ListAnomaliesAPIClient is a client that implements the ListAnomalies operation. +type ListAnomaliesAPIClient interface { + ListAnomalies(context.Context, *ListAnomaliesInput, ...func(*Options)) (*ListAnomaliesOutput, error) +} + +var _ ListAnomaliesAPIClient = (*Client)(nil) + +// ListAnomaliesPaginatorOptions is the paginator options for ListAnomalies +type ListAnomaliesPaginatorOptions struct { + // The maximum number of items to return. If you don't specify a value, the + // default maximum value of 50 items is used. + 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 +} + +// ListAnomaliesPaginator is a paginator for ListAnomalies +type ListAnomaliesPaginator struct { + options ListAnomaliesPaginatorOptions + client ListAnomaliesAPIClient + params *ListAnomaliesInput + nextToken *string + firstPage bool +} + +// NewListAnomaliesPaginator returns a new ListAnomaliesPaginator +func NewListAnomaliesPaginator(client ListAnomaliesAPIClient, params *ListAnomaliesInput, optFns ...func(*ListAnomaliesPaginatorOptions)) *ListAnomaliesPaginator { + if params == nil { + params = &ListAnomaliesInput{} + } + + options := ListAnomaliesPaginatorOptions{} + if params.Limit != nil { + options.Limit = *params.Limit + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAnomaliesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAnomaliesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAnomalies page. +func (p *ListAnomaliesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAnomaliesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.Limit = limit + + result, err := p.client.ListAnomalies(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_opListAnomalies(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListAnomalies", + } +} diff --git a/service/cloudwatchlogs/api_op_ListLogAnomalyDetectors.go b/service/cloudwatchlogs/api_op_ListLogAnomalyDetectors.go new file mode 100644 index 00000000000..5b20632b006 --- /dev/null +++ b/service/cloudwatchlogs/api_op_ListLogAnomalyDetectors.go @@ -0,0 +1,237 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +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/cloudwatchlogs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of the log anomaly detectors in the account. +func (c *Client) ListLogAnomalyDetectors(ctx context.Context, params *ListLogAnomalyDetectorsInput, optFns ...func(*Options)) (*ListLogAnomalyDetectorsOutput, error) { + if params == nil { + params = &ListLogAnomalyDetectorsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListLogAnomalyDetectors", params, optFns, c.addOperationListLogAnomalyDetectorsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListLogAnomalyDetectorsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListLogAnomalyDetectorsInput struct { + + // Use this to optionally filter the results to only include anomaly detectors + // that are associated with the specified log group. + FilterLogGroupArn *string + + // The maximum number of items to return. If you don't specify a value, the + // default maximum value of 50 items is used. + Limit *int32 + + // The token for the next set of items to return. The token expires after 24 hours. + NextToken *string + + noSmithyDocumentSerde +} + +type ListLogAnomalyDetectorsOutput struct { + + // An array of structures, where each structure in the array contains information + // about one anomaly detector. + AnomalyDetectors []types.AnomalyDetector + + // The token for the next set of items to return. The token expires after 24 hours. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListLogAnomalyDetectorsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListLogAnomalyDetectors{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListLogAnomalyDetectors{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListLogAnomalyDetectors"); 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_opListLogAnomalyDetectors(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 +} + +// ListLogAnomalyDetectorsAPIClient is a client that implements the +// ListLogAnomalyDetectors operation. +type ListLogAnomalyDetectorsAPIClient interface { + ListLogAnomalyDetectors(context.Context, *ListLogAnomalyDetectorsInput, ...func(*Options)) (*ListLogAnomalyDetectorsOutput, error) +} + +var _ ListLogAnomalyDetectorsAPIClient = (*Client)(nil) + +// ListLogAnomalyDetectorsPaginatorOptions is the paginator options for +// ListLogAnomalyDetectors +type ListLogAnomalyDetectorsPaginatorOptions struct { + // The maximum number of items to return. If you don't specify a value, the + // default maximum value of 50 items is used. + 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 +} + +// ListLogAnomalyDetectorsPaginator is a paginator for ListLogAnomalyDetectors +type ListLogAnomalyDetectorsPaginator struct { + options ListLogAnomalyDetectorsPaginatorOptions + client ListLogAnomalyDetectorsAPIClient + params *ListLogAnomalyDetectorsInput + nextToken *string + firstPage bool +} + +// NewListLogAnomalyDetectorsPaginator returns a new +// ListLogAnomalyDetectorsPaginator +func NewListLogAnomalyDetectorsPaginator(client ListLogAnomalyDetectorsAPIClient, params *ListLogAnomalyDetectorsInput, optFns ...func(*ListLogAnomalyDetectorsPaginatorOptions)) *ListLogAnomalyDetectorsPaginator { + if params == nil { + params = &ListLogAnomalyDetectorsInput{} + } + + options := ListLogAnomalyDetectorsPaginatorOptions{} + if params.Limit != nil { + options.Limit = *params.Limit + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListLogAnomalyDetectorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLogAnomalyDetectorsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListLogAnomalyDetectors page. +func (p *ListLogAnomalyDetectorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLogAnomalyDetectorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.Limit = limit + + result, err := p.client.ListLogAnomalyDetectors(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_opListLogAnomalyDetectors(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListLogAnomalyDetectors", + } +} diff --git a/service/cloudwatchlogs/api_op_PutDeliveryDestination.go b/service/cloudwatchlogs/api_op_PutDeliveryDestination.go index 100c0b7097d..0ae0693cb49 100644 --- a/service/cloudwatchlogs/api_op_PutDeliveryDestination.go +++ b/service/cloudwatchlogs/api_op_PutDeliveryDestination.go @@ -37,7 +37,7 @@ import ( // deliveries to configure multiple delivery sources to send logs to the same // delivery destination. Only some Amazon Web Services services support being // configured as a delivery source. These services are listed as Supported [V2 -// Permissions] in the table at Enabling logging from Amazon Web Services services. (https://docs.aws.amazon.com/ AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-vended-logs-permissions) +// Permissions] in the table at Enabling logging from Amazon Web Services services. (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html) // If you use this operation to update an existing delivery destination, all the // current delivery destination parameters are overwritten with the new parameter // values that you specify. diff --git a/service/cloudwatchlogs/api_op_PutDeliveryDestinationPolicy.go b/service/cloudwatchlogs/api_op_PutDeliveryDestinationPolicy.go index 09b09120ba8..55cab813058 100644 --- a/service/cloudwatchlogs/api_op_PutDeliveryDestinationPolicy.go +++ b/service/cloudwatchlogs/api_op_PutDeliveryDestinationPolicy.go @@ -33,7 +33,7 @@ import ( // // Only some Amazon Web Services services support being configured as a delivery // source. These services are listed as Supported [V2 Permissions] in the table at -// Enabling logging from Amazon Web Services services. (https://docs.aws.amazon.com/ AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-vended-logs-permissions) +// Enabling logging from Amazon Web Services services. (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html) // The contents of the policy must include two statements. One statement enables // general logs delivery, and the other allows delivery to the chosen destination. // See the examples for the needed policies. diff --git a/service/cloudwatchlogs/api_op_PutDeliverySource.go b/service/cloudwatchlogs/api_op_PutDeliverySource.go index 85792947164..7bb5c443703 100644 --- a/service/cloudwatchlogs/api_op_PutDeliverySource.go +++ b/service/cloudwatchlogs/api_op_PutDeliverySource.go @@ -37,7 +37,7 @@ import ( // deliveries to configure multiple delivery sources to send logs to the same // delivery destination. Only some Amazon Web Services services support being // configured as a delivery source. These services are listed as Supported [V2 -// Permissions] in the table at Enabling logging from Amazon Web Services services. (https://docs.aws.amazon.com/ AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-vended-logs-permissions) +// Permissions] in the table at Enabling logging from Amazon Web Services services. (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html) // If you use this operation to update an existing delivery source, all the current // delivery source parameters are overwritten with the new parameter values that // you specify. diff --git a/service/cloudwatchlogs/api_op_UpdateAnomaly.go b/service/cloudwatchlogs/api_op_UpdateAnomaly.go new file mode 100644 index 00000000000..6bbe41e09dc --- /dev/null +++ b/service/cloudwatchlogs/api_op_UpdateAnomaly.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +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/cloudwatchlogs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Use this operation to suppress anomaly detection for a specified anomaly or +// pattern. If you suppress an anomaly, CloudWatch Logs won’t report new +// occurrences of that anomaly and won't update that anomaly with new data. If you +// suppress a pattern, CloudWatch Logs won’t report any anomalies related to that +// pattern. You must specify either anomalyId or patternId , but you can't specify +// both parameters in the same operation. If you have previously used this +// operation to suppress detection of a pattern or anomaly, you can use it again to +// cause CloudWatch Logs to end the suppression. To do this, use this operation and +// specify the anomaly or pattern to stop suppressing, and omit the suppressionType +// and suppressionPeriod parameters. +func (c *Client) UpdateAnomaly(ctx context.Context, params *UpdateAnomalyInput, optFns ...func(*Options)) (*UpdateAnomalyOutput, error) { + if params == nil { + params = &UpdateAnomalyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateAnomaly", params, optFns, c.addOperationUpdateAnomalyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateAnomalyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateAnomalyInput struct { + + // The ARN of the anomaly detector that this operation is to act on. + // + // This member is required. + AnomalyDetectorArn *string + + // If you are suppressing or unsuppressing an anomaly, specify its unique ID here. + // You can find anomaly IDs by using the ListAnomalies (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html) + // operation. + AnomalyId *string + + // If you are suppressing or unsuppressing an pattern, specify its unique ID here. + // You can find pattern IDs by using the ListAnomalies (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html) + // operation. + PatternId *string + + // If you are temporarily suppressing an anomaly or pattern, use this structure to + // specify how long the suppression is to last. + SuppressionPeriod *types.SuppressionPeriod + + // Use this to specify whether the suppression to be temporary or infinite. If you + // specify LIMITED , you must also specify a suppressionPeriod . If you specify + // INFINITE , any value for suppressionPeriod is ignored. + SuppressionType types.SuppressionType + + noSmithyDocumentSerde +} + +type UpdateAnomalyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateAnomalyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateAnomaly{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateAnomaly{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateAnomaly"); 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 = addOpUpdateAnomalyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAnomaly(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_opUpdateAnomaly(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateAnomaly", + } +} diff --git a/service/cloudwatchlogs/api_op_UpdateLogAnomalyDetector.go b/service/cloudwatchlogs/api_op_UpdateLogAnomalyDetector.go new file mode 100644 index 00000000000..6eaf5de91ec --- /dev/null +++ b/service/cloudwatchlogs/api_op_UpdateLogAnomalyDetector.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +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/cloudwatchlogs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates an existing log anomaly detector. +func (c *Client) UpdateLogAnomalyDetector(ctx context.Context, params *UpdateLogAnomalyDetectorInput, optFns ...func(*Options)) (*UpdateLogAnomalyDetectorOutput, error) { + if params == nil { + params = &UpdateLogAnomalyDetectorInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateLogAnomalyDetector", params, optFns, c.addOperationUpdateLogAnomalyDetectorMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateLogAnomalyDetectorOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateLogAnomalyDetectorInput struct { + + // The ARN of the anomaly detector that you want to update. + // + // This member is required. + AnomalyDetectorArn *string + + // Use this parameter to pause or restart the anomaly detector. + // + // This member is required. + Enabled *bool + + // The number of days to use as the life cycle of anomalies. After this time, + // anomalies are automatically baselined and the anomaly detector model will treat + // new occurrences of similar event as normal. Therefore, if you do not correct the + // cause of an anomaly during this time, it will be considered normal going forward + // and will not be detected. + AnomalyVisibilityTime *int64 + + // Specifies how often the anomaly detector runs and look for anomalies. Set this + // value according to the frequency that the log group receives new logs. For + // example, if the log group receives new log events every 10 minutes, then setting + // evaluationFrequency to FIFTEEN_MIN might be appropriate. + EvaluationFrequency types.EvaluationFrequency + + // A symbolic description of how CloudWatch Logs should interpret the data in each + // log event. For example, a log event can contain timestamps, IP addresses, + // strings, and so on. You use the filter pattern to specify what to look for in + // the log event message. + FilterPattern *string + + noSmithyDocumentSerde +} + +type UpdateLogAnomalyDetectorOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateLogAnomalyDetectorMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateLogAnomalyDetector{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateLogAnomalyDetector{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateLogAnomalyDetector"); 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 = addOpUpdateLogAnomalyDetectorValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateLogAnomalyDetector(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_opUpdateLogAnomalyDetector(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateLogAnomalyDetector", + } +} diff --git a/service/cloudwatchlogs/deserializers.go b/service/cloudwatchlogs/deserializers.go index 0d85fb47eed..55096ef2cf1 100644 --- a/service/cloudwatchlogs/deserializers.go +++ b/service/cloudwatchlogs/deserializers.go @@ -471,6 +471,129 @@ func awsAwsjson11_deserializeOpErrorCreateExportTask(response *smithyhttp.Respon } } +type awsAwsjson11_deserializeOpCreateLogAnomalyDetector struct { +} + +func (*awsAwsjson11_deserializeOpCreateLogAnomalyDetector) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateLogAnomalyDetector) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreateLogAnomalyDetector(response, &metadata) + } + output := &CreateLogAnomalyDetectorOutput{} + 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_deserializeOpDocumentCreateLogAnomalyDetectorOutput(&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_deserializeOpErrorCreateLogAnomalyDetector(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCreateLogGroup struct { } @@ -1374,6 +1497,104 @@ func awsAwsjson11_deserializeOpErrorDeleteDestination(response *smithyhttp.Respo } } +type awsAwsjson11_deserializeOpDeleteLogAnomalyDetector struct { +} + +func (*awsAwsjson11_deserializeOpDeleteLogAnomalyDetector) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteLogAnomalyDetector) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteLogAnomalyDetector(response, &metadata) + } + output := &DeleteLogAnomalyDetectorOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDeleteLogAnomalyDetector(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDeleteLogGroup struct { } @@ -4415,14 +4636,14 @@ func awsAwsjson11_deserializeOpErrorGetDeliverySource(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpGetLogEvents struct { +type awsAwsjson11_deserializeOpGetLogAnomalyDetector struct { } -func (*awsAwsjson11_deserializeOpGetLogEvents) ID() string { +func (*awsAwsjson11_deserializeOpGetLogAnomalyDetector) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetLogEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetLogAnomalyDetector) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4436,9 +4657,9 @@ func (m *awsAwsjson11_deserializeOpGetLogEvents) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetLogEvents(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetLogAnomalyDetector(response, &metadata) } - output := &GetLogEventsOutput{} + output := &GetLogAnomalyDetectorOutput{} out.Result = output var buff [1024]byte @@ -4458,7 +4679,7 @@ func (m *awsAwsjson11_deserializeOpGetLogEvents) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetLogEventsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetLogAnomalyDetectorOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4472,7 +4693,7 @@ func (m *awsAwsjson11_deserializeOpGetLogEvents) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetLogEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetLogAnomalyDetector(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4516,6 +4737,9 @@ func awsAwsjson11_deserializeOpErrorGetLogEvents(response *smithyhttp.Response, case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -4532,14 +4756,14 @@ func awsAwsjson11_deserializeOpErrorGetLogEvents(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpGetLogGroupFields struct { +type awsAwsjson11_deserializeOpGetLogEvents struct { } -func (*awsAwsjson11_deserializeOpGetLogGroupFields) ID() string { +func (*awsAwsjson11_deserializeOpGetLogEvents) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetLogGroupFields) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetLogEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4553,9 +4777,9 @@ func (m *awsAwsjson11_deserializeOpGetLogGroupFields) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetLogGroupFields(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetLogEvents(response, &metadata) } - output := &GetLogGroupFieldsOutput{} + output := &GetLogEventsOutput{} out.Result = output var buff [1024]byte @@ -4575,7 +4799,7 @@ func (m *awsAwsjson11_deserializeOpGetLogGroupFields) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetLogGroupFieldsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetLogEventsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4589,7 +4813,7 @@ func (m *awsAwsjson11_deserializeOpGetLogGroupFields) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetLogGroupFields(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetLogEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4633,9 +4857,6 @@ func awsAwsjson11_deserializeOpErrorGetLogGroupFields(response *smithyhttp.Respo case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -4652,14 +4873,14 @@ func awsAwsjson11_deserializeOpErrorGetLogGroupFields(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpGetLogRecord struct { +type awsAwsjson11_deserializeOpGetLogGroupFields struct { } -func (*awsAwsjson11_deserializeOpGetLogRecord) ID() string { +func (*awsAwsjson11_deserializeOpGetLogGroupFields) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetLogRecord) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetLogGroupFields) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4673,9 +4894,9 @@ func (m *awsAwsjson11_deserializeOpGetLogRecord) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetLogRecord(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetLogGroupFields(response, &metadata) } - output := &GetLogRecordOutput{} + output := &GetLogGroupFieldsOutput{} out.Result = output var buff [1024]byte @@ -4695,7 +4916,7 @@ func (m *awsAwsjson11_deserializeOpGetLogRecord) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetLogRecordOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetLogGroupFieldsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4709,7 +4930,7 @@ func (m *awsAwsjson11_deserializeOpGetLogRecord) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetLogRecord(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetLogGroupFields(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4772,14 +4993,14 @@ func awsAwsjson11_deserializeOpErrorGetLogRecord(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpGetQueryResults struct { +type awsAwsjson11_deserializeOpGetLogRecord struct { } -func (*awsAwsjson11_deserializeOpGetQueryResults) ID() string { +func (*awsAwsjson11_deserializeOpGetLogRecord) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetQueryResults) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetLogRecord) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4793,9 +5014,9 @@ func (m *awsAwsjson11_deserializeOpGetQueryResults) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetQueryResults(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetLogRecord(response, &metadata) } - output := &GetQueryResultsOutput{} + output := &GetLogRecordOutput{} out.Result = output var buff [1024]byte @@ -4815,7 +5036,7 @@ func (m *awsAwsjson11_deserializeOpGetQueryResults) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetQueryResultsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetLogRecordOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4829,7 +5050,7 @@ func (m *awsAwsjson11_deserializeOpGetQueryResults) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetQueryResults(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetLogRecord(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4873,6 +5094,9 @@ func awsAwsjson11_deserializeOpErrorGetQueryResults(response *smithyhttp.Respons case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -4889,14 +5113,14 @@ func awsAwsjson11_deserializeOpErrorGetQueryResults(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpListTagsForResource struct { +type awsAwsjson11_deserializeOpGetQueryResults struct { } -func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { +func (*awsAwsjson11_deserializeOpGetQueryResults) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetQueryResults) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4910,9 +5134,9 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetQueryResults(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &GetQueryResultsOutput{} out.Result = output var buff [1024]byte @@ -4932,7 +5156,7 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetQueryResultsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4946,7 +5170,7 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetQueryResults(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5006,14 +5230,14 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpListTagsLogGroup struct { +type awsAwsjson11_deserializeOpListAnomalies struct { } -func (*awsAwsjson11_deserializeOpListTagsLogGroup) ID() string { +func (*awsAwsjson11_deserializeOpListAnomalies) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListTagsLogGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListAnomalies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5027,9 +5251,9 @@ func (m *awsAwsjson11_deserializeOpListTagsLogGroup) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListTagsLogGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListAnomalies(response, &metadata) } - output := &ListTagsLogGroupOutput{} + output := &ListAnomaliesOutput{} out.Result = output var buff [1024]byte @@ -5049,7 +5273,7 @@ func (m *awsAwsjson11_deserializeOpListTagsLogGroup) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListTagsLogGroupOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListAnomaliesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5063,7 +5287,7 @@ func (m *awsAwsjson11_deserializeOpListTagsLogGroup) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListTagsLogGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListAnomalies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5104,6 +5328,12 @@ func awsAwsjson11_deserializeOpErrorListTagsLogGroup(response *smithyhttp.Respon } switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -5120,14 +5350,14 @@ func awsAwsjson11_deserializeOpErrorListTagsLogGroup(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpPutAccountPolicy struct { +type awsAwsjson11_deserializeOpListLogAnomalyDetectors struct { } -func (*awsAwsjson11_deserializeOpPutAccountPolicy) ID() string { +func (*awsAwsjson11_deserializeOpListLogAnomalyDetectors) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutAccountPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListLogAnomalyDetectors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5141,9 +5371,9 @@ func (m *awsAwsjson11_deserializeOpPutAccountPolicy) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutAccountPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListLogAnomalyDetectors(response, &metadata) } - output := &PutAccountPolicyOutput{} + output := &ListLogAnomalyDetectorsOutput{} out.Result = output var buff [1024]byte @@ -5163,7 +5393,7 @@ func (m *awsAwsjson11_deserializeOpPutAccountPolicy) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutAccountPolicyOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListLogAnomalyDetectorsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5177,7 +5407,7 @@ func (m *awsAwsjson11_deserializeOpPutAccountPolicy) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutAccountPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListLogAnomalyDetectors(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5221,12 +5451,12 @@ func awsAwsjson11_deserializeOpErrorPutAccountPolicy(response *smithyhttp.Respon case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("OperationAbortedException", errorCode): return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -5240,14 +5470,14 @@ func awsAwsjson11_deserializeOpErrorPutAccountPolicy(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpPutDataProtectionPolicy struct { +type awsAwsjson11_deserializeOpListTagsForResource struct { } -func (*awsAwsjson11_deserializeOpPutDataProtectionPolicy) ID() string { +func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutDataProtectionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5261,9 +5491,9 @@ func (m *awsAwsjson11_deserializeOpPutDataProtectionPolicy) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutDataProtectionPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &PutDataProtectionPolicyOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -5283,7 +5513,7 @@ func (m *awsAwsjson11_deserializeOpPutDataProtectionPolicy) HandleDeserialize(ct return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutDataProtectionPolicyOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5297,7 +5527,7 @@ func (m *awsAwsjson11_deserializeOpPutDataProtectionPolicy) HandleDeserialize(ct return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutDataProtectionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5341,12 +5571,6 @@ func awsAwsjson11_deserializeOpErrorPutDataProtectionPolicy(response *smithyhttp case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -5363,14 +5587,14 @@ func awsAwsjson11_deserializeOpErrorPutDataProtectionPolicy(response *smithyhttp } } -type awsAwsjson11_deserializeOpPutDeliveryDestination struct { +type awsAwsjson11_deserializeOpListTagsLogGroup struct { } -func (*awsAwsjson11_deserializeOpPutDeliveryDestination) ID() string { +func (*awsAwsjson11_deserializeOpListTagsLogGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutDeliveryDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListTagsLogGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5384,9 +5608,9 @@ func (m *awsAwsjson11_deserializeOpPutDeliveryDestination) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutDeliveryDestination(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListTagsLogGroup(response, &metadata) } - output := &PutDeliveryDestinationOutput{} + output := &ListTagsLogGroupOutput{} out.Result = output var buff [1024]byte @@ -5406,7 +5630,7 @@ func (m *awsAwsjson11_deserializeOpPutDeliveryDestination) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutDeliveryDestinationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListTagsLogGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5420,7 +5644,7 @@ func (m *awsAwsjson11_deserializeOpPutDeliveryDestination) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutDeliveryDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListTagsLogGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5461,24 +5685,12 @@ func awsAwsjson11_deserializeOpErrorPutDeliveryDestination(response *smithyhttp. } switch { - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson11_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): - return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsAwsjson11_deserializeErrorValidationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5489,14 +5701,14 @@ func awsAwsjson11_deserializeOpErrorPutDeliveryDestination(response *smithyhttp. } } -type awsAwsjson11_deserializeOpPutDeliveryDestinationPolicy struct { +type awsAwsjson11_deserializeOpPutAccountPolicy struct { } -func (*awsAwsjson11_deserializeOpPutDeliveryDestinationPolicy) ID() string { +func (*awsAwsjson11_deserializeOpPutAccountPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutDeliveryDestinationPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutAccountPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5510,9 +5722,9 @@ func (m *awsAwsjson11_deserializeOpPutDeliveryDestinationPolicy) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutDeliveryDestinationPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutAccountPolicy(response, &metadata) } - output := &PutDeliveryDestinationPolicyOutput{} + output := &PutAccountPolicyOutput{} out.Result = output var buff [1024]byte @@ -5532,7 +5744,7 @@ func (m *awsAwsjson11_deserializeOpPutDeliveryDestinationPolicy) HandleDeseriali return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutDeliveryDestinationPolicyOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutAccountPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5546,7 +5758,7 @@ func (m *awsAwsjson11_deserializeOpPutDeliveryDestinationPolicy) HandleDeseriali return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutDeliveryDestinationPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutAccountPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5587,18 +5799,18 @@ func awsAwsjson11_deserializeOpErrorPutDeliveryDestinationPolicy(response *smith } switch { - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): - return awsAwsjson11_deserializeErrorValidationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5609,14 +5821,14 @@ func awsAwsjson11_deserializeOpErrorPutDeliveryDestinationPolicy(response *smith } } -type awsAwsjson11_deserializeOpPutDeliverySource struct { +type awsAwsjson11_deserializeOpPutDataProtectionPolicy struct { } -func (*awsAwsjson11_deserializeOpPutDeliverySource) ID() string { +func (*awsAwsjson11_deserializeOpPutDataProtectionPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutDeliverySource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutDataProtectionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5630,9 +5842,9 @@ func (m *awsAwsjson11_deserializeOpPutDeliverySource) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutDeliverySource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutDataProtectionPolicy(response, &metadata) } - output := &PutDeliverySourceOutput{} + output := &PutDataProtectionPolicyOutput{} out.Result = output var buff [1024]byte @@ -5652,7 +5864,7 @@ func (m *awsAwsjson11_deserializeOpPutDeliverySource) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutDeliverySourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutDataProtectionPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5666,7 +5878,7 @@ func (m *awsAwsjson11_deserializeOpPutDeliverySource) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutDeliverySource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutDataProtectionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5707,24 +5919,21 @@ func awsAwsjson11_deserializeOpErrorPutDeliverySource(response *smithyhttp.Respo } switch { - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): - return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsAwsjson11_deserializeErrorValidationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5735,14 +5944,14 @@ func awsAwsjson11_deserializeOpErrorPutDeliverySource(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpPutDestination struct { +type awsAwsjson11_deserializeOpPutDeliveryDestination struct { } -func (*awsAwsjson11_deserializeOpPutDestination) ID() string { +func (*awsAwsjson11_deserializeOpPutDeliveryDestination) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutDeliveryDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5756,9 +5965,9 @@ func (m *awsAwsjson11_deserializeOpPutDestination) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutDestination(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutDeliveryDestination(response, &metadata) } - output := &PutDestinationOutput{} + output := &PutDeliveryDestinationOutput{} out.Result = output var buff [1024]byte @@ -5778,7 +5987,7 @@ func (m *awsAwsjson11_deserializeOpPutDestination) HandleDeserialize(ctx context return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutDestinationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutDeliveryDestinationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5792,7 +6001,7 @@ func (m *awsAwsjson11_deserializeOpPutDestination) HandleDeserialize(ctx context return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutDeliveryDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5833,15 +6042,24 @@ func awsAwsjson11_deserializeOpErrorPutDestination(response *smithyhttp.Response } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5852,14 +6070,14 @@ func awsAwsjson11_deserializeOpErrorPutDestination(response *smithyhttp.Response } } -type awsAwsjson11_deserializeOpPutDestinationPolicy struct { +type awsAwsjson11_deserializeOpPutDeliveryDestinationPolicy struct { } -func (*awsAwsjson11_deserializeOpPutDestinationPolicy) ID() string { +func (*awsAwsjson11_deserializeOpPutDeliveryDestinationPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutDestinationPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutDeliveryDestinationPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5873,21 +6091,43 @@ func (m *awsAwsjson11_deserializeOpPutDestinationPolicy) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutDestinationPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutDeliveryDestinationPolicy(response, &metadata) } - output := &PutDestinationPolicyOutput{} + output := &PutDeliveryDestinationPolicyOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentPutDeliveryDestinationPolicyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } + return out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutDestinationPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutDeliveryDestinationPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5928,15 +6168,18 @@ func awsAwsjson11_deserializeOpErrorPutDestinationPolicy(response *smithyhttp.Re } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5947,14 +6190,14 @@ func awsAwsjson11_deserializeOpErrorPutDestinationPolicy(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpPutLogEvents struct { +type awsAwsjson11_deserializeOpPutDeliverySource struct { } -func (*awsAwsjson11_deserializeOpPutLogEvents) ID() string { +func (*awsAwsjson11_deserializeOpPutDeliverySource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutLogEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutDeliverySource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5968,9 +6211,9 @@ func (m *awsAwsjson11_deserializeOpPutLogEvents) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutLogEvents(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutDeliverySource(response, &metadata) } - output := &PutLogEventsOutput{} + output := &PutDeliverySourceOutput{} out.Result = output var buff [1024]byte @@ -5990,7 +6233,7 @@ func (m *awsAwsjson11_deserializeOpPutLogEvents) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutLogEventsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutDeliverySourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6004,7 +6247,7 @@ func (m *awsAwsjson11_deserializeOpPutLogEvents) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutLogEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutDeliverySource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6045,23 +6288,23 @@ func awsAwsjson11_deserializeOpErrorPutLogEvents(response *smithyhttp.Response, } switch { - case strings.EqualFold("DataAlreadyAcceptedException", errorCode): - return awsAwsjson11_deserializeErrorDataAlreadyAcceptedException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidSequenceTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidSequenceTokenException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("UnrecognizedClientException", errorCode): - return awsAwsjson11_deserializeErrorUnrecognizedClientException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -6073,14 +6316,14 @@ func awsAwsjson11_deserializeOpErrorPutLogEvents(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpPutMetricFilter struct { +type awsAwsjson11_deserializeOpPutDestination struct { } -func (*awsAwsjson11_deserializeOpPutMetricFilter) ID() string { +func (*awsAwsjson11_deserializeOpPutDestination) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutMetricFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6094,21 +6337,43 @@ func (m *awsAwsjson11_deserializeOpPutMetricFilter) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutMetricFilter(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutDestination(response, &metadata) } - output := &PutMetricFilterOutput{} + output := &PutDestinationOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentPutDestinationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } + return out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutMetricFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6152,15 +6417,9 @@ func awsAwsjson11_deserializeOpErrorPutMetricFilter(response *smithyhttp.Respons case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("OperationAbortedException", errorCode): return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -6174,14 +6433,14 @@ func awsAwsjson11_deserializeOpErrorPutMetricFilter(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpPutQueryDefinition struct { +type awsAwsjson11_deserializeOpPutDestinationPolicy struct { } -func (*awsAwsjson11_deserializeOpPutQueryDefinition) ID() string { +func (*awsAwsjson11_deserializeOpPutDestinationPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutQueryDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutDestinationPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6195,43 +6454,21 @@ func (m *awsAwsjson11_deserializeOpPutQueryDefinition) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutQueryDefinition(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutDestinationPolicy(response, &metadata) } - output := &PutQueryDefinitionOutput{} + output := &PutDestinationPolicyOutput{} 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_deserializeOpDocumentPutQueryDefinitionOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutQueryDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutDestinationPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6275,11 +6512,8 @@ func awsAwsjson11_deserializeOpErrorPutQueryDefinition(response *smithyhttp.Resp case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -6294,14 +6528,14 @@ func awsAwsjson11_deserializeOpErrorPutQueryDefinition(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpPutResourcePolicy struct { +type awsAwsjson11_deserializeOpPutLogEvents struct { } -func (*awsAwsjson11_deserializeOpPutResourcePolicy) ID() string { +func (*awsAwsjson11_deserializeOpPutLogEvents) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutLogEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6315,9 +6549,9 @@ func (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutResourcePolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutLogEvents(response, &metadata) } - output := &PutResourcePolicyOutput{} + output := &PutLogEventsOutput{} out.Result = output var buff [1024]byte @@ -6337,7 +6571,7 @@ func (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutLogEventsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6351,7 +6585,7 @@ func (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutLogEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6392,15 +6626,24 @@ func awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Respo } switch { + case strings.EqualFold("DataAlreadyAcceptedException", errorCode): + return awsAwsjson11_deserializeErrorDataAlreadyAcceptedException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("InvalidSequenceTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidSequenceTokenException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("UnrecognizedClientException", errorCode): + return awsAwsjson11_deserializeErrorUnrecognizedClientException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6411,14 +6654,14 @@ func awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpPutRetentionPolicy struct { +type awsAwsjson11_deserializeOpPutMetricFilter struct { } -func (*awsAwsjson11_deserializeOpPutRetentionPolicy) ID() string { +func (*awsAwsjson11_deserializeOpPutMetricFilter) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutRetentionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutMetricFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6432,9 +6675,9 @@ func (m *awsAwsjson11_deserializeOpPutRetentionPolicy) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutMetricFilter(response, &metadata) } - output := &PutRetentionPolicyOutput{} + output := &PutMetricFilterOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -6446,7 +6689,7 @@ func (m *awsAwsjson11_deserializeOpPutRetentionPolicy) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutMetricFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6490,6 +6733,9 @@ func awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response *smithyhttp.Resp case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("OperationAbortedException", errorCode): return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) @@ -6509,14 +6755,14 @@ func awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpPutSubscriptionFilter struct { +type awsAwsjson11_deserializeOpPutQueryDefinition struct { } -func (*awsAwsjson11_deserializeOpPutSubscriptionFilter) ID() string { +func (*awsAwsjson11_deserializeOpPutQueryDefinition) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutSubscriptionFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutQueryDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6530,21 +6776,43 @@ func (m *awsAwsjson11_deserializeOpPutSubscriptionFilter) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutSubscriptionFilter(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutQueryDefinition(response, &metadata) } - output := &PutSubscriptionFilterOutput{} + output := &PutQueryDefinitionOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentPutQueryDefinitionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } + return out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutSubscriptionFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutQueryDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6591,9 +6859,6 @@ func awsAwsjson11_deserializeOpErrorPutSubscriptionFilter(response *smithyhttp.R case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -6610,14 +6875,14 @@ func awsAwsjson11_deserializeOpErrorPutSubscriptionFilter(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpStartQuery struct { +type awsAwsjson11_deserializeOpPutResourcePolicy struct { } -func (*awsAwsjson11_deserializeOpStartQuery) ID() string { +func (*awsAwsjson11_deserializeOpPutResourcePolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStartQuery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6631,9 +6896,9 @@ func (m *awsAwsjson11_deserializeOpStartQuery) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartQuery(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutResourcePolicy(response, &metadata) } - output := &StartQueryOutput{} + output := &PutResourcePolicyOutput{} out.Result = output var buff [1024]byte @@ -6653,7 +6918,7 @@ func (m *awsAwsjson11_deserializeOpStartQuery) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStartQueryOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6667,7 +6932,7 @@ func (m *awsAwsjson11_deserializeOpStartQuery) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStartQuery(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6714,12 +6979,6 @@ func awsAwsjson11_deserializeOpErrorStartQuery(response *smithyhttp.Response, me case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("MalformedQueryException", errorCode): - return awsAwsjson11_deserializeErrorMalformedQueryException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -6733,14 +6992,14 @@ func awsAwsjson11_deserializeOpErrorStartQuery(response *smithyhttp.Response, me } } -type awsAwsjson11_deserializeOpStopQuery struct { +type awsAwsjson11_deserializeOpPutRetentionPolicy struct { } -func (*awsAwsjson11_deserializeOpStopQuery) ID() string { +func (*awsAwsjson11_deserializeOpPutRetentionPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStopQuery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutRetentionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6754,43 +7013,21 @@ func (m *awsAwsjson11_deserializeOpStopQuery) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStopQuery(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response, &metadata) } - output := &StopQueryOutput{} + output := &PutRetentionPolicyOutput{} out.Result = output - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentStopQueryOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStopQuery(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6834,7 +7071,10 @@ func awsAwsjson11_deserializeOpErrorStopQuery(response *smithyhttp.Response, met case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): @@ -6850,14 +7090,14 @@ func awsAwsjson11_deserializeOpErrorStopQuery(response *smithyhttp.Response, met } } -type awsAwsjson11_deserializeOpTagLogGroup struct { +type awsAwsjson11_deserializeOpPutSubscriptionFilter struct { } -func (*awsAwsjson11_deserializeOpTagLogGroup) ID() string { +func (*awsAwsjson11_deserializeOpPutSubscriptionFilter) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpTagLogGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutSubscriptionFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6871,9 +7111,9 @@ func (m *awsAwsjson11_deserializeOpTagLogGroup) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorTagLogGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutSubscriptionFilter(response, &metadata) } - output := &TagLogGroupOutput{} + output := &PutSubscriptionFilterOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -6885,7 +7125,7 @@ func (m *awsAwsjson11_deserializeOpTagLogGroup) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorTagLogGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutSubscriptionFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6929,9 +7169,18 @@ func awsAwsjson11_deserializeOpErrorTagLogGroup(response *smithyhttp.Response, m case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6942,14 +7191,14 @@ func awsAwsjson11_deserializeOpErrorTagLogGroup(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpTagResource struct { +type awsAwsjson11_deserializeOpStartQuery struct { } -func (*awsAwsjson11_deserializeOpTagResource) ID() string { +func (*awsAwsjson11_deserializeOpStartQuery) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpStartQuery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6963,21 +7212,43 @@ func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorStartQuery(response, &metadata) } - output := &TagResourceOutput{} + output := &StartQueryOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentStartQueryOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } + return out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorStartQuery(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7021,15 +7292,18 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("MalformedQueryException", errorCode): + return awsAwsjson11_deserializeErrorMalformedQueryException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("TooManyTagsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7040,14 +7314,14 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpTestMetricFilter struct { +type awsAwsjson11_deserializeOpStopQuery struct { } -func (*awsAwsjson11_deserializeOpTestMetricFilter) ID() string { +func (*awsAwsjson11_deserializeOpStopQuery) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpTestMetricFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpStopQuery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7061,9 +7335,9 @@ func (m *awsAwsjson11_deserializeOpTestMetricFilter) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorTestMetricFilter(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorStopQuery(response, &metadata) } - output := &TestMetricFilterOutput{} + output := &StopQueryOutput{} out.Result = output var buff [1024]byte @@ -7083,7 +7357,7 @@ func (m *awsAwsjson11_deserializeOpTestMetricFilter) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentTestMetricFilterOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentStopQueryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7097,7 +7371,7 @@ func (m *awsAwsjson11_deserializeOpTestMetricFilter) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorTestMetricFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorStopQuery(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7141,6 +7415,9 @@ func awsAwsjson11_deserializeOpErrorTestMetricFilter(response *smithyhttp.Respon case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -7154,14 +7431,14 @@ func awsAwsjson11_deserializeOpErrorTestMetricFilter(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpUntagLogGroup struct { +type awsAwsjson11_deserializeOpTagLogGroup struct { } -func (*awsAwsjson11_deserializeOpUntagLogGroup) ID() string { +func (*awsAwsjson11_deserializeOpTagLogGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUntagLogGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpTagLogGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7175,9 +7452,9 @@ func (m *awsAwsjson11_deserializeOpUntagLogGroup) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUntagLogGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorTagLogGroup(response, &metadata) } - output := &UntagLogGroupOutput{} + output := &TagLogGroupOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -7189,7 +7466,7 @@ func (m *awsAwsjson11_deserializeOpUntagLogGroup) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUntagLogGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorTagLogGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7230,6 +7507,9 @@ func awsAwsjson11_deserializeOpErrorUntagLogGroup(response *smithyhttp.Response, } switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -7243,14 +7523,14 @@ func awsAwsjson11_deserializeOpErrorUntagLogGroup(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpUntagResource struct { +type awsAwsjson11_deserializeOpTagResource struct { } -func (*awsAwsjson11_deserializeOpUntagResource) ID() string { +func (*awsAwsjson11_deserializeOpTagResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7264,9 +7544,9 @@ func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) } - output := &UntagResourceOutput{} + output := &TagResourceOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -7278,7 +7558,7 @@ func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7328,6 +7608,9 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("TooManyTagsException", errorCode): + return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7338,46 +7621,36 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -func awsAwsjson11_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } +type awsAwsjson11_deserializeOpTestMetricFilter struct { +} - output := &types.AccessDeniedException{} - err := awsAwsjson11_deserializeDocumentAccessDeniedException(&output, shape) +func (*awsAwsjson11_deserializeOpTestMetricFilter) ID() string { + return "OperationDeserializer" +} +func (m *awsAwsjson11_deserializeOpTestMetricFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output -} + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorTestMetricFilter(response, &metadata) + } + output := &TestMetricFilterOutput{} + out.Result = output -func awsAwsjson11_deserializeErrorConflictException(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{} @@ -7388,12 +7661,10 @@ func awsAwsjson11_deserializeErrorConflictException(response *smithyhttp.Respons Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.ConflictException{} - err := awsAwsjson11_deserializeDocumentConflictException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentTestMetricFilterOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7401,69 +7672,34 @@ func awsAwsjson11_deserializeErrorConflictException(response *smithyhttp.Respons Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorDataAlreadyAcceptedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err +func awsAwsjson11_deserializeOpErrorTestMetricFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } + errorBody := bytes.NewReader(errorBuffer.Bytes()) - output := &types.DataAlreadyAcceptedException{} - err := awsAwsjson11_deserializeDocumentDataAlreadyAcceptedException(&output, shape) + errorCode := "UnknownError" + errorMessage := errorCode - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorInvalidOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.InvalidOperationException{} - err := awsAwsjson11_deserializeDocumentInvalidOperationException(&output, shape) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7475,15 +7711,556 @@ func awsAwsjson11_deserializeErrorInvalidOperationException(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 + } -func awsAwsjson11_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUntagLogGroup struct { +} + +func (*awsAwsjson11_deserializeOpUntagLogGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUntagLogGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUntagLogGroup(response, &metadata) + } + output := &UntagLogGroupOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUntagLogGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUntagResource struct { +} + +func (*awsAwsjson11_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateAnomaly struct { +} + +func (*awsAwsjson11_deserializeOpUpdateAnomaly) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateAnomaly) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateAnomaly(response, &metadata) + } + output := &UpdateAnomalyOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateAnomaly(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateLogAnomalyDetector struct { +} + +func (*awsAwsjson11_deserializeOpUpdateLogAnomalyDetector) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateLogAnomalyDetector) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateLogAnomalyDetector(response, &metadata) + } + output := &UpdateLogAnomalyDetectorOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateLogAnomalyDetector(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson11_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.AccessDeniedException{} + err := awsAwsjson11_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ConflictException{} + err := awsAwsjson11_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorDataAlreadyAcceptedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.DataAlreadyAcceptedException{} + err := awsAwsjson11_deserializeDocumentDataAlreadyAcceptedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorInvalidOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidOperationException{} + err := awsAwsjson11_deserializeDocumentInvalidOperationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { @@ -7955,13 +8732,136 @@ func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDenie for key, value := range shape { switch key { - case "message": + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAccountPolicies(v *[]types.AccountPolicy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.AccountPolicy + if *v == nil { + cv = []types.AccountPolicy{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AccountPolicy + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAccountPolicy(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentAccountPolicy(v **types.AccountPolicy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccountPolicy + if *v == nil { + sv = &types.AccountPolicy{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.AccountId = ptr.String(jtv) + } + + case "lastUpdatedTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LastUpdatedTime = ptr.Int64(i64) + } + + case "policyDocument": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountPolicyDocument to be of type string, got %T instead", value) + } + sv.PolicyDocument = ptr.String(jtv) + } + + case "policyName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) + } + sv.PolicyName = ptr.String(jtv) + } + + case "policyType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyType to be of type string, got %T instead", value) + } + sv.PolicyType = types.PolicyType(jtv) + } + + case "scope": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Scope to be of type string, got %T instead", value) + } + sv.Scope = types.Scope(jtv) } default: @@ -7973,7 +8873,7 @@ func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } -func awsAwsjson11_deserializeDocumentAccountPolicies(v *[]types.AccountPolicy, value interface{}) error { +func awsAwsjson11_deserializeDocumentAnomalies(v *[]types.Anomaly, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7986,17 +8886,17 @@ func awsAwsjson11_deserializeDocumentAccountPolicies(v *[]types.AccountPolicy, v return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AccountPolicy + var cv []types.Anomaly if *v == nil { - cv = []types.AccountPolicy{} + cv = []types.Anomaly{} } else { cv = *v } for _, value := range shape { - var col types.AccountPolicy + var col types.Anomaly destAddr := &col - if err := awsAwsjson11_deserializeDocumentAccountPolicy(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentAnomaly(&destAddr, value); err != nil { return err } col = *destAddr @@ -8007,7 +8907,7 @@ func awsAwsjson11_deserializeDocumentAccountPolicies(v *[]types.AccountPolicy, v return nil } -func awsAwsjson11_deserializeDocumentAccountPolicy(v **types.AccountPolicy, value interface{}) error { +func awsAwsjson11_deserializeDocumentAnomaly(v **types.Anomaly, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8020,71 +8920,313 @@ func awsAwsjson11_deserializeDocumentAccountPolicy(v **types.AccountPolicy, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccountPolicy + var sv *types.Anomaly if *v == nil { - sv = &types.AccountPolicy{} + sv = &types.Anomaly{} } else { sv = *v } for key, value := range shape { switch key { - case "accountId": + case "active": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Active = ptr.Bool(jtv) + } + + case "anomalyDetectorArn": 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 AnomalyDetectorArn to be of type string, got %T instead", value) } - sv.AccountId = ptr.String(jtv) + sv.AnomalyDetectorArn = ptr.String(jtv) } - case "lastUpdatedTime": + case "anomalyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AnomalyId to be of type string, got %T instead", value) + } + sv.AnomalyId = 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 "firstSeen": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + return fmt.Errorf("expected EpochMillis to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.LastUpdatedTime = ptr.Int64(i64) + sv.FirstSeen = i64 } - case "policyDocument": + case "histogram": + if err := awsAwsjson11_deserializeDocumentHistogram(&sv.Histogram, value); err != nil { + return err + } + + case "isPatternLevelSuppression": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsPatternLevelSuppression = ptr.Bool(jtv) + } + + case "lastSeen": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected EpochMillis to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LastSeen = i64 + } + + case "logGroupArnList": + if err := awsAwsjson11_deserializeDocumentLogGroupArnList(&sv.LogGroupArnList, value); err != nil { + return err + } + + case "logSamples": + if err := awsAwsjson11_deserializeDocumentLogSamples(&sv.LogSamples, value); err != nil { + return err + } + + case "patternId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AccountPolicyDocument to be of type string, got %T instead", value) + return fmt.Errorf("expected PatternId to be of type string, got %T instead", value) } - sv.PolicyDocument = ptr.String(jtv) + sv.PatternId = ptr.String(jtv) } - case "policyName": + case "patternRegex": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) + return fmt.Errorf("expected PatternRegex to be of type string, got %T instead", value) } - sv.PolicyName = ptr.String(jtv) + sv.PatternRegex = ptr.String(jtv) } - case "policyType": + case "patternString": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PolicyType to be of type string, got %T instead", value) + return fmt.Errorf("expected PatternString to be of type string, got %T instead", value) } - sv.PolicyType = types.PolicyType(jtv) + sv.PatternString = ptr.String(jtv) } - case "scope": + case "patternTokens": + if err := awsAwsjson11_deserializeDocumentPatternTokens(&sv.PatternTokens, value); err != nil { + return err + } + + case "priority": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Scope to be of type string, got %T instead", value) + return fmt.Errorf("expected Priority to be of type string, got %T instead", value) + } + sv.Priority = ptr.String(jtv) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected State to be of type string, got %T instead", value) + } + sv.State = types.State(jtv) + } + + case "suppressed": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Suppressed = ptr.Bool(jtv) + } + + case "suppressedDate": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected EpochMillis to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.SuppressedDate = i64 + } + + case "suppressedUntil": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected EpochMillis to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.SuppressedUntil = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAnomalyDetector(v **types.AnomalyDetector, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AnomalyDetector + if *v == nil { + sv = &types.AnomalyDetector{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "anomalyDetectorArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AnomalyDetectorArn to be of type string, got %T instead", value) + } + sv.AnomalyDetectorArn = ptr.String(jtv) + } + + case "anomalyDetectorStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AnomalyDetectorStatus to be of type string, got %T instead", value) + } + sv.AnomalyDetectorStatus = types.AnomalyDetectorStatus(jtv) + } + + case "anomalyVisibilityTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected AnomalyVisibilityTime to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.AnomalyVisibilityTime = ptr.Int64(i64) + } + + case "creationTimeStamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected EpochMillis to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.CreationTimeStamp = i64 + } + + case "detectorName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DetectorName to be of type string, got %T instead", value) + } + sv.DetectorName = ptr.String(jtv) + } + + case "evaluationFrequency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EvaluationFrequency to be of type string, got %T instead", value) + } + sv.EvaluationFrequency = types.EvaluationFrequency(jtv) + } + + case "filterPattern": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FilterPattern to be of type string, got %T instead", value) + } + sv.FilterPattern = ptr.String(jtv) + } + + case "kmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } + + case "lastModifiedTimeStamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected EpochMillis to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err } - sv.Scope = types.Scope(jtv) + sv.LastModifiedTimeStamp = i64 + } + + case "logGroupArnList": + if err := awsAwsjson11_deserializeDocumentLogGroupArnList(&sv.LogGroupArnList, value); err != nil { + return err } default: @@ -8096,6 +9238,40 @@ func awsAwsjson11_deserializeDocumentAccountPolicy(v **types.AccountPolicy, valu return nil } +func awsAwsjson11_deserializeDocumentAnomalyDetectors(v *[]types.AnomalyDetector, 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.AnomalyDetector + if *v == nil { + cv = []types.AnomalyDetector{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AnomalyDetector + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAnomalyDetector(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8721,6 +9897,46 @@ func awsAwsjson11_deserializeDocumentDimensions(v *map[string]string, value inte return nil } +func awsAwsjson11_deserializeDocumentEnumerations(v *map[string]int64, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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]int64 + if *v == nil { + mv = map[string]int64{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal int64 + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected TokenValue to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + parsedVal = i64 + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsAwsjson11_deserializeDocumentExportTask(v **types.ExportTask, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9127,6 +10343,46 @@ func awsAwsjson11_deserializeDocumentFilteredLogEvents(v *[]types.FilteredLogEve return nil } +func awsAwsjson11_deserializeDocumentHistogram(v *map[string]int64, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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]int64 + if *v == nil { + mv = map[string]int64{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal int64 + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Count to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + parsedVal = i64 + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsAwsjson11_deserializeDocumentInheritedProperties(v *[]types.InheritedProperty, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9399,6 +10655,15 @@ func awsAwsjson11_deserializeDocumentLogGroup(v **types.LogGroup, value interfac sv.KmsKeyId = ptr.String(jtv) } + case "logGroupClass": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LogGroupClass to be of type string, got %T instead", value) + } + sv.LogGroupClass = types.LogGroupClass(jtv) + } + case "logGroupName": if value != nil { jtv, ok := value.(string) @@ -9456,6 +10721,42 @@ func awsAwsjson11_deserializeDocumentLogGroup(v **types.LogGroup, value interfac return nil } +func awsAwsjson11_deserializeDocumentLogGroupArnList(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 LogGroupArn to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentLogGroupField(v **types.LogGroupField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9649,6 +10950,42 @@ func awsAwsjson11_deserializeDocumentLogRecord(v *map[string]string, value inter return nil } +func awsAwsjson11_deserializeDocumentLogSamples(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 LogEvent to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentLogStream(v **types.LogStream, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10229,11 +11566,111 @@ func awsAwsjson11_deserializeDocumentOperationAbortedException(v **types.Operati } } - *v = sv + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentOutputLogEvent(v **types.OutputLogEvent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.OutputLogEvent + if *v == nil { + sv = &types.OutputLogEvent{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ingestionTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.IngestionTime = ptr.Int64(i64) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "timestamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Timestamp = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentOutputLogEvents(v *[]types.OutputLogEvent, 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.OutputLogEvent + if *v == nil { + cv = []types.OutputLogEvent{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.OutputLogEvent + destAddr := &col + if err := awsAwsjson11_deserializeDocumentOutputLogEvent(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv return nil } -func awsAwsjson11_deserializeDocumentOutputLogEvent(v **types.OutputLogEvent, value interface{}) error { +func awsAwsjson11_deserializeDocumentPatternToken(v **types.PatternToken, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10246,48 +11683,49 @@ func awsAwsjson11_deserializeDocumentOutputLogEvent(v **types.OutputLogEvent, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.OutputLogEvent + var sv *types.PatternToken if *v == nil { - sv = &types.OutputLogEvent{} + sv = &types.PatternToken{} } else { sv = *v } for key, value := range shape { switch key { - case "ingestionTime": + case "dynamicTokenPosition": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + return fmt.Errorf("expected DynamicTokenPosition to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.IngestionTime = ptr.Int64(i64) + sv.DynamicTokenPosition = int32(i64) } - case "message": + case "enumerations": + if err := awsAwsjson11_deserializeDocumentEnumerations(&sv.Enumerations, value); err != nil { + return err + } + + case "isDynamic": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected EventMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.IsDynamic = ptr.Bool(jtv) } - case "timestamp": + case "tokenString": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected TokenString to be of type string, got %T instead", value) } - sv.Timestamp = ptr.Int64(i64) + sv.TokenString = ptr.String(jtv) } default: @@ -10299,7 +11737,7 @@ func awsAwsjson11_deserializeDocumentOutputLogEvent(v **types.OutputLogEvent, va return nil } -func awsAwsjson11_deserializeDocumentOutputLogEvents(v *[]types.OutputLogEvent, value interface{}) error { +func awsAwsjson11_deserializeDocumentPatternTokens(v *[]types.PatternToken, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10312,17 +11750,17 @@ func awsAwsjson11_deserializeDocumentOutputLogEvents(v *[]types.OutputLogEvent, return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.OutputLogEvent + var cv []types.PatternToken if *v == nil { - cv = []types.OutputLogEvent{} + cv = []types.PatternToken{} } else { cv = *v } for _, value := range shape { - var col types.OutputLogEvent + var col types.PatternToken destAddr := &col - if err := awsAwsjson11_deserializeDocumentOutputLogEvent(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentPatternToken(&destAddr, value); err != nil { return err } col = *destAddr @@ -11805,6 +13243,46 @@ func awsAwsjson11_deserializeOpDocumentCreateExportTaskOutput(v **CreateExportTa return nil } +func awsAwsjson11_deserializeOpDocumentCreateLogAnomalyDetectorOutput(v **CreateLogAnomalyDetectorOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateLogAnomalyDetectorOutput + if *v == nil { + sv = &CreateLogAnomalyDetectorOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "anomalyDetectorArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AnomalyDetectorArn to be of type string, got %T instead", value) + } + sv.AnomalyDetectorArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDeleteQueryDefinitionOutput(v **DeleteQueryDefinitionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12677,6 +14155,126 @@ func awsAwsjson11_deserializeOpDocumentGetDeliverySourceOutput(v **GetDeliverySo return nil } +func awsAwsjson11_deserializeOpDocumentGetLogAnomalyDetectorOutput(v **GetLogAnomalyDetectorOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetLogAnomalyDetectorOutput + if *v == nil { + sv = &GetLogAnomalyDetectorOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "anomalyDetectorStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AnomalyDetectorStatus to be of type string, got %T instead", value) + } + sv.AnomalyDetectorStatus = types.AnomalyDetectorStatus(jtv) + } + + case "anomalyVisibilityTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected AnomalyVisibilityTime to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.AnomalyVisibilityTime = ptr.Int64(i64) + } + + case "creationTimeStamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected EpochMillis to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.CreationTimeStamp = i64 + } + + case "detectorName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DetectorName to be of type string, got %T instead", value) + } + sv.DetectorName = ptr.String(jtv) + } + + case "evaluationFrequency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EvaluationFrequency to be of type string, got %T instead", value) + } + sv.EvaluationFrequency = types.EvaluationFrequency(jtv) + } + + case "filterPattern": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FilterPattern to be of type string, got %T instead", value) + } + sv.FilterPattern = ptr.String(jtv) + } + + case "kmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } + + case "lastModifiedTimeStamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected EpochMillis to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LastModifiedTimeStamp = i64 + } + + case "logGroupArnList": + if err := awsAwsjson11_deserializeDocumentLogGroupArnList(&sv.LogGroupArnList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentGetLogEventsOutput(v **GetLogEventsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12862,6 +14460,96 @@ func awsAwsjson11_deserializeOpDocumentGetQueryResultsOutput(v **GetQueryResults return nil } +func awsAwsjson11_deserializeOpDocumentListAnomaliesOutput(v **ListAnomaliesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListAnomaliesOutput + if *v == nil { + sv = &ListAnomaliesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "anomalies": + if err := awsAwsjson11_deserializeDocumentAnomalies(&sv.Anomalies, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListLogAnomalyDetectorsOutput(v **ListLogAnomalyDetectorsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListLogAnomalyDetectorsOutput + if *v == nil { + sv = &ListLogAnomalyDetectorsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "anomalyDetectors": + if err := awsAwsjson11_deserializeDocumentAnomalyDetectors(&sv.AnomalyDetectors, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/cloudwatchlogs/generated.json b/service/cloudwatchlogs/generated.json index d94afea928c..8632a24cdae 100644 --- a/service/cloudwatchlogs/generated.json +++ b/service/cloudwatchlogs/generated.json @@ -13,6 +13,7 @@ "api_op_CancelExportTask.go", "api_op_CreateDelivery.go", "api_op_CreateExportTask.go", + "api_op_CreateLogAnomalyDetector.go", "api_op_CreateLogGroup.go", "api_op_CreateLogStream.go", "api_op_DeleteAccountPolicy.go", @@ -22,6 +23,7 @@ "api_op_DeleteDeliveryDestinationPolicy.go", "api_op_DeleteDeliverySource.go", "api_op_DeleteDestination.go", + "api_op_DeleteLogAnomalyDetector.go", "api_op_DeleteLogGroup.go", "api_op_DeleteLogStream.go", "api_op_DeleteMetricFilter.go", @@ -49,10 +51,13 @@ "api_op_GetDeliveryDestination.go", "api_op_GetDeliveryDestinationPolicy.go", "api_op_GetDeliverySource.go", + "api_op_GetLogAnomalyDetector.go", "api_op_GetLogEvents.go", "api_op_GetLogGroupFields.go", "api_op_GetLogRecord.go", "api_op_GetQueryResults.go", + "api_op_ListAnomalies.go", + "api_op_ListLogAnomalyDetectors.go", "api_op_ListTagsForResource.go", "api_op_ListTagsLogGroup.go", "api_op_PutAccountPolicy.go", @@ -75,6 +80,8 @@ "api_op_TestMetricFilter.go", "api_op_UntagLogGroup.go", "api_op_UntagResource.go", + "api_op_UpdateAnomaly.go", + "api_op_UpdateLogAnomalyDetector.go", "auth.go", "deserializers.go", "doc.go", diff --git a/service/cloudwatchlogs/serializers.go b/service/cloudwatchlogs/serializers.go index 15270d9d133..c0b282fffb8 100644 --- a/service/cloudwatchlogs/serializers.go +++ b/service/cloudwatchlogs/serializers.go @@ -236,6 +236,61 @@ func (m *awsAwsjson11_serializeOpCreateExportTask) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpCreateLogAnomalyDetector struct { +} + +func (*awsAwsjson11_serializeOpCreateLogAnomalyDetector) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateLogAnomalyDetector) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateLogAnomalyDetectorInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.CreateLogAnomalyDetector") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateLogAnomalyDetectorInput(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_serializeOpCreateLogGroup struct { } @@ -731,6 +786,61 @@ func (m *awsAwsjson11_serializeOpDeleteDestination) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteLogAnomalyDetector struct { +} + +func (*awsAwsjson11_serializeOpDeleteLogAnomalyDetector) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteLogAnomalyDetector) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteLogAnomalyDetectorInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteLogAnomalyDetector") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteLogAnomalyDetectorInput(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_serializeOpDeleteLogGroup struct { } @@ -2216,6 +2326,61 @@ func (m *awsAwsjson11_serializeOpGetDeliverySource) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpGetLogAnomalyDetector struct { +} + +func (*awsAwsjson11_serializeOpGetLogAnomalyDetector) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetLogAnomalyDetector) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetLogAnomalyDetectorInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.GetLogAnomalyDetector") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetLogAnomalyDetectorInput(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_serializeOpGetLogEvents struct { } @@ -2436,6 +2601,116 @@ func (m *awsAwsjson11_serializeOpGetQueryResults) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListAnomalies struct { +} + +func (*awsAwsjson11_serializeOpListAnomalies) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListAnomalies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListAnomaliesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.ListAnomalies") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListAnomaliesInput(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_serializeOpListLogAnomalyDetectors struct { +} + +func (*awsAwsjson11_serializeOpListLogAnomalyDetectors) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListLogAnomalyDetectors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListLogAnomalyDetectorsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.ListLogAnomalyDetectors") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListLogAnomalyDetectorsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListTagsForResource struct { } @@ -3645,6 +3920,116 @@ func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } + +type awsAwsjson11_serializeOpUpdateAnomaly struct { +} + +func (*awsAwsjson11_serializeOpUpdateAnomaly) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateAnomaly) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateAnomalyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.UpdateAnomaly") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateAnomalyInput(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_serializeOpUpdateLogAnomalyDetector struct { +} + +func (*awsAwsjson11_serializeOpUpdateLogAnomalyDetector) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateLogAnomalyDetector) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateLogAnomalyDetectorInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.UpdateLogAnomalyDetector") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateLogAnomalyDetectorInput(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_serializeDocumentAccountIds(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -3720,6 +4105,17 @@ func awsAwsjson11_serializeDocumentInputLogStreamNames(v []string, value smithyj return nil } +func awsAwsjson11_serializeDocumentLogGroupArnList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentLogGroupIdentifiers(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -3807,6 +4203,23 @@ func awsAwsjson11_serializeDocumentMetricTransformations(v []types.MetricTransfo return nil } +func awsAwsjson11_serializeDocumentSuppressionPeriod(v *types.SuppressionPeriod, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.SuppressionUnit) > 0 { + ok := object.Key("suppressionUnit") + ok.String(string(v.SuppressionUnit)) + } + + if v.Value != 0 { + ok := object.Key("value") + ok.Integer(v.Value) + } + + return nil +} + func awsAwsjson11_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -3951,6 +4364,52 @@ func awsAwsjson11_serializeOpDocumentCreateExportTaskInput(v *CreateExportTaskIn return nil } +func awsAwsjson11_serializeOpDocumentCreateLogAnomalyDetectorInput(v *CreateLogAnomalyDetectorInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AnomalyVisibilityTime != nil { + ok := object.Key("anomalyVisibilityTime") + ok.Long(*v.AnomalyVisibilityTime) + } + + if v.DetectorName != nil { + ok := object.Key("detectorName") + ok.String(*v.DetectorName) + } + + if len(v.EvaluationFrequency) > 0 { + ok := object.Key("evaluationFrequency") + ok.String(string(v.EvaluationFrequency)) + } + + if v.FilterPattern != nil { + ok := object.Key("filterPattern") + ok.String(*v.FilterPattern) + } + + if v.KmsKeyId != nil { + ok := object.Key("kmsKeyId") + ok.String(*v.KmsKeyId) + } + + if v.LogGroupArnList != nil { + ok := object.Key("logGroupArnList") + if err := awsAwsjson11_serializeDocumentLogGroupArnList(v.LogGroupArnList, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCreateLogGroupInput(v *CreateLogGroupInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3960,6 +4419,11 @@ func awsAwsjson11_serializeOpDocumentCreateLogGroupInput(v *CreateLogGroupInput, ok.String(*v.KmsKeyId) } + if len(v.LogGroupClass) > 0 { + ok := object.Key("logGroupClass") + ok.String(string(v.LogGroupClass)) + } + if v.LogGroupName != nil { ok := object.Key("logGroupName") ok.String(*v.LogGroupName) @@ -4081,6 +4545,18 @@ func awsAwsjson11_serializeOpDocumentDeleteDestinationInput(v *DeleteDestination return nil } +func awsAwsjson11_serializeOpDocumentDeleteLogAnomalyDetectorInput(v *DeleteLogAnomalyDetectorInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AnomalyDetectorArn != nil { + ok := object.Key("anomalyDetectorArn") + ok.String(*v.AnomalyDetectorArn) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteLogGroupInput(v *DeleteLogGroupInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4325,6 +4801,11 @@ func awsAwsjson11_serializeOpDocumentDescribeLogGroupsInput(v *DescribeLogGroups ok.Integer(*v.Limit) } + if len(v.LogGroupClass) > 0 { + ok := object.Key("logGroupClass") + ok.String(string(v.LogGroupClass)) + } + if v.LogGroupNamePattern != nil { ok := object.Key("logGroupNamePattern") ok.String(*v.LogGroupNamePattern) @@ -4656,6 +5137,18 @@ func awsAwsjson11_serializeOpDocumentGetDeliverySourceInput(v *GetDeliverySource return nil } +func awsAwsjson11_serializeOpDocumentGetLogAnomalyDetectorInput(v *GetLogAnomalyDetectorInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AnomalyDetectorArn != nil { + ok := object.Key("anomalyDetectorArn") + ok.String(*v.AnomalyDetectorArn) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetLogEventsInput(v *GetLogEventsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4759,6 +5252,55 @@ func awsAwsjson11_serializeOpDocumentGetQueryResultsInput(v *GetQueryResultsInpu return nil } +func awsAwsjson11_serializeOpDocumentListAnomaliesInput(v *ListAnomaliesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AnomalyDetectorArn != nil { + ok := object.Key("anomalyDetectorArn") + ok.String(*v.AnomalyDetectorArn) + } + + if v.Limit != nil { + ok := object.Key("limit") + ok.Integer(*v.Limit) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if len(v.SuppressionState) > 0 { + ok := object.Key("suppressionState") + ok.String(string(v.SuppressionState)) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentListLogAnomalyDetectorsInput(v *ListLogAnomalyDetectorsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FilterLogGroupArn != nil { + ok := object.Key("filterLogGroupArn") + ok.String(*v.FilterLogGroupArn) + } + + if v.Limit != nil { + ok := object.Key("limit") + ok.Integer(*v.Limit) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5270,3 +5812,69 @@ func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, v return nil } + +func awsAwsjson11_serializeOpDocumentUpdateAnomalyInput(v *UpdateAnomalyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AnomalyDetectorArn != nil { + ok := object.Key("anomalyDetectorArn") + ok.String(*v.AnomalyDetectorArn) + } + + if v.AnomalyId != nil { + ok := object.Key("anomalyId") + ok.String(*v.AnomalyId) + } + + if v.PatternId != nil { + ok := object.Key("patternId") + ok.String(*v.PatternId) + } + + if v.SuppressionPeriod != nil { + ok := object.Key("suppressionPeriod") + if err := awsAwsjson11_serializeDocumentSuppressionPeriod(v.SuppressionPeriod, ok); err != nil { + return err + } + } + + if len(v.SuppressionType) > 0 { + ok := object.Key("suppressionType") + ok.String(string(v.SuppressionType)) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentUpdateLogAnomalyDetectorInput(v *UpdateLogAnomalyDetectorInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AnomalyDetectorArn != nil { + ok := object.Key("anomalyDetectorArn") + ok.String(*v.AnomalyDetectorArn) + } + + if v.AnomalyVisibilityTime != nil { + ok := object.Key("anomalyVisibilityTime") + ok.Long(*v.AnomalyVisibilityTime) + } + + if v.Enabled != nil { + ok := object.Key("enabled") + ok.Boolean(*v.Enabled) + } + + if len(v.EvaluationFrequency) > 0 { + ok := object.Key("evaluationFrequency") + ok.String(string(v.EvaluationFrequency)) + } + + if v.FilterPattern != nil { + ok := object.Key("filterPattern") + ok.String(*v.FilterPattern) + } + + return nil +} diff --git a/service/cloudwatchlogs/types/enums.go b/service/cloudwatchlogs/types/enums.go index 30119a2152d..30cf2c08cd0 100644 --- a/service/cloudwatchlogs/types/enums.go +++ b/service/cloudwatchlogs/types/enums.go @@ -2,6 +2,32 @@ package types +type AnomalyDetectorStatus string + +// Enum values for AnomalyDetectorStatus +const ( + AnomalyDetectorStatusInitializing AnomalyDetectorStatus = "INITIALIZING" + AnomalyDetectorStatusTraining AnomalyDetectorStatus = "TRAINING" + AnomalyDetectorStatusAnalyzing AnomalyDetectorStatus = "ANALYZING" + AnomalyDetectorStatusFailed AnomalyDetectorStatus = "FAILED" + AnomalyDetectorStatusDeleted AnomalyDetectorStatus = "DELETED" + AnomalyDetectorStatusPaused AnomalyDetectorStatus = "PAUSED" +) + +// Values returns all known values for AnomalyDetectorStatus. 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 (AnomalyDetectorStatus) Values() []AnomalyDetectorStatus { + return []AnomalyDetectorStatus{ + "INITIALIZING", + "TRAINING", + "ANALYZING", + "FAILED", + "DELETED", + "PAUSED", + } +} + type DataProtectionStatus string // Enum values for DataProtectionStatus @@ -62,6 +88,32 @@ func (Distribution) Values() []Distribution { } } +type EvaluationFrequency string + +// Enum values for EvaluationFrequency +const ( + EvaluationFrequencyOneMin EvaluationFrequency = "ONE_MIN" + EvaluationFrequencyFiveMin EvaluationFrequency = "FIVE_MIN" + EvaluationFrequencyTenMin EvaluationFrequency = "TEN_MIN" + EvaluationFrequencyFifteenMin EvaluationFrequency = "FIFTEEN_MIN" + EvaluationFrequencyThirtyMin EvaluationFrequency = "THIRTY_MIN" + EvaluationFrequencyOneHour EvaluationFrequency = "ONE_HOUR" +) + +// Values returns all known values for EvaluationFrequency. 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 (EvaluationFrequency) Values() []EvaluationFrequency { + return []EvaluationFrequency{ + "ONE_MIN", + "FIVE_MIN", + "TEN_MIN", + "FIFTEEN_MIN", + "THIRTY_MIN", + "ONE_HOUR", + } +} + type ExportTaskStatusCode string // Enum values for ExportTaskStatusCode @@ -104,6 +156,24 @@ func (InheritedProperty) Values() []InheritedProperty { } } +type LogGroupClass string + +// Enum values for LogGroupClass +const ( + LogGroupClassStandard LogGroupClass = "STANDARD" + LogGroupClassInfrequentAccess LogGroupClass = "INFREQUENT_ACCESS" +) + +// Values returns all known values for LogGroupClass. 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 (LogGroupClass) Values() []LogGroupClass { + return []LogGroupClass{ + "STANDARD", + "INFREQUENT_ACCESS", + } +} + type OrderBy string // Enum values for OrderBy @@ -273,3 +343,79 @@ func (StandardUnit) Values() []StandardUnit { "None", } } + +type State string + +// Enum values for State +const ( + StateActive State = "Active" + StateSuppressed State = "Suppressed" + StateBaseline State = "Baseline" +) + +// Values returns all known values for State. 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 (State) Values() []State { + return []State{ + "Active", + "Suppressed", + "Baseline", + } +} + +type SuppressionState string + +// Enum values for SuppressionState +const ( + SuppressionStateSuppressed SuppressionState = "SUPPRESSED" + SuppressionStateUnsuppressed SuppressionState = "UNSUPPRESSED" +) + +// Values returns all known values for SuppressionState. 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 (SuppressionState) Values() []SuppressionState { + return []SuppressionState{ + "SUPPRESSED", + "UNSUPPRESSED", + } +} + +type SuppressionType string + +// Enum values for SuppressionType +const ( + SuppressionTypeLimited SuppressionType = "LIMITED" + SuppressionTypeInfinite SuppressionType = "INFINITE" +) + +// Values returns all known values for SuppressionType. 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 (SuppressionType) Values() []SuppressionType { + return []SuppressionType{ + "LIMITED", + "INFINITE", + } +} + +type SuppressionUnit string + +// Enum values for SuppressionUnit +const ( + SuppressionUnitSeconds SuppressionUnit = "SECONDS" + SuppressionUnitMinutes SuppressionUnit = "MINUTES" + SuppressionUnitHours SuppressionUnit = "HOURS" +) + +// Values returns all known values for SuppressionUnit. 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 (SuppressionUnit) Values() []SuppressionUnit { + return []SuppressionUnit{ + "SECONDS", + "MINUTES", + "HOURS", + } +} diff --git a/service/cloudwatchlogs/types/types.go b/service/cloudwatchlogs/types/types.go index bf8bc9a0441..026f0f7ddd3 100644 --- a/service/cloudwatchlogs/types/types.go +++ b/service/cloudwatchlogs/types/types.go @@ -31,6 +31,164 @@ type AccountPolicy struct { noSmithyDocumentSerde } +// This structure represents one anomaly that has been found by a logs anomaly +// detector. For more information about patterns and anomalies, see +// CreateLogAnomalyDetector (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogAnomalyDetector.html) +// . +type Anomaly struct { + + // Specifies whether this anomaly is still ongoing. + // + // This member is required. + Active *bool + + // The ARN of the anomaly detector that identified this anomaly. + // + // This member is required. + AnomalyDetectorArn *string + + // The unique ID that CloudWatch Logs assigned to this anomaly. + // + // This member is required. + AnomalyId *string + + // A human-readable description of the anomaly. This description is generated by + // CloudWatch Logs. + // + // This member is required. + Description *string + + // The date and time when the anomaly detector first saw this anomaly. It is + // specified as epoch time, which is the number of seconds since January 1, 1970, + // 00:00:00 UTC . + // + // This member is required. + FirstSeen int64 + + // A map showing times when the anomaly detector ran, and the number of + // occurrences of this anomaly that were detected at each of those runs. The times + // are specified in epoch time, which is the number of seconds since January 1, + // 1970, 00:00:00 UTC . + // + // This member is required. + Histogram map[string]int64 + + // The date and time when the anomaly detector most recently saw this anomaly. It + // is specified as epoch time, which is the number of seconds since January 1, + // 1970, 00:00:00 UTC . + // + // This member is required. + LastSeen int64 + + // An array of ARNS of the log groups that contained log events considered to be + // part of this anomaly. + // + // This member is required. + LogGroupArnList []string + + // An array of sample log event messages that are considered to be part of this + // anomaly. + // + // This member is required. + LogSamples []string + + // The ID of the pattern used to help identify this anomaly. + // + // This member is required. + PatternId *string + + // The pattern used to help identify this anomaly, in string format. + // + // This member is required. + PatternString *string + + // An array of structures where each structure contains information about one + // token that makes up the pattern. + // + // This member is required. + PatternTokens []PatternToken + + // Indicates the current state of this anomaly. If it is still being treated as an + // anomaly, the value is Active . If you have suppressed this anomaly by using the + // UpdateAnomaly (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_UpdateAnomaly.html) + // operation, the value is Suppressed . If this behavior is now considered to be + // normal, the value is Baseline . + // + // This member is required. + State State + + // If this anomaly is suppressed, this field is true if the suppression is because + // the pattern is suppressed. If false , then only this particular anomaly is + // suppressed. + IsPatternLevelSuppression *bool + + // The pattern used to help identify this anomaly, in regular expression format. + PatternRegex *string + + // The priority level of this anomaly, as determined by CloudWatch Logs. Priority + // is computed based on log severity labels such as FATAL and ERROR and the amount + // of deviation from the baseline. Possible values are HIGH , MEDIUM , and LOW . + Priority *string + + // Indicates whether this anomaly is currently suppressed. To suppress an anomaly, + // use UpdateAnomaly (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_UpdateAnomaly.html) + // . + Suppressed *bool + + // If the anomaly is suppressed, this indicates when it was suppressed. + SuppressedDate int64 + + // If the anomaly is suppressed, this indicates when the suppression will end. If + // this value is 0 , the anomaly was suppressed with no expiration, with the + // INFINITE value. + SuppressedUntil int64 + + noSmithyDocumentSerde +} + +// Contains information about one anomaly detector in the account. +type AnomalyDetector struct { + + // The ARN of the anomaly detector. + AnomalyDetectorArn *string + + // Specifies the current status of the anomaly detector. To pause an anomaly + // detector, use the enabled parameter in the UpdateLogAnomalyDetector (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_UpdateLogAnomalyDetector.html) + // operation. + AnomalyDetectorStatus AnomalyDetectorStatus + + // The number of days used as the life cycle of anomalies. After this time, + // anomalies are automatically baselined and the anomaly detector model will treat + // new occurrences of similar event as normal. + AnomalyVisibilityTime *int64 + + // The date and time when this anomaly detector was created. + CreationTimeStamp int64 + + // The name of the anomaly detector. + DetectorName *string + + // Specifies how often the anomaly detector runs and look for anomalies. + EvaluationFrequency EvaluationFrequency + + // A symbolic description of how CloudWatch Logs should interpret the data in each + // log event. For example, a log event can contain timestamps, IP addresses, + // strings, and so on. You use the filter pattern to specify what to look for in + // the log event message. + FilterPattern *string + + // The ID of the KMS key assigned to this anomaly detector, if any. + KmsKeyId *string + + // The date and time when this anomaly detector was most recently modified. + LastModifiedTimeStamp int64 + + // A list of the ARNs of the log groups that this anomaly detector watches. + LogGroupArnList []string + + noSmithyDocumentSerde +} + // This structure contains information about one delivery in your account. A // delivery is a connection between a logical delivery source and a logical // delivery destination. For more information, see CreateDelivery (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html) @@ -62,7 +220,7 @@ type Delivery struct { // This structure contains information about one delivery destination in your // account. A delivery destination is an Amazon Web Services resource that -// represents an shared id="AWS"/> service that logs can be sent to. CloudWatch +// represents an Amazon Web Services service that logs can be sent to. CloudWatch // Logs, Amazon S3, are supported as Kinesis Data Firehose delivery destinations. // To configure logs delivery between a supported Amazon Web Services service and a // destination, you must do the following: @@ -130,7 +288,7 @@ type DeliveryDestinationConfiguration struct { // S3, or Kinesis Data Firehose. Only some Amazon Web Services services support // being configured as a delivery source. These services are listed as Supported // [V2 Permissions] in the table at Enabling logging from Amazon Web Services -// services. (https://docs.aws.amazon.com/ AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-vended-logs-permissions) +// services. (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html) // To configure logs delivery between a supported Amazon Web Services service and a // destination, you must do the following: // - Create a delivery source, which is a logical object that represents the @@ -331,6 +489,13 @@ type LogGroup struct { // The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data. KmsKeyId *string + // This specifies the log group class for this log group. There are two classes: + // - The Standard log class supports all CloudWatch Logs features. + // - The Infrequent Access log class supports a subset of CloudWatch Logs + // features and incurs lower costs. + // For details about the features supported by each class, see Log classes (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html) + LogGroupClass LogGroupClass + // The name of the log group. LogGroupName *string @@ -518,6 +683,31 @@ type OutputLogEvent struct { noSmithyDocumentSerde } +// A tructures that contains information about one pattern token related to an +// anomaly. For more information about patterns and tokens, see +// CreateLogAnomalyDetector (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogAnomalyDetector.html) +// . +type PatternToken struct { + + // For a dynamic token, this indicates where in the pattern that this token + // appears, related to other dynamic tokens. The dynamic token that appears first + // has a value of 1 , the one that appears second is 2 , and so on. + DynamicTokenPosition int32 + + // Contains the values found for a dynamic token, and the number of times each + // value was found. + Enumerations map[string]int64 + + // Specifies whether this is a dynamic token. + IsDynamic *bool + + // The string represented by this token. If this is a dynamic token, the value + // will be <*> + TokenString *string + + noSmithyDocumentSerde +} + // A structure that contains information about one delivery destination policy. type Policy struct { @@ -707,4 +897,18 @@ type SubscriptionFilter struct { noSmithyDocumentSerde } +// If you are suppressing an anomaly temporariliy, this structure defines how long +// the suppression period is to be. +type SuppressionPeriod struct { + + // Specifies whether the value of value is in seconds, minutes, or hours. + SuppressionUnit SuppressionUnit + + // Specifies the number of seconds, minutes or hours to suppress this anomaly. + // There is no maximum. + Value int32 + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/cloudwatchlogs/validators.go b/service/cloudwatchlogs/validators.go index 287a39c3199..c40563713dc 100644 --- a/service/cloudwatchlogs/validators.go +++ b/service/cloudwatchlogs/validators.go @@ -90,6 +90,26 @@ func (m *validateOpCreateExportTask) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpCreateLogAnomalyDetector struct { +} + +func (*validateOpCreateLogAnomalyDetector) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateLogAnomalyDetector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateLogAnomalyDetectorInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateLogAnomalyDetectorInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateLogGroup struct { } @@ -270,6 +290,26 @@ func (m *validateOpDeleteDestination) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpDeleteLogAnomalyDetector struct { +} + +func (*validateOpDeleteLogAnomalyDetector) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteLogAnomalyDetector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteLogAnomalyDetectorInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteLogAnomalyDetectorInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteLogGroup struct { } @@ -530,6 +570,26 @@ func (m *validateOpGetDeliverySource) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpGetLogAnomalyDetector struct { +} + +func (*validateOpGetLogAnomalyDetector) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetLogAnomalyDetector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetLogAnomalyDetectorInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetLogAnomalyDetectorInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetLogEvents struct { } @@ -1010,6 +1070,46 @@ func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateAnomaly struct { +} + +func (*validateOpUpdateAnomaly) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateAnomaly) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateAnomalyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateAnomalyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateLogAnomalyDetector struct { +} + +func (*validateOpUpdateLogAnomalyDetector) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateLogAnomalyDetector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateLogAnomalyDetectorInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateLogAnomalyDetectorInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + func addOpAssociateKmsKeyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateKmsKey{}, middleware.After) } @@ -1026,6 +1126,10 @@ func addOpCreateExportTaskValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateExportTask{}, middleware.After) } +func addOpCreateLogAnomalyDetectorValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateLogAnomalyDetector{}, middleware.After) +} + func addOpCreateLogGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateLogGroup{}, middleware.After) } @@ -1062,6 +1166,10 @@ func addOpDeleteDestinationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDestination{}, middleware.After) } +func addOpDeleteLogAnomalyDetectorValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteLogAnomalyDetector{}, middleware.After) +} + func addOpDeleteLogGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteLogGroup{}, middleware.After) } @@ -1114,6 +1222,10 @@ func addOpGetDeliverySourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDeliverySource{}, middleware.After) } +func addOpGetLogAnomalyDetectorValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetLogAnomalyDetector{}, middleware.After) +} + func addOpGetLogEventsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetLogEvents{}, middleware.After) } @@ -1210,6 +1322,14 @@ func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } +func addOpUpdateAnomalyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateAnomaly{}, middleware.After) +} + +func addOpUpdateLogAnomalyDetectorValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateLogAnomalyDetector{}, middleware.After) +} + func validateDeliveryDestinationConfiguration(v *types.DeliveryDestinationConfiguration) error { if v == nil { return nil @@ -1370,6 +1490,21 @@ func validateOpCreateExportTaskInput(v *CreateExportTaskInput) error { } } +func validateOpCreateLogAnomalyDetectorInput(v *CreateLogAnomalyDetectorInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateLogAnomalyDetectorInput"} + if v.LogGroupArnList == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogGroupArnList")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateLogGroupInput(v *CreateLogGroupInput) error { if v == nil { return nil @@ -1511,6 +1646,21 @@ func validateOpDeleteDestinationInput(v *DeleteDestinationInput) error { } } +func validateOpDeleteLogAnomalyDetectorInput(v *DeleteLogAnomalyDetectorInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteLogAnomalyDetectorInput"} + if v.AnomalyDetectorArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AnomalyDetectorArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteLogGroupInput(v *DeleteLogGroupInput) error { if v == nil { return nil @@ -1715,6 +1865,21 @@ func validateOpGetDeliverySourceInput(v *GetDeliverySourceInput) error { } } +func validateOpGetLogAnomalyDetectorInput(v *GetLogAnomalyDetectorInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetLogAnomalyDetectorInput"} + if v.AnomalyDetectorArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AnomalyDetectorArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetLogEventsInput(v *GetLogEventsInput) error { if v == nil { return nil @@ -2167,3 +2332,36 @@ func validateOpUntagResourceInput(v *UntagResourceInput) error { return nil } } + +func validateOpUpdateAnomalyInput(v *UpdateAnomalyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateAnomalyInput"} + if v.AnomalyDetectorArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AnomalyDetectorArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateLogAnomalyDetectorInput(v *UpdateLogAnomalyDetectorInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateLogAnomalyDetectorInput"} + if v.AnomalyDetectorArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AnomalyDetectorArn")) + } + if v.Enabled == nil { + invalidParams.Add(smithy.NewErrParamRequired("Enabled")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} 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/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/computeoptimizer/api_op_GetEffectiveRecommendationPreferences.go b/service/computeoptimizer/api_op_GetEffectiveRecommendationPreferences.go index 87984e4fe2d..ef3b0ee0d15 100644 --- a/service/computeoptimizer/api_op_GetEffectiveRecommendationPreferences.go +++ b/service/computeoptimizer/api_op_GetEffectiveRecommendationPreferences.go @@ -71,6 +71,32 @@ type GetEffectiveRecommendationPreferencesOutput struct { // in the Compute Optimizer User Guide. ExternalMetricsPreference *types.ExternalMetricsPreference + // The number of days the utilization metrics of the Amazon Web Services resource + // are analyzed. To validate that the preference is applied to your last generated + // set of recommendations, review the effectiveRecommendationPreferences value in + // the response of the GetAutoScalingGroupRecommendations or + // GetEC2InstanceRecommendations actions. + LookBackPeriod types.LookBackPeriodPreference + + // The resource type values that are considered as candidates when generating + // rightsizing recommendations. This object resolves any wildcard expressions and + // returns the effective list of candidate resource type values. It also considers + // all applicable preferences that you set at the resource, account, and + // organization level. To validate that the preference is applied to your last + // generated set of recommendations, review the effectiveRecommendationPreferences + // value in the response of the GetAutoScalingGroupRecommendations or + // GetEC2InstanceRecommendations actions. + PreferredResources []types.EffectivePreferredResource + + // The resource’s CPU utilization threshold preferences, such as threshold and + // headroom, that were used to generate rightsizing recommendations. It considers + // all applicable preferences that you set at the resource, account, and + // organization level. To validate that the preference is applied to your last + // generated set of recommendations, review the effectiveRecommendationPreferences + // value in the response of the GetAutoScalingGroupRecommendations or + // GetEC2InstanceRecommendations actions. + UtilizationPreferences []types.UtilizationPreference + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/computeoptimizer/api_op_PutRecommendationPreferences.go b/service/computeoptimizer/api_op_PutRecommendationPreferences.go index d595ab12a4d..8d080ff1c79 100644 --- a/service/computeoptimizer/api_op_PutRecommendationPreferences.go +++ b/service/computeoptimizer/api_op_PutRecommendationPreferences.go @@ -65,6 +65,28 @@ type PutRecommendationPreferencesInput struct { // in the Compute Optimizer User Guide. InferredWorkloadTypes types.InferredWorkloadTypesPreference + // The preference to control the number of days the utilization metrics of the + // Amazon Web Services resource are analyzed. When this preference isn't specified, + // we use the default value DAYS_14 . You can only set this preference for the + // Amazon EC2 instance and Auto Scaling group resource types. + LookBackPeriod types.LookBackPeriodPreference + + // The preference to control which resource type values are considered when + // generating rightsizing recommendations. You can specify this preference as a + // combination of include and exclude lists. You must specify either an includeList + // or excludeList . If the preference is an empty set of resource type values, an + // error occurs. You can only set this preference for the Amazon EC2 instance and + // Auto Scaling group resource types. + PreferredResources []types.PreferredResource + + // The status of the savings estimation mode preference to create or update. + // Specify the AfterDiscounts status to activate the preference, or specify + // BeforeDiscounts to deactivate the preference. Only the account manager or + // delegated administrator of your organization can activate this preference. For + // more information, see Savings estimation mode (https://docs.aws.amazon.com/compute-optimizer/latest/ug/savings-estimation-mode.html) + // in the Compute Optimizer User Guide. + SavingsEstimationMode types.SavingsEstimationMode + // An object that describes the scope of the recommendation preference to create. // You can create recommendation preferences at the organization level (for // management accounts of an organization only), account level, and resource level. @@ -80,6 +102,14 @@ type PutRecommendationPreferencesInput struct { // preferences at the resource level only for standalone instances. Scope *types.Scope + // The preference to control the resource’s CPU utilization thresholds - threshold + // and headroom. When this preference isn't specified, we use the following default + // values: + // - P99_5 for threshold + // - PERCENT_17 for headroom + // You can only set this preference for the Amazon EC2 instance resource type. + UtilizationPreferences []types.UtilizationPreference + noSmithyDocumentSerde } diff --git a/service/computeoptimizer/deserializers.go b/service/computeoptimizer/deserializers.go index e391d10a7fa..25506f77310 100644 --- a/service/computeoptimizer/deserializers.go +++ b/service/computeoptimizer/deserializers.go @@ -3578,6 +3578,80 @@ func awsAwsjson10_deserializeDocumentAutoScalingGroupConfiguration(v **types.Aut return nil } +func awsAwsjson10_deserializeDocumentAutoScalingGroupEstimatedMonthlySavings(v **types.AutoScalingGroupEstimatedMonthlySavings, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AutoScalingGroupEstimatedMonthlySavings + if *v == nil { + sv = &types.AutoScalingGroupEstimatedMonthlySavings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "currency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Currency to be of type string, got %T instead", value) + } + sv.Currency = types.Currency(jtv) + } + + case "value": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Value = 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.Value = f64 + + default: + return fmt.Errorf("expected Value to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentAutoScalingGroupRecommendation(v **types.AutoScalingGroupRecommendation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3832,6 +3906,11 @@ func awsAwsjson10_deserializeDocumentAutoScalingGroupRecommendationOption(v **ty return err } + case "savingsOpportunityAfterDiscounts": + if err := awsAwsjson10_deserializeDocumentAutoScalingGroupSavingsOpportunityAfterDiscounts(&sv.SavingsOpportunityAfterDiscounts, value); err != nil { + return err + } + default: _, _ = key, value @@ -3909,6 +3988,76 @@ func awsAwsjson10_deserializeDocumentAutoScalingGroupRecommendations(v *[]types. return nil } +func awsAwsjson10_deserializeDocumentAutoScalingGroupSavingsOpportunityAfterDiscounts(v **types.AutoScalingGroupSavingsOpportunityAfterDiscounts, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AutoScalingGroupSavingsOpportunityAfterDiscounts + if *v == nil { + sv = &types.AutoScalingGroupSavingsOpportunityAfterDiscounts{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "estimatedMonthlySavings": + if err := awsAwsjson10_deserializeDocumentAutoScalingGroupEstimatedMonthlySavings(&sv.EstimatedMonthlySavings, value); err != nil { + return err + } + + case "savingsOpportunityPercentage": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SavingsOpportunityPercentage = 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.SavingsOpportunityPercentage = f64 + + default: + return fmt.Errorf("expected SavingsOpportunityPercentage to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentContainerConfiguration(v **types.ContainerConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4212,7 +4361,7 @@ func awsAwsjson10_deserializeDocumentCurrentPerformanceRiskRatings(v **types.Cur return nil } -func awsAwsjson10_deserializeDocumentEBSUtilizationMetric(v **types.EBSUtilizationMetric, value interface{}) error { +func awsAwsjson10_deserializeDocumentCustomizableMetricParameters(v **types.CustomizableMetricParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4225,31 +4374,107 @@ func awsAwsjson10_deserializeDocumentEBSUtilizationMetric(v **types.EBSUtilizati return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.EBSUtilizationMetric + var sv *types.CustomizableMetricParameters if *v == nil { - sv = &types.EBSUtilizationMetric{} + sv = &types.CustomizableMetricParameters{} } else { sv = *v } for key, value := range shape { switch key { - case "name": + case "headroom": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EBSMetricName to be of type string, got %T instead", value) + return fmt.Errorf("expected CustomizableMetricHeadroom to be of type string, got %T instead", value) } - sv.Name = types.EBSMetricName(jtv) + sv.Headroom = types.CustomizableMetricHeadroom(jtv) } - case "statistic": + case "threshold": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MetricStatistic to be of type string, got %T instead", value) + return fmt.Errorf("expected CustomizableMetricThreshold to be of type string, got %T instead", value) } - sv.Statistic = types.MetricStatistic(jtv) + sv.Threshold = types.CustomizableMetricThreshold(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEBSEffectiveRecommendationPreferences(v **types.EBSEffectiveRecommendationPreferences, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EBSEffectiveRecommendationPreferences + if *v == nil { + sv = &types.EBSEffectiveRecommendationPreferences{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "savingsEstimationMode": + if err := awsAwsjson10_deserializeDocumentEBSSavingsEstimationMode(&sv.SavingsEstimationMode, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEBSEstimatedMonthlySavings(v **types.EBSEstimatedMonthlySavings, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EBSEstimatedMonthlySavings + if *v == nil { + sv = &types.EBSEstimatedMonthlySavings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "currency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Currency to be of type string, got %T instead", value) + } + sv.Currency = types.Currency(jtv) } case "value": @@ -4281,7 +4506,7 @@ func awsAwsjson10_deserializeDocumentEBSUtilizationMetric(v **types.EBSUtilizati sv.Value = f64 default: - return fmt.Errorf("expected MetricValue to be a JSON Number, got %T instead", value) + return fmt.Errorf("expected Value to be a JSON Number, got %T instead", value) } } @@ -4295,7 +4520,7 @@ func awsAwsjson10_deserializeDocumentEBSUtilizationMetric(v **types.EBSUtilizati return nil } -func awsAwsjson10_deserializeDocumentEBSUtilizationMetrics(v *[]types.EBSUtilizationMetric, value interface{}) error { +func awsAwsjson10_deserializeDocumentEBSSavingsEstimationMode(v **types.EBSSavingsEstimationMode, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4303,33 +4528,39 @@ func awsAwsjson10_deserializeDocumentEBSUtilizationMetrics(v *[]types.EBSUtiliza 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.EBSUtilizationMetric + var sv *types.EBSSavingsEstimationMode if *v == nil { - cv = []types.EBSUtilizationMetric{} + sv = &types.EBSSavingsEstimationMode{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.EBSUtilizationMetric - destAddr := &col - if err := awsAwsjson10_deserializeDocumentEBSUtilizationMetric(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EBSSavingsEstimationModeSource to be of type string, got %T instead", value) + } + sv.Source = types.EBSSavingsEstimationModeSource(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsAwsjson10_deserializeDocumentECSServiceProjectedMetric(v **types.ECSServiceProjectedMetric, value interface{}) error { +func awsAwsjson10_deserializeDocumentEBSSavingsOpportunityAfterDiscounts(v **types.EBSSavingsOpportunityAfterDiscounts, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4342,21 +4573,428 @@ func awsAwsjson10_deserializeDocumentECSServiceProjectedMetric(v **types.ECSServ return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ECSServiceProjectedMetric + var sv *types.EBSSavingsOpportunityAfterDiscounts if *v == nil { - sv = &types.ECSServiceProjectedMetric{} + sv = &types.EBSSavingsOpportunityAfterDiscounts{} } else { sv = *v } for key, value := range shape { switch key { - case "lowerBoundValues": - if err := awsAwsjson10_deserializeDocumentMetricValues(&sv.LowerBoundValues, value); err != nil { + case "estimatedMonthlySavings": + if err := awsAwsjson10_deserializeDocumentEBSEstimatedMonthlySavings(&sv.EstimatedMonthlySavings, value); err != nil { return err } - case "name": + case "savingsOpportunityPercentage": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SavingsOpportunityPercentage = 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.SavingsOpportunityPercentage = f64 + + default: + return fmt.Errorf("expected SavingsOpportunityPercentage to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEBSUtilizationMetric(v **types.EBSUtilizationMetric, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EBSUtilizationMetric + if *v == nil { + sv = &types.EBSUtilizationMetric{} + } 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 EBSMetricName to be of type string, got %T instead", value) + } + sv.Name = types.EBSMetricName(jtv) + } + + case "statistic": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MetricStatistic to be of type string, got %T instead", value) + } + sv.Statistic = types.MetricStatistic(jtv) + } + + case "value": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Value = 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.Value = f64 + + default: + return fmt.Errorf("expected MetricValue to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEBSUtilizationMetrics(v *[]types.EBSUtilizationMetric, 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.EBSUtilizationMetric + if *v == nil { + cv = []types.EBSUtilizationMetric{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EBSUtilizationMetric + destAddr := &col + if err := awsAwsjson10_deserializeDocumentEBSUtilizationMetric(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentECSEffectiveRecommendationPreferences(v **types.ECSEffectiveRecommendationPreferences, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ECSEffectiveRecommendationPreferences + if *v == nil { + sv = &types.ECSEffectiveRecommendationPreferences{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "savingsEstimationMode": + if err := awsAwsjson10_deserializeDocumentECSSavingsEstimationMode(&sv.SavingsEstimationMode, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentECSEstimatedMonthlySavings(v **types.ECSEstimatedMonthlySavings, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ECSEstimatedMonthlySavings + if *v == nil { + sv = &types.ECSEstimatedMonthlySavings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "currency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Currency to be of type string, got %T instead", value) + } + sv.Currency = types.Currency(jtv) + } + + case "value": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Value = 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.Value = f64 + + default: + return fmt.Errorf("expected Value to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentECSSavingsEstimationMode(v **types.ECSSavingsEstimationMode, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ECSSavingsEstimationMode + if *v == nil { + sv = &types.ECSSavingsEstimationMode{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ECSSavingsEstimationModeSource to be of type string, got %T instead", value) + } + sv.Source = types.ECSSavingsEstimationModeSource(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentECSSavingsOpportunityAfterDiscounts(v **types.ECSSavingsOpportunityAfterDiscounts, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ECSSavingsOpportunityAfterDiscounts + if *v == nil { + sv = &types.ECSSavingsOpportunityAfterDiscounts{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "estimatedMonthlySavings": + if err := awsAwsjson10_deserializeDocumentECSEstimatedMonthlySavings(&sv.EstimatedMonthlySavings, value); err != nil { + return err + } + + case "savingsOpportunityPercentage": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SavingsOpportunityPercentage = 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.SavingsOpportunityPercentage = f64 + + default: + return fmt.Errorf("expected SavingsOpportunityPercentage to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentECSServiceProjectedMetric(v **types.ECSServiceProjectedMetric, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ECSServiceProjectedMetric + if *v == nil { + sv = &types.ECSServiceProjectedMetric{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "lowerBoundValues": + if err := awsAwsjson10_deserializeDocumentMetricValues(&sv.LowerBoundValues, value); err != nil { + return err + } + + case "name": if value != nil { jtv, ok := value.(string) if !ok { @@ -4614,6 +5252,11 @@ func awsAwsjson10_deserializeDocumentECSServiceRecommendation(v **types.ECSServi return err } + case "effectiveRecommendationPreferences": + if err := awsAwsjson10_deserializeDocumentECSEffectiveRecommendationPreferences(&sv.EffectiveRecommendationPreferences, value); err != nil { + return err + } + case "finding": if value != nil { jtv, ok := value.(string) @@ -4819,6 +5462,11 @@ func awsAwsjson10_deserializeDocumentECSServiceRecommendationOption(v **types.EC return err } + case "savingsOpportunityAfterDiscounts": + if err := awsAwsjson10_deserializeDocumentECSSavingsOpportunityAfterDiscounts(&sv.SavingsOpportunityAfterDiscounts, value); err != nil { + return err + } + default: _, _ = key, value @@ -5109,6 +5757,95 @@ func awsAwsjson10_deserializeDocumentECSServiceUtilizationMetrics(v *[]types.ECS return nil } +func awsAwsjson10_deserializeDocumentEffectivePreferredResource(v **types.EffectivePreferredResource, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EffectivePreferredResource + if *v == nil { + sv = &types.EffectivePreferredResource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "effectiveIncludeList": + if err := awsAwsjson10_deserializeDocumentPreferredResourceValues(&sv.EffectiveIncludeList, value); err != nil { + return err + } + + case "excludeList": + if err := awsAwsjson10_deserializeDocumentPreferredResourceValues(&sv.ExcludeList, value); err != nil { + return err + } + + case "includeList": + if err := awsAwsjson10_deserializeDocumentPreferredResourceValues(&sv.IncludeList, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PreferredResourceName to be of type string, got %T instead", value) + } + sv.Name = types.PreferredResourceName(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEffectivePreferredResources(v *[]types.EffectivePreferredResource, 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.EffectivePreferredResource + if *v == nil { + cv = []types.EffectivePreferredResource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EffectivePreferredResource + destAddr := &col + if err := awsAwsjson10_deserializeDocumentEffectivePreferredResource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson10_deserializeDocumentEffectiveRecommendationPreferences(v **types.EffectiveRecommendationPreferences, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5159,6 +5896,30 @@ func awsAwsjson10_deserializeDocumentEffectiveRecommendationPreferences(v **type sv.InferredWorkloadTypes = types.InferredWorkloadTypesPreference(jtv) } + case "lookBackPeriod": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LookBackPeriodPreference to be of type string, got %T instead", value) + } + sv.LookBackPeriod = types.LookBackPeriodPreference(jtv) + } + + case "preferredResources": + if err := awsAwsjson10_deserializeDocumentEffectivePreferredResources(&sv.PreferredResources, value); err != nil { + return err + } + + case "savingsEstimationMode": + if err := awsAwsjson10_deserializeDocumentInstanceSavingsEstimationMode(&sv.SavingsEstimationMode, value); err != nil { + return err + } + + case "utilizationPreferences": + if err := awsAwsjson10_deserializeDocumentUtilizationPreferences(&sv.UtilizationPreferences, value); err != nil { + return err + } + default: _, _ = key, value @@ -5656,44 +6417,118 @@ func awsAwsjson10_deserializeDocumentInferredWorkloadSavings(v *[]types.Inferred col = *destAddr cv = append(cv, col) - } - *v = cv - return nil -} + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentInferredWorkloadTypes(v *[]types.InferredWorkloadType, 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.InferredWorkloadType + if *v == nil { + cv = []types.InferredWorkloadType{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.InferredWorkloadType + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InferredWorkloadType to be of type string, got %T instead", value) + } + col = types.InferredWorkloadType(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentInstanceEstimatedMonthlySavings(v **types.InstanceEstimatedMonthlySavings, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InstanceEstimatedMonthlySavings + if *v == nil { + sv = &types.InstanceEstimatedMonthlySavings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "currency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Currency to be of type string, got %T instead", value) + } + sv.Currency = types.Currency(jtv) + } + + case "value": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Value = f64 + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) -func awsAwsjson10_deserializeDocumentInferredWorkloadTypes(v *[]types.InferredWorkloadType, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) - var cv []types.InferredWorkloadType - if *v == nil { - cv = []types.InferredWorkloadType{} - } else { - cv = *v - } + } + sv.Value = f64 - for _, value := range shape { - var col types.InferredWorkloadType - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected InferredWorkloadType to be of type string, got %T instead", value) + default: + return fmt.Errorf("expected Value to be a JSON Number, got %T instead", value) + + } } - col = types.InferredWorkloadType(jtv) - } - cv = append(cv, col) + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } @@ -6038,6 +6873,11 @@ func awsAwsjson10_deserializeDocumentInstanceRecommendationOption(v **types.Inst return err } + case "savingsOpportunityAfterDiscounts": + if err := awsAwsjson10_deserializeDocumentInstanceSavingsOpportunityAfterDiscounts(&sv.SavingsOpportunityAfterDiscounts, value); err != nil { + return err + } + default: _, _ = key, value @@ -6081,6 +6921,116 @@ func awsAwsjson10_deserializeDocumentInstanceRecommendations(v *[]types.Instance return nil } +func awsAwsjson10_deserializeDocumentInstanceSavingsEstimationMode(v **types.InstanceSavingsEstimationMode, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InstanceSavingsEstimationMode + if *v == nil { + sv = &types.InstanceSavingsEstimationMode{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceSavingsEstimationModeSource to be of type string, got %T instead", value) + } + sv.Source = types.InstanceSavingsEstimationModeSource(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentInstanceSavingsOpportunityAfterDiscounts(v **types.InstanceSavingsOpportunityAfterDiscounts, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InstanceSavingsOpportunityAfterDiscounts + if *v == nil { + sv = &types.InstanceSavingsOpportunityAfterDiscounts{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "estimatedMonthlySavings": + if err := awsAwsjson10_deserializeDocumentInstanceEstimatedMonthlySavings(&sv.EstimatedMonthlySavings, value); err != nil { + return err + } + + case "savingsOpportunityPercentage": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SavingsOpportunityPercentage = 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.SavingsOpportunityPercentage = f64 + + default: + return fmt.Errorf("expected SavingsOpportunityPercentage to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6141,15 +7091,125 @@ func awsAwsjson10_deserializeDocumentInvalidParameterValueException(v **types.In 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) + 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_deserializeDocumentLambdaEffectiveRecommendationPreferences(v **types.LambdaEffectiveRecommendationPreferences, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LambdaEffectiveRecommendationPreferences + if *v == nil { + sv = &types.LambdaEffectiveRecommendationPreferences{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "savingsEstimationMode": + if err := awsAwsjson10_deserializeDocumentLambdaSavingsEstimationMode(&sv.SavingsEstimationMode, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentLambdaEstimatedMonthlySavings(v **types.LambdaEstimatedMonthlySavings, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LambdaEstimatedMonthlySavings + if *v == nil { + sv = &types.LambdaEstimatedMonthlySavings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "currency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Currency to be of type string, got %T instead", value) + } + sv.Currency = types.Currency(jtv) + } + + case "value": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Value = 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.Value = f64 + + default: + return fmt.Errorf("expected Value to be a JSON Number, got %T instead", value) + } - sv.Message = ptr.String(jtv) } default: @@ -6336,6 +7396,11 @@ func awsAwsjson10_deserializeDocumentLambdaFunctionMemoryRecommendationOption(v return err } + case "savingsOpportunityAfterDiscounts": + if err := awsAwsjson10_deserializeDocumentLambdaSavingsOpportunityAfterDiscounts(&sv.SavingsOpportunityAfterDiscounts, value); err != nil { + return err + } + default: _, _ = key, value @@ -6432,6 +7497,11 @@ func awsAwsjson10_deserializeDocumentLambdaFunctionRecommendation(v **types.Lamb sv.CurrentPerformanceRisk = types.CurrentPerformanceRisk(jtv) } + case "effectiveRecommendationPreferences": + if err := awsAwsjson10_deserializeDocumentLambdaEffectiveRecommendationPreferences(&sv.EffectiveRecommendationPreferences, value); err != nil { + return err + } + case "finding": if value != nil { jtv, ok := value.(string) @@ -6738,6 +7808,116 @@ func awsAwsjson10_deserializeDocumentLambdaFunctionUtilizationMetrics(v *[]types return nil } +func awsAwsjson10_deserializeDocumentLambdaSavingsEstimationMode(v **types.LambdaSavingsEstimationMode, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LambdaSavingsEstimationMode + if *v == nil { + sv = &types.LambdaSavingsEstimationMode{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LambdaSavingsEstimationModeSource to be of type string, got %T instead", value) + } + sv.Source = types.LambdaSavingsEstimationModeSource(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentLambdaSavingsOpportunityAfterDiscounts(v **types.LambdaSavingsOpportunityAfterDiscounts, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LambdaSavingsOpportunityAfterDiscounts + if *v == nil { + sv = &types.LambdaSavingsOpportunityAfterDiscounts{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "estimatedMonthlySavings": + if err := awsAwsjson10_deserializeDocumentLambdaEstimatedMonthlySavings(&sv.EstimatedMonthlySavings, value); err != nil { + return err + } + + case "savingsOpportunityPercentage": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SavingsOpportunityPercentage = 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.SavingsOpportunityPercentage = f64 + + default: + return fmt.Errorf("expected SavingsOpportunityPercentage to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentLicenseConfiguration(v **types.LicenseConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7506,6 +8686,42 @@ func awsAwsjson10_deserializeDocumentPlatformDifferences(v *[]types.PlatformDiff return nil } +func awsAwsjson10_deserializeDocumentPreferredResourceValues(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 PreferredResourceValue to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson10_deserializeDocumentProjectedMetric(v **types.ProjectedMetric, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7949,6 +9165,20 @@ func awsAwsjson10_deserializeDocumentRecommendationPreferencesDetail(v **types.R sv.InferredWorkloadTypes = types.InferredWorkloadTypesPreference(jtv) } + case "lookBackPeriod": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LookBackPeriodPreference to be of type string, got %T instead", value) + } + sv.LookBackPeriod = types.LookBackPeriodPreference(jtv) + } + + case "preferredResources": + if err := awsAwsjson10_deserializeDocumentEffectivePreferredResources(&sv.PreferredResources, value); err != nil { + return err + } + case "resourceType": if value != nil { jtv, ok := value.(string) @@ -7958,11 +9188,25 @@ func awsAwsjson10_deserializeDocumentRecommendationPreferencesDetail(v **types.R sv.ResourceType = types.ResourceType(jtv) } + case "savingsEstimationMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SavingsEstimationMode to be of type string, got %T instead", value) + } + sv.SavingsEstimationMode = types.SavingsEstimationMode(jtv) + } + case "scope": if err := awsAwsjson10_deserializeDocumentScope(&sv.Scope, value); err != nil { return err } + case "utilizationPreferences": + if err := awsAwsjson10_deserializeDocumentUtilizationPreferences(&sv.UtilizationPreferences, value); err != nil { + return err + } + default: _, _ = key, value @@ -9017,6 +10261,85 @@ func awsAwsjson10_deserializeDocumentUtilizationMetrics(v *[]types.UtilizationMe return nil } +func awsAwsjson10_deserializeDocumentUtilizationPreference(v **types.UtilizationPreference, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UtilizationPreference + if *v == nil { + sv = &types.UtilizationPreference{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "metricName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomizableMetricName to be of type string, got %T instead", value) + } + sv.MetricName = types.CustomizableMetricName(jtv) + } + + case "metricParameters": + if err := awsAwsjson10_deserializeDocumentCustomizableMetricParameters(&sv.MetricParameters, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentUtilizationPreferences(v *[]types.UtilizationPreference, 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.UtilizationPreference + if *v == nil { + cv = []types.UtilizationPreference{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.UtilizationPreference + destAddr := &col + if err := awsAwsjson10_deserializeDocumentUtilizationPreference(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson10_deserializeDocumentVolumeConfiguration(v **types.VolumeConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9176,6 +10499,11 @@ func awsAwsjson10_deserializeDocumentVolumeRecommendation(v **types.VolumeRecomm sv.CurrentPerformanceRisk = types.CurrentPerformanceRisk(jtv) } + case "effectiveRecommendationPreferences": + if err := awsAwsjson10_deserializeDocumentEBSEffectiveRecommendationPreferences(&sv.EffectiveRecommendationPreferences, value); err != nil { + return err + } + case "finding": if value != nil { jtv, ok := value.(string) @@ -9347,6 +10675,11 @@ func awsAwsjson10_deserializeDocumentVolumeRecommendationOption(v **types.Volume return err } + case "savingsOpportunityAfterDiscounts": + if err := awsAwsjson10_deserializeDocumentEBSSavingsOpportunityAfterDiscounts(&sv.SavingsOpportunityAfterDiscounts, value); err != nil { + return err + } + default: _, _ = key, value @@ -10078,6 +11411,25 @@ func awsAwsjson10_deserializeOpDocumentGetEffectiveRecommendationPreferencesOutp return err } + case "lookBackPeriod": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LookBackPeriodPreference to be of type string, got %T instead", value) + } + sv.LookBackPeriod = types.LookBackPeriodPreference(jtv) + } + + case "preferredResources": + if err := awsAwsjson10_deserializeDocumentEffectivePreferredResources(&sv.PreferredResources, value); err != nil { + return err + } + + case "utilizationPreferences": + if err := awsAwsjson10_deserializeDocumentUtilizationPreferences(&sv.UtilizationPreferences, value); err != nil { + return err + } + default: _, _ = key, value diff --git a/service/computeoptimizer/endpoints.go b/service/computeoptimizer/endpoints.go index 2fd9922ffd7..4553acbed43 100644 --- a/service/computeoptimizer/endpoints.go +++ b/service/computeoptimizer/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://compute-optimizer-fips.") diff --git a/service/computeoptimizer/serializers.go b/service/computeoptimizer/serializers.go index 008960aa6a3..2f2132aea1a 100644 --- a/service/computeoptimizer/serializers.go +++ b/service/computeoptimizer/serializers.go @@ -1313,6 +1313,23 @@ func awsAwsjson10_serializeDocumentCpuVendorArchitectures(v []types.CpuVendorArc return nil } +func awsAwsjson10_serializeDocumentCustomizableMetricParameters(v *types.CustomizableMetricParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Headroom) > 0 { + ok := object.Key("headroom") + ok.String(string(v.Headroom)) + } + + if len(v.Threshold) > 0 { + ok := object.Key("threshold") + ok.String(string(v.Threshold)) + } + + return nil +} + func awsAwsjson10_serializeDocumentEBSFilter(v *types.EBSFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1659,6 +1676,56 @@ func awsAwsjson10_serializeDocumentLicenseRecommendationFilters(v []types.Licens return nil } +func awsAwsjson10_serializeDocumentPreferredResource(v *types.PreferredResource, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExcludeList != nil { + ok := object.Key("excludeList") + if err := awsAwsjson10_serializeDocumentPreferredResourceValues(v.ExcludeList, ok); err != nil { + return err + } + } + + if v.IncludeList != nil { + ok := object.Key("includeList") + if err := awsAwsjson10_serializeDocumentPreferredResourceValues(v.IncludeList, ok); err != nil { + return err + } + } + + if len(v.Name) > 0 { + ok := object.Key("name") + ok.String(string(v.Name)) + } + + return nil +} + +func awsAwsjson10_serializeDocumentPreferredResources(v []types.PreferredResource, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentPreferredResource(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeDocumentPreferredResourceValues(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson10_serializeDocumentRecommendationPreferenceNames(v []types.RecommendationPreferenceName, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1740,6 +1807,38 @@ func awsAwsjson10_serializeDocumentServiceArns(v []string, value smithyjson.Valu return nil } +func awsAwsjson10_serializeDocumentUtilizationPreference(v *types.UtilizationPreference, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.MetricName) > 0 { + ok := object.Key("metricName") + ok.String(string(v.MetricName)) + } + + if v.MetricParameters != nil { + ok := object.Key("metricParameters") + if err := awsAwsjson10_serializeDocumentCustomizableMetricParameters(v.MetricParameters, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeDocumentUtilizationPreferences(v []types.UtilizationPreference, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentUtilizationPreference(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson10_serializeDocumentVolumeArns(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -2522,11 +2621,28 @@ func awsAwsjson10_serializeOpDocumentPutRecommendationPreferencesInput(v *PutRec ok.String(string(v.InferredWorkloadTypes)) } + if len(v.LookBackPeriod) > 0 { + ok := object.Key("lookBackPeriod") + ok.String(string(v.LookBackPeriod)) + } + + if v.PreferredResources != nil { + ok := object.Key("preferredResources") + if err := awsAwsjson10_serializeDocumentPreferredResources(v.PreferredResources, ok); err != nil { + return err + } + } + if len(v.ResourceType) > 0 { ok := object.Key("resourceType") ok.String(string(v.ResourceType)) } + if len(v.SavingsEstimationMode) > 0 { + ok := object.Key("savingsEstimationMode") + ok.String(string(v.SavingsEstimationMode)) + } + if v.Scope != nil { ok := object.Key("scope") if err := awsAwsjson10_serializeDocumentScope(v.Scope, ok); err != nil { @@ -2534,6 +2650,13 @@ func awsAwsjson10_serializeOpDocumentPutRecommendationPreferencesInput(v *PutRec } } + if v.UtilizationPreferences != nil { + ok := object.Key("utilizationPreferences") + if err := awsAwsjson10_serializeDocumentUtilizationPreferences(v.UtilizationPreferences, ok); err != nil { + return err + } + } + return nil } diff --git a/service/computeoptimizer/types/enums.go b/service/computeoptimizer/types/enums.go index f547e477b57..b56381cb05b 100644 --- a/service/computeoptimizer/types/enums.go +++ b/service/computeoptimizer/types/enums.go @@ -78,6 +78,62 @@ func (CurrentPerformanceRisk) Values() []CurrentPerformanceRisk { } } +type CustomizableMetricHeadroom string + +// Enum values for CustomizableMetricHeadroom +const ( + CustomizableMetricHeadroomPercent30 CustomizableMetricHeadroom = "PERCENT_30" + CustomizableMetricHeadroomPercent20 CustomizableMetricHeadroom = "PERCENT_20" + CustomizableMetricHeadroomPercent0 CustomizableMetricHeadroom = "PERCENT_0" +) + +// Values returns all known values for CustomizableMetricHeadroom. 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 (CustomizableMetricHeadroom) Values() []CustomizableMetricHeadroom { + return []CustomizableMetricHeadroom{ + "PERCENT_30", + "PERCENT_20", + "PERCENT_0", + } +} + +type CustomizableMetricName string + +// Enum values for CustomizableMetricName +const ( + CustomizableMetricNameCpuUtilization CustomizableMetricName = "CpuUtilization" +) + +// Values returns all known values for CustomizableMetricName. 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 (CustomizableMetricName) Values() []CustomizableMetricName { + return []CustomizableMetricName{ + "CpuUtilization", + } +} + +type CustomizableMetricThreshold string + +// Enum values for CustomizableMetricThreshold +const ( + CustomizableMetricThresholdP90 CustomizableMetricThreshold = "P90" + CustomizableMetricThresholdP95 CustomizableMetricThreshold = "P95" + CustomizableMetricThresholdP995 CustomizableMetricThreshold = "P99_5" +) + +// Values returns all known values for CustomizableMetricThreshold. 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 (CustomizableMetricThreshold) Values() []CustomizableMetricThreshold { + return []CustomizableMetricThreshold{ + "P90", + "P95", + "P99_5", + } +} + type EBSFilterName string // Enum values for EBSFilterName @@ -134,6 +190,48 @@ func (EBSMetricName) Values() []EBSMetricName { } } +type EBSSavingsEstimationModeSource string + +// Enum values for EBSSavingsEstimationModeSource +const ( + EBSSavingsEstimationModeSourcePublicPricing EBSSavingsEstimationModeSource = "PublicPricing" + EBSSavingsEstimationModeSourceCostExplorerRightsizing EBSSavingsEstimationModeSource = "CostExplorerRightsizing" + EBSSavingsEstimationModeSourceCostOptimizationHub EBSSavingsEstimationModeSource = "CostOptimizationHub" +) + +// Values returns all known values for EBSSavingsEstimationModeSource. 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 (EBSSavingsEstimationModeSource) Values() []EBSSavingsEstimationModeSource { + return []EBSSavingsEstimationModeSource{ + "PublicPricing", + "CostExplorerRightsizing", + "CostOptimizationHub", + } +} + +type ECSSavingsEstimationModeSource string + +// Enum values for ECSSavingsEstimationModeSource +const ( + ECSSavingsEstimationModeSourcePublicPricing ECSSavingsEstimationModeSource = "PublicPricing" + ECSSavingsEstimationModeSourceCostExplorerRightsizing ECSSavingsEstimationModeSource = "CostExplorerRightsizing" + ECSSavingsEstimationModeSourceCostOptimizationHub ECSSavingsEstimationModeSource = "CostOptimizationHub" +) + +// Values returns all known values for ECSSavingsEstimationModeSource. 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 (ECSSavingsEstimationModeSource) Values() []ECSSavingsEstimationModeSource { + return []ECSSavingsEstimationModeSource{ + "PublicPricing", + "CostExplorerRightsizing", + "CostOptimizationHub", + } +} + type ECSServiceLaunchType string // Enum values for ECSServiceLaunchType @@ -290,66 +388,72 @@ type ExportableAutoScalingGroupField string // Enum values for ExportableAutoScalingGroupField const ( - ExportableAutoScalingGroupFieldAccountId ExportableAutoScalingGroupField = "AccountId" - ExportableAutoScalingGroupFieldAutoScalingGroupArn ExportableAutoScalingGroupField = "AutoScalingGroupArn" - ExportableAutoScalingGroupFieldAutoScalingGroupName ExportableAutoScalingGroupField = "AutoScalingGroupName" - ExportableAutoScalingGroupFieldFinding ExportableAutoScalingGroupField = "Finding" - ExportableAutoScalingGroupFieldUtilizationMetricsCpuMaximum ExportableAutoScalingGroupField = "UtilizationMetricsCpuMaximum" - ExportableAutoScalingGroupFieldUtilizationMetricsMemoryMaximum ExportableAutoScalingGroupField = "UtilizationMetricsMemoryMaximum" - ExportableAutoScalingGroupFieldUtilizationMetricsEbsReadOpsPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsEbsReadOpsPerSecondMaximum" - ExportableAutoScalingGroupFieldUtilizationMetricsEbsWriteOpsPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsEbsWriteOpsPerSecondMaximum" - ExportableAutoScalingGroupFieldUtilizationMetricsEbsReadBytesPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsEbsReadBytesPerSecondMaximum" - ExportableAutoScalingGroupFieldUtilizationMetricsEbsWriteBytesPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsEbsWriteBytesPerSecondMaximum" - ExportableAutoScalingGroupFieldUtilizationMetricsDiskReadOpsPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsDiskReadOpsPerSecondMaximum" - ExportableAutoScalingGroupFieldUtilizationMetricsDiskWriteOpsPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsDiskWriteOpsPerSecondMaximum" - ExportableAutoScalingGroupFieldUtilizationMetricsDiskReadBytesPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsDiskReadBytesPerSecondMaximum" - ExportableAutoScalingGroupFieldUtilizationMetricsDiskWriteBytesPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsDiskWriteBytesPerSecondMaximum" - ExportableAutoScalingGroupFieldUtilizationMetricsNetworkInBytesPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsNetworkInBytesPerSecondMaximum" - ExportableAutoScalingGroupFieldUtilizationMetricsNetworkOutBytesPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsNetworkOutBytesPerSecondMaximum" - ExportableAutoScalingGroupFieldUtilizationMetricsNetworkPacketsInPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsNetworkPacketsInPerSecondMaximum" - ExportableAutoScalingGroupFieldUtilizationMetricsNetworkPacketsOutPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsNetworkPacketsOutPerSecondMaximum" - ExportableAutoScalingGroupFieldLookbackPeriodInDays ExportableAutoScalingGroupField = "LookbackPeriodInDays" - ExportableAutoScalingGroupFieldCurrentConfigurationInstanceType ExportableAutoScalingGroupField = "CurrentConfigurationInstanceType" - ExportableAutoScalingGroupFieldCurrentConfigurationDesiredCapacity ExportableAutoScalingGroupField = "CurrentConfigurationDesiredCapacity" - ExportableAutoScalingGroupFieldCurrentConfigurationMinSize ExportableAutoScalingGroupField = "CurrentConfigurationMinSize" - ExportableAutoScalingGroupFieldCurrentConfigurationMaxSize ExportableAutoScalingGroupField = "CurrentConfigurationMaxSize" - ExportableAutoScalingGroupFieldCurrentOnDemandPrice ExportableAutoScalingGroupField = "CurrentOnDemandPrice" - ExportableAutoScalingGroupFieldCurrentStandardOneYearNoUpfrontReservedPrice ExportableAutoScalingGroupField = "CurrentStandardOneYearNoUpfrontReservedPrice" - ExportableAutoScalingGroupFieldCurrentStandardThreeYearNoUpfrontReservedPrice ExportableAutoScalingGroupField = "CurrentStandardThreeYearNoUpfrontReservedPrice" - ExportableAutoScalingGroupFieldCurrentVcpus ExportableAutoScalingGroupField = "CurrentVCpus" - ExportableAutoScalingGroupFieldCurrentMemory ExportableAutoScalingGroupField = "CurrentMemory" - ExportableAutoScalingGroupFieldCurrentStorage ExportableAutoScalingGroupField = "CurrentStorage" - ExportableAutoScalingGroupFieldCurrentNetwork ExportableAutoScalingGroupField = "CurrentNetwork" - ExportableAutoScalingGroupFieldRecommendationOptionsConfigurationInstanceType ExportableAutoScalingGroupField = "RecommendationOptionsConfigurationInstanceType" - ExportableAutoScalingGroupFieldRecommendationOptionsConfigurationDesiredCapacity ExportableAutoScalingGroupField = "RecommendationOptionsConfigurationDesiredCapacity" - ExportableAutoScalingGroupFieldRecommendationOptionsConfigurationMinSize ExportableAutoScalingGroupField = "RecommendationOptionsConfigurationMinSize" - ExportableAutoScalingGroupFieldRecommendationOptionsConfigurationMaxSize ExportableAutoScalingGroupField = "RecommendationOptionsConfigurationMaxSize" - ExportableAutoScalingGroupFieldRecommendationOptionsProjectedUtilizationMetricsCpuMaximum ExportableAutoScalingGroupField = "RecommendationOptionsProjectedUtilizationMetricsCpuMaximum" - ExportableAutoScalingGroupFieldRecommendationOptionsProjectedUtilizationMetricsMemoryMaximum ExportableAutoScalingGroupField = "RecommendationOptionsProjectedUtilizationMetricsMemoryMaximum" - ExportableAutoScalingGroupFieldRecommendationOptionsPerformanceRisk ExportableAutoScalingGroupField = "RecommendationOptionsPerformanceRisk" - ExportableAutoScalingGroupFieldRecommendationOptionsOnDemandPrice ExportableAutoScalingGroupField = "RecommendationOptionsOnDemandPrice" - ExportableAutoScalingGroupFieldRecommendationOptionsStandardOneYearNoUpfrontReservedPrice ExportableAutoScalingGroupField = "RecommendationOptionsStandardOneYearNoUpfrontReservedPrice" - ExportableAutoScalingGroupFieldRecommendationOptionsStandardThreeYearNoUpfrontReservedPrice ExportableAutoScalingGroupField = "RecommendationOptionsStandardThreeYearNoUpfrontReservedPrice" - ExportableAutoScalingGroupFieldRecommendationOptionsVcpus ExportableAutoScalingGroupField = "RecommendationOptionsVcpus" - ExportableAutoScalingGroupFieldRecommendationOptionsMemory ExportableAutoScalingGroupField = "RecommendationOptionsMemory" - ExportableAutoScalingGroupFieldRecommendationOptionsStorage ExportableAutoScalingGroupField = "RecommendationOptionsStorage" - ExportableAutoScalingGroupFieldRecommendationOptionsNetwork ExportableAutoScalingGroupField = "RecommendationOptionsNetwork" - ExportableAutoScalingGroupFieldLastRefreshTimestamp ExportableAutoScalingGroupField = "LastRefreshTimestamp" - ExportableAutoScalingGroupFieldCurrentPerformanceRisk ExportableAutoScalingGroupField = "CurrentPerformanceRisk" - ExportableAutoScalingGroupFieldRecommendationOptionsSavingsOpportunityPercentage ExportableAutoScalingGroupField = "RecommendationOptionsSavingsOpportunityPercentage" - ExportableAutoScalingGroupFieldRecommendationOptionsEstimatedMonthlySavingsCurrency ExportableAutoScalingGroupField = "RecommendationOptionsEstimatedMonthlySavingsCurrency" - ExportableAutoScalingGroupFieldRecommendationOptionsEstimatedMonthlySavingsValue ExportableAutoScalingGroupField = "RecommendationOptionsEstimatedMonthlySavingsValue" - ExportableAutoScalingGroupFieldEffectiveRecommendationPreferencesCpuVendorArchitectures ExportableAutoScalingGroupField = "EffectiveRecommendationPreferencesCpuVendorArchitectures" - ExportableAutoScalingGroupFieldEffectiveRecommendationPreferencesEnhancedInfrastructureMetrics ExportableAutoScalingGroupField = "EffectiveRecommendationPreferencesEnhancedInfrastructureMetrics" - ExportableAutoScalingGroupFieldEffectiveRecommendationPreferencesInferredWorkloadTypes ExportableAutoScalingGroupField = "EffectiveRecommendationPreferencesInferredWorkloadTypes" - ExportableAutoScalingGroupFieldInferredWorkloadTypes ExportableAutoScalingGroupField = "InferredWorkloadTypes" - ExportableAutoScalingGroupFieldRecommendationOptionsMigrationEffort ExportableAutoScalingGroupField = "RecommendationOptionsMigrationEffort" - ExportableAutoScalingGroupFieldCurrentInstanceGpuInfo ExportableAutoScalingGroupField = "CurrentInstanceGpuInfo" - ExportableAutoScalingGroupFieldRecommendationOptionsInstanceGpuInfo ExportableAutoScalingGroupField = "RecommendationOptionsInstanceGpuInfo" - ExportableAutoScalingGroupFieldUtilizationMetricsGpuPercentageMaximum ExportableAutoScalingGroupField = "UtilizationMetricsGpuPercentageMaximum" - ExportableAutoScalingGroupFieldUtilizationMetricsGpuMemoryPercentageMaximum ExportableAutoScalingGroupField = "UtilizationMetricsGpuMemoryPercentageMaximum" - ExportableAutoScalingGroupFieldRecommendationOptionsProjectedUtilizationMetricsGpuMaximum ExportableAutoScalingGroupField = "RecommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum" - ExportableAutoScalingGroupFieldRecommendationOptionsProjectedUtilizationMetricsGpuMemoryMaximum ExportableAutoScalingGroupField = "RecommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum" + ExportableAutoScalingGroupFieldAccountId ExportableAutoScalingGroupField = "AccountId" + ExportableAutoScalingGroupFieldAutoScalingGroupArn ExportableAutoScalingGroupField = "AutoScalingGroupArn" + ExportableAutoScalingGroupFieldAutoScalingGroupName ExportableAutoScalingGroupField = "AutoScalingGroupName" + ExportableAutoScalingGroupFieldFinding ExportableAutoScalingGroupField = "Finding" + ExportableAutoScalingGroupFieldUtilizationMetricsCpuMaximum ExportableAutoScalingGroupField = "UtilizationMetricsCpuMaximum" + ExportableAutoScalingGroupFieldUtilizationMetricsMemoryMaximum ExportableAutoScalingGroupField = "UtilizationMetricsMemoryMaximum" + ExportableAutoScalingGroupFieldUtilizationMetricsEbsReadOpsPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsEbsReadOpsPerSecondMaximum" + ExportableAutoScalingGroupFieldUtilizationMetricsEbsWriteOpsPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsEbsWriteOpsPerSecondMaximum" + ExportableAutoScalingGroupFieldUtilizationMetricsEbsReadBytesPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsEbsReadBytesPerSecondMaximum" + ExportableAutoScalingGroupFieldUtilizationMetricsEbsWriteBytesPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsEbsWriteBytesPerSecondMaximum" + ExportableAutoScalingGroupFieldUtilizationMetricsDiskReadOpsPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsDiskReadOpsPerSecondMaximum" + ExportableAutoScalingGroupFieldUtilizationMetricsDiskWriteOpsPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsDiskWriteOpsPerSecondMaximum" + ExportableAutoScalingGroupFieldUtilizationMetricsDiskReadBytesPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsDiskReadBytesPerSecondMaximum" + ExportableAutoScalingGroupFieldUtilizationMetricsDiskWriteBytesPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsDiskWriteBytesPerSecondMaximum" + ExportableAutoScalingGroupFieldUtilizationMetricsNetworkInBytesPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsNetworkInBytesPerSecondMaximum" + ExportableAutoScalingGroupFieldUtilizationMetricsNetworkOutBytesPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsNetworkOutBytesPerSecondMaximum" + ExportableAutoScalingGroupFieldUtilizationMetricsNetworkPacketsInPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsNetworkPacketsInPerSecondMaximum" + ExportableAutoScalingGroupFieldUtilizationMetricsNetworkPacketsOutPerSecondMaximum ExportableAutoScalingGroupField = "UtilizationMetricsNetworkPacketsOutPerSecondMaximum" + ExportableAutoScalingGroupFieldLookbackPeriodInDays ExportableAutoScalingGroupField = "LookbackPeriodInDays" + ExportableAutoScalingGroupFieldCurrentConfigurationInstanceType ExportableAutoScalingGroupField = "CurrentConfigurationInstanceType" + ExportableAutoScalingGroupFieldCurrentConfigurationDesiredCapacity ExportableAutoScalingGroupField = "CurrentConfigurationDesiredCapacity" + ExportableAutoScalingGroupFieldCurrentConfigurationMinSize ExportableAutoScalingGroupField = "CurrentConfigurationMinSize" + ExportableAutoScalingGroupFieldCurrentConfigurationMaxSize ExportableAutoScalingGroupField = "CurrentConfigurationMaxSize" + ExportableAutoScalingGroupFieldCurrentOnDemandPrice ExportableAutoScalingGroupField = "CurrentOnDemandPrice" + ExportableAutoScalingGroupFieldCurrentStandardOneYearNoUpfrontReservedPrice ExportableAutoScalingGroupField = "CurrentStandardOneYearNoUpfrontReservedPrice" + ExportableAutoScalingGroupFieldCurrentStandardThreeYearNoUpfrontReservedPrice ExportableAutoScalingGroupField = "CurrentStandardThreeYearNoUpfrontReservedPrice" + ExportableAutoScalingGroupFieldCurrentVcpus ExportableAutoScalingGroupField = "CurrentVCpus" + ExportableAutoScalingGroupFieldCurrentMemory ExportableAutoScalingGroupField = "CurrentMemory" + ExportableAutoScalingGroupFieldCurrentStorage ExportableAutoScalingGroupField = "CurrentStorage" + ExportableAutoScalingGroupFieldCurrentNetwork ExportableAutoScalingGroupField = "CurrentNetwork" + ExportableAutoScalingGroupFieldRecommendationOptionsConfigurationInstanceType ExportableAutoScalingGroupField = "RecommendationOptionsConfigurationInstanceType" + ExportableAutoScalingGroupFieldRecommendationOptionsConfigurationDesiredCapacity ExportableAutoScalingGroupField = "RecommendationOptionsConfigurationDesiredCapacity" + ExportableAutoScalingGroupFieldRecommendationOptionsConfigurationMinSize ExportableAutoScalingGroupField = "RecommendationOptionsConfigurationMinSize" + ExportableAutoScalingGroupFieldRecommendationOptionsConfigurationMaxSize ExportableAutoScalingGroupField = "RecommendationOptionsConfigurationMaxSize" + ExportableAutoScalingGroupFieldRecommendationOptionsProjectedUtilizationMetricsCpuMaximum ExportableAutoScalingGroupField = "RecommendationOptionsProjectedUtilizationMetricsCpuMaximum" + ExportableAutoScalingGroupFieldRecommendationOptionsProjectedUtilizationMetricsMemoryMaximum ExportableAutoScalingGroupField = "RecommendationOptionsProjectedUtilizationMetricsMemoryMaximum" + ExportableAutoScalingGroupFieldRecommendationOptionsPerformanceRisk ExportableAutoScalingGroupField = "RecommendationOptionsPerformanceRisk" + ExportableAutoScalingGroupFieldRecommendationOptionsOnDemandPrice ExportableAutoScalingGroupField = "RecommendationOptionsOnDemandPrice" + ExportableAutoScalingGroupFieldRecommendationOptionsStandardOneYearNoUpfrontReservedPrice ExportableAutoScalingGroupField = "RecommendationOptionsStandardOneYearNoUpfrontReservedPrice" + ExportableAutoScalingGroupFieldRecommendationOptionsStandardThreeYearNoUpfrontReservedPrice ExportableAutoScalingGroupField = "RecommendationOptionsStandardThreeYearNoUpfrontReservedPrice" + ExportableAutoScalingGroupFieldRecommendationOptionsVcpus ExportableAutoScalingGroupField = "RecommendationOptionsVcpus" + ExportableAutoScalingGroupFieldRecommendationOptionsMemory ExportableAutoScalingGroupField = "RecommendationOptionsMemory" + ExportableAutoScalingGroupFieldRecommendationOptionsStorage ExportableAutoScalingGroupField = "RecommendationOptionsStorage" + ExportableAutoScalingGroupFieldRecommendationOptionsNetwork ExportableAutoScalingGroupField = "RecommendationOptionsNetwork" + ExportableAutoScalingGroupFieldLastRefreshTimestamp ExportableAutoScalingGroupField = "LastRefreshTimestamp" + ExportableAutoScalingGroupFieldCurrentPerformanceRisk ExportableAutoScalingGroupField = "CurrentPerformanceRisk" + ExportableAutoScalingGroupFieldRecommendationOptionsSavingsOpportunityPercentage ExportableAutoScalingGroupField = "RecommendationOptionsSavingsOpportunityPercentage" + ExportableAutoScalingGroupFieldRecommendationOptionsEstimatedMonthlySavingsCurrency ExportableAutoScalingGroupField = "RecommendationOptionsEstimatedMonthlySavingsCurrency" + ExportableAutoScalingGroupFieldRecommendationOptionsEstimatedMonthlySavingsValue ExportableAutoScalingGroupField = "RecommendationOptionsEstimatedMonthlySavingsValue" + ExportableAutoScalingGroupFieldEffectiveRecommendationPreferencesCpuVendorArchitectures ExportableAutoScalingGroupField = "EffectiveRecommendationPreferencesCpuVendorArchitectures" + ExportableAutoScalingGroupFieldEffectiveRecommendationPreferencesEnhancedInfrastructureMetrics ExportableAutoScalingGroupField = "EffectiveRecommendationPreferencesEnhancedInfrastructureMetrics" + ExportableAutoScalingGroupFieldEffectiveRecommendationPreferencesInferredWorkloadTypes ExportableAutoScalingGroupField = "EffectiveRecommendationPreferencesInferredWorkloadTypes" + ExportableAutoScalingGroupFieldInferredWorkloadTypes ExportableAutoScalingGroupField = "InferredWorkloadTypes" + ExportableAutoScalingGroupFieldRecommendationOptionsMigrationEffort ExportableAutoScalingGroupField = "RecommendationOptionsMigrationEffort" + ExportableAutoScalingGroupFieldCurrentInstanceGpuInfo ExportableAutoScalingGroupField = "CurrentInstanceGpuInfo" + ExportableAutoScalingGroupFieldRecommendationOptionsInstanceGpuInfo ExportableAutoScalingGroupField = "RecommendationOptionsInstanceGpuInfo" + ExportableAutoScalingGroupFieldUtilizationMetricsGpuPercentageMaximum ExportableAutoScalingGroupField = "UtilizationMetricsGpuPercentageMaximum" + ExportableAutoScalingGroupFieldUtilizationMetricsGpuMemoryPercentageMaximum ExportableAutoScalingGroupField = "UtilizationMetricsGpuMemoryPercentageMaximum" + ExportableAutoScalingGroupFieldRecommendationOptionsProjectedUtilizationMetricsGpuMaximum ExportableAutoScalingGroupField = "RecommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum" + ExportableAutoScalingGroupFieldRecommendationOptionsProjectedUtilizationMetricsGpuMemoryMaximum ExportableAutoScalingGroupField = "RecommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum" + ExportableAutoScalingGroupFieldEffectiveRecommendationPreferencesSavingsEstimationMode ExportableAutoScalingGroupField = "EffectiveRecommendationPreferencesSavingsEstimationMode" + ExportableAutoScalingGroupFieldRecommendationOptionsSavingsOpportunityAfterDiscountsPercentage ExportableAutoScalingGroupField = "RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage" + ExportableAutoScalingGroupFieldRecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts ExportableAutoScalingGroupField = "RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts" + ExportableAutoScalingGroupFieldRecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts ExportableAutoScalingGroupField = "RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts" + ExportableAutoScalingGroupFieldEffectiveRecommendationPreferencesPreferredResources ExportableAutoScalingGroupField = "EffectiveRecommendationPreferencesPreferredResources" + ExportableAutoScalingGroupFieldEffectiveRecommendationPreferencesLookbackPeriod ExportableAutoScalingGroupField = "EffectiveRecommendationPreferencesLookBackPeriod" ) // Values returns all known values for ExportableAutoScalingGroupField. Note that @@ -418,6 +522,12 @@ func (ExportableAutoScalingGroupField) Values() []ExportableAutoScalingGroupFiel "UtilizationMetricsGpuMemoryPercentageMaximum", "RecommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum", "RecommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum", + "EffectiveRecommendationPreferencesSavingsEstimationMode", + "RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage", + "RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts", + "RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts", + "EffectiveRecommendationPreferencesPreferredResources", + "EffectiveRecommendationPreferencesLookBackPeriod", } } @@ -425,30 +535,34 @@ type ExportableECSServiceField string // Enum values for ExportableECSServiceField const ( - ExportableECSServiceFieldAccountId ExportableECSServiceField = "AccountId" - ExportableECSServiceFieldServiceArn ExportableECSServiceField = "ServiceArn" - ExportableECSServiceFieldLookbackPeriodInDays ExportableECSServiceField = "LookbackPeriodInDays" - ExportableECSServiceFieldLastRefreshTimestamp ExportableECSServiceField = "LastRefreshTimestamp" - ExportableECSServiceFieldLaunchType ExportableECSServiceField = "LaunchType" - ExportableECSServiceFieldCurrentPerformanceRisk ExportableECSServiceField = "CurrentPerformanceRisk" - ExportableECSServiceFieldCurrentServiceConfigurationMemory ExportableECSServiceField = "CurrentServiceConfigurationMemory" - ExportableECSServiceFieldCurrentServiceConfigurationCpu ExportableECSServiceField = "CurrentServiceConfigurationCpu" - ExportableECSServiceFieldCurrentServiceConfigurationTaskDefinitionArn ExportableECSServiceField = "CurrentServiceConfigurationTaskDefinitionArn" - ExportableECSServiceFieldCurrentServiceConfigurationAutoScalingConfiguration ExportableECSServiceField = "CurrentServiceConfigurationAutoScalingConfiguration" - ExportableECSServiceFieldCurrentServiceContainerConfigurations ExportableECSServiceField = "CurrentServiceContainerConfigurations" - ExportableECSServiceFieldUtilizationMetricsCpuMaximum ExportableECSServiceField = "UtilizationMetricsCpuMaximum" - ExportableECSServiceFieldUtilizationMetricsMemoryMaximum ExportableECSServiceField = "UtilizationMetricsMemoryMaximum" - ExportableECSServiceFieldFinding ExportableECSServiceField = "Finding" - ExportableECSServiceFieldFindingReasonCodes ExportableECSServiceField = "FindingReasonCodes" - ExportableECSServiceFieldRecommendationOptionsMemory ExportableECSServiceField = "RecommendationOptionsMemory" - ExportableECSServiceFieldRecommendationOptionsCpu ExportableECSServiceField = "RecommendationOptionsCpu" - ExportableECSServiceFieldRecommendationOptionsSavingsOpportunityPercentage ExportableECSServiceField = "RecommendationOptionsSavingsOpportunityPercentage" - ExportableECSServiceFieldRecommendationOptionsEstimatedMonthlySavingsCurrency ExportableECSServiceField = "RecommendationOptionsEstimatedMonthlySavingsCurrency" - ExportableECSServiceFieldRecommendationOptionsEstimatedMonthlySavingsValue ExportableECSServiceField = "RecommendationOptionsEstimatedMonthlySavingsValue" - ExportableECSServiceFieldRecommendationOptionsContainerRecommendations ExportableECSServiceField = "RecommendationOptionsContainerRecommendations" - ExportableECSServiceFieldRecommendationOptionsProjectedUtilizationMetricsCpuMaximum ExportableECSServiceField = "RecommendationOptionsProjectedUtilizationMetricsCpuMaximum" - ExportableECSServiceFieldRecommendationOptionsProjectedUtilizationMetricsMemoryMaximum ExportableECSServiceField = "RecommendationOptionsProjectedUtilizationMetricsMemoryMaximum" - ExportableECSServiceFieldTags ExportableECSServiceField = "Tags" + ExportableECSServiceFieldAccountId ExportableECSServiceField = "AccountId" + ExportableECSServiceFieldServiceArn ExportableECSServiceField = "ServiceArn" + ExportableECSServiceFieldLookbackPeriodInDays ExportableECSServiceField = "LookbackPeriodInDays" + ExportableECSServiceFieldLastRefreshTimestamp ExportableECSServiceField = "LastRefreshTimestamp" + ExportableECSServiceFieldLaunchType ExportableECSServiceField = "LaunchType" + ExportableECSServiceFieldCurrentPerformanceRisk ExportableECSServiceField = "CurrentPerformanceRisk" + ExportableECSServiceFieldCurrentServiceConfigurationMemory ExportableECSServiceField = "CurrentServiceConfigurationMemory" + ExportableECSServiceFieldCurrentServiceConfigurationCpu ExportableECSServiceField = "CurrentServiceConfigurationCpu" + ExportableECSServiceFieldCurrentServiceConfigurationTaskDefinitionArn ExportableECSServiceField = "CurrentServiceConfigurationTaskDefinitionArn" + ExportableECSServiceFieldCurrentServiceConfigurationAutoScalingConfiguration ExportableECSServiceField = "CurrentServiceConfigurationAutoScalingConfiguration" + ExportableECSServiceFieldCurrentServiceContainerConfigurations ExportableECSServiceField = "CurrentServiceContainerConfigurations" + ExportableECSServiceFieldUtilizationMetricsCpuMaximum ExportableECSServiceField = "UtilizationMetricsCpuMaximum" + ExportableECSServiceFieldUtilizationMetricsMemoryMaximum ExportableECSServiceField = "UtilizationMetricsMemoryMaximum" + ExportableECSServiceFieldFinding ExportableECSServiceField = "Finding" + ExportableECSServiceFieldFindingReasonCodes ExportableECSServiceField = "FindingReasonCodes" + ExportableECSServiceFieldRecommendationOptionsMemory ExportableECSServiceField = "RecommendationOptionsMemory" + ExportableECSServiceFieldRecommendationOptionsCpu ExportableECSServiceField = "RecommendationOptionsCpu" + ExportableECSServiceFieldRecommendationOptionsSavingsOpportunityPercentage ExportableECSServiceField = "RecommendationOptionsSavingsOpportunityPercentage" + ExportableECSServiceFieldRecommendationOptionsEstimatedMonthlySavingsCurrency ExportableECSServiceField = "RecommendationOptionsEstimatedMonthlySavingsCurrency" + ExportableECSServiceFieldRecommendationOptionsEstimatedMonthlySavingsValue ExportableECSServiceField = "RecommendationOptionsEstimatedMonthlySavingsValue" + ExportableECSServiceFieldRecommendationOptionsContainerRecommendations ExportableECSServiceField = "RecommendationOptionsContainerRecommendations" + ExportableECSServiceFieldRecommendationOptionsProjectedUtilizationMetricsCpuMaximum ExportableECSServiceField = "RecommendationOptionsProjectedUtilizationMetricsCpuMaximum" + ExportableECSServiceFieldRecommendationOptionsProjectedUtilizationMetricsMemoryMaximum ExportableECSServiceField = "RecommendationOptionsProjectedUtilizationMetricsMemoryMaximum" + ExportableECSServiceFieldTags ExportableECSServiceField = "Tags" + ExportableECSServiceFieldEffectiveRecommendationPreferencesSavingsEstimationMode ExportableECSServiceField = "EffectiveRecommendationPreferencesSavingsEstimationMode" + ExportableECSServiceFieldRecommendationOptionsSavingsOpportunityAfterDiscountsPercentage ExportableECSServiceField = "RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage" + ExportableECSServiceFieldRecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts ExportableECSServiceField = "RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts" + ExportableECSServiceFieldRecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts ExportableECSServiceField = "RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts" ) // Values returns all known values for ExportableECSServiceField. Note that this @@ -480,6 +594,10 @@ func (ExportableECSServiceField) Values() []ExportableECSServiceField { "RecommendationOptionsProjectedUtilizationMetricsCpuMaximum", "RecommendationOptionsProjectedUtilizationMetricsMemoryMaximum", "Tags", + "EffectiveRecommendationPreferencesSavingsEstimationMode", + "RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage", + "RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts", + "RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts", } } @@ -551,6 +669,13 @@ const ( ExportableInstanceFieldRecommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum ExportableInstanceField = "RecommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum" ExportableInstanceFieldRecommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum ExportableInstanceField = "RecommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum" ExportableInstanceFieldIdle ExportableInstanceField = "Idle" + ExportableInstanceFieldEffectiveRecommendationPreferencesPreferredResources ExportableInstanceField = "EffectiveRecommendationPreferencesPreferredResources" + ExportableInstanceFieldEffectiveRecommendationPreferencesLookbackPeriod ExportableInstanceField = "EffectiveRecommendationPreferencesLookBackPeriod" + ExportableInstanceFieldEffectiveRecommendationPreferencesUtilizationPreferences ExportableInstanceField = "EffectiveRecommendationPreferencesUtilizationPreferences" + ExportableInstanceFieldEffectiveRecommendationPreferencesSavingsEstimationMode ExportableInstanceField = "EffectiveRecommendationPreferencesSavingsEstimationMode" + ExportableInstanceFieldRecommendationOptionsSavingsOpportunityAfterDiscountsPercentage ExportableInstanceField = "RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage" + ExportableInstanceFieldRecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts ExportableInstanceField = "RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts" + ExportableInstanceFieldRecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts ExportableInstanceField = "RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts" ) // Values returns all known values for ExportableInstanceField. Note that this can @@ -622,6 +747,13 @@ func (ExportableInstanceField) Values() []ExportableInstanceField { "RecommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum", "RecommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum", "Idle", + "EffectiveRecommendationPreferencesPreferredResources", + "EffectiveRecommendationPreferencesLookBackPeriod", + "EffectiveRecommendationPreferencesUtilizationPreferences", + "EffectiveRecommendationPreferencesSavingsEstimationMode", + "RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage", + "RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts", + "RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts", } } @@ -656,6 +788,10 @@ const ( ExportableLambdaFunctionFieldRecommendationOptionsEstimatedMonthlySavingsCurrency ExportableLambdaFunctionField = "RecommendationOptionsEstimatedMonthlySavingsCurrency" ExportableLambdaFunctionFieldRecommendationOptionsEstimatedMonthlySavingsValue ExportableLambdaFunctionField = "RecommendationOptionsEstimatedMonthlySavingsValue" ExportableLambdaFunctionFieldTags ExportableLambdaFunctionField = "Tags" + ExportableLambdaFunctionFieldEffectiveRecommendationPreferencesSavingsEstimationMode ExportableLambdaFunctionField = "EffectiveRecommendationPreferencesSavingsEstimationMode" + ExportableLambdaFunctionFieldRecommendationOptionsSavingsOpportunityAfterDiscountsPercentage ExportableLambdaFunctionField = "RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage" + ExportableLambdaFunctionFieldRecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts ExportableLambdaFunctionField = "RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts" + ExportableLambdaFunctionFieldRecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts ExportableLambdaFunctionField = "RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts" ) // Values returns all known values for ExportableLambdaFunctionField. Note that @@ -691,6 +827,10 @@ func (ExportableLambdaFunctionField) Values() []ExportableLambdaFunctionField { "RecommendationOptionsEstimatedMonthlySavingsCurrency", "RecommendationOptionsEstimatedMonthlySavingsValue", "Tags", + "EffectiveRecommendationPreferencesSavingsEstimationMode", + "RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage", + "RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts", + "RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts", } } @@ -754,37 +894,41 @@ type ExportableVolumeField string // Enum values for ExportableVolumeField const ( - ExportableVolumeFieldAccountId ExportableVolumeField = "AccountId" - ExportableVolumeFieldVolumeArn ExportableVolumeField = "VolumeArn" - ExportableVolumeFieldFinding ExportableVolumeField = "Finding" - ExportableVolumeFieldUtilizationMetricsVolumeReadOpsPerSecondMaximum ExportableVolumeField = "UtilizationMetricsVolumeReadOpsPerSecondMaximum" - ExportableVolumeFieldUtilizationMetricsVolumeWriteOpsPerSecondMaximum ExportableVolumeField = "UtilizationMetricsVolumeWriteOpsPerSecondMaximum" - ExportableVolumeFieldUtilizationMetricsVolumeReadBytesPerSecondMaximum ExportableVolumeField = "UtilizationMetricsVolumeReadBytesPerSecondMaximum" - ExportableVolumeFieldUtilizationMetricsVolumeWriteBytesPerSecondMaximum ExportableVolumeField = "UtilizationMetricsVolumeWriteBytesPerSecondMaximum" - ExportableVolumeFieldLookbackPeriodInDays ExportableVolumeField = "LookbackPeriodInDays" - ExportableVolumeFieldCurrentConfigurationVolumeType ExportableVolumeField = "CurrentConfigurationVolumeType" - ExportableVolumeFieldCurrentConfigurationVolumeBaselineIops ExportableVolumeField = "CurrentConfigurationVolumeBaselineIOPS" - ExportableVolumeFieldCurrentConfigurationVolumeBaselineThroughput ExportableVolumeField = "CurrentConfigurationVolumeBaselineThroughput" - ExportableVolumeFieldCurrentConfigurationVolumeBurstIops ExportableVolumeField = "CurrentConfigurationVolumeBurstIOPS" - ExportableVolumeFieldCurrentConfigurationVolumeBurstThroughput ExportableVolumeField = "CurrentConfigurationVolumeBurstThroughput" - ExportableVolumeFieldCurrentConfigurationVolumeSize ExportableVolumeField = "CurrentConfigurationVolumeSize" - ExportableVolumeFieldCurrentMonthlyPrice ExportableVolumeField = "CurrentMonthlyPrice" - ExportableVolumeFieldRecommendationOptionsConfigurationVolumeType ExportableVolumeField = "RecommendationOptionsConfigurationVolumeType" - ExportableVolumeFieldRecommendationOptionsConfigurationVolumeBaselineIops ExportableVolumeField = "RecommendationOptionsConfigurationVolumeBaselineIOPS" - ExportableVolumeFieldRecommendationOptionsConfigurationVolumeBaselineThroughput ExportableVolumeField = "RecommendationOptionsConfigurationVolumeBaselineThroughput" - ExportableVolumeFieldRecommendationOptionsConfigurationVolumeBurstIops ExportableVolumeField = "RecommendationOptionsConfigurationVolumeBurstIOPS" - ExportableVolumeFieldRecommendationOptionsConfigurationVolumeBurstThroughput ExportableVolumeField = "RecommendationOptionsConfigurationVolumeBurstThroughput" - ExportableVolumeFieldRecommendationOptionsConfigurationVolumeSize ExportableVolumeField = "RecommendationOptionsConfigurationVolumeSize" - ExportableVolumeFieldRecommendationOptionsMonthlyPrice ExportableVolumeField = "RecommendationOptionsMonthlyPrice" - ExportableVolumeFieldRecommendationOptionsPerformanceRisk ExportableVolumeField = "RecommendationOptionsPerformanceRisk" - ExportableVolumeFieldLastRefreshTimestamp ExportableVolumeField = "LastRefreshTimestamp" - ExportableVolumeFieldCurrentPerformanceRisk ExportableVolumeField = "CurrentPerformanceRisk" - ExportableVolumeFieldRecommendationOptionsSavingsOpportunityPercentage ExportableVolumeField = "RecommendationOptionsSavingsOpportunityPercentage" - ExportableVolumeFieldRecommendationOptionsEstimatedMonthlySavingsCurrency ExportableVolumeField = "RecommendationOptionsEstimatedMonthlySavingsCurrency" - ExportableVolumeFieldRecommendationOptionsEstimatedMonthlySavingsValue ExportableVolumeField = "RecommendationOptionsEstimatedMonthlySavingsValue" - ExportableVolumeFieldRootVolume ExportableVolumeField = "RootVolume" - ExportableVolumeFieldTags ExportableVolumeField = "Tags" - ExportableVolumeFieldCurrentConfigurationRootVolume ExportableVolumeField = "CurrentConfigurationRootVolume" + ExportableVolumeFieldAccountId ExportableVolumeField = "AccountId" + ExportableVolumeFieldVolumeArn ExportableVolumeField = "VolumeArn" + ExportableVolumeFieldFinding ExportableVolumeField = "Finding" + ExportableVolumeFieldUtilizationMetricsVolumeReadOpsPerSecondMaximum ExportableVolumeField = "UtilizationMetricsVolumeReadOpsPerSecondMaximum" + ExportableVolumeFieldUtilizationMetricsVolumeWriteOpsPerSecondMaximum ExportableVolumeField = "UtilizationMetricsVolumeWriteOpsPerSecondMaximum" + ExportableVolumeFieldUtilizationMetricsVolumeReadBytesPerSecondMaximum ExportableVolumeField = "UtilizationMetricsVolumeReadBytesPerSecondMaximum" + ExportableVolumeFieldUtilizationMetricsVolumeWriteBytesPerSecondMaximum ExportableVolumeField = "UtilizationMetricsVolumeWriteBytesPerSecondMaximum" + ExportableVolumeFieldLookbackPeriodInDays ExportableVolumeField = "LookbackPeriodInDays" + ExportableVolumeFieldCurrentConfigurationVolumeType ExportableVolumeField = "CurrentConfigurationVolumeType" + ExportableVolumeFieldCurrentConfigurationVolumeBaselineIops ExportableVolumeField = "CurrentConfigurationVolumeBaselineIOPS" + ExportableVolumeFieldCurrentConfigurationVolumeBaselineThroughput ExportableVolumeField = "CurrentConfigurationVolumeBaselineThroughput" + ExportableVolumeFieldCurrentConfigurationVolumeBurstIops ExportableVolumeField = "CurrentConfigurationVolumeBurstIOPS" + ExportableVolumeFieldCurrentConfigurationVolumeBurstThroughput ExportableVolumeField = "CurrentConfigurationVolumeBurstThroughput" + ExportableVolumeFieldCurrentConfigurationVolumeSize ExportableVolumeField = "CurrentConfigurationVolumeSize" + ExportableVolumeFieldCurrentMonthlyPrice ExportableVolumeField = "CurrentMonthlyPrice" + ExportableVolumeFieldRecommendationOptionsConfigurationVolumeType ExportableVolumeField = "RecommendationOptionsConfigurationVolumeType" + ExportableVolumeFieldRecommendationOptionsConfigurationVolumeBaselineIops ExportableVolumeField = "RecommendationOptionsConfigurationVolumeBaselineIOPS" + ExportableVolumeFieldRecommendationOptionsConfigurationVolumeBaselineThroughput ExportableVolumeField = "RecommendationOptionsConfigurationVolumeBaselineThroughput" + ExportableVolumeFieldRecommendationOptionsConfigurationVolumeBurstIops ExportableVolumeField = "RecommendationOptionsConfigurationVolumeBurstIOPS" + ExportableVolumeFieldRecommendationOptionsConfigurationVolumeBurstThroughput ExportableVolumeField = "RecommendationOptionsConfigurationVolumeBurstThroughput" + ExportableVolumeFieldRecommendationOptionsConfigurationVolumeSize ExportableVolumeField = "RecommendationOptionsConfigurationVolumeSize" + ExportableVolumeFieldRecommendationOptionsMonthlyPrice ExportableVolumeField = "RecommendationOptionsMonthlyPrice" + ExportableVolumeFieldRecommendationOptionsPerformanceRisk ExportableVolumeField = "RecommendationOptionsPerformanceRisk" + ExportableVolumeFieldLastRefreshTimestamp ExportableVolumeField = "LastRefreshTimestamp" + ExportableVolumeFieldCurrentPerformanceRisk ExportableVolumeField = "CurrentPerformanceRisk" + ExportableVolumeFieldRecommendationOptionsSavingsOpportunityPercentage ExportableVolumeField = "RecommendationOptionsSavingsOpportunityPercentage" + ExportableVolumeFieldRecommendationOptionsEstimatedMonthlySavingsCurrency ExportableVolumeField = "RecommendationOptionsEstimatedMonthlySavingsCurrency" + ExportableVolumeFieldRecommendationOptionsEstimatedMonthlySavingsValue ExportableVolumeField = "RecommendationOptionsEstimatedMonthlySavingsValue" + ExportableVolumeFieldRootVolume ExportableVolumeField = "RootVolume" + ExportableVolumeFieldTags ExportableVolumeField = "Tags" + ExportableVolumeFieldCurrentConfigurationRootVolume ExportableVolumeField = "CurrentConfigurationRootVolume" + ExportableVolumeFieldEffectiveRecommendationPreferencesSavingsEstimationMode ExportableVolumeField = "EffectiveRecommendationPreferencesSavingsEstimationMode" + ExportableVolumeFieldRecommendationOptionsSavingsOpportunityAfterDiscountsPercentage ExportableVolumeField = "RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage" + ExportableVolumeFieldRecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts ExportableVolumeField = "RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts" + ExportableVolumeFieldRecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts ExportableVolumeField = "RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts" ) // Values returns all known values for ExportableVolumeField. Note that this can @@ -823,6 +967,10 @@ func (ExportableVolumeField) Values() []ExportableVolumeField { "RootVolume", "Tags", "CurrentConfigurationRootVolume", + "EffectiveRecommendationPreferencesSavingsEstimationMode", + "RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage", + "RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts", + "RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts", } } @@ -1084,6 +1232,27 @@ func (InstanceRecommendationFindingReasonCode) Values() []InstanceRecommendation } } +type InstanceSavingsEstimationModeSource string + +// Enum values for InstanceSavingsEstimationModeSource +const ( + InstanceSavingsEstimationModeSourcePublicPricing InstanceSavingsEstimationModeSource = "PublicPricing" + InstanceSavingsEstimationModeSourceCostExplorerRightsizing InstanceSavingsEstimationModeSource = "CostExplorerRightsizing" + InstanceSavingsEstimationModeSourceCostOptimizationHub InstanceSavingsEstimationModeSource = "CostOptimizationHub" +) + +// Values returns all known values for InstanceSavingsEstimationModeSource. 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 (InstanceSavingsEstimationModeSource) Values() []InstanceSavingsEstimationModeSource { + return []InstanceSavingsEstimationModeSource{ + "PublicPricing", + "CostExplorerRightsizing", + "CostOptimizationHub", + } +} + type InstanceState string // Enum values for InstanceState @@ -1288,6 +1457,27 @@ func (LambdaFunctionRecommendationFindingReasonCode) Values() []LambdaFunctionRe } } +type LambdaSavingsEstimationModeSource string + +// Enum values for LambdaSavingsEstimationModeSource +const ( + LambdaSavingsEstimationModeSourcePublicPricing LambdaSavingsEstimationModeSource = "PublicPricing" + LambdaSavingsEstimationModeSourceCostExplorerRightsizing LambdaSavingsEstimationModeSource = "CostExplorerRightsizing" + LambdaSavingsEstimationModeSourceCostOptimizationHub LambdaSavingsEstimationModeSource = "CostOptimizationHub" +) + +// Values returns all known values for LambdaSavingsEstimationModeSource. 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 (LambdaSavingsEstimationModeSource) Values() []LambdaSavingsEstimationModeSource { + return []LambdaSavingsEstimationModeSource{ + "PublicPricing", + "CostExplorerRightsizing", + "CostOptimizationHub", + } +} + type LicenseEdition string // Enum values for LicenseEdition @@ -1407,6 +1597,26 @@ func (LicenseRecommendationFilterName) Values() []LicenseRecommendationFilterNam } } +type LookBackPeriodPreference string + +// Enum values for LookBackPeriodPreference +const ( + LookBackPeriodPreferenceDays14 LookBackPeriodPreference = "DAYS_14" + LookBackPeriodPreferenceDays32 LookBackPeriodPreference = "DAYS_32" + LookBackPeriodPreferenceDays93 LookBackPeriodPreference = "DAYS_93" +) + +// Values returns all known values for LookBackPeriodPreference. 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 (LookBackPeriodPreference) Values() []LookBackPeriodPreference { + return []LookBackPeriodPreference{ + "DAYS_14", + "DAYS_32", + "DAYS_93", + } +} + type MetricName string // Enum values for MetricName @@ -1535,6 +1745,22 @@ func (PlatformDifference) Values() []PlatformDifference { } } +type PreferredResourceName string + +// Enum values for PreferredResourceName +const ( + PreferredResourceNameEc2InstanceTypes PreferredResourceName = "Ec2InstanceTypes" +) + +// Values returns all known values for PreferredResourceName. 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 (PreferredResourceName) Values() []PreferredResourceName { + return []PreferredResourceName{ + "Ec2InstanceTypes", + } +} + type RecommendationPreferenceName string // Enum values for RecommendationPreferenceName @@ -1542,6 +1768,9 @@ const ( RecommendationPreferenceNameEnhancedInfrastructureMetrics RecommendationPreferenceName = "EnhancedInfrastructureMetrics" RecommendationPreferenceNameInferredWorkloadTypes RecommendationPreferenceName = "InferredWorkloadTypes" RecommendationPreferenceNameExternalMetricsPreference RecommendationPreferenceName = "ExternalMetricsPreference" + RecommendationPreferenceNameLookbackPeriodPreference RecommendationPreferenceName = "LookBackPeriodPreference" + RecommendationPreferenceNamePreferredResources RecommendationPreferenceName = "PreferredResources" + RecommendationPreferenceNameUtilizationPreferences RecommendationPreferenceName = "UtilizationPreferences" ) // Values returns all known values for RecommendationPreferenceName. Note that @@ -1553,6 +1782,9 @@ func (RecommendationPreferenceName) Values() []RecommendationPreferenceName { "EnhancedInfrastructureMetrics", "InferredWorkloadTypes", "ExternalMetricsPreference", + "LookBackPeriodPreference", + "PreferredResources", + "UtilizationPreferences", } } @@ -1610,6 +1842,24 @@ func (ResourceType) Values() []ResourceType { } } +type SavingsEstimationMode string + +// Enum values for SavingsEstimationMode +const ( + SavingsEstimationModeAfterDiscounts SavingsEstimationMode = "AfterDiscounts" + SavingsEstimationModeBeforeDiscounts SavingsEstimationMode = "BeforeDiscounts" +) + +// Values returns all known values for SavingsEstimationMode. 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 (SavingsEstimationMode) Values() []SavingsEstimationMode { + return []SavingsEstimationMode{ + "AfterDiscounts", + "BeforeDiscounts", + } +} + type ScopeName string // Enum values for ScopeName diff --git a/service/computeoptimizer/types/types.go b/service/computeoptimizer/types/types.go index a8bbe2c00fe..af02399fea2 100644 --- a/service/computeoptimizer/types/types.go +++ b/service/computeoptimizer/types/types.go @@ -47,6 +47,20 @@ type AutoScalingGroupConfiguration struct { noSmithyDocumentSerde } +// An object that describes the estimated monthly savings possible by adopting +// Compute Optimizer’s Auto Scaling group recommendations. This is based on the +// Savings Plans and Reserved Instances discounts. +type AutoScalingGroupEstimatedMonthlySavings struct { + + // The currency of the estimated monthly savings. + Currency Currency + + // The value of the estimated monthly savings. + Value float64 + + noSmithyDocumentSerde +} + // Describes an Auto Scaling group recommendation. type AutoScalingGroupRecommendation struct { @@ -172,6 +186,31 @@ type AutoScalingGroupRecommendationOption struct { // savings amount and percentage. SavingsOpportunity *SavingsOpportunity + // An object that describes the savings opportunity for the Auto Scaling group + // recommendation option that includes Savings Plans and Reserved Instances + // discounts. Savings opportunity includes the estimated monthly savings and + // percentage. + SavingsOpportunityAfterDiscounts *AutoScalingGroupSavingsOpportunityAfterDiscounts + + noSmithyDocumentSerde +} + +// Describes the savings opportunity for Auto Scaling group recommendations after +// applying the Savings Plans and Reserved Instances discounts. Savings opportunity +// represents the estimated monthly savings you can achieve by implementing Compute +// Optimizer recommendations. +type AutoScalingGroupSavingsOpportunityAfterDiscounts struct { + + // An object that describes the estimated monthly savings possible by adopting + // Compute Optimizer’s Auto Scaling group recommendations. This is based on the + // Savings Plans and Reserved Instances pricing discounts. + EstimatedMonthlySavings *AutoScalingGroupEstimatedMonthlySavings + + // The estimated monthly savings possible as a percentage of monthly cost after + // applying the Savings Plans and Reserved Instances discounts. This saving can be + // achieved by adopting Compute Optimizer’s Auto Scaling group recommendations. + SavingsOpportunityPercentage float64 + noSmithyDocumentSerde } @@ -229,6 +268,44 @@ type CurrentPerformanceRiskRatings struct { noSmithyDocumentSerde } +// Defines the various metric parameters that can be customized, such as threshold +// and headroom. +type CustomizableMetricParameters struct { + + // The headroom threshold value in percentage used for the specified metric + // parameter. + Headroom CustomizableMetricHeadroom + + // The threshold value used for the specified metric parameter. + Threshold CustomizableMetricThreshold + + noSmithyDocumentSerde +} + +// Describes the effective recommendation preferences for Amazon EBS volumes. +type EBSEffectiveRecommendationPreferences struct { + + // Describes the savings estimation mode preference applied for calculating + // savings opportunity for Amazon EBS volumes. + SavingsEstimationMode *EBSSavingsEstimationMode + + noSmithyDocumentSerde +} + +// An object that describes the estimated monthly savings possible by adopting +// Compute Optimizer’s Amazon EBS volume recommendations. This includes any +// applicable discounts. +type EBSEstimatedMonthlySavings struct { + + // The currency of the estimated monthly savings. + Currency Currency + + // The value of the estimated monthly savings. + Value float64 + + noSmithyDocumentSerde +} + // Describes a filter that returns a more specific list of Amazon Elastic Block // Store (Amazon EBS) volume recommendations. Use this filter with the // GetEBSVolumeRecommendations action. You can use @@ -259,6 +336,34 @@ type EBSFilter struct { noSmithyDocumentSerde } +// Describes the savings estimation mode used for calculating savings opportunity +// for Amazon EBS volumes. +type EBSSavingsEstimationMode struct { + + // Describes the source for calculating the savings opportunity for Amazon EBS + // volumes. + Source EBSSavingsEstimationModeSource + + noSmithyDocumentSerde +} + +// Describes the savings opportunity for Amazon EBS volume recommendations after +// applying specific discounts. +type EBSSavingsOpportunityAfterDiscounts struct { + + // The estimated monthly savings possible as a percentage of monthly cost by + // adopting Compute Optimizer’s Amazon EBS volume recommendations. This saving + // includes any applicable discounts. + EstimatedMonthlySavings *EBSEstimatedMonthlySavings + + // The estimated monthly savings possible as a percentage of monthly cost after + // applying the specific discounts. This saving can be achieved by adopting Compute + // Optimizer’s Amazon EBS volume recommendations. + SavingsOpportunityPercentage float64 + + noSmithyDocumentSerde +} + // Describes a utilization metric of an Amazon Elastic Block Store (Amazon EBS) // volume. Compare the utilization metric data of your resource against its // projected utilization metric data to determine the performance difference @@ -295,6 +400,60 @@ type EBSUtilizationMetric struct { noSmithyDocumentSerde } +// Describes the effective recommendation preferences for Amazon ECS services. +type ECSEffectiveRecommendationPreferences struct { + + // Describes the savings estimation mode preference applied for calculating + // savings opportunity for Amazon ECS services. + SavingsEstimationMode *ECSSavingsEstimationMode + + noSmithyDocumentSerde +} + +// Describes the estimated monthly savings possible for Amazon ECS services by +// adopting Compute Optimizer recommendations. This is based on Amazon ECS service +// pricing after applying Savings Plans discounts. +type ECSEstimatedMonthlySavings struct { + + // The currency of the estimated monthly savings. + Currency Currency + + // The value of the estimated monthly savings for Amazon ECS services. + Value float64 + + noSmithyDocumentSerde +} + +// Describes the savings estimation mode used for calculating savings opportunity +// for Amazon ECS services. +type ECSSavingsEstimationMode struct { + + // Describes the source for calculating the savings opportunity for Amazon ECS + // services. + Source ECSSavingsEstimationModeSource + + noSmithyDocumentSerde +} + +// Describes the savings opportunity for Amazon ECS service recommendations after +// applying Savings Plans discounts. Savings opportunity represents the estimated +// monthly savings after applying Savings Plans discounts. You can achieve this by +// implementing a given Compute Optimizer recommendation. +type ECSSavingsOpportunityAfterDiscounts struct { + + // The estimated monthly savings possible by adopting Compute Optimizer’s Amazon + // ECS service recommendations. This includes any applicable Savings Plans + // discounts. + EstimatedMonthlySavings *ECSEstimatedMonthlySavings + + // The estimated monthly savings possible as a percentage of monthly cost by + // adopting Compute Optimizer’s Amazon ECS service recommendations. This includes + // any applicable Savings Plans discounts. + SavingsOpportunityPercentage float64 + + noSmithyDocumentSerde +} + // Describes the projected metrics of an Amazon ECS service recommendation option. // To determine the performance difference between your current Amazon ECS service // and the recommended option, compare the metric data of your service against its @@ -370,6 +529,9 @@ type ECSServiceRecommendation struct { // The configuration of the current Amazon ECS service. CurrentServiceConfiguration *ServiceConfiguration + // Describes the effective recommendation preferences for Amazon ECS services. + EffectiveRecommendationPreferences *ECSEffectiveRecommendationPreferences + // The finding classification of an Amazon ECS service. Findings for Amazon ECS // services include: // - Underprovisioned — When Compute Optimizer detects that there’s not enough @@ -491,6 +653,12 @@ type ECSServiceRecommendationOption struct { // in the Cost Management User Guide. SavingsOpportunity *SavingsOpportunity + // Describes the savings opportunity for Amazon ECS service recommendations or for + // the recommendation option. Savings opportunity represents the estimated monthly + // savings after applying Savings Plans discounts. You can achieve this by + // implementing a given Compute Optimizer recommendation. + SavingsOpportunityAfterDiscounts *ECSSavingsOpportunityAfterDiscounts + noSmithyDocumentSerde } @@ -542,6 +710,28 @@ type ECSServiceUtilizationMetric struct { noSmithyDocumentSerde } +// Describes the effective preferred resources that Compute Optimizer considers as +// rightsizing recommendation candidates. Compute Optimizer only supports Amazon +// EC2 instance types. +type EffectivePreferredResource struct { + + // The expanded version of your preferred resource's include list. + EffectiveIncludeList []string + + // The list of preferred resources values that you want excluded from rightsizing + // recommendation candidates. + ExcludeList []string + + // The list of preferred resource values that you want considered as rightsizing + // recommendation candidates. + IncludeList []string + + // The name of the preferred resource list. + Name PreferredResourceName + + noSmithyDocumentSerde +} + // Describes the effective recommendation preferences for a resource. type EffectiveRecommendationPreferences struct { @@ -577,6 +767,23 @@ type EffectiveRecommendationPreferences struct { // to recommendations. InferredWorkloadTypes InferredWorkloadTypesPreference + // The number of days the utilization metrics of the Amazon Web Services resource + // are analyzed. + LookBackPeriod LookBackPeriodPreference + + // The resource type values that are considered as candidates when generating + // rightsizing recommendations. + PreferredResources []EffectivePreferredResource + + // Describes the savings estimation mode applied for calculating savings + // opportunity for a resource. + SavingsEstimationMode *InstanceSavingsEstimationMode + + // The resource’s CPU utilization threshold preferences, such as threshold and + // headroom, that are used to generate rightsizing recommendations. This preference + // is only available for the Amazon EC2 instance resource type. + UtilizationPreferences []UtilizationPreference + noSmithyDocumentSerde } @@ -806,6 +1013,20 @@ type InferredWorkloadSaving struct { noSmithyDocumentSerde } +// An object that describes the estimated monthly savings possible by adopting +// Compute Optimizer’s Amazon EC2 instance recommendations. This is based on the +// Savings Plans and Reserved Instances pricing discounts. +type InstanceEstimatedMonthlySavings struct { + + // The currency of the estimated monthly savings. + Currency Currency + + // The value of the estimated monthly savings. + Value float64 + + noSmithyDocumentSerde +} + // Describes an Amazon EC2 instance recommendation. type InstanceRecommendation struct { @@ -1098,6 +1319,42 @@ type InstanceRecommendationOption struct { // savings amount and percentage. SavingsOpportunity *SavingsOpportunity + // An object that describes the savings opportunity for the instance + // recommendation option that includes Savings Plans and Reserved Instances + // discounts. Savings opportunity includes the estimated monthly savings and + // percentage. + SavingsOpportunityAfterDiscounts *InstanceSavingsOpportunityAfterDiscounts + + noSmithyDocumentSerde +} + +// Describes the savings estimation mode used for calculating savings opportunity +// for Amazon EC2 instances. +type InstanceSavingsEstimationMode struct { + + // Describes the source for calculating the savings opportunity for Amazon EC2 + // instances. + Source InstanceSavingsEstimationModeSource + + noSmithyDocumentSerde +} + +// Describes the savings opportunity for instance recommendations after applying +// the Savings Plans and Reserved Instances discounts. Savings opportunity after +// discounts represents the estimated monthly savings you can achieve by +// implementing Compute Optimizer recommendations. +type InstanceSavingsOpportunityAfterDiscounts struct { + + // An object that describes the estimated monthly savings possible by adopting + // Compute Optimizer’s Amazon EC2 instance recommendations. This is based on + // pricing after applying the Savings Plans and Reserved Instances discounts. + EstimatedMonthlySavings *InstanceEstimatedMonthlySavings + + // The estimated monthly savings possible as a percentage of monthly cost after + // applying the Savings Plans and Reserved Instances discounts. This saving can be + // achieved by adopting Compute Optimizer’s EC2 instance recommendations. + SavingsOpportunityPercentage float64 + noSmithyDocumentSerde } @@ -1126,6 +1383,30 @@ type JobFilter struct { noSmithyDocumentSerde } +// Describes the effective recommendation preferences for Lambda functions. +type LambdaEffectiveRecommendationPreferences struct { + + // Describes the savings estimation mode applied for calculating savings + // opportunity for Lambda functions. + SavingsEstimationMode *LambdaSavingsEstimationMode + + noSmithyDocumentSerde +} + +// Describes the estimated monthly savings possible for Lambda functions by +// adopting Compute Optimizer recommendations. This is based on Lambda functions +// pricing after applying Savings Plans discounts. +type LambdaEstimatedMonthlySavings struct { + + // The currency of the estimated monthly savings. + Currency Currency + + // The value of the estimated monthly savings. + Value float64 + + noSmithyDocumentSerde +} + // Describes a projected utilization metric of an Lambda function recommendation // option. type LambdaFunctionMemoryProjectedMetric struct { @@ -1161,6 +1442,11 @@ type LambdaFunctionMemoryRecommendationOption struct { // savings amount and percentage. SavingsOpportunity *SavingsOpportunity + // An object that describes the savings opportunity for the Lambda recommendation + // option which includes Saving Plans discounts. Savings opportunity includes the + // estimated monthly savings and percentage. + SavingsOpportunityAfterDiscounts *LambdaSavingsOpportunityAfterDiscounts + noSmithyDocumentSerde } @@ -1178,6 +1464,9 @@ type LambdaFunctionRecommendation struct { // requires more memory. CurrentPerformanceRisk CurrentPerformanceRisk + // Describes the effective recommendation preferences for Lambda functions. + EffectiveRecommendationPreferences *LambdaEffectiveRecommendationPreferences + // The finding classification of the function. Findings for functions include: // - Optimized — The function is correctly provisioned to run your workload based // on its current configuration and its utilization history. This finding @@ -1311,6 +1600,35 @@ type LambdaFunctionUtilizationMetric struct { noSmithyDocumentSerde } +// Describes the savings estimation used for calculating savings opportunity for +// Lambda functions. +type LambdaSavingsEstimationMode struct { + + // Describes the source for calculation of savings opportunity for Lambda + // functions. + Source LambdaSavingsEstimationModeSource + + noSmithyDocumentSerde +} + +// Describes the savings opportunity for Lambda functions recommendations after +// applying Savings Plans discounts. Savings opportunity represents the estimated +// monthly savings after applying Savings Plans discounts. You can achieve this by +// implementing a given Compute Optimizer recommendation. +type LambdaSavingsOpportunityAfterDiscounts struct { + + // The estimated monthly savings possible by adopting Compute Optimizer’s Lambda + // function recommendations. This includes any applicable Savings Plans discounts. + EstimatedMonthlySavings *LambdaEstimatedMonthlySavings + + // The estimated monthly savings possible as a percentage of monthly cost by + // adopting Compute Optimizer’s Lambda function recommendations. This includes any + // applicable Savings Plans discounts. + SavingsOpportunityPercentage float64 + + noSmithyDocumentSerde +} + // Describes the configuration of a license for an Amazon EC2 instance. type LicenseConfiguration struct { @@ -1486,6 +1804,35 @@ type MetricSource struct { noSmithyDocumentSerde } +// The preference to control which resource type values are considered when +// generating rightsizing recommendations. You can specify this preference as a +// combination of include and exclude lists. You must specify either an includeList +// or excludeList . If the preference is an empty set of resource type values, an +// error occurs. For more information, see Rightsizing recommendation preferences (https://docs.aws.amazon.com/compute-optimizer/latest/ug/rightsizing-preferences.html) +// in the Compute Optimizer User Guide. +// - This preference is only available for the Amazon EC2 instance and Auto +// Scaling group resource types. +// - Compute Optimizer only supports the customization of Ec2InstanceTypes . +type PreferredResource struct { + + // The preferred resource type values to exclude from the recommendation + // candidates. If this isn’t specified, all supported resources are included by + // default. You can specify up to 1000 values in this list. + ExcludeList []string + + // The preferred resource type values to include in the recommendation candidates. + // You can specify the exact resource type value, such as m5.large, or use wild + // card expressions, such as m5. If this isn’t specified, all supported resources + // are included by default. You can specify up to 1000 values in this list. + IncludeList []string + + // The type of preferred resource to customize. Compute Optimizer only supports + // the customization of Ec2InstanceTypes . + Name PreferredResourceName + + noSmithyDocumentSerde +} + // Describes a projected utilization metric of a recommendation option, such as an // Amazon EC2 instance. This represents the projected utilization of a // recommendation option had you used that resource during the analyzed period. @@ -1620,12 +1967,28 @@ type RecommendationPreferencesDetail struct { // that the preference isn't yet applied to recommendations. InferredWorkloadTypes InferredWorkloadTypesPreference + // The preference to control the number of days the utilization metrics of the + // Amazon Web Services resource are analyzed. If the preference isn’t set, this + // object is null. + LookBackPeriod LookBackPeriodPreference + + // The preference to control which resource type values are considered when + // generating rightsizing recommendations. This object resolves any wildcard + // expressions and returns the effective list of candidate resource type values. If + // the preference isn’t set, this object is null. + PreferredResources []EffectivePreferredResource + // The target resource type of the recommendation preference to create. The // Ec2Instance option encompasses standalone instances and instances that are part // of Auto Scaling groups. The AutoScalingGroup option encompasses only instances // that are part of an Auto Scaling group. ResourceType ResourceType + // Describes the savings estimation mode used for calculating savings opportunity. + // Only the account manager or delegated administrator of your organization can + // activate this preference. + SavingsEstimationMode SavingsEstimationMode + // An object that describes the scope of the recommendation preference. // Recommendation preferences can be created at the organization level (for // management accounts of an organization only), account level, and resource level. @@ -1633,6 +1996,11 @@ type RecommendationPreferencesDetail struct { // in the Compute Optimizer User Guide. Scope *Scope + // The preference to control the resource’s CPU utilization thresholds - threshold + // and headroom. If the preference isn’t set, this object is null. This preference + // is only available for the Amazon EC2 instance resource type. + UtilizationPreferences []UtilizationPreference + noSmithyDocumentSerde } @@ -1950,6 +2318,21 @@ type UtilizationMetric struct { noSmithyDocumentSerde } +// The preference to control the resource’s CPU utilization thresholds - threshold +// and headroom. This preference is only available for the Amazon EC2 instance +// resource type. +type UtilizationPreference struct { + + // The name of the resource utilization metric name to customize. Compute + // Optimizer only supports CpuUtilization . + MetricName CustomizableMetricName + + // The parameters to set when customizing the resource utilization thresholds. + MetricParameters *CustomizableMetricParameters + + noSmithyDocumentSerde +} + // Describes the configuration of an Amazon Elastic Block Store (Amazon EBS) // volume. type VolumeConfiguration struct { @@ -1994,6 +2377,9 @@ type VolumeRecommendation struct { // have sufficient capacity. CurrentPerformanceRisk CurrentPerformanceRisk + // Describes the effective recommendation preferences for Amazon EBS volume. + EffectiveRecommendationPreferences *EBSEffectiveRecommendationPreferences + // The finding classification of the volume. Findings for volumes include: // - NotOptimized —A volume is considered not optimized when Compute Optimizer // identifies a recommendation that can provide better performance for your @@ -2050,6 +2436,11 @@ type VolumeRecommendationOption struct { // savings amount and percentage. SavingsOpportunity *SavingsOpportunity + // An object that describes the savings opportunity for the Amazon EBS volume + // recommendation option with specific discounts. Savings opportunity includes the + // estimated monthly savings and percentage. + SavingsOpportunityAfterDiscounts *EBSSavingsOpportunityAfterDiscounts + noSmithyDocumentSerde } diff --git a/service/configservice/deserializers.go b/service/configservice/deserializers.go index b5593b72562..b17024c15aa 100644 --- a/service/configservice/deserializers.go +++ b/service/configservice/deserializers.go @@ -8103,6 +8103,9 @@ func awsAwsjson11_deserializeOpErrorPutConfigurationRecorder(response *smithyhtt case strings.EqualFold("MaxNumberOfConfigurationRecordersExceededException", errorCode): return awsAwsjson11_deserializeErrorMaxNumberOfConfigurationRecordersExceededException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -13428,6 +13431,22 @@ func awsAwsjson11_deserializeDocumentBaseConfigurationItem(v **types.BaseConfigu } } + case "configurationItemDeliveryTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ConfigurationItemDeliveryTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected ConfigurationItemDeliveryTime to be a JSON Number, got %T instead", value) + + } + } + case "configurationItemStatus": if value != nil { jtv, ok := value.(string) @@ -13446,6 +13465,15 @@ func awsAwsjson11_deserializeDocumentBaseConfigurationItem(v **types.BaseConfigu sv.ConfigurationStateId = ptr.String(jtv) } + case "recordingFrequency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecordingFrequency to be of type string, got %T instead", value) + } + sv.RecordingFrequency = types.RecordingFrequency(jtv) + } + case "resourceCreationTime": if value != nil { switch jtv := value.(type) { @@ -14821,6 +14849,22 @@ func awsAwsjson11_deserializeDocumentConfigurationItem(v **types.ConfigurationIt } } + case "configurationItemDeliveryTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ConfigurationItemDeliveryTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected ConfigurationItemDeliveryTime to be a JSON Number, got %T instead", value) + + } + } + case "configurationItemMD5Hash": if value != nil { jtv, ok := value.(string) @@ -14848,6 +14892,15 @@ func awsAwsjson11_deserializeDocumentConfigurationItem(v **types.ConfigurationIt sv.ConfigurationStateId = ptr.String(jtv) } + case "recordingFrequency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecordingFrequency to be of type string, got %T instead", value) + } + sv.RecordingFrequency = types.RecordingFrequency(jtv) + } + case "relatedEvents": if err := awsAwsjson11_deserializeDocumentRelatedEventList(&sv.RelatedEvents, value); err != nil { return err @@ -14999,6 +15052,11 @@ func awsAwsjson11_deserializeDocumentConfigurationRecorder(v **types.Configurati return err } + case "recordingMode": + if err := awsAwsjson11_deserializeDocumentRecordingMode(&sv.RecordingMode, value); err != nil { + return err + } + case "roleARN": if value != nil { jtv, ok := value.(string) @@ -20622,6 +20680,175 @@ func awsAwsjson11_deserializeDocumentRecordingGroup(v **types.RecordingGroup, va return nil } +func awsAwsjson11_deserializeDocumentRecordingMode(v **types.RecordingMode, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RecordingMode + if *v == nil { + sv = &types.RecordingMode{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "recordingFrequency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecordingFrequency to be of type string, got %T instead", value) + } + sv.RecordingFrequency = types.RecordingFrequency(jtv) + } + + case "recordingModeOverrides": + if err := awsAwsjson11_deserializeDocumentRecordingModeOverrides(&sv.RecordingModeOverrides, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRecordingModeOverride(v **types.RecordingModeOverride, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RecordingModeOverride + if *v == nil { + sv = &types.RecordingModeOverride{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "recordingFrequency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecordingFrequency to be of type string, got %T instead", value) + } + sv.RecordingFrequency = types.RecordingFrequency(jtv) + } + + case "resourceTypes": + if err := awsAwsjson11_deserializeDocumentRecordingModeResourceTypesList(&sv.ResourceTypes, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRecordingModeOverrides(v *[]types.RecordingModeOverride, 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.RecordingModeOverride + if *v == nil { + cv = []types.RecordingModeOverride{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RecordingModeOverride + destAddr := &col + if err := awsAwsjson11_deserializeDocumentRecordingModeOverride(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentRecordingModeResourceTypesList(v *[]types.ResourceType, 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.ResourceType + if *v == nil { + cv = []types.ResourceType{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResourceType + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + col = types.ResourceType(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentRecordingStrategy(v **types.RecordingStrategy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/configservice/serializers.go b/service/configservice/serializers.go index 72270bb8d10..8c2ffd07c88 100644 --- a/service/configservice/serializers.go +++ b/service/configservice/serializers.go @@ -5403,6 +5403,13 @@ func awsAwsjson11_serializeDocumentConfigurationRecorder(v *types.ConfigurationR } } + if v.RecordingMode != nil { + ok := object.Key("recordingMode") + if err := awsAwsjson11_serializeDocumentRecordingMode(v.RecordingMode, ok); err != nil { + return err + } + } + if v.RoleARN != nil { ok := object.Key("roleARN") ok.String(*v.RoleARN) @@ -6115,6 +6122,73 @@ func awsAwsjson11_serializeDocumentRecordingGroup(v *types.RecordingGroup, value return nil } +func awsAwsjson11_serializeDocumentRecordingMode(v *types.RecordingMode, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.RecordingFrequency) > 0 { + ok := object.Key("recordingFrequency") + ok.String(string(v.RecordingFrequency)) + } + + if v.RecordingModeOverrides != nil { + ok := object.Key("recordingModeOverrides") + if err := awsAwsjson11_serializeDocumentRecordingModeOverrides(v.RecordingModeOverrides, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentRecordingModeOverride(v *types.RecordingModeOverride, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if len(v.RecordingFrequency) > 0 { + ok := object.Key("recordingFrequency") + ok.String(string(v.RecordingFrequency)) + } + + if v.ResourceTypes != nil { + ok := object.Key("resourceTypes") + if err := awsAwsjson11_serializeDocumentRecordingModeResourceTypesList(v.ResourceTypes, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentRecordingModeOverrides(v []types.RecordingModeOverride, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentRecordingModeOverride(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentRecordingModeResourceTypesList(v []types.ResourceType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsAwsjson11_serializeDocumentRecordingStrategy(v *types.RecordingStrategy, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/configservice/types/enums.go b/service/configservice/types/enums.go index 5a07fee82e9..4b4441d9fb1 100644 --- a/service/configservice/types/enums.go +++ b/service/configservice/types/enums.go @@ -518,6 +518,24 @@ func (RecorderStatus) Values() []RecorderStatus { } } +type RecordingFrequency string + +// Enum values for RecordingFrequency +const ( + RecordingFrequencyContinuous RecordingFrequency = "CONTINUOUS" + RecordingFrequencyDaily RecordingFrequency = "DAILY" +) + +// Values returns all known values for RecordingFrequency. 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 (RecordingFrequency) Values() []RecordingFrequency { + return []RecordingFrequency{ + "CONTINUOUS", + "DAILY", + } +} + type RecordingStrategyType string // Enum values for RecordingStrategyType diff --git a/service/configservice/types/types.go b/service/configservice/types/types.go index 812119c872d..cb168f66cb8 100644 --- a/service/configservice/types/types.go +++ b/service/configservice/types/types.go @@ -283,7 +283,7 @@ type AggregationAuthorization struct { noSmithyDocumentSerde } -// The detailed configuration of a specified resource. +// The detailed configurations of a specified resource. type BaseConfigurationItem struct { // The 12-digit Amazon Web Services account ID associated with the resource. @@ -301,25 +301,32 @@ type BaseConfigurationItem struct { // The description of the resource configuration. Configuration *string - // The time when the configuration recording was initiated. + // The time when the recording of configuration changes was initiated for the + // resource. ConfigurationItemCaptureTime *time.Time - // The configuration item status. The valid values are: - // - OK – The resource configuration has been updated - // - ResourceDiscovered – The resource was newly discovered - // - ResourceNotRecorded – The resource was discovered but its configuration was - // not recorded since the recorder excludes the recording of resources of this type - // + // The time when configuration changes for the resource were delivered. + ConfigurationItemDeliveryTime *time.Time + + // The configuration item status. Valid values include: + // - OK – The resource configuration has been updated. + // - ResourceDiscovered – The resource was newly discovered. + // - ResourceNotRecorded – The resource was discovered, but its configuration + // was not recorded since the recorder doesn't record resources of this type. // - ResourceDeleted – The resource was deleted - // - ResourceDeletedNotRecorded – The resource was deleted but its configuration - // was not recorded since the recorder excludes the recording of resources of this - // type + // - ResourceDeletedNotRecorded – The resource was deleted, but its + // configuration was not recorded since the recorder doesn't record resources of + // this type. ConfigurationItemStatus ConfigurationItemStatus // An identifier that indicates the ordering of the configuration items of a // resource. ConfigurationStateId *string + // The recording frequency that Config uses to record configuration changes for + // the resource. + RecordingFrequency RecordingFrequency + // The time stamp when the resource was created. ResourceCreationTime *time.Time @@ -759,30 +766,36 @@ type ConfigurationItem struct { // The description of the resource configuration. Configuration *string - // The time when the configuration recording was initiated. + // The time when the recording of configuration changes was initiated for the + // resource. ConfigurationItemCaptureTime *time.Time + // The time when configuration changes for the resource were delivered. + ConfigurationItemDeliveryTime *time.Time + // Unique MD5 hash that represents the configuration item's state. You can use MD5 // hash to compare the states of two or more configuration items that are // associated with the same resource. ConfigurationItemMD5Hash *string - // The configuration item status. The valid values are: + // The configuration item status. Valid values include: // - OK – The resource configuration has been updated // - ResourceDiscovered – The resource was newly discovered // - ResourceNotRecorded – The resource was discovered but its configuration was - // not recorded since the recorder excludes the recording of resources of this type - // + // not recorded since the recorder doesn't record resources of this type // - ResourceDeleted – The resource was deleted // - ResourceDeletedNotRecorded – The resource was deleted but its configuration - // was not recorded since the recorder excludes the recording of resources of this - // type + // was not recorded since the recorder doesn't record resources of this type ConfigurationItemStatus ConfigurationItemStatus // An identifier that indicates the ordering of the configuration items of a // resource. ConfigurationStateId *string + // The recording frequency that Config uses to record configuration changes for + // the resource. + RecordingFrequency RecordingFrequency + // A list of CloudTrail event IDs. A populated field indicates that the current // configuration was initiated by the events recorded in the CloudTrail log. For // more information about CloudTrail, see What Is CloudTrail (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html) @@ -820,8 +833,9 @@ type ConfigurationItem struct { noSmithyDocumentSerde } -// Records configuration changes to specified resource types. For more information -// about the configuration recorder, see Managing the Configuration Recorder (https://docs.aws.amazon.com/config/latest/developerguide/stop-start-recorder.html) +// Records configuration changes to your specified resource types. For more +// information about the configuration recorder, see Managing the Configuration +// Recorder (https://docs.aws.amazon.com/config/latest/developerguide/stop-start-recorder.html) // in the Config Developer Guide. type ConfigurationRecorder struct { @@ -847,6 +861,19 @@ type ConfigurationRecorder struct { // avoid increased configuration recording and rule evaluations. RecordingGroup *RecordingGroup + // Specifies the default recording frequency that Config uses to record + // configuration changes. Config supports Continuous recording and Daily recording. + // + // - Continuous recording allows you to record configuration changes + // continuously whenever a change occurs. + // - Daily recording allows you record configuration data once every 24 hours, + // only if a change has occurred. + // Firewall Manager depends on continuous recording to monitor your resources. If + // you are using Firewall Manager, it is recommended that you set the recording + // frequency to Continuous. You can also override the recording frequency for + // specific resource types. + RecordingMode *RecordingMode + // Amazon Resource Name (ARN) of the IAM role assumed by Config and used by the // configuration recorder. While the API model does not require this field, the // server will reject a request without a defined roleARN for the configuration @@ -1396,16 +1423,19 @@ type EvaluationStatus struct { // list of resource types you want to exclude from recording. By default, when // Config adds support for a new resource type in the Region where you set up the // configuration recorder, including global resource types, Config starts recording -// resources of that type automatically. How to use To use this option, you must -// set the useOnly field of RecordingStrategy (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html) +// resources of that type automatically. How to use the exclusion recording +// strategy To use this option, you must set the useOnly field of RecordingStrategy (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html) // to EXCLUSION_BY_RESOURCE_TYPES . Config will then record configuration changes // for all supported resource types, except the resource types that you specify to -// exclude from being recorded. Globally recorded resources Unless specifically -// listed as exclusions, AWS::RDS::GlobalCluster will be recorded automatically in -// all supported Config Regions were the configuration recorder is enabled. IAM -// users, groups, roles, and customer managed policies will be recorded -// automatically in all enabled Config Regions where Config was available before -// February 2022. This list does not include the following Regions: +// exclude from being recorded. Global resource types and the exclusion recording +// strategy Unless specifically listed as exclusions, AWS::RDS::GlobalCluster will +// be recorded automatically in all supported Config Regions were the configuration +// recorder is enabled. IAM users, groups, roles, and customer managed policies +// will be recorded in the Region where you set up the configuration recorder if +// that is a Region where Config was available before February 2022. You cannot be +// record the global IAM resouce types in Regions supported by Config after +// February 2022. This list where you cannot record the global IAM resource types +// includes the following Regions: // - Asia Pacific (Hyderabad) // - Asia Pacific (Melbourne) // - Europe (Spain) @@ -2124,19 +2154,22 @@ type QueryInfo struct { // Specifies which resource types Config records for configuration changes. By // default, Config records configuration changes for all current and future // supported resource types in the Amazon Web Services Region where you have -// enabled Config (excluding the globally recorded IAM resource types: IAM users, -// groups, roles, and customer managed policies). In the recording group, you -// specify whether you want to record all supported current and future supported -// resource types or to include or exclude specific resources types. For a list of -// supported resource types, see Supported Resource Types (https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources) +// enabled Config, excluding the global IAM resource types: IAM users, groups, +// roles, and customer managed policies. In the recording group, you specify +// whether you want to record all supported current and future supported resource +// types or to include or exclude specific resources types. For a list of supported +// resource types, see Supported Resource Types (https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources) // in the Config developer guide. If you don't want Config to record all current -// and future supported resource types, use one of the following recording -// strategies: +// and future supported resource types (excluding the global IAM resource types), +// use one of the following recording strategies: // - Record all current and future resource types with exclusions ( // EXCLUSION_BY_RESOURCE_TYPES ), or // - Record specific resource types ( INCLUSION_BY_RESOURCE_TYPES ). // -// Aurora global clusters are automatically globally recorded The +// If you use the recording strategy to Record all current and future resource +// types ( ALL_SUPPORTED_RESOURCE_TYPES ), you can use the flag +// includeGlobalResourceTypes to include the global IAM resource types in your +// recording. Aurora global clusters are recorded in all enabled Regions The // AWS::RDS::GlobalCluster resource type will be recorded in all supported Config // Regions where the configuration recorder is enabled. If you do not want to // record AWS::RDS::GlobalCluster in all enabled Regions, use the @@ -2144,66 +2177,67 @@ type QueryInfo struct { type RecordingGroup struct { // Specifies whether Config records configuration changes for all supported - // regionally recorded resource types. If you set this field to true , when Config - // adds support for a new regionally recorded resource type, Config starts + // resource types, excluding the global IAM resource types. If you set this field + // to true , when Config adds support for a new resource type, Config starts // recording resources of that type automatically. If you set this field to true , // you cannot enumerate specific resource types to record in the resourceTypes // field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) // , or to exclude in the resourceTypes field of ExclusionByResourceTypes (https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html) - // . Region Availability Check Resource Coverage by Region Availability (https://docs.aws.amazon.com/config/latest/developerguide/what-is-resource-config-coverage.html) + // . Region availability Check Resource Coverage by Region Availability (https://docs.aws.amazon.com/config/latest/developerguide/what-is-resource-config-coverage.html) // to see if a resource type is supported in the Amazon Web Services Region where // you set up Config. AllSupported bool // An object that specifies how Config excludes resource types from being recorded - // by the configuration recorder. To use this option, you must set the useOnly - // field of RecordingStrategy (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html) + // by the configuration recorder. Required fields To use this option, you must set + // the useOnly field of RecordingStrategy (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html) // to EXCLUSION_BY_RESOURCE_TYPES . ExclusionByResourceTypes *ExclusionByResourceTypes - // A legacy field which only applies to the globally recorded IAM resource types: - // IAM users, groups, roles, and customer managed policies. If you select this - // option, these resource types will be recorded in all enabled Config regions - // where Config was available before February 2022. This list does not include the - // following Regions: + // This option is a bundle which only applies to the global IAM resource types: + // IAM users, groups, roles, and customer managed policies. These global IAM + // resource types can only be recorded by Config in Regions where Config was + // available before February 2022. You cannot be record the global IAM resouce + // types in Regions supported by Config after February 2022. This list where you + // cannot record the global IAM resource types includes the following Regions: // - Asia Pacific (Hyderabad) // - Asia Pacific (Melbourne) // - Europe (Spain) // - Europe (Zurich) // - Israel (Tel Aviv) // - Middle East (UAE) - // Aurora global clusters are automatically globally recorded The + // Aurora global clusters are recorded in all enabled Regions The // AWS::RDS::GlobalCluster resource type will be recorded in all supported Config // Regions where the configuration recorder is enabled, even if - // includeGlobalResourceTypes is not set to true . includeGlobalResourceTypes is a - // legacy field which only applies to IAM users, groups, roles, and customer + // includeGlobalResourceTypes is not set to true . The includeGlobalResourceTypes + // option is a bundle which only applies to IAM users, groups, roles, and customer // managed policies. If you do not want to record AWS::RDS::GlobalCluster in all // enabled Regions, use one of the following recording strategies: // - Record all current and future resource types with exclusions ( // EXCLUSION_BY_RESOURCE_TYPES ), or // - Record specific resource types ( INCLUSION_BY_RESOURCE_TYPES ). // For more information, see Selecting Which Resources are Recorded (https://docs.aws.amazon.com/config/latest/developerguide/select-resources.html#select-resources-all) - // in the Config developer guide. Required and optional fields Before you set this - // field to true , set the allSupported field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) + // in the Config developer guide. Before you set this field to true , set the + // allSupported field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) // to true . Optionally, you can set the useOnly field of RecordingStrategy (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html) // to ALL_SUPPORTED_RESOURCE_TYPES . Overriding fields If you set this field to - // false but list globally recorded IAM resource types in the resourceTypes field - // of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) + // false but list global IAM resource types in the resourceTypes field of + // RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) // , Config will still record configuration changes for those specified resource // types regardless of if you set the includeGlobalResourceTypes field to false. - // If you do not want to record configuration changes to the globally recorded IAM - // resource types (IAM users, groups, roles, and customer managed policies), make - // sure to not list them in the resourceTypes field in addition to setting the + // If you do not want to record configuration changes to the global IAM resource + // types (IAM users, groups, roles, and customer managed policies), make sure to + // not list them in the resourceTypes field in addition to setting the // includeGlobalResourceTypes field to false. IncludeGlobalResourceTypes bool // An object that specifies the recording strategy for the configuration recorder. // - If you set the useOnly field of RecordingStrategy (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html) // to ALL_SUPPORTED_RESOURCE_TYPES , Config records configuration changes for all - // supported regionally recorded resource types. You also must set the - // allSupported field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) - // to true . When Config adds support for a new regionally recorded resource - // type, Config automatically starts recording resources of that type. + // supported resource types, excluding the global IAM resource types. You also must + // set the allSupported field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) + // to true . When Config adds support for a new resource type, Config + // automatically starts recording resources of that type. // - If you set the useOnly field of RecordingStrategy (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html) // to INCLUSION_BY_RESOURCE_TYPES , Config records configuration changes for only // the resource types you specify in the resourceTypes field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) @@ -2222,19 +2256,21 @@ type RecordingGroup struct { // . Overriding fields If you choose EXCLUSION_BY_RESOURCE_TYPES for the recording // strategy, the exclusionByResourceTypes field will override other properties in // the request. For example, even if you set includeGlobalResourceTypes to false, - // globally recorded IAM resource types will still be automatically recorded in - // this option unless those resource types are specifically listed as exclusions in - // the resourceTypes field of exclusionByResourceTypes . Global resources types and - // the resource exclusion recording strategy By default, if you choose the + // global IAM resource types will still be automatically recorded in this option + // unless those resource types are specifically listed as exclusions in the + // resourceTypes field of exclusionByResourceTypes . Global resources types and the + // resource exclusion recording strategy By default, if you choose the // EXCLUSION_BY_RESOURCE_TYPES recording strategy, when Config adds support for a // new resource type in the Region where you set up the configuration recorder, // including global resource types, Config starts recording resources of that type - // automatically. In addition, unless specifically listed as exclusions, - // AWS::RDS::GlobalCluster will be recorded automatically in all supported Config - // Regions were the configuration recorder is enabled. IAM users, groups, roles, - // and customer managed policies will be recorded automatically in all enabled - // Config Regions where Config was available before February 2022. This list does - // not include the following Regions: + // automatically. Unless specifically listed as exclusions, AWS::RDS::GlobalCluster + // will be recorded automatically in all supported Config Regions were the + // configuration recorder is enabled. IAM users, groups, roles, and customer + // managed policies will be recorded in the Region where you set up the + // configuration recorder if that is a Region where Config was available before + // February 2022. You cannot be record the global IAM resouce types in Regions + // supported by Config after February 2022. This list where you cannot record the + // global IAM resource types includes the following Regions: // - Asia Pacific (Hyderabad) // - Asia Pacific (Melbourne) // - Europe (Spain) @@ -2243,18 +2279,19 @@ type RecordingGroup struct { // - Middle East (UAE) RecordingStrategy *RecordingStrategy - // A comma-separated list that specifies which resource types Config records. - // Optionally, you can set the useOnly field of RecordingStrategy (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html) + // A comma-separated list that specifies which resource types Config records. For + // a list of valid resourceTypes values, see the Resource Type Value column in + // Supported Amazon Web Services resource Types (https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources) + // in the Config developer guide. Required and optional fields Optionally, you can + // set the useOnly field of RecordingStrategy (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html) // to INCLUSION_BY_RESOURCE_TYPES . To record all configuration changes, set the // allSupported field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) // to true , and either omit this field or don't specify any resource types in this // field. If you set the allSupported field to false and specify values for // resourceTypes , when Config adds support for a new type of resource, it will not // record resources of that type unless you manually add that type to your - // recording group. For a list of valid resourceTypes values, see the Resource - // Type Value column in Supported Amazon Web Services resource Types (https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources) - // in the Config developer guide. Region Availability Before specifying a resource - // type for Config to track, check Resource Coverage by Region Availability (https://docs.aws.amazon.com/config/latest/developerguide/what-is-resource-config-coverage.html) + // recording group. Region availability Before specifying a resource type for + // Config to track, check Resource Coverage by Region Availability (https://docs.aws.amazon.com/config/latest/developerguide/what-is-resource-config-coverage.html) // to see if the resource type is supported in the Amazon Web Services Region where // you set up Config. If a resource type is supported by Config in at least one // Region, you can enable the recording of that resource type in all Regions @@ -2265,16 +2302,82 @@ type RecordingGroup struct { noSmithyDocumentSerde } +// Specifies the default recording frequency that Config uses to record +// configuration changes. Config supports Continuous recording and Daily recording. +// +// - Continuous recording allows you to record configuration changes +// continuously whenever a change occurs. +// - Daily recording allows you record configuration data once every 24 hours, +// only if a change has occurred. +// +// Firewall Manager depends on continuous recording to monitor your resources. If +// you are using Firewall Manager, it is recommended that you set the recording +// frequency to Continuous. You can also override the recording frequency for +// specific resource types. +type RecordingMode struct { + + // The default recording frequency that Config uses to record configuration + // changes. Daily recording is not supported for the following resource types: + // - AWS::Config::ResourceCompliance + // - AWS::Config::ConformancePackCompliance + // - AWS::Config::ConfigurationRecorder + // For the allSupported ( ALL_SUPPORTED_RESOURCE_TYPES ) recording strategy, these + // resource types will be set to Continuous recording. + // + // This member is required. + RecordingFrequency RecordingFrequency + + // An array of recordingModeOverride objects for you to specify your overrides for + // the recording mode. The recordingModeOverride object in the + // recordingModeOverrides array consists of three fields: a description , the new + // recordingFrequency , and an array of resourceTypes to override. + RecordingModeOverrides []RecordingModeOverride + + noSmithyDocumentSerde +} + +// An object for you to specify your overrides for the recording mode. +type RecordingModeOverride struct { + + // The recording frequency that will be applied to all the resource types + // specified in the override. + // - Continuous recording allows you to record configuration changes + // continuously whenever a change occurs. + // - Daily recording allows you record configuration data once every 24 hours, + // only if a change has occurred. + // Firewall Manager depends on continuous recording to monitor your resources. If + // you are using Firewall Manager, it is recommended that you set the recording + // frequency to Continuous. + // + // This member is required. + RecordingFrequency RecordingFrequency + + // A comma-separated list that specifies which resource types Config includes in + // the override. Daily recording is not supported for the following resource types: + // + // - AWS::Config::ResourceCompliance + // - AWS::Config::ConformancePackCompliance + // - AWS::Config::ConfigurationRecorder + // + // This member is required. + ResourceTypes []ResourceType + + // A description that you provide for the override. + Description *string + + noSmithyDocumentSerde +} + // Specifies the recording strategy of the configuration recorder. type RecordingStrategy struct { // The recording strategy for the configuration recorder. // - If you set this option to ALL_SUPPORTED_RESOURCE_TYPES , Config records - // configuration changes for all supported regionally recorded resource types. You - // also must set the allSupported field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) - // to true . When Config adds support for a new regionally recorded resource - // type, Config automatically starts recording resources of that type. For a list - // of supported resource types, see Supported Resource Types (https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources) + // configuration changes for all supported resource types, excluding the global IAM + // resource types. You also must set the allSupported field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) + // to true . When Config adds support for a new resource type, Config + // automatically starts recording resources of that type. For a list of supported + // resource types, see Supported Resource Types (https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources) // in the Config developer guide. // - If you set this option to INCLUSION_BY_RESOURCE_TYPES , Config records // configuration changes for only the resource types that you specify in the @@ -2294,19 +2397,21 @@ type RecordingStrategy struct { // . Overriding fields If you choose EXCLUSION_BY_RESOURCE_TYPES for the recording // strategy, the exclusionByResourceTypes field will override other properties in // the request. For example, even if you set includeGlobalResourceTypes to false, - // globally recorded IAM resource types will still be automatically recorded in - // this option unless those resource types are specifically listed as exclusions in - // the resourceTypes field of exclusionByResourceTypes . Global resource types and - // the exclusion recording strategy By default, if you choose the + // global IAM resource types will still be automatically recorded in this option + // unless those resource types are specifically listed as exclusions in the + // resourceTypes field of exclusionByResourceTypes . Global resource types and the + // exclusion recording strategy By default, if you choose the // EXCLUSION_BY_RESOURCE_TYPES recording strategy, when Config adds support for a // new resource type in the Region where you set up the configuration recorder, // including global resource types, Config starts recording resources of that type - // automatically. In addition, unless specifically listed as exclusions, - // AWS::RDS::GlobalCluster will be recorded automatically in all supported Config - // Regions were the configuration recorder is enabled. IAM users, groups, roles, - // and customer managed policies will be recorded automatically in all enabled - // Config Regions where Config was available before February 2022. This list does - // not include the following Regions: + // automatically. Unless specifically listed as exclusions, AWS::RDS::GlobalCluster + // will be recorded automatically in all supported Config Regions were the + // configuration recorder is enabled. IAM users, groups, roles, and customer + // managed policies will be recorded in the Region where you set up the + // configuration recorder if that is a Region where Config was available before + // February 2022. You cannot be record the global IAM resouce types in Regions + // supported by Config after February 2022. This list where you cannot record the + // global IAM resource types includes the following Regions: // - Asia Pacific (Hyderabad) // - Asia Pacific (Melbourne) // - Europe (Spain) diff --git a/service/configservice/validators.go b/service/configservice/validators.go index 8feba76331c..75d3df6b77d 100644 --- a/service/configservice/validators.go +++ b/service/configservice/validators.go @@ -1669,6 +1669,23 @@ func validateConfigRule(v *types.ConfigRule) error { } } +func validateConfigurationRecorder(v *types.ConfigurationRecorder) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ConfigurationRecorder"} + if v.RecordingMode != nil { + if err := validateRecordingMode(v.RecordingMode); err != nil { + invalidParams.AddNested("RecordingMode", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateConformancePackComplianceScoresFilters(v *types.ConformancePackComplianceScoresFilters) error { if v == nil { return nil @@ -1868,6 +1885,61 @@ func validateOrganizationManagedRuleMetadata(v *types.OrganizationManagedRuleMet } } +func validateRecordingMode(v *types.RecordingMode) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RecordingMode"} + if len(v.RecordingFrequency) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("RecordingFrequency")) + } + if v.RecordingModeOverrides != nil { + if err := validateRecordingModeOverrides(v.RecordingModeOverrides); err != nil { + invalidParams.AddNested("RecordingModeOverrides", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRecordingModeOverride(v *types.RecordingModeOverride) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RecordingModeOverride"} + if v.ResourceTypes == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceTypes")) + } + if len(v.RecordingFrequency) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("RecordingFrequency")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRecordingModeOverrides(v []types.RecordingModeOverride) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RecordingModeOverrides"} + for i := range v { + if err := validateRecordingModeOverride(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateRemediationConfiguration(v *types.RemediationConfiguration) error { if v == nil { return nil @@ -2870,6 +2942,10 @@ func validateOpPutConfigurationRecorderInput(v *PutConfigurationRecorderInput) e invalidParams := smithy.InvalidParamsError{Context: "PutConfigurationRecorderInput"} if v.ConfigurationRecorder == nil { invalidParams.Add(smithy.NewErrParamRequired("ConfigurationRecorder")) + } else if v.ConfigurationRecorder != nil { + if err := validateConfigurationRecorder(v.ConfigurationRecorder); err != nil { + invalidParams.AddNested("ConfigurationRecorder", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams diff --git a/service/controltower/api_op_CreateLandingZone.go b/service/controltower/api_op_CreateLandingZone.go new file mode 100644 index 00000000000..173a95503dd --- /dev/null +++ b/service/controltower/api_op_CreateLandingZone.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package controltower + +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/controltower/document" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new landing zone. This starts an asynchronous operation that creates +// and configures a landing zone based on the parameters specified in the manifest +// JSON file. +func (c *Client) CreateLandingZone(ctx context.Context, params *CreateLandingZoneInput, optFns ...func(*Options)) (*CreateLandingZoneOutput, error) { + if params == nil { + params = &CreateLandingZoneInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateLandingZone", params, optFns, c.addOperationCreateLandingZoneMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateLandingZoneOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateLandingZoneInput struct { + + // The manifest.yaml file is a text file that describes your Amazon Web Services + // resources. For examples, review The manifest file (https://docs.aws.amazon.com/controltower/latest/userguide/the-manifest-file) + // . + // + // This member is required. + Manifest document.Interface + + // The landing zone version. + // + // This member is required. + Version *string + + // Tags to be applied to the landing zone. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateLandingZoneOutput struct { + + // The ARN of the landing zone. + // + // This member is required. + Arn *string + + // A unique identifier assigned to a CreateLandingZone operation. You can use this + // identifier as an input of GetLandingZoneOperation to check the operation's + // status. + // + // This member is required. + OperationIdentifier *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateLandingZoneMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateLandingZone{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateLandingZone{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateLandingZone"); 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 = addOpCreateLandingZoneValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLandingZone(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_opCreateLandingZone(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateLandingZone", + } +} diff --git a/service/controltower/api_op_DeleteLandingZone.go b/service/controltower/api_op_DeleteLandingZone.go new file mode 100644 index 00000000000..2d18b8a21e3 --- /dev/null +++ b/service/controltower/api_op_DeleteLandingZone.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package controltower + +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" +) + +// This decommissions a landing zone. This starts an asynchronous operation that +// deletes Amazon Web Services Control Tower resources deployed in Amazon Web +// Services Control Tower managed accounts. +func (c *Client) DeleteLandingZone(ctx context.Context, params *DeleteLandingZoneInput, optFns ...func(*Options)) (*DeleteLandingZoneOutput, error) { + if params == nil { + params = &DeleteLandingZoneInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteLandingZone", params, optFns, c.addOperationDeleteLandingZoneMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteLandingZoneOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteLandingZoneInput struct { + + // The unique identifier of the landing zone. + // + // This member is required. + LandingZoneIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteLandingZoneOutput struct { + + // A unique identifier assigned to a DeleteLandingZone operation. You can use this + // identifier as an input of GetLandingZoneOperation to check the operation's + // status. + // + // This member is required. + OperationIdentifier *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteLandingZoneMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteLandingZone{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteLandingZone{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteLandingZone"); 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 = addOpDeleteLandingZoneValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLandingZone(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_opDeleteLandingZone(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteLandingZone", + } +} diff --git a/service/controltower/api_op_DisableControl.go b/service/controltower/api_op_DisableControl.go index 41747da5724..a3c86ef8662 100644 --- a/service/controltower/api_op_DisableControl.go +++ b/service/controltower/api_op_DisableControl.go @@ -12,9 +12,10 @@ import ( ) // This API call turns off a control. It starts an asynchronous operation that -// deletes AWS resources on the specified organizational unit and the accounts it -// contains. The resources will vary according to the control that you specify. For -// usage examples, see the AWS Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// deletes Amazon Web Services resources on the specified organizational unit and +// the accounts it contains. The resources will vary according to the control that +// you specify. For usage examples, see the Amazon Web Services Control Tower User +// Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) // . func (c *Client) DisableControl(ctx context.Context, params *DisableControlInput, optFns ...func(*Options)) (*DisableControlOutput, error) { if params == nil { diff --git a/service/controltower/api_op_EnableControl.go b/service/controltower/api_op_EnableControl.go index 4ace505bef3..330d6d78f05 100644 --- a/service/controltower/api_op_EnableControl.go +++ b/service/controltower/api_op_EnableControl.go @@ -12,9 +12,10 @@ import ( ) // This API call activates a control. It starts an asynchronous operation that -// creates AWS resources on the specified organizational unit and the accounts it -// contains. The resources created will vary according to the control that you -// specify. For usage examples, see the AWS Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// creates Amazon Web Services resources on the specified organizational unit and +// the accounts it contains. The resources created will vary according to the +// control that you specify. For usage examples, see the Amazon Web Services +// Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) // . func (c *Client) EnableControl(ctx context.Context, params *EnableControlInput, optFns ...func(*Options)) (*EnableControlOutput, error) { if params == nil { diff --git a/service/controltower/api_op_GetControlOperation.go b/service/controltower/api_op_GetControlOperation.go index 805b82af1fe..bb1efd84e95 100644 --- a/service/controltower/api_op_GetControlOperation.go +++ b/service/controltower/api_op_GetControlOperation.go @@ -14,7 +14,8 @@ import ( // Returns the status of a particular EnableControl or DisableControl operation. // Displays a message in case of error. Details for an operation are available for -// 90 days. For usage examples, see the AWS Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// 90 days. For usage examples, see the Amazon Web Services Control Tower User +// Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) // . func (c *Client) GetControlOperation(ctx context.Context, params *GetControlOperationInput, optFns ...func(*Options)) (*GetControlOperationOutput, error) { if params == nil { diff --git a/service/controltower/api_op_GetEnabledControl.go b/service/controltower/api_op_GetEnabledControl.go index eaf1adaff3c..a09c232c36d 100644 --- a/service/controltower/api_op_GetEnabledControl.go +++ b/service/controltower/api_op_GetEnabledControl.go @@ -12,8 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves details about an enabled control. For usage examples, see the AWS -// Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// Retrieves details about an enabled control. For usage examples, see the Amazon +// Web Services Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) // . func (c *Client) GetEnabledControl(ctx context.Context, params *GetEnabledControlInput, optFns ...func(*Options)) (*GetEnabledControlOutput, error) { if params == nil { diff --git a/service/controltower/api_op_GetLandingZone.go b/service/controltower/api_op_GetLandingZone.go new file mode 100644 index 00000000000..45cdd10f3b8 --- /dev/null +++ b/service/controltower/api_op_GetLandingZone.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package controltower + +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/controltower/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns details about the landing zone. Displays a message in case of error. +func (c *Client) GetLandingZone(ctx context.Context, params *GetLandingZoneInput, optFns ...func(*Options)) (*GetLandingZoneOutput, error) { + if params == nil { + params = &GetLandingZoneInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetLandingZone", params, optFns, c.addOperationGetLandingZoneMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetLandingZoneOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetLandingZoneInput struct { + + // The unique identifier of the landing zone. + // + // This member is required. + LandingZoneIdentifier *string + + noSmithyDocumentSerde +} + +type GetLandingZoneOutput struct { + + // Information about the landing zone. + // + // This member is required. + LandingZone *types.LandingZoneDetail + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetLandingZoneMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetLandingZone{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetLandingZone{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetLandingZone"); 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 = addOpGetLandingZoneValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLandingZone(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_opGetLandingZone(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetLandingZone", + } +} diff --git a/service/controltower/api_op_GetLandingZoneOperation.go b/service/controltower/api_op_GetLandingZoneOperation.go new file mode 100644 index 00000000000..301fe4547c5 --- /dev/null +++ b/service/controltower/api_op_GetLandingZoneOperation.go @@ -0,0 +1,140 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package controltower + +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/controltower/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the status of the specified landing zone operation. Details for an +// operation are available for X days. +func (c *Client) GetLandingZoneOperation(ctx context.Context, params *GetLandingZoneOperationInput, optFns ...func(*Options)) (*GetLandingZoneOperationOutput, error) { + if params == nil { + params = &GetLandingZoneOperationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetLandingZoneOperation", params, optFns, c.addOperationGetLandingZoneOperationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetLandingZoneOperationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetLandingZoneOperationInput struct { + + // A unique identifier assigned to a landing zone operation. + // + // This member is required. + OperationIdentifier *string + + noSmithyDocumentSerde +} + +type GetLandingZoneOperationOutput struct { + + // The landing zone operation details. + // + // This member is required. + OperationDetails *types.LandingZoneOperationDetail + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetLandingZoneOperationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetLandingZoneOperation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetLandingZoneOperation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetLandingZoneOperation"); 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 = addOpGetLandingZoneOperationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLandingZoneOperation(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_opGetLandingZoneOperation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetLandingZoneOperation", + } +} diff --git a/service/controltower/api_op_ListEnabledControls.go b/service/controltower/api_op_ListEnabledControls.go index 3c2dcf0f5e7..5137ecaa1ac 100644 --- a/service/controltower/api_op_ListEnabledControls.go +++ b/service/controltower/api_op_ListEnabledControls.go @@ -12,9 +12,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the controls enabled by AWS Control Tower on the specified organizational -// unit and the accounts it contains. For usage examples, see the AWS Control -// Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// Lists the controls enabled by Amazon Web Services Control Tower on the +// specified organizational unit and the accounts it contains. For usage examples, +// see the Amazon Web Services Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) // . func (c *Client) ListEnabledControls(ctx context.Context, params *ListEnabledControlsInput, optFns ...func(*Options)) (*ListEnabledControlsOutput, error) { if params == nil { @@ -52,8 +52,8 @@ type ListEnabledControlsInput struct { type ListEnabledControlsOutput struct { - // Lists the controls enabled by AWS Control Tower on the specified organizational - // unit and the accounts it contains. + // Lists the controls enabled by Amazon Web Services Control Tower on the + // specified organizational unit and the accounts it contains. // // This member is required. EnabledControls []types.EnabledControlSummary diff --git a/service/controltower/api_op_ListLandingZones.go b/service/controltower/api_op_ListLandingZones.go new file mode 100644 index 00000000000..596483d0c16 --- /dev/null +++ b/service/controltower/api_op_ListLandingZones.go @@ -0,0 +1,234 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package controltower + +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/controltower/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the landing zone ARN for the landing zone deployed in your managed +// account. This API also creates an ARN for existing accounts that do not yet have +// a landing zone ARN. The return limit is one landing zone ARN. +func (c *Client) ListLandingZones(ctx context.Context, params *ListLandingZonesInput, optFns ...func(*Options)) (*ListLandingZonesOutput, error) { + if params == nil { + params = &ListLandingZonesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListLandingZones", params, optFns, c.addOperationListLandingZonesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListLandingZonesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListLandingZonesInput struct { + + // The maximum number of returned landing zone ARNs. + MaxResults *int32 + + // The token to continue the list from a previous API call with the same + // parameters. + NextToken *string + + noSmithyDocumentSerde +} + +type ListLandingZonesOutput struct { + + // The ARN of the landing zone. + // + // This member is required. + LandingZones []types.LandingZoneSummary + + // Retrieves the next page of results. If the string is empty, the current + // response is the end of the results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListLandingZonesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListLandingZones{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListLandingZones{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListLandingZones"); 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_opListLandingZones(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 +} + +// ListLandingZonesAPIClient is a client that implements the ListLandingZones +// operation. +type ListLandingZonesAPIClient interface { + ListLandingZones(context.Context, *ListLandingZonesInput, ...func(*Options)) (*ListLandingZonesOutput, error) +} + +var _ ListLandingZonesAPIClient = (*Client)(nil) + +// ListLandingZonesPaginatorOptions is the paginator options for ListLandingZones +type ListLandingZonesPaginatorOptions struct { + // The maximum number of returned landing zone ARNs. + 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 +} + +// ListLandingZonesPaginator is a paginator for ListLandingZones +type ListLandingZonesPaginator struct { + options ListLandingZonesPaginatorOptions + client ListLandingZonesAPIClient + params *ListLandingZonesInput + nextToken *string + firstPage bool +} + +// NewListLandingZonesPaginator returns a new ListLandingZonesPaginator +func NewListLandingZonesPaginator(client ListLandingZonesAPIClient, params *ListLandingZonesInput, optFns ...func(*ListLandingZonesPaginatorOptions)) *ListLandingZonesPaginator { + if params == nil { + params = &ListLandingZonesInput{} + } + + options := ListLandingZonesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListLandingZonesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLandingZonesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListLandingZones page. +func (p *ListLandingZonesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLandingZonesOutput, 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.ListLandingZones(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_opListLandingZones(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListLandingZones", + } +} diff --git a/service/controltower/api_op_ListTagsForResource.go b/service/controltower/api_op_ListTagsForResource.go index a0d1c237429..a7be279c50c 100644 --- a/service/controltower/api_op_ListTagsForResource.go +++ b/service/controltower/api_op_ListTagsForResource.go @@ -12,7 +12,7 @@ import ( ) // Returns a list of tags associated with the resource. For usage examples, see -// the AWS Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// the Amazon Web Services Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) // . func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { diff --git a/service/controltower/api_op_ResetLandingZone.go b/service/controltower/api_op_ResetLandingZone.go new file mode 100644 index 00000000000..271362d84f4 --- /dev/null +++ b/service/controltower/api_op_ResetLandingZone.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package controltower + +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" +) + +// This API call resets a landing zone. It starts an asynchronous operation that +// resets the landing zone to the parameters specified in its original +// configuration. +func (c *Client) ResetLandingZone(ctx context.Context, params *ResetLandingZoneInput, optFns ...func(*Options)) (*ResetLandingZoneOutput, error) { + if params == nil { + params = &ResetLandingZoneInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ResetLandingZone", params, optFns, c.addOperationResetLandingZoneMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ResetLandingZoneOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ResetLandingZoneInput struct { + + // The unique identifier of the landing zone. + // + // This member is required. + LandingZoneIdentifier *string + + noSmithyDocumentSerde +} + +type ResetLandingZoneOutput struct { + + // A unique identifier assigned to a ResetLandingZone operation. You can use this + // identifier as an input of GetLandingZoneOperation to check the operation's + // status. + // + // This member is required. + OperationIdentifier *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationResetLandingZoneMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpResetLandingZone{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpResetLandingZone{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ResetLandingZone"); 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 = addOpResetLandingZoneValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResetLandingZone(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_opResetLandingZone(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ResetLandingZone", + } +} diff --git a/service/controltower/api_op_TagResource.go b/service/controltower/api_op_TagResource.go index c667cb1d9df..80bb59b627f 100644 --- a/service/controltower/api_op_TagResource.go +++ b/service/controltower/api_op_TagResource.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Applies tags to a resource. For usage examples, see the AWS Control Tower User -// Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// Applies tags to a resource. For usage examples, see the Amazon Web Services +// Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) // . func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { diff --git a/service/controltower/api_op_UntagResource.go b/service/controltower/api_op_UntagResource.go index 73ab95951f3..ab805ef69c6 100644 --- a/service/controltower/api_op_UntagResource.go +++ b/service/controltower/api_op_UntagResource.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Removes tags from a resource. For usage examples, see the AWS Control Tower -// User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// Removes tags from a resource. For usage examples, see the Amazon Web Services +// Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) // . func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { diff --git a/service/controltower/api_op_UpdateLandingZone.go b/service/controltower/api_op_UpdateLandingZone.go new file mode 100644 index 00000000000..005691d51e2 --- /dev/null +++ b/service/controltower/api_op_UpdateLandingZone.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package controltower + +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/controltower/document" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// This API call updates the landing zone. It starts an asynchronous operation +// that updates the landing zone based on the new landing zone version or the +// updated parameters specified in the updated manifest file. +func (c *Client) UpdateLandingZone(ctx context.Context, params *UpdateLandingZoneInput, optFns ...func(*Options)) (*UpdateLandingZoneOutput, error) { + if params == nil { + params = &UpdateLandingZoneInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateLandingZone", params, optFns, c.addOperationUpdateLandingZoneMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateLandingZoneOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateLandingZoneInput struct { + + // The unique identifier of the landing zone. + // + // This member is required. + LandingZoneIdentifier *string + + // The manifest.yaml file is a text file that describes your Amazon Web Services + // resources. For examples, review The manifest file (https://docs.aws.amazon.com/controltower/latest/userguide/the-manifest-file) + // + // This member is required. + Manifest document.Interface + + // The landing zone version. + // + // This member is required. + Version *string + + noSmithyDocumentSerde +} + +type UpdateLandingZoneOutput struct { + + // A unique identifier assigned to a UpdateLandingZone operation. You can use this + // identifier as an input of GetLandingZoneOperation to check the operation's + // status. + // + // This member is required. + OperationIdentifier *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateLandingZoneMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateLandingZone{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateLandingZone{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateLandingZone"); 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 = addOpUpdateLandingZoneValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateLandingZone(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_opUpdateLandingZone(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateLandingZone", + } +} diff --git a/service/controltower/deserializers.go b/service/controltower/deserializers.go index 7f537bcdaf8..0d6572cd88c 100644 --- a/service/controltower/deserializers.go +++ b/service/controltower/deserializers.go @@ -8,6 +8,8 @@ import ( "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/controltower/document" + internaldocument "github.com/aws/aws-sdk-go-v2/service/controltower/internal/document" "github.com/aws/aws-sdk-go-v2/service/controltower/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" @@ -20,14 +22,14 @@ import ( "strings" ) -type awsRestjson1_deserializeOpDisableControl struct { +type awsRestjson1_deserializeOpCreateLandingZone struct { } -func (*awsRestjson1_deserializeOpDisableControl) ID() string { +func (*awsRestjson1_deserializeOpCreateLandingZone) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisableControl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateLandingZone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -41,9 +43,9 @@ func (m *awsRestjson1_deserializeOpDisableControl) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisableControl(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateLandingZone(response, &metadata) } - output := &DisableControlOutput{} + output := &CreateLandingZoneOutput{} out.Result = output var buff [1024]byte @@ -64,7 +66,7 @@ func (m *awsRestjson1_deserializeOpDisableControl) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDisableControlOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateLandingZoneOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -77,7 +79,7 @@ func (m *awsRestjson1_deserializeOpDisableControl) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorDisableControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateLandingZone(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -127,12 +129,6 @@ func awsRestjson1_deserializeOpErrorDisableControl(response *smithyhttp.Response case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -149,7 +145,7 @@ func awsRestjson1_deserializeOpErrorDisableControl(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentDisableControlOutput(v **DisableControlOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateLandingZoneOutput(v **CreateLandingZoneOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -162,15 +158,24 @@ func awsRestjson1_deserializeOpDocumentDisableControlOutput(v **DisableControlOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DisableControlOutput + var sv *CreateLandingZoneOutput if *v == nil { - sv = &DisableControlOutput{} + sv = &CreateLandingZoneOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + case "operationIdentifier": if value != nil { jtv, ok := value.(string) @@ -189,14 +194,14 @@ func awsRestjson1_deserializeOpDocumentDisableControlOutput(v **DisableControlOu return nil } -type awsRestjson1_deserializeOpEnableControl struct { +type awsRestjson1_deserializeOpDeleteLandingZone struct { } -func (*awsRestjson1_deserializeOpEnableControl) ID() string { +func (*awsRestjson1_deserializeOpDeleteLandingZone) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpEnableControl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteLandingZone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -210,9 +215,9 @@ func (m *awsRestjson1_deserializeOpEnableControl) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorEnableControl(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteLandingZone(response, &metadata) } - output := &EnableControlOutput{} + output := &DeleteLandingZoneOutput{} out.Result = output var buff [1024]byte @@ -233,7 +238,7 @@ func (m *awsRestjson1_deserializeOpEnableControl) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentEnableControlOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteLandingZoneOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -246,7 +251,7 @@ func (m *awsRestjson1_deserializeOpEnableControl) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorEnableControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteLandingZone(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -299,9 +304,6 @@ func awsRestjson1_deserializeOpErrorEnableControl(response *smithyhttp.Response, case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -318,7 +320,7 @@ func awsRestjson1_deserializeOpErrorEnableControl(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentEnableControlOutput(v **EnableControlOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteLandingZoneOutput(v **DeleteLandingZoneOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -331,24 +333,15 @@ func awsRestjson1_deserializeOpDocumentEnableControlOutput(v **EnableControlOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *EnableControlOutput + var sv *DeleteLandingZoneOutput if *v == nil { - sv = &EnableControlOutput{} + sv = &DeleteLandingZoneOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - case "operationIdentifier": if value != nil { jtv, ok := value.(string) @@ -367,14 +360,14 @@ func awsRestjson1_deserializeOpDocumentEnableControlOutput(v **EnableControlOutp return nil } -type awsRestjson1_deserializeOpGetControlOperation struct { +type awsRestjson1_deserializeOpDisableControl struct { } -func (*awsRestjson1_deserializeOpGetControlOperation) ID() string { +func (*awsRestjson1_deserializeOpDisableControl) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetControlOperation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDisableControl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -388,9 +381,9 @@ func (m *awsRestjson1_deserializeOpGetControlOperation) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetControlOperation(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDisableControl(response, &metadata) } - output := &GetControlOperationOutput{} + output := &DisableControlOutput{} out.Result = output var buff [1024]byte @@ -411,7 +404,7 @@ func (m *awsRestjson1_deserializeOpGetControlOperation) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetControlOperationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDisableControlOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -424,7 +417,7 @@ func (m *awsRestjson1_deserializeOpGetControlOperation) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetControlOperation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDisableControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -468,12 +461,18 @@ func awsRestjson1_deserializeOpErrorGetControlOperation(response *smithyhttp.Res case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -490,7 +489,7 @@ func awsRestjson1_deserializeOpErrorGetControlOperation(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentGetControlOperationOutput(v **GetControlOperationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDisableControlOutput(v **DisableControlOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -503,18 +502,22 @@ func awsRestjson1_deserializeOpDocumentGetControlOperationOutput(v **GetControlO return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetControlOperationOutput + var sv *DisableControlOutput if *v == nil { - sv = &GetControlOperationOutput{} + sv = &DisableControlOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "controlOperation": - if err := awsRestjson1_deserializeDocumentControlOperation(&sv.ControlOperation, value); err != nil { - return err + case "operationIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperationIdentifier to be of type string, got %T instead", value) + } + sv.OperationIdentifier = ptr.String(jtv) } default: @@ -526,14 +529,14 @@ func awsRestjson1_deserializeOpDocumentGetControlOperationOutput(v **GetControlO return nil } -type awsRestjson1_deserializeOpGetEnabledControl struct { +type awsRestjson1_deserializeOpEnableControl struct { } -func (*awsRestjson1_deserializeOpGetEnabledControl) ID() string { +func (*awsRestjson1_deserializeOpEnableControl) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetEnabledControl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpEnableControl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -547,9 +550,9 @@ func (m *awsRestjson1_deserializeOpGetEnabledControl) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetEnabledControl(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorEnableControl(response, &metadata) } - output := &GetEnabledControlOutput{} + output := &EnableControlOutput{} out.Result = output var buff [1024]byte @@ -570,7 +573,7 @@ func (m *awsRestjson1_deserializeOpGetEnabledControl) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetEnabledControlOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentEnableControlOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -583,7 +586,7 @@ func (m *awsRestjson1_deserializeOpGetEnabledControl) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetEnabledControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorEnableControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -627,12 +630,18 @@ func awsRestjson1_deserializeOpErrorGetEnabledControl(response *smithyhttp.Respo case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -649,7 +658,7 @@ func awsRestjson1_deserializeOpErrorGetEnabledControl(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentGetEnabledControlOutput(v **GetEnabledControlOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentEnableControlOutput(v **EnableControlOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -662,18 +671,31 @@ func awsRestjson1_deserializeOpDocumentGetEnabledControlOutput(v **GetEnabledCon return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetEnabledControlOutput + var sv *EnableControlOutput if *v == nil { - sv = &GetEnabledControlOutput{} + sv = &EnableControlOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "enabledControlDetails": - if err := awsRestjson1_deserializeDocumentEnabledControlDetails(&sv.EnabledControlDetails, value); err != nil { - return err + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "operationIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperationIdentifier to be of type string, got %T instead", value) + } + sv.OperationIdentifier = ptr.String(jtv) } default: @@ -685,14 +707,14 @@ func awsRestjson1_deserializeOpDocumentGetEnabledControlOutput(v **GetEnabledCon return nil } -type awsRestjson1_deserializeOpListEnabledControls struct { +type awsRestjson1_deserializeOpGetControlOperation struct { } -func (*awsRestjson1_deserializeOpListEnabledControls) ID() string { +func (*awsRestjson1_deserializeOpGetControlOperation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListEnabledControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetControlOperation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -706,9 +728,9 @@ func (m *awsRestjson1_deserializeOpListEnabledControls) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListEnabledControls(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetControlOperation(response, &metadata) } - output := &ListEnabledControlsOutput{} + output := &GetControlOperationOutput{} out.Result = output var buff [1024]byte @@ -729,7 +751,7 @@ func (m *awsRestjson1_deserializeOpListEnabledControls) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListEnabledControlsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetControlOperationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -742,7 +764,7 @@ func (m *awsRestjson1_deserializeOpListEnabledControls) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListEnabledControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetControlOperation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -808,7 +830,7 @@ func awsRestjson1_deserializeOpErrorListEnabledControls(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListEnabledControlsOutput(v **ListEnabledControlsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetControlOperationOutput(v **GetControlOperationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -821,29 +843,20 @@ func awsRestjson1_deserializeOpDocumentListEnabledControlsOutput(v **ListEnabled return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListEnabledControlsOutput + var sv *GetControlOperationOutput if *v == nil { - sv = &ListEnabledControlsOutput{} + sv = &GetControlOperationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "enabledControls": - if err := awsRestjson1_deserializeDocumentEnabledControls(&sv.EnabledControls, value); err != nil { + case "controlOperation": + if err := awsRestjson1_deserializeDocumentControlOperation(&sv.ControlOperation, 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 @@ -853,14 +866,14 @@ func awsRestjson1_deserializeOpDocumentListEnabledControlsOutput(v **ListEnabled return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpGetEnabledControl struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpGetEnabledControl) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetEnabledControl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -874,9 +887,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_deserializeOpErrorGetEnabledControl(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &GetEnabledControlOutput{} out.Result = output var buff [1024]byte @@ -897,7 +910,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetEnabledControlOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -910,7 +923,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetEnabledControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -951,12 +964,18 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } 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) @@ -970,7 +989,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetEnabledControlOutput(v **GetEnabledControlOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -983,17 +1002,17 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *GetEnabledControlOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &GetEnabledControlOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "enabledControlDetails": + if err := awsRestjson1_deserializeDocumentEnabledControlDetails(&sv.EnabledControlDetails, value); err != nil { return err } @@ -1006,14 +1025,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpGetLandingZone struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpGetLandingZone) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetLandingZone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1027,15 +1046,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_deserializeOpErrorGetLandingZone(response, &metadata) } - output := &TagResourceOutput{} + output := &GetLandingZoneOutput{} 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_deserializeOpDocumentGetLandingZoneOutput(&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_deserializeOpErrorGetLandingZone(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1076,12 +1123,18 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } 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) @@ -1095,30 +1148,966 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -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 +func awsRestjson1_deserializeOpDocumentGetLandingZoneOutput(v **GetLandingZoneOutput, 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_deserializeOpErrorUntagResource(response, &metadata) - } - output := &UntagResourceOutput{} + var sv *GetLandingZoneOutput + if *v == nil { + sv = &GetLandingZoneOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "landingZone": + if err := awsRestjson1_deserializeDocumentLandingZoneDetail(&sv.LandingZone, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetLandingZoneOperation struct { +} + +func (*awsRestjson1_deserializeOpGetLandingZoneOperation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetLandingZoneOperation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetLandingZoneOperation(response, &metadata) + } + output := &GetLandingZoneOperationOutput{} + 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_deserializeOpDocumentGetLandingZoneOperationOutput(&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_deserializeOpErrorGetLandingZoneOperation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentGetLandingZoneOperationOutput(v **GetLandingZoneOperationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetLandingZoneOperationOutput + if *v == nil { + sv = &GetLandingZoneOperationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "operationDetails": + if err := awsRestjson1_deserializeDocumentLandingZoneOperationDetail(&sv.OperationDetails, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListEnabledControls struct { +} + +func (*awsRestjson1_deserializeOpListEnabledControls) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListEnabledControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListEnabledControls(response, &metadata) + } + output := &ListEnabledControlsOutput{} + 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_deserializeOpDocumentListEnabledControlsOutput(&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_deserializeOpErrorListEnabledControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentListEnabledControlsOutput(v **ListEnabledControlsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListEnabledControlsOutput + if *v == nil { + sv = &ListEnabledControlsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "enabledControls": + if err := awsRestjson1_deserializeDocumentEnabledControls(&sv.EnabledControls, 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_deserializeOpListLandingZones struct { +} + +func (*awsRestjson1_deserializeOpListLandingZones) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListLandingZones) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListLandingZones(response, &metadata) + } + output := &ListLandingZonesOutput{} + 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_deserializeOpDocumentListLandingZonesOutput(&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_deserializeOpErrorListLandingZones(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentListLandingZonesOutput(v **ListLandingZonesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListLandingZonesOutput + if *v == nil { + sv = &ListLandingZonesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "landingZones": + if err := awsRestjson1_deserializeDocumentLandingZoneSummaries(&sv.LandingZones, 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("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_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_deserializeOpResetLandingZone struct { +} + +func (*awsRestjson1_deserializeOpResetLandingZone) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpResetLandingZone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorResetLandingZone(response, &metadata) + } + output := &ResetLandingZoneOutput{} + 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_deserializeOpDocumentResetLandingZoneOutput(&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_deserializeOpErrorResetLandingZone(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentResetLandingZoneOutput(v **ResetLandingZoneOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ResetLandingZoneOutput + if *v == nil { + sv = &ResetLandingZoneOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "operationIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperationIdentifier to be of type string, got %T instead", value) + } + sv.OperationIdentifier = ptr.String(jtv) + } + + 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("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_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 @@ -1174,14 +2163,180 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateLandingZone struct { +} + +func (*awsRestjson1_deserializeOpUpdateLandingZone) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateLandingZone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateLandingZone(response, &metadata) + } + output := &UpdateLandingZoneOutput{} + 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_deserializeOpDocumentUpdateLandingZoneOutput(&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_deserializeOpErrorUpdateLandingZone(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentUpdateLandingZoneOutput(v **UpdateLandingZoneOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateLandingZoneOutput + if *v == nil { + sv = &UpdateLandingZoneOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "operationIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperationIdentifier to be of type string, got %T instead", value) + } + sv.OperationIdentifier = ptr.String(jtv) + } + + default: + _, _ = key, value + } - return genericError - } + *v = sv + return nil } func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { @@ -1924,6 +3079,289 @@ func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalS return nil } +func awsRestjson1_deserializeDocumentLandingZoneDetail(v **types.LandingZoneDetail, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LandingZoneDetail + if *v == nil { + sv = &types.LandingZoneDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "driftStatus": + if err := awsRestjson1_deserializeDocumentLandingZoneDriftStatusSummary(&sv.DriftStatus, value); err != nil { + return err + } + + case "latestAvailableVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LandingZoneVersion to be of type string, got %T instead", value) + } + sv.LatestAvailableVersion = ptr.String(jtv) + } + + case "manifest": + if err := awsRestjson1_deserializeDocumentManifest(&sv.Manifest, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LandingZoneStatus to be of type string, got %T instead", value) + } + sv.Status = types.LandingZoneStatus(jtv) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LandingZoneVersion to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLandingZoneDriftStatusSummary(v **types.LandingZoneDriftStatusSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LandingZoneDriftStatusSummary + if *v == nil { + sv = &types.LandingZoneDriftStatusSummary{} + } 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 LandingZoneDriftStatus to be of type string, got %T instead", value) + } + sv.Status = types.LandingZoneDriftStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLandingZoneOperationDetail(v **types.LandingZoneOperationDetail, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LandingZoneOperationDetail + if *v == nil { + sv = &types.LandingZoneOperationDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.EndTime = ptr.Time(t) + } + + case "operationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LandingZoneOperationType to be of type string, got %T instead", value) + } + sv.OperationType = types.LandingZoneOperationType(jtv) + } + + case "startTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.StartTime = ptr.Time(t) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LandingZoneOperationStatus to be of type string, got %T instead", value) + } + sv.Status = types.LandingZoneOperationStatus(jtv) + } + + case "statusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.StatusMessage = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLandingZoneSummaries(v *[]types.LandingZoneSummary, 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.LandingZoneSummary + if *v == nil { + cv = []types.LandingZoneSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LandingZoneSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentLandingZoneSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentLandingZoneSummary(v **types.LandingZoneSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LandingZoneSummary + if *v == nil { + sv = &types.LandingZoneSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentManifest(v *document.Interface, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + *v = internaldocument.NewDocumentUnmarshaler(value) + return nil +} + func awsRestjson1_deserializeDocumentRegion(v **types.Region, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/controltower/doc.go b/service/controltower/doc.go index 64235881be3..bc6ec486032 100644 --- a/service/controltower/doc.go +++ b/service/controltower/doc.go @@ -3,10 +3,10 @@ // Package controltower provides the API client, operations, and parameter types // for AWS Control Tower. // -// These interfaces allow you to apply the AWS library of pre-defined controls to -// your organizational units, programmatically. In AWS Control Tower, the terms -// "control" and "guardrail" are synonyms. To call these APIs, you'll need to know: -// +// These interfaces allow you to apply the Amazon Web Services library of +// pre-defined controls to your organizational units, programmatically. In Amazon +// Web Services Control Tower, the terms "control" and "guardrail" are synonyms. To +// call these APIs, you'll need to know: // - the controlIdentifier for the control--or guardrail--you are targeting. // - the ARN associated with the target organizational unit (OU), which we call // the targetIdentifier . @@ -15,20 +15,21 @@ // To get the controlIdentifier for your AWS Control Tower control: The // controlIdentifier is an ARN that is specified for each control. You can view the // controlIdentifier in the console on the Control details page, as well as in the -// documentation. The controlIdentifier is unique in each AWS Region for each -// control. You can find the controlIdentifier for each Region and control in the -// Tables of control metadata (https://docs.aws.amazon.com/controltower/latest/userguide/control-metadata-tables.html) -// in the AWS Control Tower User Guide. A quick-reference list of control -// identifers for the AWS Control Tower legacy Strongly recommended and Elective -// controls is given in Resource identifiers for APIs and controls (https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html.html) +// documentation. The controlIdentifier is unique in each Amazon Web Services +// Region for each control. You can find the controlIdentifier for each Region and +// control in the Tables of control metadata (https://docs.aws.amazon.com/controltower/latest/userguide/control-metadata-tables.html) +// in the Amazon Web Services Control Tower User Guide. A quick-reference list of +// control identifers for the Amazon Web Services Control Tower legacy Strongly +// recommended and Elective controls is given in Resource identifiers for APIs and +// controls (https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html.html) // in the Controls reference guide section (https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html) -// of the AWS Control Tower User Guide. Remember that Mandatory controls cannot be -// added or removed. ARN format: +// of the Amazon Web Services Control Tower User Guide. Remember that Mandatory +// controls cannot be added or removed. ARN format: // arn:aws:controltower:{REGION}::control/{CONTROL_NAME} Example: // arn:aws:controltower:us-west-2::control/AWS-GR_AUTOSCALING_LAUNCH_CONFIG_PUBLIC_IP_DISABLED // To get the targetIdentifier : The targetIdentifier is the ARN for an OU. In the -// AWS Organizations console, you can find the ARN for the OU on the Organizational -// unit details page associated with that OU. OU ARN format: +// Amazon Web Services Organizations console, you can find the ARN for the OU on +// the Organizational unit details page associated with that OU. OU ARN format: // arn:${Partition}:organizations::${MasterAccountId}:ou/o-${OrganizationId}/ou-${OrganizationalUnitId} // Details and examples // - Control API input and output examples with CLI (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) @@ -37,16 +38,20 @@ // - List of identifiers for legacy controls (https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html) // - Controls reference guide (https://docs.aws.amazon.com/controltower/latest/userguide/controls.html) // - Controls library groupings (https://docs.aws.amazon.com/controltower/latest/userguide/controls-reference.html) -// - Creating AWS Control Tower resources with AWS CloudFormation (https://docs.aws.amazon.com/controltower/latest/userguide/creating-resources-with-cloudformation.html) +// - Creating Amazon Web Services Control Tower resources with Amazon Web +// Services CloudFormation (https://docs.aws.amazon.com/controltower/latest/userguide/creating-resources-with-cloudformation.html) // // To view the open source resource repository on GitHub, see // aws-cloudformation/aws-cloudformation-resource-providers-controltower (https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-controltower) -// Recording API Requests AWS Control Tower supports AWS CloudTrail, a service that -// records AWS API calls for your AWS account and delivers log files to an Amazon -// S3 bucket. By using information collected by CloudTrail, you can determine which -// requests the AWS Control Tower service received, who made the request and when, -// and so on. For more about AWS Control Tower and its support for CloudTrail, see -// Logging AWS Control Tower Actions with AWS CloudTrail (https://docs.aws.amazon.com/controltower/latest/userguide/logging-using-cloudtrail.html) -// in the AWS Control Tower User Guide. To learn more about CloudTrail, including -// how to turn it on and find your log files, see the AWS CloudTrail User Guide. +// Recording API Requests Amazon Web Services Control Tower supports Amazon Web +// Services CloudTrail, a service that records Amazon Web Services API calls for +// your Amazon Web Services account and delivers log files to an Amazon S3 bucket. +// By using information collected by CloudTrail, you can determine which requests +// the Amazon Web Services Control Tower service received, who made the request and +// when, and so on. For more about Amazon Web Services Control Tower and its +// support for CloudTrail, see Logging Amazon Web Services Control Tower Actions +// with Amazon Web Services CloudTrail (https://docs.aws.amazon.com/controltower/latest/userguide/logging-using-cloudtrail.html) +// in the Amazon Web Services Control Tower User Guide. To learn more about +// CloudTrail, including how to turn it on and find your log files, see the Amazon +// Web Services CloudTrail User Guide. package controltower diff --git a/service/controltower/document/doc.go b/service/controltower/document/doc.go new file mode 100644 index 00000000000..2b06b14f3cd --- /dev/null +++ b/service/controltower/document/doc.go @@ -0,0 +1,66 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package document implements encoding and decoding of open-content that has a JSON-like data model. +// This data-model allows for UTF-8 strings, arbitrary precision numbers, booleans, nulls, a list of these values, and a +// map of UTF-8 strings to these values. +// +// Interface defines the semantics for how a document type is marshalled and unmarshalled for requests and responses +// for the service. To send a document as input to the service you use NewLazyDocument and pass it the Go type to be +// sent to the service. NewLazyDocument returns a document Interface type that encodes the provided Go type during +// the request serialization step after you have invoked an API client operation that uses the document type. +// +// The following examples show how you can create document types using basic Go types. +// +// NewLazyDocument(map[string]interface{}{ +// "favoriteNumber": 42, +// "fruits": []string{"apple", "orange"}, +// "capitals": map[string]interface{}{ +// "Washington": "Olympia", +// "Oregon": "Salem", +// }, +// "skyIsBlue": true, +// }) +// +// NewLazyDocument(3.14159) +// +// NewLazyDocument([]interface{"One", 2, 3, 3.5, "four"}) +// +// NewLazyDocument(true) +// +// Services can send document types as part of their API responses. To retrieve the content of a response document +// you use the UnmarshalSmithyDocument method on the response document. When calling UnmarshalSmithyDocument you pass +// a reference to the Go type that you want to unmarshal and map the response to. +// +// For example, if you expect to receive key/value map from the service response: +// +// var kv map[string]interface{} +// if err := outputDocument.UnmarshalSmithyDocument(&kv); err != nil { +// // handle error +// } +// +// If a service can return one or more data-types in the response, you can use an empty interface and type switch to +// dynamically handle the response type. +// +// var v interface{} +// if err := outputDocument.UnmarshalSmithyDocument(&v); err != nil { +// // handle error +// } +// +// switch vv := v.(type) { +// case map[string]interface{}: +// // handle key/value map +// case []interface{}: +// // handle array of values +// case bool: +// // handle boolean +// case document.Number: +// // handle an arbitrary precision number +// case string: +// // handle string +// default: +// // handle unknown case +// } +// +// The mapping of Go types to document types is covered in more depth in https://pkg.go.dev/github.com/aws/smithy-go/document +// including more in depth examples that cover user-defined structure types. +package document diff --git a/service/controltower/document/document.go b/service/controltower/document/document.go new file mode 100644 index 00000000000..b9ed0a723cd --- /dev/null +++ b/service/controltower/document/document.go @@ -0,0 +1,34 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package document + +import ( + internaldocument "github.com/aws/aws-sdk-go-v2/service/controltower/internal/document" +) + +// Interface defines a document which is a protocol-agnostic type which supports a +// JSON-like data-model. You can use this type to send UTF-8 strings, arbitrary +// precision numbers, booleans, nulls, a list of these values, and a map of UTF-8 +// strings to these values. +// +// You create a document type using the NewLazyDocument function and passing it +// the Go type to marshal. When receiving a document in an API response, you use +// the document's UnmarshalSmithyDocument function to decode the response to your +// desired Go type. Unless documented specifically generated structure types in +// client packages or client types packages are not supported at this time. Such +// types embed a noSmithyDocumentSerde and will cause an error to be returned when +// attempting to send an API request. +// +// For more information see the accompanying package documentation and linked +// references. +type Interface = internaldocument.Interface + +// You create document type using the NewLazyDocument function and passing it the +// Go type to be marshaled and sent to the service. The document marshaler supports +// semantics similar to the encoding/json Go standard library. +// +// For more information see the accompanying package documentation and linked +// references. +func NewLazyDocument(v interface{}) Interface { + return internaldocument.NewDocumentMarshaler(v) +} diff --git a/service/controltower/endpoints_test.go b/service/controltower/endpoints_test.go index 6bd48fdb5ac..1703808decf 100644 --- a/service/controltower/endpoints_test.go +++ b/service/controltower/endpoints_test.go @@ -1517,23 +1517,3 @@ func TestEndpointCase41(t *testing.T) { t.Errorf("expect %v error in %v", e, a) } } - -// Partition doesn't support DualStack -func TestEndpointCase42(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/controltower/generated.json b/service/controltower/generated.json index caf6f1a0797..bb095028663 100644 --- a/service/controltower/generated.json +++ b/service/controltower/generated.json @@ -9,21 +9,32 @@ "files": [ "api_client.go", "api_client_test.go", + "api_op_CreateLandingZone.go", + "api_op_DeleteLandingZone.go", "api_op_DisableControl.go", "api_op_EnableControl.go", "api_op_GetControlOperation.go", "api_op_GetEnabledControl.go", + "api_op_GetLandingZone.go", + "api_op_GetLandingZoneOperation.go", "api_op_ListEnabledControls.go", + "api_op_ListLandingZones.go", "api_op_ListTagsForResource.go", + "api_op_ResetLandingZone.go", "api_op_TagResource.go", "api_op_UntagResource.go", + "api_op_UpdateLandingZone.go", "auth.go", "deserializers.go", "doc.go", + "document/doc.go", + "document/document.go", "endpoints.go", "endpoints_config_test.go", "endpoints_test.go", "generated.json", + "internal/document/document.go", + "internal/document/document_test.go", "internal/endpoints/endpoints.go", "internal/endpoints/endpoints_test.go", "options.go", diff --git a/service/controltower/internal/document/document.go b/service/controltower/internal/document/document.go new file mode 100644 index 00000000000..59bc5a524a5 --- /dev/null +++ b/service/controltower/internal/document/document.go @@ -0,0 +1,99 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package document + +import ( + "bytes" + "encoding/json" + smithydocument "github.com/aws/smithy-go/document" + smithydocumentjson "github.com/aws/smithy-go/document/json" +) + +// github.com/aws/aws-sdk-go-v2/service/controltower/internal/document.smithyDocument +// is an interface which is used to bind a document type to its service client. +type smithyDocument interface { + isSmithyDocument() +} + +// github.com/aws/aws-sdk-go-v2/service/controltower/internal/document.Interface +// is a JSON-like data model type that is protocol agnostic and is usedto send +// open-content to a service. +type Interface interface { + smithyDocument + smithydocument.Marshaler + smithydocument.Unmarshaler +} + +type documentMarshaler struct { + value interface{} +} + +func (m *documentMarshaler) UnmarshalSmithyDocument(v interface{}) error { + mBytes, err := m.MarshalSmithyDocument() + if err != nil { + return err + } + + jDecoder := json.NewDecoder(bytes.NewReader(mBytes)) + jDecoder.UseNumber() + + var jv interface{} + if err := jDecoder.Decode(&v); err != nil { + return err + } + + return NewDocumentUnmarshaler(v).UnmarshalSmithyDocument(&jv) +} + +func (m *documentMarshaler) MarshalSmithyDocument() ([]byte, error) { + return smithydocumentjson.NewEncoder().Encode(m.value) +} + +func (m *documentMarshaler) isSmithyDocument() {} + +var _ Interface = (*documentMarshaler)(nil) + +type documentUnmarshaler struct { + value interface{} +} + +func (m *documentUnmarshaler) UnmarshalSmithyDocument(v interface{}) error { + decoder := smithydocumentjson.NewDecoder() + return decoder.DecodeJSONInterface(m.value, v) +} + +func (m *documentUnmarshaler) MarshalSmithyDocument() ([]byte, error) { + return json.Marshal(m.value) +} + +func (m *documentUnmarshaler) isSmithyDocument() {} + +var _ Interface = (*documentUnmarshaler)(nil) + +// NewDocumentMarshaler creates a new document marshaler for the given input type +func NewDocumentMarshaler(v interface{}) Interface { + return &documentMarshaler{ + value: v, + } +} + +// NewDocumentUnmarshaler creates a new document unmarshaler for the given service +// response +func NewDocumentUnmarshaler(v interface{}) Interface { + return &documentUnmarshaler{ + value: v, + } +} + +// github.com/aws/aws-sdk-go-v2/service/controltower/internal/document.IsInterface +// returns whether the given Interface implementation is a valid client +// implementation +func IsInterface(v Interface) (ok bool) { + defer func() { + if err := recover(); err != nil { + ok = false + } + }() + v.isSmithyDocument() + return true +} diff --git a/service/controltower/internal/document/document_test.go b/service/controltower/internal/document/document_test.go new file mode 100644 index 00000000000..775645dcd6e --- /dev/null +++ b/service/controltower/internal/document/document_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package document + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +var _ smithyDocument = (Interface)(nil) +var _ smithydocument.Marshaler = (Interface)(nil) +var _ smithydocument.Unmarshaler = (Interface)(nil) diff --git a/service/controltower/serializers.go b/service/controltower/serializers.go index 35ebb575240..0d514a4e455 100644 --- a/service/controltower/serializers.go +++ b/service/controltower/serializers.go @@ -6,6 +6,8 @@ import ( "bytes" "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/controltower/document" + internaldocument "github.com/aws/aws-sdk-go-v2/service/controltower/internal/document" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" @@ -13,6 +15,170 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +type awsRestjson1_serializeOpCreateLandingZone struct { +} + +func (*awsRestjson1_serializeOpCreateLandingZone) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateLandingZone) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateLandingZoneInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/create-landingzone") + 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_serializeOpDocumentCreateLandingZoneInput(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_serializeOpHttpBindingsCreateLandingZoneInput(v *CreateLandingZoneInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateLandingZoneInput(v *CreateLandingZoneInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Manifest != nil { + ok := object.Key("manifest") + if err := awsRestjson1_serializeDocumentManifest(v.Manifest, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + if v.Version != nil { + ok := object.Key("version") + ok.String(*v.Version) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteLandingZone struct { +} + +func (*awsRestjson1_serializeOpDeleteLandingZone) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteLandingZone) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteLandingZoneInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/delete-landingzone") + 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_serializeOpDocumentDeleteLandingZoneInput(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_serializeOpHttpBindingsDeleteLandingZoneInput(v *DeleteLandingZoneInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteLandingZoneInput(v *DeleteLandingZoneInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LandingZoneIdentifier != nil { + ok := object.Key("landingZoneIdentifier") + ok.String(*v.LandingZoneIdentifier) + } + + return nil +} + type awsRestjson1_serializeOpDisableControl struct { } @@ -330,6 +496,156 @@ func awsRestjson1_serializeOpDocumentGetEnabledControlInput(v *GetEnabledControl return nil } +type awsRestjson1_serializeOpGetLandingZone struct { +} + +func (*awsRestjson1_serializeOpGetLandingZone) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetLandingZone) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetLandingZoneInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/get-landingzone") + 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_serializeOpDocumentGetLandingZoneInput(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_serializeOpHttpBindingsGetLandingZoneInput(v *GetLandingZoneInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetLandingZoneInput(v *GetLandingZoneInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LandingZoneIdentifier != nil { + ok := object.Key("landingZoneIdentifier") + ok.String(*v.LandingZoneIdentifier) + } + + return nil +} + +type awsRestjson1_serializeOpGetLandingZoneOperation struct { +} + +func (*awsRestjson1_serializeOpGetLandingZoneOperation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetLandingZoneOperation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetLandingZoneOperationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/get-landingzone-operation") + 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_serializeOpDocumentGetLandingZoneOperationInput(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_serializeOpHttpBindingsGetLandingZoneOperationInput(v *GetLandingZoneOperationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetLandingZoneOperationInput(v *GetLandingZoneOperationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OperationIdentifier != nil { + ok := object.Key("operationIdentifier") + ok.String(*v.OperationIdentifier) + } + + return nil +} + type awsRestjson1_serializeOpListEnabledControls struct { } @@ -415,6 +731,86 @@ func awsRestjson1_serializeOpDocumentListEnabledControlsInput(v *ListEnabledCont return nil } +type awsRestjson1_serializeOpListLandingZones struct { +} + +func (*awsRestjson1_serializeOpListLandingZones) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListLandingZones) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListLandingZonesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/list-landingzones") + 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_serializeOpDocumentListLandingZonesInput(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_serializeOpHttpBindingsListLandingZonesInput(v *ListLandingZonesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListLandingZonesInput(v *ListLandingZonesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListTagsForResource struct { } @@ -480,6 +876,81 @@ func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsFor return nil } +type awsRestjson1_serializeOpResetLandingZone struct { +} + +func (*awsRestjson1_serializeOpResetLandingZone) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpResetLandingZone) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ResetLandingZoneInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/reset-landingzone") + 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_serializeOpDocumentResetLandingZoneInput(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_serializeOpHttpBindingsResetLandingZoneInput(v *ResetLandingZoneInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentResetLandingZoneInput(v *ResetLandingZoneInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LandingZoneIdentifier != nil { + ok := object.Key("landingZoneIdentifier") + ok.String(*v.LandingZoneIdentifier) + } + + return nil +} + type awsRestjson1_serializeOpTagResource struct { } @@ -641,6 +1112,108 @@ func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInpu return nil } +type awsRestjson1_serializeOpUpdateLandingZone struct { +} + +func (*awsRestjson1_serializeOpUpdateLandingZone) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateLandingZone) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateLandingZoneInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/update-landingzone") + 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_serializeOpDocumentUpdateLandingZoneInput(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_serializeOpHttpBindingsUpdateLandingZoneInput(v *UpdateLandingZoneInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateLandingZoneInput(v *UpdateLandingZoneInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LandingZoneIdentifier != nil { + ok := object.Key("landingZoneIdentifier") + ok.String(*v.LandingZoneIdentifier) + } + + if v.Manifest != nil { + ok := object.Key("manifest") + if err := awsRestjson1_serializeDocumentManifest(v.Manifest, ok); err != nil { + return err + } + } + + if v.Version != nil { + ok := object.Key("version") + ok.String(*v.Version) + } + + return nil +} + +func awsRestjson1_serializeDocumentManifest(v document.Interface, value smithyjson.Value) error { + if v == nil { + return nil + } + if !internaldocument.IsInterface(v) { + return fmt.Errorf("%T is not a compatible document type", v) + } + db, err := v.MarshalSmithyDocument() + if err != nil { + return err + } + value.Write(db) + return nil +} + func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/controltower/types/enums.go b/service/controltower/types/enums.go index aba92d20f71..d71ac527d03 100644 --- a/service/controltower/types/enums.go +++ b/service/controltower/types/enums.go @@ -81,3 +81,83 @@ func (EnablementStatus) Values() []EnablementStatus { "UNDER_CHANGE", } } + +type LandingZoneDriftStatus string + +// Enum values for LandingZoneDriftStatus +const ( + LandingZoneDriftStatusDrifted LandingZoneDriftStatus = "DRIFTED" + LandingZoneDriftStatusInSync LandingZoneDriftStatus = "IN_SYNC" +) + +// Values returns all known values for LandingZoneDriftStatus. 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 (LandingZoneDriftStatus) Values() []LandingZoneDriftStatus { + return []LandingZoneDriftStatus{ + "DRIFTED", + "IN_SYNC", + } +} + +type LandingZoneOperationStatus string + +// Enum values for LandingZoneOperationStatus +const ( + LandingZoneOperationStatusSucceeded LandingZoneOperationStatus = "SUCCEEDED" + LandingZoneOperationStatusFailed LandingZoneOperationStatus = "FAILED" + LandingZoneOperationStatusInProgress LandingZoneOperationStatus = "IN_PROGRESS" +) + +// Values returns all known values for LandingZoneOperationStatus. 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 (LandingZoneOperationStatus) Values() []LandingZoneOperationStatus { + return []LandingZoneOperationStatus{ + "SUCCEEDED", + "FAILED", + "IN_PROGRESS", + } +} + +type LandingZoneOperationType string + +// Enum values for LandingZoneOperationType +const ( + LandingZoneOperationTypeDelete LandingZoneOperationType = "DELETE" + LandingZoneOperationTypeCreate LandingZoneOperationType = "CREATE" + LandingZoneOperationTypeUpdate LandingZoneOperationType = "UPDATE" + LandingZoneOperationTypeReset LandingZoneOperationType = "RESET" +) + +// Values returns all known values for LandingZoneOperationType. 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 (LandingZoneOperationType) Values() []LandingZoneOperationType { + return []LandingZoneOperationType{ + "DELETE", + "CREATE", + "UPDATE", + "RESET", + } +} + +type LandingZoneStatus string + +// Enum values for LandingZoneStatus +const ( + LandingZoneStatusActive LandingZoneStatus = "ACTIVE" + LandingZoneStatusProcessing LandingZoneStatus = "PROCESSING" + LandingZoneStatusFailed LandingZoneStatus = "FAILED" +) + +// Values returns all known values for LandingZoneStatus. 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 (LandingZoneStatus) Values() []LandingZoneStatus { + return []LandingZoneStatus{ + "ACTIVE", + "PROCESSING", + "FAILED", + } +} diff --git a/service/controltower/types/errors.go b/service/controltower/types/errors.go index 4002980011b..cf82f5d5cea 100644 --- a/service/controltower/types/errors.go +++ b/service/controltower/types/errors.go @@ -7,7 +7,7 @@ import ( smithy "github.com/aws/smithy-go" ) -// User does not have sufficient access to perform this action. +// You do not have sufficient access to perform this action. type AccessDeniedException struct { Message *string @@ -168,7 +168,8 @@ func (e *ThrottlingException) ErrorCode() string { } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The input fails to satisfy the constraints specified by an AWS service. +// The input fails to satisfy the constraints specified by an Amazon Web Services +// service. type ValidationException struct { Message *string diff --git a/service/controltower/types/types.go b/service/controltower/types/types.go index 3bab8298443..23d7ff958ec 100644 --- a/service/controltower/types/types.go +++ b/service/controltower/types/types.go @@ -3,6 +3,7 @@ package types import ( + "github.com/aws/aws-sdk-go-v2/service/controltower/document" smithydocument "github.com/aws/smithy-go/document" "time" ) @@ -29,21 +30,22 @@ type ControlOperation struct { noSmithyDocumentSerde } -// The drift summary of the enabled control. AWS Control Tower expects the enabled -// control configuration to include all supported and governed Regions. If the -// enabled control differs from the expected configuration, it is defined to be in -// a state of drift. You can repair this drift by resetting the enabled control. +// The drift summary of the enabled control. Amazon Web Services Control Tower +// expects the enabled control configuration to include all supported and governed +// Regions. If the enabled control differs from the expected configuration, it is +// defined to be in a state of drift. You can repair this drift by resetting the +// enabled control. type DriftStatusSummary struct { // The drift status of the enabled control. Valid values: // - DRIFTED : The enabledControl deployed in this configuration doesn’t match - // the configuration that AWS Control Tower expected. + // the configuration that Amazon Web Services Control Tower expected. // - IN_SYNC : The enabledControl deployed in this configuration matches the - // configuration that AWS Control Tower expected. - // - NOT_CHECKING : AWS Control Tower does not check drift for this enabled - // control. Drift is not supported for the control type. - // - UNKNOWN : AWS Control Tower is not able to check the drift status for the - // enabled control. + // configuration that Amazon Web Services Control Tower expected. + // - NOT_CHECKING : Amazon Web Services Control Tower does not check drift for + // this enabled control. Drift is not supported for the control type. + // - UNKNOWN : Amazon Web Services Control Tower is not able to check the drift + // status for the enabled control. DriftStatus DriftStatus noSmithyDocumentSerde @@ -71,7 +73,7 @@ type EnabledControlDetails struct { // . TargetIdentifier *string - // Target AWS Regions for the enabled control. + // Target Amazon Web Services Regions for the enabled control. TargetRegions []Region noSmithyDocumentSerde @@ -113,14 +115,100 @@ type EnablementStatusSummary struct { noSmithyDocumentSerde } -// An AWS Region in which AWS Control Tower expects to find the control deployed. -// The expected Regions are based on the Regions that are governed by the landing -// zone. In certain cases, a control is not actually enabled in the Region as -// expected, such as during drift, or mixed governance (https://docs.aws.amazon.com/controltower/latest/userguide/region-how.html#mixed-governance) +// Information about the landing zone. +type LandingZoneDetail struct { + + // The landing zone manifest.yaml text file that specifies the landing zone + // configurations. + // + // This member is required. + Manifest document.Interface + + // The landing zone's current deployed version. + // + // This member is required. + Version *string + + // The ARN of the landing zone. + Arn *string + + // The drift status of the landing zone. + DriftStatus *LandingZoneDriftStatusSummary + + // The latest available version of the landing zone. + LatestAvailableVersion *string + + // The landing zone deployment status. Valid values: + // - ACTIVE : The landing zone is actively deployed. + // - PROCESSING : The landing zone is processing deployment. + // - FAILED : The landing zone failed deployment. + Status LandingZoneStatus + + noSmithyDocumentSerde +} + +// The drift status summary of the landing zone. If the landing zone differs from +// the expected configuration, it is defined to be in a state of drift. You can +// repair this drift by resetting the landing zone. +type LandingZoneDriftStatusSummary struct { + + // The drift status of the landing zone. Valid values: + // - DRIFTED : The landing zone deployed in this configuration does not match the + // configuration that Amazon Web Services Control Tower expected. + // - IN_SYNC : The landing zone deployed in this configuration matches the + // configuration that Amazon Web Services Control Tower expected. + Status LandingZoneDriftStatus + + noSmithyDocumentSerde +} + +// Information about a landing zone operation. +type LandingZoneOperationDetail struct { + + // The landing zone operation end time. + EndTime *time.Time + + // The landing zone operation type. Valid values: + // - DELETE : The DeleteLandingZone operation. + // - CREATE : The CreateLandingZone operation. + // - UPDATE : The UpdateLandingZone operation. + // - RESET : The ResetLandingZone operation. + OperationType LandingZoneOperationType + + // The landing zone operation start time. + StartTime *time.Time + + // The landing zone operation status. Valid values: + // - SUCCEEDED : The landing zone operation succeeded. + // - IN_PROGRESS : The landing zone operation is in progress. + // - FAILED : The landing zone operation failed. + Status LandingZoneOperationStatus + + // If the operation result is FAILED, this string contains a message explaining + // why the operation failed. + StatusMessage *string + + noSmithyDocumentSerde +} + +// Returns a summary of information about a landing zone. +type LandingZoneSummary struct { + + // The ARN of the landing zone. + Arn *string + + noSmithyDocumentSerde +} + +// An Amazon Web Services Region in which Amazon Web Services Control Tower +// expects to find the control deployed. The expected Regions are based on the +// Regions that are governed by the landing zone. In certain cases, a control is +// not actually enabled in the Region as expected, such as during drift, or mixed +// governance (https://docs.aws.amazon.com/controltower/latest/userguide/region-how.html#mixed-governance) // . type Region struct { - // The AWS Region name. + // The Amazon Web Services Region name. Name *string noSmithyDocumentSerde diff --git a/service/controltower/validators.go b/service/controltower/validators.go index 6f3c21cd60a..0b9453beae5 100644 --- a/service/controltower/validators.go +++ b/service/controltower/validators.go @@ -9,6 +9,46 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpCreateLandingZone struct { +} + +func (*validateOpCreateLandingZone) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateLandingZone) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateLandingZoneInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateLandingZoneInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteLandingZone struct { +} + +func (*validateOpDeleteLandingZone) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteLandingZone) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteLandingZoneInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteLandingZoneInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDisableControl struct { } @@ -89,6 +129,46 @@ func (m *validateOpGetEnabledControl) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpGetLandingZone struct { +} + +func (*validateOpGetLandingZone) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetLandingZone) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetLandingZoneInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetLandingZoneInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetLandingZoneOperation struct { +} + +func (*validateOpGetLandingZoneOperation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetLandingZoneOperation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetLandingZoneOperationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetLandingZoneOperationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListEnabledControls struct { } @@ -129,6 +209,26 @@ func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpResetLandingZone struct { +} + +func (*validateOpResetLandingZone) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpResetLandingZone) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ResetLandingZoneInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpResetLandingZoneInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -169,6 +269,34 @@ func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateLandingZone struct { +} + +func (*validateOpUpdateLandingZone) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateLandingZone) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateLandingZoneInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateLandingZoneInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateLandingZoneValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateLandingZone{}, middleware.After) +} + +func addOpDeleteLandingZoneValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteLandingZone{}, middleware.After) +} + func addOpDisableControlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisableControl{}, middleware.After) } @@ -185,6 +313,14 @@ func addOpGetEnabledControlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetEnabledControl{}, middleware.After) } +func addOpGetLandingZoneValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetLandingZone{}, middleware.After) +} + +func addOpGetLandingZoneOperationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetLandingZoneOperation{}, middleware.After) +} + func addOpListEnabledControlsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListEnabledControls{}, middleware.After) } @@ -193,6 +329,10 @@ func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } +func addOpResetLandingZoneValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpResetLandingZone{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -201,6 +341,43 @@ func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } +func addOpUpdateLandingZoneValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateLandingZone{}, middleware.After) +} + +func validateOpCreateLandingZoneInput(v *CreateLandingZoneInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateLandingZoneInput"} + if v.Version == nil { + invalidParams.Add(smithy.NewErrParamRequired("Version")) + } + if v.Manifest == nil { + invalidParams.Add(smithy.NewErrParamRequired("Manifest")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteLandingZoneInput(v *DeleteLandingZoneInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteLandingZoneInput"} + if v.LandingZoneIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("LandingZoneIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDisableControlInput(v *DisableControlInput) error { if v == nil { return nil @@ -267,6 +444,36 @@ func validateOpGetEnabledControlInput(v *GetEnabledControlInput) error { } } +func validateOpGetLandingZoneInput(v *GetLandingZoneInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetLandingZoneInput"} + if v.LandingZoneIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("LandingZoneIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetLandingZoneOperationInput(v *GetLandingZoneOperationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetLandingZoneOperationInput"} + if v.OperationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("OperationIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListEnabledControlsInput(v *ListEnabledControlsInput) error { if v == nil { return nil @@ -297,6 +504,21 @@ func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { } } +func validateOpResetLandingZoneInput(v *ResetLandingZoneInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResetLandingZoneInput"} + if v.LandingZoneIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("LandingZoneIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil @@ -332,3 +554,24 @@ func validateOpUntagResourceInput(v *UntagResourceInput) error { return nil } } + +func validateOpUpdateLandingZoneInput(v *UpdateLandingZoneInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateLandingZoneInput"} + if v.Version == nil { + invalidParams.Add(smithy.NewErrParamRequired("Version")) + } + if v.Manifest == nil { + invalidParams.Add(smithy.NewErrParamRequired("Manifest")) + } + if v.LandingZoneIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("LandingZoneIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/costoptimizationhub/LICENSE.txt b/service/costoptimizationhub/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/costoptimizationhub/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/costoptimizationhub/api_client.go b/service/costoptimizationhub/api_client.go new file mode 100644 index 00000000000..f2b004fbff7 --- /dev/null +++ b/service/costoptimizationhub/api_client.go @@ -0,0 +1,455 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +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 = "Cost Optimization Hub" +const ServiceAPIVersion = "2022-07-26" + +// Client provides the API client to make operations call for Cost Optimization +// Hub. +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, "costoptimizationhub", 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/costoptimizationhub/api_client_test.go b/service/costoptimizationhub/api_client_test.go new file mode 100644 index 00000000000..265ff9311c1 --- /dev/null +++ b/service/costoptimizationhub/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +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/costoptimizationhub/api_op_GetPreferences.go b/service/costoptimizationhub/api_op_GetPreferences.go new file mode 100644 index 00000000000..fc39c82a129 --- /dev/null +++ b/service/costoptimizationhub/api_op_GetPreferences.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +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/costoptimizationhub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a set of preferences for an account in order to add account-specific +// preferences into the service. These preferences impact how the savings +// associated with recommendations are presented—estimated savings after discounts +// or estimated savings before discounts, for example. +func (c *Client) GetPreferences(ctx context.Context, params *GetPreferencesInput, optFns ...func(*Options)) (*GetPreferencesOutput, error) { + if params == nil { + params = &GetPreferencesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetPreferences", params, optFns, c.addOperationGetPreferencesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetPreferencesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetPreferencesInput struct { + noSmithyDocumentSerde +} + +type GetPreferencesOutput struct { + + // Retrieves the status of the "member account discount visibility" preference. + MemberAccountDiscountVisibility types.MemberAccountDiscountVisibility + + // Retrieves the status of the "savings estimation mode" preference. + SavingsEstimationMode types.SavingsEstimationMode + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetPreferencesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetPreferences{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetPreferences{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetPreferences"); 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_opGetPreferences(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_opGetPreferences(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetPreferences", + } +} diff --git a/service/costoptimizationhub/api_op_GetRecommendation.go b/service/costoptimizationhub/api_op_GetRecommendation.go new file mode 100644 index 00000000000..336766dc105 --- /dev/null +++ b/service/costoptimizationhub/api_op_GetRecommendation.go @@ -0,0 +1,210 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +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/costoptimizationhub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns both the current and recommended resource configuration and the +// estimated cost impact for a recommendation. The recommendationId is only valid +// for up to a maximum of 24 hours as recommendations are refreshed daily. To +// retrieve the recommendationId , use the ListRecommendations API. +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 ID for the recommendation. + // + // This member is required. + RecommendationId *string + + noSmithyDocumentSerde +} + +type GetRecommendationOutput struct { + + // The account that the recommendation is for. + AccountId *string + + // The type of action you can take by adopting the recommendation. + ActionType types.ActionType + + // The lookback period used to calculate cost impact for a recommendation. + CostCalculationLookbackPeriodInDays *int32 + + // The currency code used for the recommendation. + CurrencyCode *string + + // The details for the resource. + CurrentResourceDetails types.ResourceDetails + + // The type of resource. + CurrentResourceType types.ResourceType + + // The estimated monthly cost of the recommendation. + EstimatedMonthlyCost *float64 + + // The estimated monthly savings amount for the recommendation. + EstimatedMonthlySavings *float64 + + // The estimated savings amount over the lookback period used to calculate cost + // impact for a recommendation. + EstimatedSavingsOverCostCalculationLookbackPeriod *float64 + + // The estimated savings percentage relative to the total cost over the cost + // calculation lookback period. + EstimatedSavingsPercentage *float64 + + // The effort required to implement the recommendation. + ImplementationEffort types.ImplementationEffort + + // The time when the recommendation was last generated. + LastRefreshTimestamp *time.Time + + // The ID for the recommendation. + RecommendationId *string + + // The lookback period that's used to generate the recommendation. + RecommendationLookbackPeriodInDays *int32 + + // The details about the recommended resource. + RecommendedResourceDetails types.ResourceDetails + + // The resource type of the recommendation. + RecommendedResourceType types.ResourceType + + // The Amazon Web Services Region of the resource. + Region *string + + // The Amazon Resource Name (ARN) of the resource. + ResourceArn *string + + // The unique identifier for the resource. This is the same as the Amazon Resource + // Name (ARN), if available. + ResourceId *string + + // Whether or not implementing the recommendation requires a restart. + RestartNeeded *bool + + // Whether or not implementing the recommendation can be rolled back. + RollbackPossible *bool + + // The source of the recommendation. + Source types.Source + + // A list of tags associated with the resource for which the recommendation exists. + Tags []types.Tag + + // 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(&awsAwsjson10_serializeOpGetRecommendation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_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/costoptimizationhub/api_op_ListEnrollmentStatuses.go b/service/costoptimizationhub/api_op_ListEnrollmentStatuses.go new file mode 100644 index 00000000000..39674fad692 --- /dev/null +++ b/service/costoptimizationhub/api_op_ListEnrollmentStatuses.go @@ -0,0 +1,236 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +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/costoptimizationhub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the enrollment status for an account. It can also return the list of +// accounts that are enrolled under the organization. +func (c *Client) ListEnrollmentStatuses(ctx context.Context, params *ListEnrollmentStatusesInput, optFns ...func(*Options)) (*ListEnrollmentStatusesOutput, error) { + if params == nil { + params = &ListEnrollmentStatusesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListEnrollmentStatuses", params, optFns, c.addOperationListEnrollmentStatusesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListEnrollmentStatusesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListEnrollmentStatusesInput struct { + + // The enrollment status of a specific account ID in the organization. + AccountId *string + + // Indicates whether to return the enrollment status for the organization. + IncludeOrganizationInfo bool + + // The maximum number of objects that are returned for the request. + MaxResults *int32 + + // The token to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListEnrollmentStatusesOutput struct { + + // The account enrollment statuses. + Items []types.AccountEnrollmentStatus + + // The token to retrieve the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListEnrollmentStatusesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListEnrollmentStatuses{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListEnrollmentStatuses{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListEnrollmentStatuses"); 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_opListEnrollmentStatuses(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 +} + +// ListEnrollmentStatusesAPIClient is a client that implements the +// ListEnrollmentStatuses operation. +type ListEnrollmentStatusesAPIClient interface { + ListEnrollmentStatuses(context.Context, *ListEnrollmentStatusesInput, ...func(*Options)) (*ListEnrollmentStatusesOutput, error) +} + +var _ ListEnrollmentStatusesAPIClient = (*Client)(nil) + +// ListEnrollmentStatusesPaginatorOptions is the paginator options for +// ListEnrollmentStatuses +type ListEnrollmentStatusesPaginatorOptions struct { + // The maximum number of objects that are returned for the request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListEnrollmentStatusesPaginator is a paginator for ListEnrollmentStatuses +type ListEnrollmentStatusesPaginator struct { + options ListEnrollmentStatusesPaginatorOptions + client ListEnrollmentStatusesAPIClient + params *ListEnrollmentStatusesInput + nextToken *string + firstPage bool +} + +// NewListEnrollmentStatusesPaginator returns a new ListEnrollmentStatusesPaginator +func NewListEnrollmentStatusesPaginator(client ListEnrollmentStatusesAPIClient, params *ListEnrollmentStatusesInput, optFns ...func(*ListEnrollmentStatusesPaginatorOptions)) *ListEnrollmentStatusesPaginator { + if params == nil { + params = &ListEnrollmentStatusesInput{} + } + + options := ListEnrollmentStatusesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListEnrollmentStatusesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEnrollmentStatusesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListEnrollmentStatuses page. +func (p *ListEnrollmentStatusesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEnrollmentStatusesOutput, 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.ListEnrollmentStatuses(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_opListEnrollmentStatuses(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListEnrollmentStatuses", + } +} diff --git a/service/costoptimizationhub/api_op_ListRecommendationSummaries.go b/service/costoptimizationhub/api_op_ListRecommendationSummaries.go new file mode 100644 index 00000000000..a174a295f00 --- /dev/null +++ b/service/costoptimizationhub/api_op_ListRecommendationSummaries.go @@ -0,0 +1,255 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +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/costoptimizationhub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a concise representation of savings estimates for resources. Also +// returns de-duped savings across different types of recommendations. The +// following filters are not supported for this API: recommendationIds , +// resourceArns , and resourceIds . +func (c *Client) ListRecommendationSummaries(ctx context.Context, params *ListRecommendationSummariesInput, optFns ...func(*Options)) (*ListRecommendationSummariesOutput, error) { + if params == nil { + params = &ListRecommendationSummariesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListRecommendationSummaries", params, optFns, c.addOperationListRecommendationSummariesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListRecommendationSummariesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListRecommendationSummariesInput struct { + + // The grouping of recommendations by a dimension. + // + // This member is required. + GroupBy *string + + // Describes a filter that returns a more specific list of recommendations. + // Filters recommendations by different dimensions. + Filter *types.Filter + + // The maximum number of recommendations that are returned for the request. + MaxResults *int32 + + // The token to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListRecommendationSummariesOutput struct { + + // The currency code used for the recommendation. + CurrencyCode *string + + // The total overall savings for the aggregated view. + EstimatedTotalDedupedSavings *float64 + + // The dimension used to group the recommendations by. + GroupBy *string + + // List of all savings recommendations. + Items []types.RecommendationSummary + + // The token to retrieve the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListRecommendationSummariesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListRecommendationSummaries{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListRecommendationSummaries{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListRecommendationSummaries"); 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 = addOpListRecommendationSummariesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRecommendationSummaries(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 +} + +// ListRecommendationSummariesAPIClient is a client that implements the +// ListRecommendationSummaries operation. +type ListRecommendationSummariesAPIClient interface { + ListRecommendationSummaries(context.Context, *ListRecommendationSummariesInput, ...func(*Options)) (*ListRecommendationSummariesOutput, error) +} + +var _ ListRecommendationSummariesAPIClient = (*Client)(nil) + +// ListRecommendationSummariesPaginatorOptions is the paginator options for +// ListRecommendationSummaries +type ListRecommendationSummariesPaginatorOptions struct { + // The maximum number of recommendations that are returned for the request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListRecommendationSummariesPaginator is a paginator for +// ListRecommendationSummaries +type ListRecommendationSummariesPaginator struct { + options ListRecommendationSummariesPaginatorOptions + client ListRecommendationSummariesAPIClient + params *ListRecommendationSummariesInput + nextToken *string + firstPage bool +} + +// NewListRecommendationSummariesPaginator returns a new +// ListRecommendationSummariesPaginator +func NewListRecommendationSummariesPaginator(client ListRecommendationSummariesAPIClient, params *ListRecommendationSummariesInput, optFns ...func(*ListRecommendationSummariesPaginatorOptions)) *ListRecommendationSummariesPaginator { + if params == nil { + params = &ListRecommendationSummariesInput{} + } + + options := ListRecommendationSummariesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListRecommendationSummariesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRecommendationSummariesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListRecommendationSummaries page. +func (p *ListRecommendationSummariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecommendationSummariesOutput, 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.ListRecommendationSummaries(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_opListRecommendationSummaries(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListRecommendationSummaries", + } +} diff --git a/service/costoptimizationhub/api_op_ListRecommendations.go b/service/costoptimizationhub/api_op_ListRecommendations.go new file mode 100644 index 00000000000..afddc87fcce --- /dev/null +++ b/service/costoptimizationhub/api_op_ListRecommendations.go @@ -0,0 +1,239 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +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/costoptimizationhub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list 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 { + + // The constraints that you want all returned recommendations to match. + Filter *types.Filter + + // List of all recommendations for a resource, or a single recommendation if + // de-duped by resourceId . + IncludeAllRecommendations bool + + // The maximum number of recommendations that are returned for the request. + MaxResults *int32 + + // The token to retrieve the next set of results. + NextToken *string + + // The ordering of recommendations by a dimension. + OrderBy *types.OrderBy + + noSmithyDocumentSerde +} + +type ListRecommendationsOutput struct { + + // List of all savings recommendations. + Items []types.Recommendation + + // The token 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(&awsAwsjson10_serializeOpListRecommendations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_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 recommendations that are returned for the request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// 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/costoptimizationhub/api_op_UpdateEnrollmentStatus.go b/service/costoptimizationhub/api_op_UpdateEnrollmentStatus.go new file mode 100644 index 00000000000..7c99c8c6c95 --- /dev/null +++ b/service/costoptimizationhub/api_op_UpdateEnrollmentStatus.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +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/costoptimizationhub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the enrollment (opt in and opt out) status of an account to the Cost +// Optimization Hub service. If the account is a management account of an +// organization, this action can also be used to enroll member accounts of the +// organization. You must have the appropriate permissions to opt in to Cost +// Optimization Hub and to view its recommendations. When you opt in, Cost +// Optimization Hub automatically creates a service-linked role in your account to +// access its data. +func (c *Client) UpdateEnrollmentStatus(ctx context.Context, params *UpdateEnrollmentStatusInput, optFns ...func(*Options)) (*UpdateEnrollmentStatusOutput, error) { + if params == nil { + params = &UpdateEnrollmentStatusInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateEnrollmentStatus", params, optFns, c.addOperationUpdateEnrollmentStatusMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateEnrollmentStatusOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateEnrollmentStatusInput struct { + + // Sets the account status. + // + // This member is required. + Status types.EnrollmentStatus + + // Indicates whether to enroll member accounts of the organization if the account + // is the management account. + IncludeMemberAccounts *bool + + noSmithyDocumentSerde +} + +type UpdateEnrollmentStatusOutput struct { + + // The enrollment status of the account. + Status *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateEnrollmentStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateEnrollmentStatus{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateEnrollmentStatus{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateEnrollmentStatus"); 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 = addOpUpdateEnrollmentStatusValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateEnrollmentStatus(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_opUpdateEnrollmentStatus(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateEnrollmentStatus", + } +} diff --git a/service/costoptimizationhub/api_op_UpdatePreferences.go b/service/costoptimizationhub/api_op_UpdatePreferences.go new file mode 100644 index 00000000000..a09273f9184 --- /dev/null +++ b/service/costoptimizationhub/api_op_UpdatePreferences.go @@ -0,0 +1,140 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +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/costoptimizationhub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a set of preferences for an account in order to add account-specific +// preferences into the service. These preferences impact how the savings +// associated with recommendations are presented. +func (c *Client) UpdatePreferences(ctx context.Context, params *UpdatePreferencesInput, optFns ...func(*Options)) (*UpdatePreferencesOutput, error) { + if params == nil { + params = &UpdatePreferencesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdatePreferences", params, optFns, c.addOperationUpdatePreferencesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdatePreferencesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdatePreferencesInput struct { + + // Sets the "member account discount visibility" preference. + MemberAccountDiscountVisibility types.MemberAccountDiscountVisibility + + // Sets the "savings estimation mode" preference. + SavingsEstimationMode types.SavingsEstimationMode + + noSmithyDocumentSerde +} + +type UpdatePreferencesOutput struct { + + // Shows the status of the "member account discount visibility" preference. + MemberAccountDiscountVisibility types.MemberAccountDiscountVisibility + + // Shows the status of the "savings estimation mode" preference. + SavingsEstimationMode types.SavingsEstimationMode + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdatePreferencesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdatePreferences{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdatePreferences{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdatePreferences"); 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_opUpdatePreferences(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_opUpdatePreferences(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdatePreferences", + } +} diff --git a/service/costoptimizationhub/auth.go b/service/costoptimizationhub/auth.go new file mode 100644 index 00000000000..eaaebf94089 --- /dev/null +++ b/service/costoptimizationhub/auth.go @@ -0,0 +1,256 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +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, "cost-optimization-hub") + 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/costoptimizationhub/deserializers.go b/service/costoptimizationhub/deserializers.go new file mode 100644 index 00000000000..c58ca509190 --- /dev/null +++ b/service/costoptimizationhub/deserializers.go @@ -0,0 +1,5728 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/costoptimizationhub/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "math" + "strings" +) + +type awsAwsjson10_deserializeOpGetPreferences struct { +} + +func (*awsAwsjson10_deserializeOpGetPreferences) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpGetPreferences) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetPreferences(response, &metadata) + } + output := &GetPreferencesOutput{} + 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_deserializeOpDocumentGetPreferencesOutput(&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_deserializeOpErrorGetPreferences(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("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_deserializeOpGetRecommendation struct { +} + +func (*awsAwsjson10_deserializeOpGetRecommendation) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_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, awsAwsjson10_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 = awsAwsjson10_deserializeOpDocumentGetRecommendationOutput(&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_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 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_deserializeOpListEnrollmentStatuses struct { +} + +func (*awsAwsjson10_deserializeOpListEnrollmentStatuses) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListEnrollmentStatuses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListEnrollmentStatuses(response, &metadata) + } + output := &ListEnrollmentStatusesOutput{} + 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_deserializeOpDocumentListEnrollmentStatusesOutput(&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_deserializeOpErrorListEnrollmentStatuses(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("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_deserializeOpListRecommendations struct { +} + +func (*awsAwsjson10_deserializeOpListRecommendations) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_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, awsAwsjson10_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 = awsAwsjson10_deserializeOpDocumentListRecommendationsOutput(&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_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 awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpListRecommendationSummaries struct { +} + +func (*awsAwsjson10_deserializeOpListRecommendationSummaries) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListRecommendationSummaries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListRecommendationSummaries(response, &metadata) + } + output := &ListRecommendationSummariesOutput{} + 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_deserializeOpDocumentListRecommendationSummariesOutput(&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_deserializeOpErrorListRecommendationSummaries(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("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_deserializeOpUpdateEnrollmentStatus struct { +} + +func (*awsAwsjson10_deserializeOpUpdateEnrollmentStatus) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateEnrollmentStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateEnrollmentStatus(response, &metadata) + } + output := &UpdateEnrollmentStatusOutput{} + 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_deserializeOpDocumentUpdateEnrollmentStatusOutput(&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_deserializeOpErrorUpdateEnrollmentStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("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_deserializeOpUpdatePreferences struct { +} + +func (*awsAwsjson10_deserializeOpUpdatePreferences) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdatePreferences) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdatePreferences(response, &metadata) + } + output := &UpdatePreferencesOutput{} + 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_deserializeOpDocumentUpdatePreferencesOutput(&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_deserializeOpErrorUpdatePreferences(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson10_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.AccessDeniedException{} + err := awsAwsjson10_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InternalServerException{} + err := awsAwsjson10_deserializeDocumentInternalServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ResourceNotFoundException{} + err := awsAwsjson10_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ThrottlingException{} + err := awsAwsjson10_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ValidationException{} + err := awsAwsjson10_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentAccountEnrollmentStatus(v **types.AccountEnrollmentStatus, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccountEnrollmentStatus + if *v == nil { + sv = &types.AccountEnrollmentStatus{} + } 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 "createdTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "lastUpdatedTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedTimestamp = 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 EnrollmentStatus to be of type string, got %T instead", value) + } + sv.Status = types.EnrollmentStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentAccountEnrollmentStatuses(v *[]types.AccountEnrollmentStatus, 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.AccountEnrollmentStatus + if *v == nil { + cv = []types.AccountEnrollmentStatus{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AccountEnrollmentStatus + destAddr := &col + if err := awsAwsjson10_deserializeDocumentAccountEnrollmentStatus(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentBlockStoragePerformanceConfiguration(v **types.BlockStoragePerformanceConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BlockStoragePerformanceConfiguration + if *v == nil { + sv = &types.BlockStoragePerformanceConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "iops": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Iops = 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.Iops = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "throughput": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Throughput = 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.Throughput = 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 awsAwsjson10_deserializeDocumentComputeConfiguration(v **types.ComputeConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ComputeConfiguration + if *v == nil { + sv = &types.ComputeConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "architecture": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Architecture = ptr.String(jtv) + } + + case "memorySizeInMB": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MemorySizeInMB = ptr.Int32(int32(i64)) + } + + case "platform": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Platform = ptr.String(jtv) + } + + case "vCpu": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.VCpu = 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.VCpu = 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 awsAwsjson10_deserializeDocumentComputeSavingsPlans(v **types.ComputeSavingsPlans, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ComputeSavingsPlans + if *v == nil { + sv = &types.ComputeSavingsPlans{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configuration": + if err := awsAwsjson10_deserializeDocumentComputeSavingsPlansConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "costCalculation": + if err := awsAwsjson10_deserializeDocumentSavingsPlansCostCalculation(&sv.CostCalculation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentComputeSavingsPlansConfiguration(v **types.ComputeSavingsPlansConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ComputeSavingsPlansConfiguration + if *v == nil { + sv = &types.ComputeSavingsPlansConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountScope": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AccountScope = ptr.String(jtv) + } + + case "hourlyCommitment": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.HourlyCommitment = ptr.String(jtv) + } + + case "paymentOption": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PaymentOption = ptr.String(jtv) + } + + case "term": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Term = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEbsVolume(v **types.EbsVolume, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EbsVolume + if *v == nil { + sv = &types.EbsVolume{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configuration": + if err := awsAwsjson10_deserializeDocumentEbsVolumeConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "costCalculation": + if err := awsAwsjson10_deserializeDocumentResourceCostCalculation(&sv.CostCalculation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEbsVolumeConfiguration(v **types.EbsVolumeConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EbsVolumeConfiguration + if *v == nil { + sv = &types.EbsVolumeConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "attachmentState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AttachmentState = ptr.String(jtv) + } + + case "performance": + if err := awsAwsjson10_deserializeDocumentBlockStoragePerformanceConfiguration(&sv.Performance, value); err != nil { + return err + } + + case "storage": + if err := awsAwsjson10_deserializeDocumentStorageConfiguration(&sv.Storage, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEc2AutoScalingGroup(v **types.Ec2AutoScalingGroup, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Ec2AutoScalingGroup + if *v == nil { + sv = &types.Ec2AutoScalingGroup{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configuration": + if err := awsAwsjson10_deserializeDocumentEc2AutoScalingGroupConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "costCalculation": + if err := awsAwsjson10_deserializeDocumentResourceCostCalculation(&sv.CostCalculation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEc2AutoScalingGroupConfiguration(v **types.Ec2AutoScalingGroupConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Ec2AutoScalingGroupConfiguration + if *v == nil { + sv = &types.Ec2AutoScalingGroupConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "instance": + if err := awsAwsjson10_deserializeDocumentInstanceConfiguration(&sv.Instance, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEc2Instance(v **types.Ec2Instance, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Ec2Instance + if *v == nil { + sv = &types.Ec2Instance{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configuration": + if err := awsAwsjson10_deserializeDocumentEc2InstanceConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "costCalculation": + if err := awsAwsjson10_deserializeDocumentResourceCostCalculation(&sv.CostCalculation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEc2InstanceConfiguration(v **types.Ec2InstanceConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Ec2InstanceConfiguration + if *v == nil { + sv = &types.Ec2InstanceConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "instance": + if err := awsAwsjson10_deserializeDocumentInstanceConfiguration(&sv.Instance, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEc2InstanceSavingsPlans(v **types.Ec2InstanceSavingsPlans, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Ec2InstanceSavingsPlans + if *v == nil { + sv = &types.Ec2InstanceSavingsPlans{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configuration": + if err := awsAwsjson10_deserializeDocumentEc2InstanceSavingsPlansConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "costCalculation": + if err := awsAwsjson10_deserializeDocumentSavingsPlansCostCalculation(&sv.CostCalculation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEc2InstanceSavingsPlansConfiguration(v **types.Ec2InstanceSavingsPlansConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Ec2InstanceSavingsPlansConfiguration + if *v == nil { + sv = &types.Ec2InstanceSavingsPlansConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountScope": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AccountScope = ptr.String(jtv) + } + + case "hourlyCommitment": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.HourlyCommitment = ptr.String(jtv) + } + + case "instanceFamily": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceFamily = ptr.String(jtv) + } + + case "paymentOption": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PaymentOption = ptr.String(jtv) + } + + case "savingsPlansRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SavingsPlansRegion = ptr.String(jtv) + } + + case "term": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Term = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEc2ReservedInstances(v **types.Ec2ReservedInstances, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Ec2ReservedInstances + if *v == nil { + sv = &types.Ec2ReservedInstances{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configuration": + if err := awsAwsjson10_deserializeDocumentEc2ReservedInstancesConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "costCalculation": + if err := awsAwsjson10_deserializeDocumentReservedInstancesCostCalculation(&sv.CostCalculation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEc2ReservedInstancesConfiguration(v **types.Ec2ReservedInstancesConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Ec2ReservedInstancesConfiguration + if *v == nil { + sv = &types.Ec2ReservedInstancesConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountScope": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AccountScope = ptr.String(jtv) + } + + case "currentGeneration": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CurrentGeneration = ptr.String(jtv) + } + + case "instanceFamily": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceFamily = ptr.String(jtv) + } + + case "instanceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceType = ptr.String(jtv) + } + + case "monthlyRecurringCost": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MonthlyRecurringCost = ptr.String(jtv) + } + + case "normalizedUnitsToPurchase": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NormalizedUnitsToPurchase = ptr.String(jtv) + } + + case "numberOfInstancesToPurchase": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NumberOfInstancesToPurchase = ptr.String(jtv) + } + + case "offeringClass": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.OfferingClass = ptr.String(jtv) + } + + case "paymentOption": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PaymentOption = ptr.String(jtv) + } + + case "platform": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Platform = ptr.String(jtv) + } + + case "reservedInstancesRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ReservedInstancesRegion = ptr.String(jtv) + } + + case "service": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Service = ptr.String(jtv) + } + + case "sizeFlexEligible": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.SizeFlexEligible = ptr.Bool(jtv) + } + + case "tenancy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Tenancy = ptr.String(jtv) + } + + case "term": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Term = ptr.String(jtv) + } + + case "upfrontCost": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UpfrontCost = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEcsService(v **types.EcsService, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EcsService + if *v == nil { + sv = &types.EcsService{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configuration": + if err := awsAwsjson10_deserializeDocumentEcsServiceConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "costCalculation": + if err := awsAwsjson10_deserializeDocumentResourceCostCalculation(&sv.CostCalculation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEcsServiceConfiguration(v **types.EcsServiceConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EcsServiceConfiguration + if *v == nil { + sv = &types.EcsServiceConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "compute": + if err := awsAwsjson10_deserializeDocumentComputeConfiguration(&sv.Compute, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentElastiCacheReservedInstances(v **types.ElastiCacheReservedInstances, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ElastiCacheReservedInstances + if *v == nil { + sv = &types.ElastiCacheReservedInstances{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configuration": + if err := awsAwsjson10_deserializeDocumentElastiCacheReservedInstancesConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "costCalculation": + if err := awsAwsjson10_deserializeDocumentReservedInstancesCostCalculation(&sv.CostCalculation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentElastiCacheReservedInstancesConfiguration(v **types.ElastiCacheReservedInstancesConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ElastiCacheReservedInstancesConfiguration + if *v == nil { + sv = &types.ElastiCacheReservedInstancesConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountScope": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AccountScope = ptr.String(jtv) + } + + case "currentGeneration": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CurrentGeneration = ptr.String(jtv) + } + + case "instanceFamily": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceFamily = ptr.String(jtv) + } + + case "instanceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceType = ptr.String(jtv) + } + + case "monthlyRecurringCost": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MonthlyRecurringCost = ptr.String(jtv) + } + + case "normalizedUnitsToPurchase": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NormalizedUnitsToPurchase = ptr.String(jtv) + } + + case "numberOfInstancesToPurchase": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NumberOfInstancesToPurchase = ptr.String(jtv) + } + + case "paymentOption": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PaymentOption = ptr.String(jtv) + } + + case "reservedInstancesRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ReservedInstancesRegion = ptr.String(jtv) + } + + case "service": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Service = ptr.String(jtv) + } + + case "sizeFlexEligible": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.SizeFlexEligible = ptr.Bool(jtv) + } + + case "term": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Term = ptr.String(jtv) + } + + case "upfrontCost": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UpfrontCost = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEstimatedDiscounts(v **types.EstimatedDiscounts, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EstimatedDiscounts + if *v == nil { + sv = &types.EstimatedDiscounts{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "otherDiscount": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.OtherDiscount = 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.OtherDiscount = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "reservedInstancesDiscount": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ReservedInstancesDiscount = 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.ReservedInstancesDiscount = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "savingsPlansDiscount": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SavingsPlansDiscount = 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.SavingsPlansDiscount = 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 awsAwsjson10_deserializeDocumentInstanceConfiguration(v **types.InstanceConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InstanceConfiguration + if *v == nil { + sv = &types.InstanceConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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 awsAwsjson10_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentLambdaFunction(v **types.LambdaFunction, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LambdaFunction + if *v == nil { + sv = &types.LambdaFunction{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configuration": + if err := awsAwsjson10_deserializeDocumentLambdaFunctionConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "costCalculation": + if err := awsAwsjson10_deserializeDocumentResourceCostCalculation(&sv.CostCalculation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentLambdaFunctionConfiguration(v **types.LambdaFunctionConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LambdaFunctionConfiguration + if *v == nil { + sv = &types.LambdaFunctionConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "compute": + if err := awsAwsjson10_deserializeDocumentComputeConfiguration(&sv.Compute, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentOpenSearchReservedInstances(v **types.OpenSearchReservedInstances, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.OpenSearchReservedInstances + if *v == nil { + sv = &types.OpenSearchReservedInstances{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configuration": + if err := awsAwsjson10_deserializeDocumentOpenSearchReservedInstancesConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "costCalculation": + if err := awsAwsjson10_deserializeDocumentReservedInstancesCostCalculation(&sv.CostCalculation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentOpenSearchReservedInstancesConfiguration(v **types.OpenSearchReservedInstancesConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.OpenSearchReservedInstancesConfiguration + if *v == nil { + sv = &types.OpenSearchReservedInstancesConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountScope": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AccountScope = ptr.String(jtv) + } + + case "currentGeneration": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CurrentGeneration = ptr.String(jtv) + } + + case "instanceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceType = ptr.String(jtv) + } + + case "monthlyRecurringCost": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MonthlyRecurringCost = ptr.String(jtv) + } + + case "normalizedUnitsToPurchase": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NormalizedUnitsToPurchase = ptr.String(jtv) + } + + case "numberOfInstancesToPurchase": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NumberOfInstancesToPurchase = ptr.String(jtv) + } + + case "paymentOption": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PaymentOption = ptr.String(jtv) + } + + case "reservedInstancesRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ReservedInstancesRegion = ptr.String(jtv) + } + + case "service": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Service = ptr.String(jtv) + } + + case "sizeFlexEligible": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.SizeFlexEligible = ptr.Bool(jtv) + } + + case "term": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Term = ptr.String(jtv) + } + + case "upfrontCost": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UpfrontCost = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentRdsReservedInstances(v **types.RdsReservedInstances, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RdsReservedInstances + if *v == nil { + sv = &types.RdsReservedInstances{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configuration": + if err := awsAwsjson10_deserializeDocumentRdsReservedInstancesConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "costCalculation": + if err := awsAwsjson10_deserializeDocumentReservedInstancesCostCalculation(&sv.CostCalculation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentRdsReservedInstancesConfiguration(v **types.RdsReservedInstancesConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RdsReservedInstancesConfiguration + if *v == nil { + sv = &types.RdsReservedInstancesConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountScope": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AccountScope = ptr.String(jtv) + } + + case "currentGeneration": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CurrentGeneration = ptr.String(jtv) + } + + case "databaseEdition": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DatabaseEdition = ptr.String(jtv) + } + + case "databaseEngine": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DatabaseEngine = ptr.String(jtv) + } + + case "deploymentOption": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DeploymentOption = ptr.String(jtv) + } + + case "instanceFamily": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceFamily = ptr.String(jtv) + } + + case "instanceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceType = ptr.String(jtv) + } + + case "licenseModel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.LicenseModel = ptr.String(jtv) + } + + case "monthlyRecurringCost": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MonthlyRecurringCost = ptr.String(jtv) + } + + case "normalizedUnitsToPurchase": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NormalizedUnitsToPurchase = ptr.String(jtv) + } + + case "numberOfInstancesToPurchase": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NumberOfInstancesToPurchase = ptr.String(jtv) + } + + case "paymentOption": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PaymentOption = ptr.String(jtv) + } + + case "reservedInstancesRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ReservedInstancesRegion = ptr.String(jtv) + } + + case "service": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Service = ptr.String(jtv) + } + + case "sizeFlexEligible": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.SizeFlexEligible = ptr.Bool(jtv) + } + + case "term": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Term = ptr.String(jtv) + } + + case "upfrontCost": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UpfrontCost = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_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 "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "actionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ActionType = ptr.String(jtv) + } + + case "currencyCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CurrencyCode = ptr.String(jtv) + } + + case "currentResourceSummary": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CurrentResourceSummary = ptr.String(jtv) + } + + case "currentResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CurrentResourceType = ptr.String(jtv) + } + + case "estimatedMonthlyCost": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedMonthlyCost = 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.EstimatedMonthlyCost = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + 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 "estimatedSavingsPercentage": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedSavingsPercentage = 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.EstimatedSavingsPercentage = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "implementationEffort": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ImplementationEffort = ptr.String(jtv) + } + + case "lastRefreshTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastRefreshTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Datetime to be a JSON Number, got %T instead", value) + + } + } + + case "recommendationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RecommendationId = ptr.String(jtv) + } + + case "recommendationLookbackPeriodInDays": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RecommendationLookbackPeriodInDays = ptr.Int32(int32(i64)) + } + + case "recommendedResourceSummary": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RecommendedResourceSummary = ptr.String(jtv) + } + + case "recommendedResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RecommendedResourceType = ptr.String(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "resourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "restartNeeded": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.RestartNeeded = ptr.Bool(jtv) + } + + case "rollbackPossible": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.RollbackPossible = ptr.Bool(jtv) + } + + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Source to be of type string, got %T instead", value) + } + sv.Source = types.Source(jtv) + } + + case "tags": + if err := awsAwsjson10_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentRecommendationList(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.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Recommendation + if *v == nil { + cv = []types.Recommendation{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Recommendation + destAddr := &col + if err := awsAwsjson10_deserializeDocumentRecommendation(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentRecommendationSummariesList(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 := awsAwsjson10_deserializeDocumentRecommendationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_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 "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 "group": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Group = ptr.String(jtv) + } + + case "recommendationCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RecommendationCount = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentRedshiftReservedInstances(v **types.RedshiftReservedInstances, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RedshiftReservedInstances + if *v == nil { + sv = &types.RedshiftReservedInstances{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configuration": + if err := awsAwsjson10_deserializeDocumentRedshiftReservedInstancesConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "costCalculation": + if err := awsAwsjson10_deserializeDocumentReservedInstancesCostCalculation(&sv.CostCalculation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentRedshiftReservedInstancesConfiguration(v **types.RedshiftReservedInstancesConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RedshiftReservedInstancesConfiguration + if *v == nil { + sv = &types.RedshiftReservedInstancesConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountScope": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AccountScope = ptr.String(jtv) + } + + case "currentGeneration": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CurrentGeneration = ptr.String(jtv) + } + + case "instanceFamily": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceFamily = ptr.String(jtv) + } + + case "instanceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceType = ptr.String(jtv) + } + + case "monthlyRecurringCost": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MonthlyRecurringCost = ptr.String(jtv) + } + + case "normalizedUnitsToPurchase": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NormalizedUnitsToPurchase = ptr.String(jtv) + } + + case "numberOfInstancesToPurchase": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NumberOfInstancesToPurchase = ptr.String(jtv) + } + + case "paymentOption": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PaymentOption = ptr.String(jtv) + } + + case "reservedInstancesRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ReservedInstancesRegion = ptr.String(jtv) + } + + case "service": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Service = ptr.String(jtv) + } + + case "sizeFlexEligible": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.SizeFlexEligible = ptr.Bool(jtv) + } + + case "term": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Term = ptr.String(jtv) + } + + case "upfrontCost": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UpfrontCost = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentReservedInstancesCostCalculation(v **types.ReservedInstancesCostCalculation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ReservedInstancesCostCalculation + if *v == nil { + sv = &types.ReservedInstancesCostCalculation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "pricing": + if err := awsAwsjson10_deserializeDocumentReservedInstancesPricing(&sv.Pricing, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentReservedInstancesPricing(v **types.ReservedInstancesPricing, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ReservedInstancesPricing + if *v == nil { + sv = &types.ReservedInstancesPricing{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "estimatedMonthlyAmortizedReservationCost": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedMonthlyAmortizedReservationCost = 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.EstimatedMonthlyAmortizedReservationCost = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "estimatedOnDemandCost": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedOnDemandCost = 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.EstimatedOnDemandCost = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "monthlyReservationEligibleCost": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.MonthlyReservationEligibleCost = 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.MonthlyReservationEligibleCost = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "savingsPercentage": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SavingsPercentage = 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.SavingsPercentage = 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 awsAwsjson10_deserializeDocumentResourceCostCalculation(v **types.ResourceCostCalculation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceCostCalculation + if *v == nil { + sv = &types.ResourceCostCalculation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "pricing": + if err := awsAwsjson10_deserializeDocumentResourcePricing(&sv.Pricing, value); err != nil { + return err + } + + case "usages": + if err := awsAwsjson10_deserializeDocumentUsageList(&sv.Usages, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentResourceDetails(v *types.ResourceDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.ResourceDetails +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "computeSavingsPlans": + var mv types.ComputeSavingsPlans + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentComputeSavingsPlans(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ResourceDetailsMemberComputeSavingsPlans{Value: mv} + break loop + + case "ebsVolume": + var mv types.EbsVolume + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentEbsVolume(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ResourceDetailsMemberEbsVolume{Value: mv} + break loop + + case "ec2AutoScalingGroup": + var mv types.Ec2AutoScalingGroup + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentEc2AutoScalingGroup(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ResourceDetailsMemberEc2AutoScalingGroup{Value: mv} + break loop + + case "ec2Instance": + var mv types.Ec2Instance + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentEc2Instance(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ResourceDetailsMemberEc2Instance{Value: mv} + break loop + + case "ec2InstanceSavingsPlans": + var mv types.Ec2InstanceSavingsPlans + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentEc2InstanceSavingsPlans(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ResourceDetailsMemberEc2InstanceSavingsPlans{Value: mv} + break loop + + case "ec2ReservedInstances": + var mv types.Ec2ReservedInstances + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentEc2ReservedInstances(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ResourceDetailsMemberEc2ReservedInstances{Value: mv} + break loop + + case "ecsService": + var mv types.EcsService + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentEcsService(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ResourceDetailsMemberEcsService{Value: mv} + break loop + + case "elastiCacheReservedInstances": + var mv types.ElastiCacheReservedInstances + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentElastiCacheReservedInstances(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ResourceDetailsMemberElastiCacheReservedInstances{Value: mv} + break loop + + case "lambdaFunction": + var mv types.LambdaFunction + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentLambdaFunction(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ResourceDetailsMemberLambdaFunction{Value: mv} + break loop + + case "openSearchReservedInstances": + var mv types.OpenSearchReservedInstances + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentOpenSearchReservedInstances(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ResourceDetailsMemberOpenSearchReservedInstances{Value: mv} + break loop + + case "rdsReservedInstances": + var mv types.RdsReservedInstances + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentRdsReservedInstances(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ResourceDetailsMemberRdsReservedInstances{Value: mv} + break loop + + case "redshiftReservedInstances": + var mv types.RedshiftReservedInstances + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentRedshiftReservedInstances(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ResourceDetailsMemberRedshiftReservedInstances{Value: mv} + break loop + + case "sageMakerSavingsPlans": + var mv types.SageMakerSavingsPlans + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentSageMakerSavingsPlans(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ResourceDetailsMemberSageMakerSavingsPlans{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsAwsjson10_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentResourcePricing(v **types.ResourcePricing, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourcePricing + if *v == nil { + sv = &types.ResourcePricing{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "estimatedCostAfterDiscounts": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedCostAfterDiscounts = 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.EstimatedCostAfterDiscounts = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "estimatedCostBeforeDiscounts": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedCostBeforeDiscounts = 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.EstimatedCostBeforeDiscounts = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "estimatedDiscounts": + if err := awsAwsjson10_deserializeDocumentEstimatedDiscounts(&sv.EstimatedDiscounts, value); err != nil { + return err + } + + case "estimatedNetUnusedAmortizedCommitments": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedNetUnusedAmortizedCommitments = 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.EstimatedNetUnusedAmortizedCommitments = 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 awsAwsjson10_deserializeDocumentSageMakerSavingsPlans(v **types.SageMakerSavingsPlans, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SageMakerSavingsPlans + if *v == nil { + sv = &types.SageMakerSavingsPlans{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configuration": + if err := awsAwsjson10_deserializeDocumentSageMakerSavingsPlansConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "costCalculation": + if err := awsAwsjson10_deserializeDocumentSavingsPlansCostCalculation(&sv.CostCalculation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentSageMakerSavingsPlansConfiguration(v **types.SageMakerSavingsPlansConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SageMakerSavingsPlansConfiguration + if *v == nil { + sv = &types.SageMakerSavingsPlansConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountScope": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AccountScope = ptr.String(jtv) + } + + case "hourlyCommitment": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.HourlyCommitment = ptr.String(jtv) + } + + case "paymentOption": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PaymentOption = ptr.String(jtv) + } + + case "term": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Term = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentSavingsPlansCostCalculation(v **types.SavingsPlansCostCalculation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SavingsPlansCostCalculation + if *v == nil { + sv = &types.SavingsPlansCostCalculation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "pricing": + if err := awsAwsjson10_deserializeDocumentSavingsPlansPricing(&sv.Pricing, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentSavingsPlansPricing(v **types.SavingsPlansPricing, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SavingsPlansPricing + if *v == nil { + sv = &types.SavingsPlansPricing{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "estimatedMonthlyCommitment": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedMonthlyCommitment = 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.EstimatedMonthlyCommitment = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "estimatedOnDemandCost": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedOnDemandCost = 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.EstimatedOnDemandCost = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "monthlySavingsPlansEligibleCost": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.MonthlySavingsPlansEligibleCost = 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.MonthlySavingsPlansEligibleCost = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "savingsPercentage": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SavingsPercentage = 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.SavingsPercentage = 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 awsAwsjson10_deserializeDocumentStorageConfiguration(v **types.StorageConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.StorageConfiguration + if *v == nil { + sv = &types.StorageConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "sizeInGb": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SizeInGb = 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.SizeInGb = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + 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 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 String 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 String to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Tag + if *v == nil { + cv = []types.Tag{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Tag + destAddr := &col + if err := awsAwsjson10_deserializeDocumentTag(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentUsage(v **types.Usage, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Usage + if *v == nil { + sv = &types.Usage{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "operation": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Operation = ptr.String(jtv) + } + + case "productCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ProductCode = ptr.String(jtv) + } + + case "unit": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Unit = ptr.String(jtv) + } + + case "usageAmount": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UsageAmount = 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.UsageAmount = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "usageType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UsageType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentUsageList(v *[]types.Usage, 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.Usage + if *v == nil { + cv = []types.Usage{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Usage + destAddr := &col + if err := awsAwsjson10_deserializeDocumentUsage(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fields": + if err := awsAwsjson10_deserializeDocumentValidationExceptionDetails(&sv.Fields, value); err != nil { + return err + } + + 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 "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.ValidationExceptionReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentValidationExceptionDetail(v **types.ValidationExceptionDetail, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationExceptionDetail + if *v == nil { + sv = &types.ValidationExceptionDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fieldName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FieldName = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentValidationExceptionDetails(v *[]types.ValidationExceptionDetail, 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.ValidationExceptionDetail + if *v == nil { + cv = []types.ValidationExceptionDetail{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionDetail + destAddr := &col + if err := awsAwsjson10_deserializeDocumentValidationExceptionDetail(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeOpDocumentGetPreferencesOutput(v **GetPreferencesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetPreferencesOutput + if *v == nil { + sv = &GetPreferencesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "memberAccountDiscountVisibility": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MemberAccountDiscountVisibility to be of type string, got %T instead", value) + } + sv.MemberAccountDiscountVisibility = types.MemberAccountDiscountVisibility(jtv) + } + + case "savingsEstimationMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SavingsEstimationMode to be of type string, got %T instead", value) + } + sv.SavingsEstimationMode = types.SavingsEstimationMode(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_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 "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AccountId = 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 = types.ActionType(jtv) + } + + case "costCalculationLookbackPeriodInDays": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.CostCalculationLookbackPeriodInDays = ptr.Int32(int32(i64)) + } + + case "currencyCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CurrencyCode = ptr.String(jtv) + } + + case "currentResourceDetails": + if err := awsAwsjson10_deserializeDocumentResourceDetails(&sv.CurrentResourceDetails, value); err != nil { + return err + } + + case "currentResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.CurrentResourceType = types.ResourceType(jtv) + } + + case "estimatedMonthlyCost": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedMonthlyCost = 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.EstimatedMonthlyCost = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + 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 "estimatedSavingsOverCostCalculationLookbackPeriod": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedSavingsOverCostCalculationLookbackPeriod = 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.EstimatedSavingsOverCostCalculationLookbackPeriod = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "estimatedSavingsPercentage": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedSavingsPercentage = 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.EstimatedSavingsPercentage = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "implementationEffort": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImplementationEffort to be of type string, got %T instead", value) + } + sv.ImplementationEffort = types.ImplementationEffort(jtv) + } + + case "lastRefreshTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastRefreshTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Datetime to be a JSON Number, got %T instead", value) + + } + } + + case "recommendationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RecommendationId = ptr.String(jtv) + } + + case "recommendationLookbackPeriodInDays": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RecommendationLookbackPeriodInDays = ptr.Int32(int32(i64)) + } + + case "recommendedResourceDetails": + if err := awsAwsjson10_deserializeDocumentResourceDetails(&sv.RecommendedResourceDetails, value); err != nil { + return err + } + + case "recommendedResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.RecommendedResourceType = types.ResourceType(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "resourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "restartNeeded": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.RestartNeeded = ptr.Bool(jtv) + } + + case "rollbackPossible": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.RollbackPossible = ptr.Bool(jtv) + } + + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Source to be of type string, got %T instead", value) + } + sv.Source = types.Source(jtv) + } + + case "tags": + if err := awsAwsjson10_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentListEnrollmentStatusesOutput(v **ListEnrollmentStatusesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListEnrollmentStatusesOutput + if *v == nil { + sv = &ListEnrollmentStatusesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsAwsjson10_deserializeDocumentAccountEnrollmentStatuses(&sv.Items, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_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 "items": + if err := awsAwsjson10_deserializeDocumentRecommendationList(&sv.Items, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentListRecommendationSummariesOutput(v **ListRecommendationSummariesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListRecommendationSummariesOutput + if *v == nil { + sv = &ListRecommendationSummariesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "currencyCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CurrencyCode = ptr.String(jtv) + } + + case "estimatedTotalDedupedSavings": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedTotalDedupedSavings = 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.EstimatedTotalDedupedSavings = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "groupBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.GroupBy = ptr.String(jtv) + } + + case "items": + if err := awsAwsjson10_deserializeDocumentRecommendationSummariesList(&sv.Items, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentUpdateEnrollmentStatusOutput(v **UpdateEnrollmentStatusOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateEnrollmentStatusOutput + if *v == nil { + sv = &UpdateEnrollmentStatusOutput{} + } 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 String to be of type string, got %T instead", value) + } + sv.Status = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentUpdatePreferencesOutput(v **UpdatePreferencesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdatePreferencesOutput + if *v == nil { + sv = &UpdatePreferencesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "memberAccountDiscountVisibility": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MemberAccountDiscountVisibility to be of type string, got %T instead", value) + } + sv.MemberAccountDiscountVisibility = types.MemberAccountDiscountVisibility(jtv) + } + + case "savingsEstimationMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SavingsEstimationMode to be of type string, got %T instead", value) + } + sv.SavingsEstimationMode = types.SavingsEstimationMode(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/costoptimizationhub/doc.go b/service/costoptimizationhub/doc.go new file mode 100644 index 00000000000..94816ea945b --- /dev/null +++ b/service/costoptimizationhub/doc.go @@ -0,0 +1,12 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package costoptimizationhub provides the API client, operations, and parameter +// types for Cost Optimization Hub. +// +// You can use the Cost Optimization Hub API to programmatically identify, filter, +// aggregate, and quantify savings for your cost optimization recommendations +// across multiple Amazon Web Services Regions and Amazon Web Services accounts in +// your organization. The Cost Optimization Hub API provides the following +// endpoint: +// - https://cost-optimization-hub.us-east-1.amazonaws.com +package costoptimizationhub diff --git a/service/costoptimizationhub/endpoints.go b/service/costoptimizationhub/endpoints.go new file mode 100644 index 00000000000..5b4f3ed2e12 --- /dev/null +++ b/service/costoptimizationhub/endpoints.go @@ -0,0 +1,509 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +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/costoptimizationhub/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 = "costoptimizationhubservice" + } + 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_COST_OPTIMIZATION_HUB") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "Cost Optimization Hub", 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://cost-optimization-hub-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://cost-optimization-hub-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://cost-optimization-hub.") + 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://cost-optimization-hub.") + 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/costoptimizationhub/endpoints_config_test.go b/service/costoptimizationhub/endpoints_config_test.go new file mode 100644 index 00000000000..68fd26e7b09 --- /dev/null +++ b/service/costoptimizationhub/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +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-cost-optimization-hub.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-cost-optimization-hub.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-cost-optimization-hub.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-cost-optimization-hub.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-cost-optimization-hub.dev", + expectURL: aws.String("https://env-cost-optimization-hub.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-cost-optimization-hub.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-cost-optimization-hub.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-cost-optimization-hub.dev", + expectURL: aws.String("http://config-cost-optimization-hub.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-cost-optimization-hub.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-cost-optimization-hub.dev", + clientEndpoint: aws.String("https://client-cost-optimization-hub.dev"), + expectURL: aws.String("https://client-cost-optimization-hub.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_COST_OPTIMIZATION_HUB", 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/costoptimizationhub/endpoints_test.go b/service/costoptimizationhub/endpoints_test.go new file mode 100644 index 00000000000..4cf7eedb8c5 --- /dev/null +++ b/service/costoptimizationhub/endpoints_test.go @@ -0,0 +1,856 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +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://cost-optimization-hub-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://cost-optimization-hub-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://cost-optimization-hub.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://cost-optimization-hub.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://cost-optimization-hub-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://cost-optimization-hub-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://cost-optimization-hub.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://cost-optimization-hub.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://cost-optimization-hub-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://cost-optimization-hub-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://cost-optimization-hub.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://cost-optimization-hub.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://cost-optimization-hub-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://cost-optimization-hub.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://cost-optimization-hub-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://cost-optimization-hub.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/costoptimizationhub/generated.json b/service/costoptimizationhub/generated.json new file mode 100644 index 00000000000..ca1d245749d --- /dev/null +++ b/service/costoptimizationhub/generated.json @@ -0,0 +1,40 @@ +{ + "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_GetPreferences.go", + "api_op_GetRecommendation.go", + "api_op_ListEnrollmentStatuses.go", + "api_op_ListRecommendationSummaries.go", + "api_op_ListRecommendations.go", + "api_op_UpdateEnrollmentStatus.go", + "api_op_UpdatePreferences.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", + "types/types_exported_test.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/costoptimizationhub", + "unstable": false +} diff --git a/service/costoptimizationhub/go.mod b/service/costoptimizationhub/go.mod new file mode 100644 index 00000000000..6ca25f082f0 --- /dev/null +++ b/service/costoptimizationhub/go.mod @@ -0,0 +1,17 @@ +module github.com/aws/aws-sdk-go-v2/service/costoptimizationhub + +go 1.19 + +require ( + github.com/aws/aws-sdk-go-v2 v1.23.1 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4 + 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/costoptimizationhub/go.sum b/service/costoptimizationhub/go.sum new file mode 100644 index 00000000000..42e4fc806b4 --- /dev/null +++ b/service/costoptimizationhub/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/costoptimizationhub/go_module_metadata.go b/service/costoptimizationhub/go_module_metadata.go new file mode 100644 index 00000000000..b78c5286f68 --- /dev/null +++ b/service/costoptimizationhub/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package costoptimizationhub + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/costoptimizationhub/internal/endpoints/endpoints.go b/service/costoptimizationhub/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..47565bacbf0 --- /dev/null +++ b/service/costoptimizationhub/internal/endpoints/endpoints.go @@ -0,0 +1,306 @@ +// 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 Cost Optimization Hub 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: "cost-optimization-hub.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cost-optimization-hub-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cost-optimization-hub-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cost-optimization-hub.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{ + Hostname: "cost-optimization-hub.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + }, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cost-optimization-hub.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cost-optimization-hub-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cost-optimization-hub-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cost-optimization-hub.{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: "cost-optimization-hub-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cost-optimization-hub.{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: "cost-optimization-hub-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cost-optimization-hub.{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: "cost-optimization-hub-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cost-optimization-hub.{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: "cost-optimization-hub-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cost-optimization-hub.{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: "cost-optimization-hub.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cost-optimization-hub-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cost-optimization-hub-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cost-optimization-hub.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/costoptimizationhub/internal/endpoints/endpoints_test.go b/service/costoptimizationhub/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/costoptimizationhub/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/costoptimizationhub/options.go b/service/costoptimizationhub/options.go new file mode 100644 index 00000000000..5b9b16540f9 --- /dev/null +++ b/service/costoptimizationhub/options.go @@ -0,0 +1,219 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +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/costoptimizationhub/protocol_test.go b/service/costoptimizationhub/protocol_test.go new file mode 100644 index 00000000000..681368d489a --- /dev/null +++ b/service/costoptimizationhub/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub diff --git a/service/costoptimizationhub/serializers.go b/service/costoptimizationhub/serializers.go new file mode 100644 index 00000000000..038fb6a7007 --- /dev/null +++ b/service/costoptimizationhub/serializers.go @@ -0,0 +1,760 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/costoptimizationhub/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "path" +) + +type awsAwsjson10_serializeOpGetPreferences struct { +} + +func (*awsAwsjson10_serializeOpGetPreferences) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetPreferences) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetPreferencesInput) + _ = 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("CostOptimizationHubService.GetPreferences") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetPreferencesInput(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_serializeOpGetRecommendation struct { +} + +func (*awsAwsjson10_serializeOpGetRecommendation) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_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)} + } + + 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("CostOptimizationHubService.GetRecommendation") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetRecommendationInput(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_serializeOpListEnrollmentStatuses struct { +} + +func (*awsAwsjson10_serializeOpListEnrollmentStatuses) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListEnrollmentStatuses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListEnrollmentStatusesInput) + _ = 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("CostOptimizationHubService.ListEnrollmentStatuses") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListEnrollmentStatusesInput(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_serializeOpListRecommendations struct { +} + +func (*awsAwsjson10_serializeOpListRecommendations) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_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)} + } + + 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("CostOptimizationHubService.ListRecommendations") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListRecommendationsInput(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_serializeOpListRecommendationSummaries struct { +} + +func (*awsAwsjson10_serializeOpListRecommendationSummaries) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListRecommendationSummaries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListRecommendationSummariesInput) + _ = 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("CostOptimizationHubService.ListRecommendationSummaries") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListRecommendationSummariesInput(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_serializeOpUpdateEnrollmentStatus struct { +} + +func (*awsAwsjson10_serializeOpUpdateEnrollmentStatus) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdateEnrollmentStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateEnrollmentStatusInput) + _ = 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("CostOptimizationHubService.UpdateEnrollmentStatus") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdateEnrollmentStatusInput(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_serializeOpUpdatePreferences struct { +} + +func (*awsAwsjson10_serializeOpUpdatePreferences) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdatePreferences) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdatePreferencesInput) + _ = 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("CostOptimizationHubService.UpdatePreferences") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdatePreferencesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsAwsjson10_serializeDocumentAccountIdList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson10_serializeDocumentActionTypeList(v []types.ActionType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsAwsjson10_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountIds != nil { + ok := object.Key("accountIds") + if err := awsAwsjson10_serializeDocumentAccountIdList(v.AccountIds, ok); err != nil { + return err + } + } + + if v.ActionTypes != nil { + ok := object.Key("actionTypes") + if err := awsAwsjson10_serializeDocumentActionTypeList(v.ActionTypes, ok); err != nil { + return err + } + } + + if v.ImplementationEfforts != nil { + ok := object.Key("implementationEfforts") + if err := awsAwsjson10_serializeDocumentImplementationEffortList(v.ImplementationEfforts, ok); err != nil { + return err + } + } + + if v.RecommendationIds != nil { + ok := object.Key("recommendationIds") + if err := awsAwsjson10_serializeDocumentRecommendationIdList(v.RecommendationIds, ok); err != nil { + return err + } + } + + if v.Regions != nil { + ok := object.Key("regions") + if err := awsAwsjson10_serializeDocumentRegionList(v.Regions, ok); err != nil { + return err + } + } + + if v.ResourceArns != nil { + ok := object.Key("resourceArns") + if err := awsAwsjson10_serializeDocumentResourceArnList(v.ResourceArns, ok); err != nil { + return err + } + } + + if v.ResourceIds != nil { + ok := object.Key("resourceIds") + if err := awsAwsjson10_serializeDocumentResourceIdList(v.ResourceIds, ok); err != nil { + return err + } + } + + if v.ResourceTypes != nil { + ok := object.Key("resourceTypes") + if err := awsAwsjson10_serializeDocumentResourceTypeList(v.ResourceTypes, ok); err != nil { + return err + } + } + + if v.RestartNeeded != nil { + ok := object.Key("restartNeeded") + ok.Boolean(*v.RestartNeeded) + } + + if v.RollbackPossible != nil { + ok := object.Key("rollbackPossible") + ok.Boolean(*v.RollbackPossible) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsAwsjson10_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeDocumentImplementationEffortList(v []types.ImplementationEffort, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsAwsjson10_serializeDocumentOrderBy(v *types.OrderBy, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Dimension != nil { + ok := object.Key("dimension") + ok.String(*v.Dimension) + } + + if len(v.Order) > 0 { + ok := object.Key("order") + ok.String(string(v.Order)) + } + + return nil +} + +func awsAwsjson10_serializeDocumentRecommendationIdList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson10_serializeDocumentRegionList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson10_serializeDocumentResourceArnList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson10_serializeDocumentResourceIdList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson10_serializeDocumentResourceTypeList(v []types.ResourceType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsAwsjson10_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("value") + ok.String(*v.Value) + } + + return nil +} + +func awsAwsjson10_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentTag(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeOpDocumentGetPreferencesInput(v *GetPreferencesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + return nil +} + +func awsAwsjson10_serializeOpDocumentGetRecommendationInput(v *GetRecommendationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RecommendationId != nil { + ok := object.Key("recommendationId") + ok.String(*v.RecommendationId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentListEnrollmentStatusesInput(v *ListEnrollmentStatusesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountId != nil { + ok := object.Key("accountId") + ok.String(*v.AccountId) + } + + if v.IncludeOrganizationInfo { + ok := object.Key("includeOrganizationInfo") + ok.Boolean(v.IncludeOrganizationInfo) + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentListRecommendationsInput(v *ListRecommendationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filter != nil { + ok := object.Key("filter") + if err := awsAwsjson10_serializeDocumentFilter(v.Filter, ok); err != nil { + return err + } + } + + if v.IncludeAllRecommendations { + ok := object.Key("includeAllRecommendations") + ok.Boolean(v.IncludeAllRecommendations) + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.OrderBy != nil { + ok := object.Key("orderBy") + if err := awsAwsjson10_serializeDocumentOrderBy(v.OrderBy, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentListRecommendationSummariesInput(v *ListRecommendationSummariesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filter != nil { + ok := object.Key("filter") + if err := awsAwsjson10_serializeDocumentFilter(v.Filter, ok); err != nil { + return err + } + } + + if v.GroupBy != nil { + ok := object.Key("groupBy") + ok.String(*v.GroupBy) + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentUpdateEnrollmentStatusInput(v *UpdateEnrollmentStatusInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IncludeMemberAccounts != nil { + ok := object.Key("includeMemberAccounts") + ok.Boolean(*v.IncludeMemberAccounts) + } + + if len(v.Status) > 0 { + ok := object.Key("status") + ok.String(string(v.Status)) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentUpdatePreferencesInput(v *UpdatePreferencesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.MemberAccountDiscountVisibility) > 0 { + ok := object.Key("memberAccountDiscountVisibility") + ok.String(string(v.MemberAccountDiscountVisibility)) + } + + if len(v.SavingsEstimationMode) > 0 { + ok := object.Key("savingsEstimationMode") + ok.String(string(v.SavingsEstimationMode)) + } + + return nil +} diff --git a/service/costoptimizationhub/types/enums.go b/service/costoptimizationhub/types/enums.go new file mode 100644 index 00000000000..8803ad57c10 --- /dev/null +++ b/service/costoptimizationhub/types/enums.go @@ -0,0 +1,202 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type ActionType string + +// Enum values for ActionType +const ( + ActionTypeRightsize ActionType = "Rightsize" + ActionTypeStop ActionType = "Stop" + ActionTypeUpgrade ActionType = "Upgrade" + ActionTypePurchaseSavingsPlans ActionType = "PurchaseSavingsPlans" + ActionTypePurchaseReservedInstances ActionType = "PurchaseReservedInstances" + ActionTypeMigrateToGraviton ActionType = "MigrateToGraviton" +) + +// Values returns all known values for ActionType. 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 (ActionType) Values() []ActionType { + return []ActionType{ + "Rightsize", + "Stop", + "Upgrade", + "PurchaseSavingsPlans", + "PurchaseReservedInstances", + "MigrateToGraviton", + } +} + +type EnrollmentStatus string + +// Enum values for EnrollmentStatus +const ( + EnrollmentStatusActive EnrollmentStatus = "Active" + EnrollmentStatusInactive EnrollmentStatus = "Inactive" +) + +// Values returns all known values for EnrollmentStatus. 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 (EnrollmentStatus) Values() []EnrollmentStatus { + return []EnrollmentStatus{ + "Active", + "Inactive", + } +} + +type ImplementationEffort string + +// Enum values for ImplementationEffort +const ( + ImplementationEffortVeryLow ImplementationEffort = "VeryLow" + ImplementationEffortLow ImplementationEffort = "Low" + ImplementationEffortMedium ImplementationEffort = "Medium" + ImplementationEffortHigh ImplementationEffort = "High" + ImplementationEffortVeryHigh ImplementationEffort = "VeryHigh" +) + +// Values returns all known values for ImplementationEffort. 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 (ImplementationEffort) Values() []ImplementationEffort { + return []ImplementationEffort{ + "VeryLow", + "Low", + "Medium", + "High", + "VeryHigh", + } +} + +type MemberAccountDiscountVisibility string + +// Enum values for MemberAccountDiscountVisibility +const ( + MemberAccountDiscountVisibilityAll MemberAccountDiscountVisibility = "All" + MemberAccountDiscountVisibilityNone MemberAccountDiscountVisibility = "None" +) + +// Values returns all known values for MemberAccountDiscountVisibility. 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 (MemberAccountDiscountVisibility) Values() []MemberAccountDiscountVisibility { + return []MemberAccountDiscountVisibility{ + "All", + "None", + } +} + +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 ResourceType string + +// Enum values for ResourceType +const ( + ResourceTypeEc2Instance ResourceType = "Ec2Instance" + ResourceTypeLambdaFunction ResourceType = "LambdaFunction" + ResourceTypeEbsVolume ResourceType = "EbsVolume" + ResourceTypeEcsService ResourceType = "EcsService" + ResourceTypeEc2AutoScalingGroup ResourceType = "Ec2AutoScalingGroup" + ResourceTypeEc2InstanceSavingsPlans ResourceType = "Ec2InstanceSavingsPlans" + ResourceTypeComputeSavingsPlans ResourceType = "ComputeSavingsPlans" + ResourceTypeSageMakerSavingsPlans ResourceType = "SageMakerSavingsPlans" + ResourceTypeEc2ReservedInstances ResourceType = "Ec2ReservedInstances" + ResourceTypeRdsReservedInstances ResourceType = "RdsReservedInstances" + ResourceTypeOpenSearchReservedInstances ResourceType = "OpenSearchReservedInstances" + ResourceTypeRedshiftReservedInstances ResourceType = "RedshiftReservedInstances" + ResourceTypeElastiCacheReservedInstances ResourceType = "ElastiCacheReservedInstances" +) + +// Values returns all known values for ResourceType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (ResourceType) Values() []ResourceType { + return []ResourceType{ + "Ec2Instance", + "LambdaFunction", + "EbsVolume", + "EcsService", + "Ec2AutoScalingGroup", + "Ec2InstanceSavingsPlans", + "ComputeSavingsPlans", + "SageMakerSavingsPlans", + "Ec2ReservedInstances", + "RdsReservedInstances", + "OpenSearchReservedInstances", + "RedshiftReservedInstances", + "ElastiCacheReservedInstances", + } +} + +type SavingsEstimationMode string + +// Enum values for SavingsEstimationMode +const ( + SavingsEstimationModeBeforeDiscounts SavingsEstimationMode = "BeforeDiscounts" + SavingsEstimationModeAfterDiscounts SavingsEstimationMode = "AfterDiscounts" +) + +// Values returns all known values for SavingsEstimationMode. 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 (SavingsEstimationMode) Values() []SavingsEstimationMode { + return []SavingsEstimationMode{ + "BeforeDiscounts", + "AfterDiscounts", + } +} + +type Source string + +// Enum values for Source +const ( + SourceComputeOptimizer Source = "ComputeOptimizer" + SourceCostExplorer Source = "CostExplorer" +) + +// Values returns all known values for Source. 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 (Source) Values() []Source { + return []Source{ + "ComputeOptimizer", + "CostExplorer", + } +} + +type ValidationExceptionReason string + +// Enum values for ValidationExceptionReason +const ( + ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "FieldValidationFailed" + ValidationExceptionReasonOther ValidationExceptionReason = "Other" +) + +// Values returns all known values for ValidationExceptionReason. 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 (ValidationExceptionReason) Values() []ValidationExceptionReason { + return []ValidationExceptionReason{ + "FieldValidationFailed", + "Other", + } +} diff --git a/service/costoptimizationhub/types/errors.go b/service/costoptimizationhub/types/errors.go new file mode 100644 index 00000000000..3845e69a38a --- /dev/null +++ b/service/costoptimizationhub/types/errors.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// You are not authorized to use this operation with the given parameters. +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 } + +// An error on the server occurred during the processing of your request. 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 specified Amazon Resource Name (ARN) in the request doesn't exist. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *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 } + +// 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 input fails to satisfy the constraints specified by an Amazon Web Services +// service. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + Reason ValidationExceptionReason + Fields []ValidationExceptionDetail + + 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/costoptimizationhub/types/types.go b/service/costoptimizationhub/types/types.go new file mode 100644 index 00000000000..bfb33f4fa02 --- /dev/null +++ b/service/costoptimizationhub/types/types.go @@ -0,0 +1,1050 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// Describes the enrollment status of an organization's member accounts in Cost +// Optimization Hub. +type AccountEnrollmentStatus struct { + + // The Amazon Web Services account ID. + AccountId *string + + // The time when the account enrollment status was created. + CreatedTimestamp *time.Time + + // The time when the account enrollment status was last updated. + LastUpdatedTimestamp *time.Time + + // The account enrollment status. + Status EnrollmentStatus + + noSmithyDocumentSerde +} + +// Describes the Amazon Elastic Block Store performance configuration of the +// current and recommended resource configuration for a recommendation. +type BlockStoragePerformanceConfiguration struct { + + // The number of I/O operations per second. + Iops *float64 + + // The throughput that the volume supports. + Throughput *float64 + + noSmithyDocumentSerde +} + +// Describes the performance configuration for compute services such as Amazon +// EC2, Lambda, and ECS. +type ComputeConfiguration struct { + + // The architecture of the resource. + Architecture *string + + // The memory size of the resource. + MemorySizeInMB *int32 + + // The platform of the resource. The platform is the specific combination of + // operating system, license model, and software on an instance. + Platform *string + + // The number of vCPU cores in the resource. + VCpu *float64 + + noSmithyDocumentSerde +} + +// The Compute Savings Plans recommendation details. +type ComputeSavingsPlans struct { + + // Configuration details of the Compute Savings Plans to purchase. + Configuration *ComputeSavingsPlansConfiguration + + // Cost impact of the Savings Plans purchase recommendation. + CostCalculation *SavingsPlansCostCalculation + + noSmithyDocumentSerde +} + +// The Compute Savings Plans configuration used for recommendations. +type ComputeSavingsPlansConfiguration struct { + + // The account scope that you want your recommendations for. Amazon Web Services + // calculates recommendations including the management account and member accounts + // if the value is set to PAYER . If the value is LINKED , recommendations are + // calculated for individual member accounts only. + AccountScope *string + + // The hourly commitment for the Savings Plans type. + HourlyCommitment *string + + // The payment option for the commitment. + PaymentOption *string + + // The Savings Plans recommendation term in years. + Term *string + + noSmithyDocumentSerde +} + +// Describes the Amazon Elastic Block Store volume configuration of the current +// and recommended resource configuration for a recommendation. +type EbsVolume struct { + + // The Amazon Elastic Block Store volume configuration used for recommendations. + Configuration *EbsVolumeConfiguration + + // Cost impact of the recommendation. + CostCalculation *ResourceCostCalculation + + noSmithyDocumentSerde +} + +// The Amazon Elastic Block Store volume configuration used for recommendations. +type EbsVolumeConfiguration struct { + + // The Amazon Elastic Block Store attachment state. + AttachmentState *string + + // The Amazon Elastic Block Store performance configuration. + Performance *BlockStoragePerformanceConfiguration + + // The disk storage of the Amazon Elastic Block Store volume. + Storage *StorageConfiguration + + noSmithyDocumentSerde +} + +// The EC2 Auto Scaling group recommendation details. +type Ec2AutoScalingGroup struct { + + // The EC2 Auto Scaling group configuration used for recommendations. + Configuration *Ec2AutoScalingGroupConfiguration + + // Cost impact of the recommendation. + CostCalculation *ResourceCostCalculation + + noSmithyDocumentSerde +} + +// The EC2 auto scaling group configuration used for recommendations. +type Ec2AutoScalingGroupConfiguration struct { + + // Details about the instance. + Instance *InstanceConfiguration + + noSmithyDocumentSerde +} + +// Describes the EC2 instance configuration of the current and recommended +// resource configuration for a recommendation. +type Ec2Instance struct { + + // The EC2 instance configuration used for recommendations. + Configuration *Ec2InstanceConfiguration + + // Cost impact of the recommendation. + CostCalculation *ResourceCostCalculation + + noSmithyDocumentSerde +} + +// The EC2 instance configuration used for recommendations. +type Ec2InstanceConfiguration struct { + + // Details about the instance. + Instance *InstanceConfiguration + + noSmithyDocumentSerde +} + +// The EC2 instance Savings Plans recommendation details. +type Ec2InstanceSavingsPlans struct { + + // The EC2 instance Savings Plans configuration used for recommendations. + Configuration *Ec2InstanceSavingsPlansConfiguration + + // Cost impact of the Savings Plans purchase recommendation. + CostCalculation *SavingsPlansCostCalculation + + noSmithyDocumentSerde +} + +// The EC2 instance Savings Plans configuration used for recommendations. +type Ec2InstanceSavingsPlansConfiguration struct { + + // The account scope that you want your recommendations for. + AccountScope *string + + // The hourly commitment for the Savings Plans type. + HourlyCommitment *string + + // The instance family of the recommended Savings Plan. + InstanceFamily *string + + // The payment option for the commitment. + PaymentOption *string + + // The Amazon Web Services Region of the commitment. + SavingsPlansRegion *string + + // The Savings Plans recommendation term in years. + Term *string + + noSmithyDocumentSerde +} + +// The EC2 reserved instances recommendation details. +type Ec2ReservedInstances struct { + + // The EC2 reserved instances configuration used for recommendations. + Configuration *Ec2ReservedInstancesConfiguration + + // Cost impact of the purchase recommendation. + CostCalculation *ReservedInstancesCostCalculation + + noSmithyDocumentSerde +} + +// The EC2 reserved instances configuration used for recommendations. +type Ec2ReservedInstancesConfiguration struct { + + // The account scope that you want your recommendations for. + AccountScope *string + + // Determines whether the recommendation is for a current generation instance. + CurrentGeneration *string + + // The instance family of the recommended reservation. + InstanceFamily *string + + // The type of instance that Amazon Web Services recommends. + InstanceType *string + + // How much purchasing reserved instances costs you on a monthly basis. + MonthlyRecurringCost *string + + // The number of normalized units that Amazon Web Services recommends that you + // purchase. + NormalizedUnitsToPurchase *string + + // The number of instances that Amazon Web Services recommends that you purchase. + NumberOfInstancesToPurchase *string + + // Indicates whether the recommendation is for standard or convertible + // reservations. + OfferingClass *string + + // The payment option for the commitment. + PaymentOption *string + + // The platform of the recommended reservation. The platform is the specific + // combination of operating system, license model, and software on an instance. + Platform *string + + // The Amazon Web Services Region of the commitment. + ReservedInstancesRegion *string + + // The service that you want your recommendations for. + Service *string + + // Determines whether the recommendation is size flexible. + SizeFlexEligible *bool + + // Determines whether the recommended reservation is dedicated or shared. + Tenancy *string + + // The reserved instances recommendation term in years. + Term *string + + // How much purchasing this instance costs you upfront. + UpfrontCost *string + + noSmithyDocumentSerde +} + +// The ECS service recommendation details. +type EcsService struct { + + // The ECS service configuration used for recommendations. + Configuration *EcsServiceConfiguration + + // Cost impact of the recommendation. + CostCalculation *ResourceCostCalculation + + noSmithyDocumentSerde +} + +// The ECS service configuration used for recommendations. +type EcsServiceConfiguration struct { + + // Details about the compute configuration. + Compute *ComputeConfiguration + + noSmithyDocumentSerde +} + +// The ElastiCache reserved instances recommendation details. +type ElastiCacheReservedInstances struct { + + // The ElastiCache reserved instances configuration used for recommendations. + Configuration *ElastiCacheReservedInstancesConfiguration + + // Cost impact of the purchase recommendation. + CostCalculation *ReservedInstancesCostCalculation + + noSmithyDocumentSerde +} + +// The ElastiCache reserved instances configuration used for recommendations. +type ElastiCacheReservedInstancesConfiguration struct { + + // The account scope that you want your recommendations for. + AccountScope *string + + // Determines whether the recommendation is for a current generation instance. + CurrentGeneration *string + + // The instance family of the recommended reservation. + InstanceFamily *string + + // The type of instance that Amazon Web Services recommends. + InstanceType *string + + // How much purchasing reserved instances costs you on a monthly basis. + MonthlyRecurringCost *string + + // The number of normalized units that Amazon Web Services recommends that you + // purchase. + NormalizedUnitsToPurchase *string + + // The number of instances that Amazon Web Services recommends that you purchase. + NumberOfInstancesToPurchase *string + + // The payment option for the commitment. + PaymentOption *string + + // The Amazon Web Services Region of the commitment. + ReservedInstancesRegion *string + + // The service that you want your recommendations for. + Service *string + + // Determines whether the recommendation is size flexible. + SizeFlexEligible *bool + + // The reserved instances recommendation term in years. + Term *string + + // How much purchasing this instance costs you upfront. + UpfrontCost *string + + noSmithyDocumentSerde +} + +// Estimated discount details of the current and recommended resource +// configuration for a recommendation. +type EstimatedDiscounts struct { + + // Estimated other discounts include all discounts that are not itemized. Itemized + // discounts include reservedInstanceDiscount and savingsPlansDiscount . + OtherDiscount *float64 + + // Estimated reserved instance discounts. + ReservedInstancesDiscount *float64 + + // Estimated Savings Plans discounts. + SavingsPlansDiscount *float64 + + noSmithyDocumentSerde +} + +// Describes a filter that returns a more specific list of recommendations. +// Filters recommendations by different dimensions. +type Filter struct { + + // The account that the recommendation is for. + AccountIds []string + + // The type of action you can take by adopting the recommendation. + ActionTypes []ActionType + + // The effort required to implement the recommendation. + ImplementationEfforts []ImplementationEffort + + // The IDs for the recommendations. + RecommendationIds []string + + // The Amazon Web Services Region of the resource. + Regions []string + + // The Amazon Resource Name (ARN) of the recommendation. + ResourceArns []string + + // The resource ID of the recommendation. + ResourceIds []string + + // The resource type of the recommendation. + ResourceTypes []ResourceType + + // Whether or not implementing the recommendation requires a restart. + RestartNeeded *bool + + // Whether or not implementing the recommendation can be rolled back. + RollbackPossible *bool + + // A list of tags assigned to the recommendation. + Tags []Tag + + noSmithyDocumentSerde +} + +// The Instance configuration used for recommendations. +type InstanceConfiguration struct { + + // Details about the type. + Type *string + + noSmithyDocumentSerde +} + +// The Lambda function recommendation details. +type LambdaFunction struct { + + // The Lambda function configuration used for recommendations. + Configuration *LambdaFunctionConfiguration + + // Cost impact of the recommendation. + CostCalculation *ResourceCostCalculation + + noSmithyDocumentSerde +} + +// The Lambda function configuration used for recommendations. +type LambdaFunctionConfiguration struct { + + // Details about the compute configuration. + Compute *ComputeConfiguration + + noSmithyDocumentSerde +} + +// The OpenSearch reserved instances recommendation details. +type OpenSearchReservedInstances struct { + + // The OpenSearch reserved instances configuration used for recommendations. + Configuration *OpenSearchReservedInstancesConfiguration + + // Cost impact of the purchase recommendation. + CostCalculation *ReservedInstancesCostCalculation + + noSmithyDocumentSerde +} + +// The OpenSearch reserved instances configuration used for recommendations. +type OpenSearchReservedInstancesConfiguration struct { + + // The account scope that you want your recommendations for. + AccountScope *string + + // Determines whether the recommendation is for a current generation instance. + CurrentGeneration *string + + // The type of instance that Amazon Web Services recommends. + InstanceType *string + + // How much purchasing reserved instances costs you on a monthly basis. + MonthlyRecurringCost *string + + // The number of normalized units that Amazon Web Services recommends that you + // purchase. + NormalizedUnitsToPurchase *string + + // The number of instances that Amazon Web Services recommends that you purchase. + NumberOfInstancesToPurchase *string + + // The payment option for the commitment. + PaymentOption *string + + // The Amazon Web Services Region of the commitment. + ReservedInstancesRegion *string + + // The service that you want your recommendations for. + Service *string + + // Determines whether the recommendation is size flexible. + SizeFlexEligible *bool + + // The reserved instances recommendation term in years. + Term *string + + // How much purchasing this instance costs you upfront. + UpfrontCost *string + + noSmithyDocumentSerde +} + +// Defines how rows will be sorted in the response. +type OrderBy struct { + + // Sorts by dimension values. + Dimension *string + + // The order that's used to sort the data. + Order Order + + noSmithyDocumentSerde +} + +// The RDS reserved instances recommendation details. +type RdsReservedInstances struct { + + // The RDS reserved instances configuration used for recommendations. + Configuration *RdsReservedInstancesConfiguration + + // Cost impact of the purchase recommendation. + CostCalculation *ReservedInstancesCostCalculation + + noSmithyDocumentSerde +} + +// The RDS reserved instances configuration used for recommendations. +type RdsReservedInstancesConfiguration struct { + + // The account scope that you want your recommendations for. + AccountScope *string + + // Determines whether the recommendation is for a current generation instance. + CurrentGeneration *string + + // The database edition that the recommended reservation supports. + DatabaseEdition *string + + // The database engine that the recommended reservation supports. + DatabaseEngine *string + + // Determines whether the recommendation is for a reservation in a single + // Availability Zone or a reservation with a backup in a second Availability Zone. + DeploymentOption *string + + // The instance family of the recommended reservation. + InstanceFamily *string + + // The type of instance that Amazon Web Services recommends. + InstanceType *string + + // The license model that the recommended reservation supports. + LicenseModel *string + + // How much purchasing this instance costs you on a monthly basis. + MonthlyRecurringCost *string + + // The number of normalized units that Amazon Web Services recommends that you + // purchase. + NormalizedUnitsToPurchase *string + + // The number of instances that Amazon Web Services recommends that you purchase. + NumberOfInstancesToPurchase *string + + // The payment option for the commitment. + PaymentOption *string + + // The Amazon Web Services Region of the commitment. + ReservedInstancesRegion *string + + // The service that you want your recommendations for. + Service *string + + // Determines whether the recommendation is size flexible. + SizeFlexEligible *bool + + // The reserved instances recommendation term in years. + Term *string + + // How much purchasing this instance costs you upfront. + UpfrontCost *string + + noSmithyDocumentSerde +} + +// Describes a recommendation. +type Recommendation struct { + + // The account that the recommendation is for. + AccountId *string + + // The type of tasks that can be carried out by this action. + ActionType *string + + // The currency code used for the recommendation. + CurrencyCode *string + + // Describes the current resource. + CurrentResourceSummary *string + + // The current resource type. + CurrentResourceType *string + + // The estimated monthly cost for the recommendation. + EstimatedMonthlyCost *float64 + + // The estimated monthly savings amount for the recommendation. + EstimatedMonthlySavings *float64 + + // The estimated savings percentage relative to the total cost over the cost + // calculation lookback period. + EstimatedSavingsPercentage *float64 + + // The effort required to implement the recommendation. + ImplementationEffort *string + + // The time when the recommendation was last generated. + LastRefreshTimestamp *time.Time + + // The ID for the recommendation. + RecommendationId *string + + // The lookback period that's used to generate the recommendation. + RecommendationLookbackPeriodInDays *int32 + + // Describes the recommended resource. + RecommendedResourceSummary *string + + // The recommended resource type. + RecommendedResourceType *string + + // The Amazon Web Services Region of the resource. + Region *string + + // The Amazon Resource Name (ARN) for the recommendation. + ResourceArn *string + + // The resource ID for the recommendation. + ResourceId *string + + // Whether or not implementing the recommendation requires a restart. + RestartNeeded *bool + + // Whether or not implementing the recommendation can be rolled back. + RollbackPossible *bool + + // The source of the recommendation. + Source Source + + // A list of tags assigned to the recommendation. + Tags []Tag + + noSmithyDocumentSerde +} + +// The summary of rightsizing recommendations, including de-duped savings from all +// types of recommendations. +type RecommendationSummary struct { + + // The estimated total savings resulting from modifications, on a monthly basis. + EstimatedMonthlySavings *float64 + + // The grouping of recommendations. + Group *string + + // The total number of instance recommendations. + RecommendationCount *int32 + + noSmithyDocumentSerde +} + +// The Redshift reserved instances recommendation details. +type RedshiftReservedInstances struct { + + // The Redshift reserved instances configuration used for recommendations. + Configuration *RedshiftReservedInstancesConfiguration + + // Cost impact of the purchase recommendation. + CostCalculation *ReservedInstancesCostCalculation + + noSmithyDocumentSerde +} + +// The Redshift reserved instances configuration used for recommendations. +type RedshiftReservedInstancesConfiguration struct { + + // The account scope that you want your recommendations for. + AccountScope *string + + // Determines whether the recommendation is for a current generation instance. + CurrentGeneration *string + + // The instance family of the recommended reservation. + InstanceFamily *string + + // The type of instance that Amazon Web Services recommends. + InstanceType *string + + // How much purchasing reserved instances costs you on a monthly basis. + MonthlyRecurringCost *string + + // The number of normalized units that Amazon Web Services recommends that you + // purchase. + NormalizedUnitsToPurchase *string + + // The number of instances that Amazon Web Services recommends that you purchase. + NumberOfInstancesToPurchase *string + + // The payment option for the commitment. + PaymentOption *string + + // The Amazon Web Services Region of the commitment. + ReservedInstancesRegion *string + + // The service that you want your recommendations for. + Service *string + + // Determines whether the recommendation is size flexible. + SizeFlexEligible *bool + + // The reserved instances recommendation term in years. + Term *string + + // How much purchasing this instance costs you upfront. + UpfrontCost *string + + noSmithyDocumentSerde +} + +// Cost impact of the purchase recommendation. +type ReservedInstancesCostCalculation struct { + + // Pricing details of the purchase recommendation. + Pricing *ReservedInstancesPricing + + noSmithyDocumentSerde +} + +// Pricing details for your recommended reserved instance. +type ReservedInstancesPricing struct { + + // The estimated cost of your recurring monthly fees for the recommended reserved + // instance across the month. + EstimatedMonthlyAmortizedReservationCost *float64 + + // The remaining On-Demand cost estimated to not be covered by the recommended + // reserved instance, over the length of the lookback period. + EstimatedOnDemandCost *float64 + + // The cost of paying for the recommended reserved instance monthly. + MonthlyReservationEligibleCost *float64 + + // The savings percentage relative to the total On-Demand costs that are + // associated with this instance. + SavingsPercentage *float64 + + noSmithyDocumentSerde +} + +// Cost impact of the resource recommendation. +type ResourceCostCalculation struct { + + // Pricing details of the resource recommendation. + Pricing *ResourcePricing + + // Usage details of the resource recommendation. + Usages []Usage + + noSmithyDocumentSerde +} + +// Contains detailed information about the specified resource. +// +// The following types satisfy this interface: +// +// ResourceDetailsMemberComputeSavingsPlans +// ResourceDetailsMemberEbsVolume +// ResourceDetailsMemberEc2AutoScalingGroup +// ResourceDetailsMemberEc2Instance +// ResourceDetailsMemberEc2InstanceSavingsPlans +// ResourceDetailsMemberEc2ReservedInstances +// ResourceDetailsMemberEcsService +// ResourceDetailsMemberElastiCacheReservedInstances +// ResourceDetailsMemberLambdaFunction +// ResourceDetailsMemberOpenSearchReservedInstances +// ResourceDetailsMemberRdsReservedInstances +// ResourceDetailsMemberRedshiftReservedInstances +// ResourceDetailsMemberSageMakerSavingsPlans +type ResourceDetails interface { + isResourceDetails() +} + +// The Compute Savings Plans recommendation details. +type ResourceDetailsMemberComputeSavingsPlans struct { + Value ComputeSavingsPlans + + noSmithyDocumentSerde +} + +func (*ResourceDetailsMemberComputeSavingsPlans) isResourceDetails() {} + +// The Amazon Elastic Block Store volume recommendation details. +type ResourceDetailsMemberEbsVolume struct { + Value EbsVolume + + noSmithyDocumentSerde +} + +func (*ResourceDetailsMemberEbsVolume) isResourceDetails() {} + +// The EC2 Auto Scaling group recommendation details. +type ResourceDetailsMemberEc2AutoScalingGroup struct { + Value Ec2AutoScalingGroup + + noSmithyDocumentSerde +} + +func (*ResourceDetailsMemberEc2AutoScalingGroup) isResourceDetails() {} + +// The EC2 instance recommendation details. +type ResourceDetailsMemberEc2Instance struct { + Value Ec2Instance + + noSmithyDocumentSerde +} + +func (*ResourceDetailsMemberEc2Instance) isResourceDetails() {} + +// The EC2 instance Savings Plans recommendation details. +type ResourceDetailsMemberEc2InstanceSavingsPlans struct { + Value Ec2InstanceSavingsPlans + + noSmithyDocumentSerde +} + +func (*ResourceDetailsMemberEc2InstanceSavingsPlans) isResourceDetails() {} + +// The EC2 reserved instances recommendation details. +type ResourceDetailsMemberEc2ReservedInstances struct { + Value Ec2ReservedInstances + + noSmithyDocumentSerde +} + +func (*ResourceDetailsMemberEc2ReservedInstances) isResourceDetails() {} + +// The ECS service recommendation details. +type ResourceDetailsMemberEcsService struct { + Value EcsService + + noSmithyDocumentSerde +} + +func (*ResourceDetailsMemberEcsService) isResourceDetails() {} + +// The ElastiCache reserved instances recommendation details. +type ResourceDetailsMemberElastiCacheReservedInstances struct { + Value ElastiCacheReservedInstances + + noSmithyDocumentSerde +} + +func (*ResourceDetailsMemberElastiCacheReservedInstances) isResourceDetails() {} + +// The Lambda function recommendation details. +type ResourceDetailsMemberLambdaFunction struct { + Value LambdaFunction + + noSmithyDocumentSerde +} + +func (*ResourceDetailsMemberLambdaFunction) isResourceDetails() {} + +// The OpenSearch reserved instances recommendation details. +type ResourceDetailsMemberOpenSearchReservedInstances struct { + Value OpenSearchReservedInstances + + noSmithyDocumentSerde +} + +func (*ResourceDetailsMemberOpenSearchReservedInstances) isResourceDetails() {} + +// The RDS reserved instances recommendation details. +type ResourceDetailsMemberRdsReservedInstances struct { + Value RdsReservedInstances + + noSmithyDocumentSerde +} + +func (*ResourceDetailsMemberRdsReservedInstances) isResourceDetails() {} + +// The Redshift reserved instances recommendation details. +type ResourceDetailsMemberRedshiftReservedInstances struct { + Value RedshiftReservedInstances + + noSmithyDocumentSerde +} + +func (*ResourceDetailsMemberRedshiftReservedInstances) isResourceDetails() {} + +// The SageMaker Savings Plans recommendation details. +type ResourceDetailsMemberSageMakerSavingsPlans struct { + Value SageMakerSavingsPlans + + noSmithyDocumentSerde +} + +func (*ResourceDetailsMemberSageMakerSavingsPlans) isResourceDetails() {} + +// Contains pricing information about the specified resource. +type ResourcePricing struct { + + // The savings estimate incorporating all discounts with Amazon Web Services, such + // as Reserved Instances and Savings Plans. + EstimatedCostAfterDiscounts *float64 + + // The savings estimate using Amazon Web Services public pricing without + // incorporating any discounts. + EstimatedCostBeforeDiscounts *float64 + + // The estimated discounts for a recommendation. + EstimatedDiscounts *EstimatedDiscounts + + // The estimated net unused amortized commitment for the recommendation. + EstimatedNetUnusedAmortizedCommitments *float64 + + noSmithyDocumentSerde +} + +// The SageMaker Savings Plans recommendation details. +type SageMakerSavingsPlans struct { + + // The SageMaker Savings Plans configuration used for recommendations. + Configuration *SageMakerSavingsPlansConfiguration + + // Cost impact of the Savings Plans purchase recommendation. + CostCalculation *SavingsPlansCostCalculation + + noSmithyDocumentSerde +} + +// The SageMaker Savings Plans configuration used for recommendations. +type SageMakerSavingsPlansConfiguration struct { + + // The account scope that you want your recommendations for. + AccountScope *string + + // The hourly commitment for the Savings Plans type. + HourlyCommitment *string + + // The payment option for the commitment. + PaymentOption *string + + // The Savings Plans recommendation term in years. + Term *string + + noSmithyDocumentSerde +} + +// Cost impact of the purchase recommendation. +type SavingsPlansCostCalculation struct { + + // Pricing details of the purchase recommendation. + Pricing *SavingsPlansPricing + + noSmithyDocumentSerde +} + +// Pricing information about a Savings Plan. +type SavingsPlansPricing struct { + + // Estimated monthly commitment for the Savings Plan. + EstimatedMonthlyCommitment *float64 + + // Estimated On-Demand cost you will pay after buying the Savings Plan. + EstimatedOnDemandCost *float64 + + // The cost of paying for the recommended Savings Plan monthly. + MonthlySavingsPlansEligibleCost *float64 + + // Estimated savings as a percentage of your overall costs after buying the + // Savings Plan. + SavingsPercentage *float64 + + noSmithyDocumentSerde +} + +// The storage configuration used for recommendations. +type StorageConfiguration struct { + + // The storage volume. + SizeInGb *float64 + + // The storage type. + Type *string + + noSmithyDocumentSerde +} + +// The tag structure that contains a tag key and value. +type Tag struct { + + // The key that's associated with the tag. + Key *string + + // The value that's associated with the tag. + Value *string + + noSmithyDocumentSerde +} + +// Details about the usage. +type Usage struct { + + // The operation value. + Operation *string + + // The product code. + ProductCode *string + + // The usage unit. + Unit *string + + // The usage amount. + UsageAmount *float64 + + // The usage type. + UsageType *string + + noSmithyDocumentSerde +} + +// The input failed to meet the constraints specified by the Amazon Web Services +// service in a specified field. +type ValidationExceptionDetail struct { + + // The field name where the invalid entry was detected. + // + // This member is required. + FieldName *string + + // A message with the reason for the validation exception error. + // + // This member is required. + Message *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +// UnknownUnionMember is returned when a union member is returned over the wire, +// but has an unknown tag. +type UnknownUnionMember struct { + Tag string + Value []byte + + noSmithyDocumentSerde +} + +func (*UnknownUnionMember) isResourceDetails() {} diff --git a/service/costoptimizationhub/types/types_exported_test.go b/service/costoptimizationhub/types/types_exported_test.go new file mode 100644 index 00000000000..10c12ac2128 --- /dev/null +++ b/service/costoptimizationhub/types/types_exported_test.go @@ -0,0 +1,74 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/costoptimizationhub/types" +) + +func ExampleResourceDetails_outputUsage() { + var union types.ResourceDetails + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ResourceDetailsMemberComputeSavingsPlans: + _ = v.Value // Value is types.ComputeSavingsPlans + + case *types.ResourceDetailsMemberEbsVolume: + _ = v.Value // Value is types.EbsVolume + + case *types.ResourceDetailsMemberEc2AutoScalingGroup: + _ = v.Value // Value is types.Ec2AutoScalingGroup + + case *types.ResourceDetailsMemberEc2Instance: + _ = v.Value // Value is types.Ec2Instance + + case *types.ResourceDetailsMemberEc2InstanceSavingsPlans: + _ = v.Value // Value is types.Ec2InstanceSavingsPlans + + case *types.ResourceDetailsMemberEc2ReservedInstances: + _ = v.Value // Value is types.Ec2ReservedInstances + + case *types.ResourceDetailsMemberEcsService: + _ = v.Value // Value is types.EcsService + + case *types.ResourceDetailsMemberElastiCacheReservedInstances: + _ = v.Value // Value is types.ElastiCacheReservedInstances + + case *types.ResourceDetailsMemberLambdaFunction: + _ = v.Value // Value is types.LambdaFunction + + case *types.ResourceDetailsMemberOpenSearchReservedInstances: + _ = v.Value // Value is types.OpenSearchReservedInstances + + case *types.ResourceDetailsMemberRdsReservedInstances: + _ = v.Value // Value is types.RdsReservedInstances + + case *types.ResourceDetailsMemberRedshiftReservedInstances: + _ = v.Value // Value is types.RedshiftReservedInstances + + case *types.ResourceDetailsMemberSageMakerSavingsPlans: + _ = v.Value // Value is types.SageMakerSavingsPlans + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.ComputeSavingsPlans +var _ *types.Ec2AutoScalingGroup +var _ *types.RdsReservedInstances +var _ *types.OpenSearchReservedInstances +var _ *types.Ec2ReservedInstances +var _ *types.SageMakerSavingsPlans +var _ *types.Ec2Instance +var _ *types.Ec2InstanceSavingsPlans +var _ *types.EcsService +var _ *types.RedshiftReservedInstances +var _ *types.ElastiCacheReservedInstances +var _ *types.LambdaFunction +var _ *types.EbsVolume diff --git a/service/costoptimizationhub/validators.go b/service/costoptimizationhub/validators.go new file mode 100644 index 00000000000..af05548b8ed --- /dev/null +++ b/service/costoptimizationhub/validators.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +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 validateOpListRecommendationSummaries struct { +} + +func (*validateOpListRecommendationSummaries) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListRecommendationSummaries) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListRecommendationSummariesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListRecommendationSummariesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateEnrollmentStatus struct { +} + +func (*validateOpUpdateEnrollmentStatus) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateEnrollmentStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateEnrollmentStatusInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateEnrollmentStatusInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpGetRecommendationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetRecommendation{}, middleware.After) +} + +func addOpListRecommendationSummariesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListRecommendationSummaries{}, middleware.After) +} + +func addOpUpdateEnrollmentStatusValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateEnrollmentStatus{}, middleware.After) +} + +func validateOpGetRecommendationInput(v *GetRecommendationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetRecommendationInput"} + if v.RecommendationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RecommendationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListRecommendationSummariesInput(v *ListRecommendationSummariesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListRecommendationSummariesInput"} + if v.GroupBy == nil { + invalidParams.Add(smithy.NewErrParamRequired("GroupBy")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateEnrollmentStatusInput(v *UpdateEnrollmentStatusInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateEnrollmentStatusInput"} + if len(v.Status) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Status")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/detective/api_op_GetInvestigation.go b/service/detective/api_op_GetInvestigation.go new file mode 100644 index 00000000000..0bf59151a14 --- /dev/null +++ b/service/detective/api_op_GetInvestigation.go @@ -0,0 +1,175 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package detective + +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/detective/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns the investigation results of an investigation for a behavior graph. +func (c *Client) GetInvestigation(ctx context.Context, params *GetInvestigationInput, optFns ...func(*Options)) (*GetInvestigationOutput, error) { + if params == nil { + params = &GetInvestigationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetInvestigation", params, optFns, c.addOperationGetInvestigationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetInvestigationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetInvestigationInput struct { + + // The ARN of the behavior graph. + // + // This member is required. + GraphArn *string + + // The investigation ID of the investigation report. + // + // This member is required. + InvestigationId *string + + noSmithyDocumentSerde +} + +type GetInvestigationOutput struct { + + // The UTC time stamp of the creation time of the investigation report. + CreatedTime *time.Time + + // The unique Amazon Resource Name (ARN) of the IAM user and IAM role. + EntityArn *string + + // Type of entity. For example, Amazon Web Services accounts, such as IAM user and + // role. + EntityType types.EntityType + + // The ARN of the behavior graph. + GraphArn *string + + // The investigation ID of the investigation report. + InvestigationId *string + + // The data and time when the investigation began. The value is an UTC ISO8601 + // formatted string. For example, 2021-08-18T16:35:56.284Z. + ScopeEndTime *time.Time + + // The start date and time for the scope time set to generate the investigation + // report. + ScopeStartTime *time.Time + + // Severity based on the likelihood and impact of the indicators of compromise + // discovered in the investigation. + Severity types.Severity + + // The current state of the investigation. An archived investigation indicates you + // have completed reviewing the investigation. + State types.State + + // Status based on the completion status of the investigation. + Status types.Status + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetInvestigationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetInvestigation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetInvestigation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetInvestigation"); 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 = addOpGetInvestigationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetInvestigation(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_opGetInvestigation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetInvestigation", + } +} diff --git a/service/detective/api_op_ListIndicators.go b/service/detective/api_op_ListIndicators.go new file mode 100644 index 00000000000..678ebee8656 --- /dev/null +++ b/service/detective/api_op_ListIndicators.go @@ -0,0 +1,169 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package detective + +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/detective/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get the indicators from an investigation +func (c *Client) ListIndicators(ctx context.Context, params *ListIndicatorsInput, optFns ...func(*Options)) (*ListIndicatorsOutput, error) { + if params == nil { + params = &ListIndicatorsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListIndicators", params, optFns, c.addOperationListIndicatorsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListIndicatorsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListIndicatorsInput struct { + + // The ARN of the behavior graph. + // + // This member is required. + GraphArn *string + + // The investigation ID of the investigation report. + // + // This member is required. + InvestigationId *string + + // See Detective investigations. (https://docs.aws.amazon.com/detective/latest/userguide/detective-investigations.html) + // . + IndicatorType types.IndicatorType + + // List the maximum number of indicators in a page. + MaxResults *int32 + + // List if there are more results available. The value of nextToken is a unique + // pagination token for each page. Repeat the call using the returned token to + // retrieve the next page. Keep all other arguments unchanged. Each pagination + // token expires after 24 hours. Using an expired pagination token will return a + // Validation Exception error. + NextToken *string + + noSmithyDocumentSerde +} + +type ListIndicatorsOutput struct { + + // The ARN of the behavior graph. + GraphArn *string + + // Indicators of compromise listed based on severity. + Indicators []types.Indicator + + // The investigation ID of the investigation report. + InvestigationId *string + + // List if there are more results available. The value of nextToken is a unique + // pagination token for each page. Repeat the call using the returned token to + // retrieve the next page. Keep all other arguments unchanged. Each pagination + // token expires after 24 hours. Using an expired pagination token will return a + // Validation Exception error. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListIndicatorsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListIndicators{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListIndicators{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListIndicators"); 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 = addOpListIndicatorsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListIndicators(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_opListIndicators(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListIndicators", + } +} diff --git a/service/detective/api_op_ListInvestigations.go b/service/detective/api_op_ListInvestigations.go new file mode 100644 index 00000000000..db6863ca1e1 --- /dev/null +++ b/service/detective/api_op_ListInvestigations.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package detective + +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/detective/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List all Investigations. +func (c *Client) ListInvestigations(ctx context.Context, params *ListInvestigationsInput, optFns ...func(*Options)) (*ListInvestigationsOutput, error) { + if params == nil { + params = &ListInvestigationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListInvestigations", params, optFns, c.addOperationListInvestigationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListInvestigationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListInvestigationsInput struct { + + // The ARN of the behavior graph. + // + // This member is required. + GraphArn *string + + // Filter the investigation results based on a criteria. + FilterCriteria *types.FilterCriteria + + // List the maximum number of investigations in a page. + MaxResults *int32 + + // List if there are more results available. The value of nextToken is a unique + // pagination token for each page. Repeat the call using the returned token to + // retrieve the next page. Keep all other arguments unchanged. Each pagination + // token expires after 24 hours. Using an expired pagination token will return a + // Validation Exception error. + NextToken *string + + // Sorts the investigation results based on a criteria. + SortCriteria *types.SortCriteria + + noSmithyDocumentSerde +} + +type ListInvestigationsOutput struct { + + // Investigations details lists the summary of uncommon behavior or malicious + // activity which indicates a compromise. + InvestigationDetails []types.InvestigationDetail + + // List if there are more results available. The value of nextToken is a unique + // pagination token for each page. Repeat the call using the returned token to + // retrieve the next page. Keep all other arguments unchanged. Each pagination + // token expires after 24 hours. Using an expired pagination token will return an + // HTTP 400 InvalidToken error. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListInvestigationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListInvestigations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListInvestigations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListInvestigations"); 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 = addOpListInvestigationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListInvestigations(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_opListInvestigations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListInvestigations", + } +} diff --git a/service/detective/api_op_StartInvestigation.go b/service/detective/api_op_StartInvestigation.go new file mode 100644 index 00000000000..28c2763955f --- /dev/null +++ b/service/detective/api_op_StartInvestigation.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package detective + +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" +) + +// initiate an investigation on an entity in a graph +func (c *Client) StartInvestigation(ctx context.Context, params *StartInvestigationInput, optFns ...func(*Options)) (*StartInvestigationOutput, error) { + if params == nil { + params = &StartInvestigationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartInvestigation", params, optFns, c.addOperationStartInvestigationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartInvestigationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartInvestigationInput struct { + + // The unique Amazon Resource Name (ARN) of the IAM user and IAM role. + // + // This member is required. + EntityArn *string + + // The ARN of the behavior graph. + // + // This member is required. + GraphArn *string + + // The data and time when the investigation began. The value is an UTC ISO8601 + // formatted string. For example, 2021-08-18T16:35:56.284Z . + // + // This member is required. + ScopeEndTime *time.Time + + // The data and time when the investigation began. The value is an UTC ISO8601 + // formatted string. For example, 2021-08-18T16:35:56.284Z . + // + // This member is required. + ScopeStartTime *time.Time + + noSmithyDocumentSerde +} + +type StartInvestigationOutput struct { + + // The investigation ID of the investigation report. + InvestigationId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartInvestigationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartInvestigation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartInvestigation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartInvestigation"); 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 = addOpStartInvestigationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartInvestigation(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_opStartInvestigation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartInvestigation", + } +} diff --git a/service/detective/api_op_UpdateInvestigationState.go b/service/detective/api_op_UpdateInvestigationState.go new file mode 100644 index 00000000000..9d0d3e7d70b --- /dev/null +++ b/service/detective/api_op_UpdateInvestigationState.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package detective + +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/detective/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update the state of an investigation. +func (c *Client) UpdateInvestigationState(ctx context.Context, params *UpdateInvestigationStateInput, optFns ...func(*Options)) (*UpdateInvestigationStateOutput, error) { + if params == nil { + params = &UpdateInvestigationStateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateInvestigationState", params, optFns, c.addOperationUpdateInvestigationStateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateInvestigationStateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateInvestigationStateInput struct { + + // The ARN of the behavior graph. + // + // This member is required. + GraphArn *string + + // The investigation ID of the investigation report. + // + // This member is required. + InvestigationId *string + + // The current state of the investigation. An archived investigation indicates you + // have completed reviewing the investigation. + // + // This member is required. + State types.State + + noSmithyDocumentSerde +} + +type UpdateInvestigationStateOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateInvestigationStateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateInvestigationState{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateInvestigationState{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateInvestigationState"); 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 = addOpUpdateInvestigationStateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateInvestigationState(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_opUpdateInvestigationState(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateInvestigationState", + } +} diff --git a/service/detective/deserializers.go b/service/detective/deserializers.go index b898f4c1e11..1701b633b14 100644 --- a/service/detective/deserializers.go +++ b/service/detective/deserializers.go @@ -1487,14 +1487,14 @@ func awsRestjson1_deserializeOpErrorEnableOrganizationAdminAccount(response *smi } } -type awsRestjson1_deserializeOpGetMembers struct { +type awsRestjson1_deserializeOpGetInvestigation struct { } -func (*awsRestjson1_deserializeOpGetMembers) ID() string { +func (*awsRestjson1_deserializeOpGetInvestigation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetInvestigation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1508,9 +1508,9 @@ func (m *awsRestjson1_deserializeOpGetMembers) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetMembers(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetInvestigation(response, &metadata) } - output := &GetMembersOutput{} + output := &GetInvestigationOutput{} out.Result = output var buff [1024]byte @@ -1531,7 +1531,7 @@ func (m *awsRestjson1_deserializeOpGetMembers) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetMembersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetInvestigationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1544,7 +1544,7 @@ func (m *awsRestjson1_deserializeOpGetMembers) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetInvestigation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1594,6 +1594,9 @@ func awsRestjson1_deserializeOpErrorGetMembers(response *smithyhttp.Response, me case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -1607,7 +1610,7 @@ func awsRestjson1_deserializeOpErrorGetMembers(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentGetMembersOutput(v **GetMembersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetInvestigationOutput(v **GetInvestigationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1620,23 +1623,115 @@ func awsRestjson1_deserializeOpDocumentGetMembersOutput(v **GetMembersOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetMembersOutput + var sv *GetInvestigationOutput if *v == nil { - sv = &GetMembersOutput{} + sv = &GetInvestigationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "MemberDetails": - if err := awsRestjson1_deserializeDocumentMemberDetailList(&sv.MemberDetails, value); err != nil { - return err + case "CreatedTime": + 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.CreatedTime = ptr.Time(t) } - case "UnprocessedAccounts": - if err := awsRestjson1_deserializeDocumentUnprocessedAccountList(&sv.UnprocessedAccounts, value); err != nil { - return err + case "EntityArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityArn to be of type string, got %T instead", value) + } + sv.EntityArn = ptr.String(jtv) + } + + case "EntityType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityType to be of type string, got %T instead", value) + } + sv.EntityType = types.EntityType(jtv) + } + + case "GraphArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GraphArn to be of type string, got %T instead", value) + } + sv.GraphArn = ptr.String(jtv) + } + + case "InvestigationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InvestigationId to be of type string, got %T instead", value) + } + sv.InvestigationId = ptr.String(jtv) + } + + case "ScopeEndTime": + 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.ScopeEndTime = ptr.Time(t) + } + + case "ScopeStartTime": + 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.ScopeStartTime = ptr.Time(t) + } + + case "Severity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Severity to be of type string, got %T instead", value) + } + sv.Severity = types.Severity(jtv) + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected State to be of type string, got %T instead", value) + } + sv.State = types.State(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Status to be of type string, got %T instead", value) + } + sv.Status = types.Status(jtv) } default: @@ -1648,14 +1743,14 @@ func awsRestjson1_deserializeOpDocumentGetMembersOutput(v **GetMembersOutput, va return nil } -type awsRestjson1_deserializeOpListDatasourcePackages struct { +type awsRestjson1_deserializeOpGetMembers struct { } -func (*awsRestjson1_deserializeOpListDatasourcePackages) ID() string { +func (*awsRestjson1_deserializeOpGetMembers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListDatasourcePackages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1669,9 +1764,9 @@ func (m *awsRestjson1_deserializeOpListDatasourcePackages) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDatasourcePackages(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetMembers(response, &metadata) } - output := &ListDatasourcePackagesOutput{} + output := &GetMembersOutput{} out.Result = output var buff [1024]byte @@ -1692,7 +1787,7 @@ func (m *awsRestjson1_deserializeOpListDatasourcePackages) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListDatasourcePackagesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetMembersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1705,7 +1800,7 @@ func (m *awsRestjson1_deserializeOpListDatasourcePackages) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListDatasourcePackages(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1768,7 +1863,7 @@ func awsRestjson1_deserializeOpErrorListDatasourcePackages(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentListDatasourcePackagesOutput(v **ListDatasourcePackagesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetMembersOutput(v **GetMembersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1781,27 +1876,23 @@ func awsRestjson1_deserializeOpDocumentListDatasourcePackagesOutput(v **ListData return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDatasourcePackagesOutput + var sv *GetMembersOutput if *v == nil { - sv = &ListDatasourcePackagesOutput{} + sv = &GetMembersOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "DatasourcePackages": - if err := awsRestjson1_deserializeDocumentDatasourcePackageIngestDetails(&sv.DatasourcePackages, value); err != nil { + case "MemberDetails": + if err := awsRestjson1_deserializeDocumentMemberDetailList(&sv.MemberDetails, value); err != nil { return err } - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) + case "UnprocessedAccounts": + if err := awsRestjson1_deserializeDocumentUnprocessedAccountList(&sv.UnprocessedAccounts, value); err != nil { + return err } default: @@ -1813,14 +1904,14 @@ func awsRestjson1_deserializeOpDocumentListDatasourcePackagesOutput(v **ListData return nil } -type awsRestjson1_deserializeOpListGraphs struct { +type awsRestjson1_deserializeOpListDatasourcePackages struct { } -func (*awsRestjson1_deserializeOpListGraphs) ID() string { +func (*awsRestjson1_deserializeOpListDatasourcePackages) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListGraphs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListDatasourcePackages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1834,9 +1925,9 @@ func (m *awsRestjson1_deserializeOpListGraphs) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListGraphs(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListDatasourcePackages(response, &metadata) } - output := &ListGraphsOutput{} + output := &ListDatasourcePackagesOutput{} out.Result = output var buff [1024]byte @@ -1857,7 +1948,7 @@ func (m *awsRestjson1_deserializeOpListGraphs) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListGraphsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListDatasourcePackagesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1870,7 +1961,7 @@ func (m *awsRestjson1_deserializeOpListGraphs) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListGraphs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListDatasourcePackages(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1917,6 +2008,9 @@ func awsRestjson1_deserializeOpErrorListGraphs(response *smithyhttp.Response, me case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -1930,7 +2024,7 @@ func awsRestjson1_deserializeOpErrorListGraphs(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentListGraphsOutput(v **ListGraphsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListDatasourcePackagesOutput(v **ListDatasourcePackagesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1943,17 +2037,17 @@ func awsRestjson1_deserializeOpDocumentListGraphsOutput(v **ListGraphsOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListGraphsOutput + var sv *ListDatasourcePackagesOutput if *v == nil { - sv = &ListGraphsOutput{} + sv = &ListDatasourcePackagesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "GraphList": - if err := awsRestjson1_deserializeDocumentGraphList(&sv.GraphList, value); err != nil { + case "DatasourcePackages": + if err := awsRestjson1_deserializeDocumentDatasourcePackageIngestDetails(&sv.DatasourcePackages, value); err != nil { return err } @@ -1975,14 +2069,14 @@ func awsRestjson1_deserializeOpDocumentListGraphsOutput(v **ListGraphsOutput, va return nil } -type awsRestjson1_deserializeOpListInvitations struct { +type awsRestjson1_deserializeOpListGraphs struct { } -func (*awsRestjson1_deserializeOpListInvitations) ID() string { +func (*awsRestjson1_deserializeOpListGraphs) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListGraphs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1996,9 +2090,9 @@ func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListInvitations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListGraphs(response, &metadata) } - output := &ListInvitationsOutput{} + output := &ListGraphsOutput{} out.Result = output var buff [1024]byte @@ -2019,7 +2113,7 @@ func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListInvitationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListGraphsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2032,7 +2126,7 @@ func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorListInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListGraphs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2092,7 +2186,7 @@ func awsRestjson1_deserializeOpErrorListInvitations(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentListInvitationsOutput(v **ListInvitationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListGraphsOutput(v **ListGraphsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2105,17 +2199,17 @@ func awsRestjson1_deserializeOpDocumentListInvitationsOutput(v **ListInvitations return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListInvitationsOutput + var sv *ListGraphsOutput if *v == nil { - sv = &ListInvitationsOutput{} + sv = &ListGraphsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Invitations": - if err := awsRestjson1_deserializeDocumentMemberDetailList(&sv.Invitations, value); err != nil { + case "GraphList": + if err := awsRestjson1_deserializeDocumentGraphList(&sv.GraphList, value); err != nil { return err } @@ -2137,14 +2231,14 @@ func awsRestjson1_deserializeOpDocumentListInvitationsOutput(v **ListInvitations return nil } -type awsRestjson1_deserializeOpListMembers struct { +type awsRestjson1_deserializeOpListIndicators struct { } -func (*awsRestjson1_deserializeOpListMembers) ID() string { +func (*awsRestjson1_deserializeOpListIndicators) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListIndicators) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2158,9 +2252,9 @@ func (m *awsRestjson1_deserializeOpListMembers) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListMembers(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListIndicators(response, &metadata) } - output := &ListMembersOutput{} + output := &ListIndicatorsOutput{} out.Result = output var buff [1024]byte @@ -2181,7 +2275,7 @@ func (m *awsRestjson1_deserializeOpListMembers) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListMembersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListIndicatorsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2194,7 +2288,7 @@ func (m *awsRestjson1_deserializeOpListMembers) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListIndicators(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2244,6 +2338,9 @@ func awsRestjson1_deserializeOpErrorListMembers(response *smithyhttp.Response, m case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -2257,7 +2354,7 @@ func awsRestjson1_deserializeOpErrorListMembers(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListIndicatorsOutput(v **ListIndicatorsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2270,25 +2367,43 @@ func awsRestjson1_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListMembersOutput + var sv *ListIndicatorsOutput if *v == nil { - sv = &ListMembersOutput{} + sv = &ListIndicatorsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "MemberDetails": - if err := awsRestjson1_deserializeDocumentMemberDetailList(&sv.MemberDetails, value); err != nil { + case "GraphArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GraphArn to be of type string, got %T instead", value) + } + sv.GraphArn = ptr.String(jtv) + } + + case "Indicators": + if err := awsRestjson1_deserializeDocumentIndicators(&sv.Indicators, value); err != nil { return err } + case "InvestigationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InvestigationId to be of type string, got %T instead", value) + } + sv.InvestigationId = ptr.String(jtv) + } + case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + return fmt.Errorf("expected AiPaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } @@ -2302,14 +2417,14 @@ func awsRestjson1_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, return nil } -type awsRestjson1_deserializeOpListOrganizationAdminAccounts struct { +type awsRestjson1_deserializeOpListInvestigations struct { } -func (*awsRestjson1_deserializeOpListOrganizationAdminAccounts) ID() string { +func (*awsRestjson1_deserializeOpListInvestigations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListOrganizationAdminAccounts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListInvestigations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2323,9 +2438,9 @@ func (m *awsRestjson1_deserializeOpListOrganizationAdminAccounts) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListOrganizationAdminAccounts(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListInvestigations(response, &metadata) } - output := &ListOrganizationAdminAccountsOutput{} + output := &ListInvestigationsOutput{} out.Result = output var buff [1024]byte @@ -2346,7 +2461,7 @@ func (m *awsRestjson1_deserializeOpListOrganizationAdminAccounts) HandleDeserial return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListOrganizationAdminAccountsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListInvestigationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2359,7 +2474,7 @@ func (m *awsRestjson1_deserializeOpListOrganizationAdminAccounts) HandleDeserial return out, metadata, err } -func awsRestjson1_deserializeOpErrorListOrganizationAdminAccounts(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListInvestigations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2406,6 +2521,9 @@ func awsRestjson1_deserializeOpErrorListOrganizationAdminAccounts(response *smit case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) @@ -2422,7 +2540,7 @@ func awsRestjson1_deserializeOpErrorListOrganizationAdminAccounts(response *smit } } -func awsRestjson1_deserializeOpDocumentListOrganizationAdminAccountsOutput(v **ListOrganizationAdminAccountsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListInvestigationsOutput(v **ListInvestigationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2435,17 +2553,17 @@ func awsRestjson1_deserializeOpDocumentListOrganizationAdminAccountsOutput(v **L return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListOrganizationAdminAccountsOutput + var sv *ListInvestigationsOutput if *v == nil { - sv = &ListOrganizationAdminAccountsOutput{} + sv = &ListInvestigationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Administrators": - if err := awsRestjson1_deserializeDocumentAdministratorList(&sv.Administrators, value); err != nil { + case "InvestigationDetails": + if err := awsRestjson1_deserializeDocumentInvestigationDetails(&sv.InvestigationDetails, value); err != nil { return err } @@ -2453,7 +2571,7 @@ func awsRestjson1_deserializeOpDocumentListOrganizationAdminAccountsOutput(v **L if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + return fmt.Errorf("expected AiPaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } @@ -2467,14 +2585,14 @@ func awsRestjson1_deserializeOpDocumentListOrganizationAdminAccountsOutput(v **L return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpListInvitations struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpListInvitations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2488,9 +2606,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_deserializeOpErrorListInvitations(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListInvitationsOutput{} out.Result = output var buff [1024]byte @@ -2511,7 +2629,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListInvitationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2524,7 +2642,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2571,9 +2689,6 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -2587,7 +2702,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListInvitationsOutput(v **ListInvitationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2600,21 +2715,30 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *ListInvitationsOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListInvitationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "Invitations": + if err := awsRestjson1_deserializeDocumentMemberDetailList(&sv.Invitations, value); err != nil { return err } - default: + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: _, _ = key, value } @@ -2623,14 +2747,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpRejectInvitation struct { +type awsRestjson1_deserializeOpListMembers struct { } -func (*awsRestjson1_deserializeOpRejectInvitation) ID() string { +func (*awsRestjson1_deserializeOpListMembers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpRejectInvitation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2644,21 +2768,43 @@ func (m *awsRestjson1_deserializeOpRejectInvitation) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRejectInvitation(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListMembers(response, &metadata) } - output := &RejectInvitationOutput{} + output := &ListMembersOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListMembersOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorRejectInvitation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2702,9 +2848,6 @@ func awsRestjson1_deserializeOpErrorRejectInvitation(response *smithyhttp.Respon 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) @@ -2724,14 +2867,59 @@ func awsRestjson1_deserializeOpErrorRejectInvitation(response *smithyhttp.Respon } } -type awsRestjson1_deserializeOpStartMonitoringMember struct { +func awsRestjson1_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListMembersOutput + if *v == nil { + sv = &ListMembersOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MemberDetails": + if err := awsRestjson1_deserializeDocumentMemberDetailList(&sv.MemberDetails, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpStartMonitoringMember) ID() string { +type awsRestjson1_deserializeOpListOrganizationAdminAccounts struct { +} + +func (*awsRestjson1_deserializeOpListOrganizationAdminAccounts) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartMonitoringMember) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListOrganizationAdminAccounts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2745,21 +2933,43 @@ func (m *awsRestjson1_deserializeOpStartMonitoringMember) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartMonitoringMember(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListOrganizationAdminAccounts(response, &metadata) } - output := &StartMonitoringMemberOutput{} + output := &ListOrganizationAdminAccountsOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListOrganizationAdminAccountsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartMonitoringMember(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListOrganizationAdminAccounts(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2803,17 +3013,11 @@ func awsRestjson1_deserializeOpErrorStartMonitoringMember(response *smithyhttp.R case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -2828,14 +3032,59 @@ func awsRestjson1_deserializeOpErrorStartMonitoringMember(response *smithyhttp.R } } -type awsRestjson1_deserializeOpTagResource struct { +func awsRestjson1_deserializeOpDocumentListOrganizationAdminAccountsOutput(v **ListOrganizationAdminAccountsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListOrganizationAdminAccountsOutput + if *v == nil { + sv = &ListOrganizationAdminAccountsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Administrators": + if err := awsRestjson1_deserializeDocumentAdministratorList(&sv.Administrators, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) 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) @@ -2849,15 +3098,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_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &TagResourceOutput{} + 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_deserializeOpErrorTagResource(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)} @@ -2920,36 +3197,78 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -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 +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 } - 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_deserializeOpErrorUntagResource(response, &metadata) - } - output := &UntagResourceOutput{} + 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_deserializeOpRejectInvitation struct { +} + +func (*awsRestjson1_deserializeOpRejectInvitation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRejectInvitation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorRejectInvitation(response, &metadata) + } + output := &RejectInvitationOutput{} 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_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorRejectInvitation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2993,6 +3312,9 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -3012,14 +3334,14 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateDatasourcePackages struct { +type awsRestjson1_deserializeOpStartInvestigation struct { } -func (*awsRestjson1_deserializeOpUpdateDatasourcePackages) ID() string { +func (*awsRestjson1_deserializeOpStartInvestigation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateDatasourcePackages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStartInvestigation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3033,21 +3355,43 @@ func (m *awsRestjson1_deserializeOpUpdateDatasourcePackages) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateDatasourcePackages(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStartInvestigation(response, &metadata) } - output := &UpdateDatasourcePackagesOutput{} + output := &StartInvestigationOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentStartInvestigationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateDatasourcePackages(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStartInvestigation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3097,8 +3441,8 @@ func awsRestjson1_deserializeOpErrorUpdateDatasourcePackages(response *smithyhtt case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -3113,14 +3457,54 @@ func awsRestjson1_deserializeOpErrorUpdateDatasourcePackages(response *smithyhtt } } -type awsRestjson1_deserializeOpUpdateOrganizationConfiguration struct { +func awsRestjson1_deserializeOpDocumentStartInvestigationOutput(v **StartInvestigationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartInvestigationOutput + if *v == nil { + sv = &StartInvestigationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "InvestigationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InvestigationId to be of type string, got %T instead", value) + } + sv.InvestigationId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateOrganizationConfiguration) ID() string { +type awsRestjson1_deserializeOpStartMonitoringMember struct { +} + +func (*awsRestjson1_deserializeOpStartMonitoringMember) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateOrganizationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStartMonitoringMember) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3134,9 +3518,9 @@ func (m *awsRestjson1_deserializeOpUpdateOrganizationConfiguration) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateOrganizationConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStartMonitoringMember(response, &metadata) } - output := &UpdateOrganizationConfigurationOutput{} + output := &StartMonitoringMemberOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -3148,7 +3532,7 @@ func (m *awsRestjson1_deserializeOpUpdateOrganizationConfiguration) HandleDeseri return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateOrganizationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStartMonitoringMember(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3192,11 +3576,17 @@ func awsRestjson1_deserializeOpErrorUpdateOrganizationConfiguration(response *sm 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("TooManyRequestsException", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsException(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) @@ -3211,99 +3601,57 @@ func awsRestjson1_deserializeOpErrorUpdateOrganizationConfiguration(response *sm } } -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 - } +type awsRestjson1_deserializeOpTagResource struct { +} - err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) +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 { - var snapshot 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 -} - -func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ConflictException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - 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 + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } + output := &TagResourceOutput{} + out.Result = output - err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + return out, metadata, err +} - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err +func 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()) - errorBody.Seek(0, io.SeekStart) + errorCode := "UnknownError" + errorMessage := errorCode - return output -} + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } -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) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3315,20 +3663,186 @@ func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.R } errorBody.Seek(0, io.SeekStart) - - return output + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } } -func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} +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() - 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{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateDatasourcePackages struct { +} + +func (*awsRestjson1_deserializeOpUpdateDatasourcePackages) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateDatasourcePackages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateDatasourcePackages(response, &metadata) + } + output := &UpdateDatasourcePackagesOutput{} + 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_deserializeOpErrorUpdateDatasourcePackages(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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{ @@ -3338,132 +3852,890 @@ func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp return err } - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + 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("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 + + } +} + +type awsRestjson1_deserializeOpUpdateInvestigationState struct { +} + +func (*awsRestjson1_deserializeOpUpdateInvestigationState) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateInvestigationState) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateInvestigationState(response, &metadata) + } + output := &UpdateInvestigationStateOutput{} + 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_deserializeOpErrorUpdateInvestigationState(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateOrganizationConfiguration struct { +} + +func (*awsRestjson1_deserializeOpUpdateOrganizationConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateOrganizationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateOrganizationConfiguration(response, &metadata) + } + output := &UpdateOrganizationConfigurationOutput{} + 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_deserializeOpErrorUpdateOrganizationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_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_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_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyRequestsException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentTooManyRequestsException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode_ = types.ErrorCode(jtv) + } + + case "ErrorCodeReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCodeReason to be of type string, got %T instead", value) + } + sv.ErrorCodeReason = ptr.String(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "SubErrorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.SubErrorCode = types.ErrorCode(jtv) + } + + case "SubErrorCodeReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCodeReason to be of type string, got %T instead", value) + } + sv.SubErrorCodeReason = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAccountIdList(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 AccountId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAdministrator(v **types.Administrator, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Administrator + if *v == nil { + sv = &types.Administrator{} + } 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 "DelegationTime": + 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.DelegationTime = ptr.Time(t) + } + + case "GraphArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GraphArn to be of type string, got %T instead", value) + } + sv.GraphArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAdministratorList(v *[]types.Administrator, 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.Administrator + if *v == nil { + cv = []types.Administrator{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Administrator + destAddr := &col + if err := awsRestjson1_deserializeDocumentAdministrator(&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 ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDatasourcePackageIngestDetail(v **types.DatasourcePackageIngestDetail, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DatasourcePackageIngestDetail + if *v == nil { + sv = &types.DatasourcePackageIngestDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DatasourcePackageIngestState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DatasourcePackageIngestState to be of type string, got %T instead", value) + } + sv.DatasourcePackageIngestState = types.DatasourcePackageIngestState(jtv) + } + + case "LastIngestStateChange": + if err := awsRestjson1_deserializeDocumentLastIngestStateChangeDates(&sv.LastIngestStateChange, value); err != nil { + return err + } + + default: + _, _ = key, value - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), } - return err } - - errorBody.Seek(0, io.SeekStart) - - return output + *v = sv + return nil } -func 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 +func awsRestjson1_deserializeDocumentDatasourcePackageIngestDetails(v *map[string]types.DatasourcePackageIngestDetail, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + var mv map[string]types.DatasourcePackageIngestDetail + if *v == nil { + mv = map[string]types.DatasourcePackageIngestDetail{} + } else { + mv = *v } - errorBody.Seek(0, io.SeekStart) + for key, value := range shape { + var parsedVal types.DatasourcePackageIngestDetail + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentDatasourcePackageIngestDetail(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal - return output + } + *v = mv + return nil } -func awsRestjson1_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyRequestsException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err +func awsRestjson1_deserializeDocumentDatasourcePackageIngestHistory(v *map[string]map[string]types.TimestampForCollection, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - err := awsRestjson1_deserializeDocumentTooManyRequestsException(&output, shape) + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + var mv map[string]map[string]types.TimestampForCollection + if *v == nil { + mv = map[string]map[string]types.TimestampForCollection{} + } else { + mv = *v } - errorBody.Seek(0, io.SeekStart) + for key, value := range shape { + var parsedVal map[string]types.TimestampForCollection + mapVar := parsedVal + if err := awsRestjson1_deserializeDocumentLastIngestStateChangeDates(&mapVar, value); err != nil { + return err + } + parsedVal = mapVar + mv[key] = parsedVal - return output + } + *v = mv + return nil } -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 +func awsRestjson1_deserializeDocumentDatasourcePackageIngestStates(v *map[string]types.DatasourcePackageIngestState, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + var mv map[string]types.DatasourcePackageIngestState + if *v == nil { + mv = map[string]types.DatasourcePackageIngestState{} + } else { + mv = *v } - errorBody.Seek(0, io.SeekStart) + for key, value := range shape { + var parsedVal types.DatasourcePackageIngestState + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DatasourcePackageIngestState to be of type string, got %T instead", value) + } + parsedVal = types.DatasourcePackageIngestState(jtv) + } + mv[key] = parsedVal - return output + } + *v = mv + return nil } -func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { +func awsRestjson1_deserializeDocumentDatasourcePackageUsageInfo(v **types.DatasourcePackageUsageInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3476,58 +4748,39 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccessDeniedException + var sv *types.DatasourcePackageUsageInfo if *v == nil { - sv = &types.AccessDeniedException{} + sv = &types.DatasourcePackageUsageInfo{} } else { sv = *v } for key, value := range shape { switch key { - case "ErrorCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) - } - sv.ErrorCode_ = types.ErrorCode(jtv) - } - - case "ErrorCodeReason": + case "VolumeUsageInBytes": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected ErrorCodeReason to be of type string, got %T instead", value) + return fmt.Errorf("expected ByteValue to be json.Number, got %T instead", value) } - sv.ErrorCodeReason = ptr.String(jtv) - } - - case "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + i64, err := jtv.Int64() + if err != nil { + return err } - sv.Message = ptr.String(jtv) + sv.VolumeUsageInBytes = ptr.Int64(i64) } - case "SubErrorCode": + case "VolumeUsageUpdateTime": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } - sv.SubErrorCode = types.ErrorCode(jtv) - } - - case "SubErrorCodeReason": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorCodeReason to be of type string, got %T instead", value) + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err } - sv.SubErrorCodeReason = ptr.String(jtv) + sv.VolumeUsageUpdateTime = ptr.Time(t) } default: @@ -3539,7 +4792,7 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } -func awsRestjson1_deserializeDocumentAccountIdList(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentFlaggedIpAddressDetail(v **types.FlaggedIpAddressDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3547,35 +4800,48 @@ func awsRestjson1_deserializeDocumentAccountIdList(v *[]string, 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 []string + var sv *types.FlaggedIpAddressDetail if *v == nil { - cv = []string{} + sv = &types.FlaggedIpAddressDetail{} } 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 AccountId to be of type string, got %T instead", value) + for key, value := range shape { + switch key { + case "IpAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IpAddress to be of type string, got %T instead", value) + } + sv.IpAddress = ptr.String(jtv) } - col = jtv - } - cv = append(cv, col) + case "Reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Reason to be of type string, got %T instead", value) + } + sv.Reason = types.Reason(jtv) + } + + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentAdministrator(v **types.Administrator, value interface{}) error { +func awsRestjson1_deserializeDocumentGraph(v **types.Graph, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3588,25 +4854,25 @@ func awsRestjson1_deserializeDocumentAdministrator(v **types.Administrator, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Administrator + var sv *types.Graph if *v == nil { - sv = &types.Administrator{} + sv = &types.Graph{} } else { sv = *v } for key, value := range shape { switch key { - case "AccountId": + case "Arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + return fmt.Errorf("expected GraphArn to be of type string, got %T instead", value) } - sv.AccountId = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "DelegationTime": + case "CreatedTime": if value != nil { jtv, ok := value.(string) if !ok { @@ -3616,16 +4882,7 @@ func awsRestjson1_deserializeDocumentAdministrator(v **types.Administrator, valu if err != nil { return err } - sv.DelegationTime = ptr.Time(t) - } - - case "GraphArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GraphArn to be of type string, got %T instead", value) - } - sv.GraphArn = ptr.String(jtv) + sv.CreatedTime = ptr.Time(t) } default: @@ -3637,7 +4894,7 @@ func awsRestjson1_deserializeDocumentAdministrator(v **types.Administrator, valu return nil } -func awsRestjson1_deserializeDocumentAdministratorList(v *[]types.Administrator, value interface{}) error { +func awsRestjson1_deserializeDocumentGraphList(v *[]types.Graph, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3650,17 +4907,17 @@ func awsRestjson1_deserializeDocumentAdministratorList(v *[]types.Administrator, return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Administrator + var cv []types.Graph if *v == nil { - cv = []types.Administrator{} + cv = []types.Graph{} } else { cv = *v } for _, value := range shape { - var col types.Administrator + var col types.Graph destAddr := &col - if err := awsRestjson1_deserializeDocumentAdministrator(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentGraph(&destAddr, value); err != nil { return err } col = *destAddr @@ -3671,7 +4928,7 @@ func awsRestjson1_deserializeDocumentAdministratorList(v *[]types.Administrator, return nil } -func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { +func awsRestjson1_deserializeDocumentImpossibleTravelDetail(v **types.ImpossibleTravelDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3684,22 +4941,62 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ConflictException + var sv *types.ImpossibleTravelDetail if *v == nil { - sv = &types.ConflictException{} + sv = &types.ImpossibleTravelDetail{} } else { sv = *v } for key, value := range shape { switch key { - case "Message": + case "EndingIpAddress": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected IpAddress to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.EndingIpAddress = ptr.String(jtv) + } + + case "EndingLocation": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Location to be of type string, got %T instead", value) + } + sv.EndingLocation = ptr.String(jtv) + } + + case "HourlyTimeDelta": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected HourlyTimeDelta to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.HourlyTimeDelta = ptr.Int32(int32(i64)) + } + + case "StartingIpAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IpAddress to be of type string, got %T instead", value) + } + sv.StartingIpAddress = ptr.String(jtv) + } + + case "StartingLocation": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Location to be of type string, got %T instead", value) + } + sv.StartingLocation = ptr.String(jtv) } default: @@ -3711,7 +5008,7 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } -func awsRestjson1_deserializeDocumentDatasourcePackageIngestDetail(v **types.DatasourcePackageIngestDetail, value interface{}) error { +func awsRestjson1_deserializeDocumentIndicator(v **types.Indicator, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3724,27 +5021,27 @@ func awsRestjson1_deserializeDocumentDatasourcePackageIngestDetail(v **types.Dat return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DatasourcePackageIngestDetail + var sv *types.Indicator if *v == nil { - sv = &types.DatasourcePackageIngestDetail{} + sv = &types.Indicator{} } else { sv = *v } for key, value := range shape { switch key { - case "DatasourcePackageIngestState": + case "IndicatorDetail": + if err := awsRestjson1_deserializeDocumentIndicatorDetail(&sv.IndicatorDetail, value); err != nil { + return err + } + + case "IndicatorType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DatasourcePackageIngestState to be of type string, got %T instead", value) + return fmt.Errorf("expected IndicatorType to be of type string, got %T instead", value) } - sv.DatasourcePackageIngestState = types.DatasourcePackageIngestState(jtv) - } - - case "LastIngestStateChange": - if err := awsRestjson1_deserializeDocumentLastIngestStateChangeDates(&sv.LastIngestStateChange, value); err != nil { - return err + sv.IndicatorType = types.IndicatorType(jtv) } default: @@ -3756,7 +5053,7 @@ func awsRestjson1_deserializeDocumentDatasourcePackageIngestDetail(v **types.Dat return nil } -func awsRestjson1_deserializeDocumentDatasourcePackageIngestDetails(v *map[string]types.DatasourcePackageIngestDetail, value interface{}) error { +func awsRestjson1_deserializeDocumentIndicatorDetail(v **types.IndicatorDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3769,29 +5066,65 @@ func awsRestjson1_deserializeDocumentDatasourcePackageIngestDetails(v *map[strin return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]types.DatasourcePackageIngestDetail + var sv *types.IndicatorDetail if *v == nil { - mv = map[string]types.DatasourcePackageIngestDetail{} + sv = &types.IndicatorDetail{} } else { - mv = *v + sv = *v } for key, value := range shape { - var parsedVal types.DatasourcePackageIngestDetail - mapVar := parsedVal - destAddr := &mapVar - if err := awsRestjson1_deserializeDocumentDatasourcePackageIngestDetail(&destAddr, value); err != nil { - return err - } - parsedVal = *destAddr - mv[key] = parsedVal + switch key { + case "FlaggedIpAddressDetail": + if err := awsRestjson1_deserializeDocumentFlaggedIpAddressDetail(&sv.FlaggedIpAddressDetail, value); err != nil { + return err + } + + case "ImpossibleTravelDetail": + if err := awsRestjson1_deserializeDocumentImpossibleTravelDetail(&sv.ImpossibleTravelDetail, value); err != nil { + return err + } + + case "NewAsoDetail": + if err := awsRestjson1_deserializeDocumentNewAsoDetail(&sv.NewAsoDetail, value); err != nil { + return err + } + + case "NewGeolocationDetail": + if err := awsRestjson1_deserializeDocumentNewGeolocationDetail(&sv.NewGeolocationDetail, value); err != nil { + return err + } + + case "NewUserAgentDetail": + if err := awsRestjson1_deserializeDocumentNewUserAgentDetail(&sv.NewUserAgentDetail, value); err != nil { + return err + } + + case "RelatedFindingDetail": + if err := awsRestjson1_deserializeDocumentRelatedFindingDetail(&sv.RelatedFindingDetail, value); err != nil { + return err + } + + case "RelatedFindingGroupDetail": + if err := awsRestjson1_deserializeDocumentRelatedFindingGroupDetail(&sv.RelatedFindingGroupDetail, value); err != nil { + return err + } + + case "TTPsObservedDetail": + if err := awsRestjson1_deserializeDocumentTTPsObservedDetail(&sv.TTPsObservedDetail, value); err != nil { + return err + } + default: + _, _ = key, value + + } } - *v = mv + *v = sv return nil } -func awsRestjson1_deserializeDocumentDatasourcePackageIngestHistory(v *map[string]map[string]types.TimestampForCollection, value interface{}) error { +func awsRestjson1_deserializeDocumentIndicators(v *[]types.Indicator, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3799,33 +5132,33 @@ func awsRestjson1_deserializeDocumentDatasourcePackageIngestHistory(v *map[strin 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]map[string]types.TimestampForCollection + var cv []types.Indicator if *v == nil { - mv = map[string]map[string]types.TimestampForCollection{} + cv = []types.Indicator{} } else { - mv = *v + cv = *v } - for key, value := range shape { - var parsedVal map[string]types.TimestampForCollection - mapVar := parsedVal - if err := awsRestjson1_deserializeDocumentLastIngestStateChangeDates(&mapVar, value); err != nil { + for _, value := range shape { + var col types.Indicator + destAddr := &col + if err := awsRestjson1_deserializeDocumentIndicator(&destAddr, value); err != nil { return err } - parsedVal = mapVar - mv[key] = parsedVal + col = *destAddr + cv = append(cv, col) } - *v = mv + *v = cv return nil } -func awsRestjson1_deserializeDocumentDatasourcePackageIngestStates(v *map[string]types.DatasourcePackageIngestState, value interface{}) error { +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3838,30 +5171,34 @@ func awsRestjson1_deserializeDocumentDatasourcePackageIngestStates(v *map[string return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]types.DatasourcePackageIngestState + var sv *types.InternalServerException if *v == nil { - mv = map[string]types.DatasourcePackageIngestState{} + sv = &types.InternalServerException{} } else { - mv = *v + sv = *v } for key, value := range shape { - var parsedVal types.DatasourcePackageIngestState - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DatasourcePackageIngestState to be of type string, got %T instead", value) + 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) } - parsedVal = types.DatasourcePackageIngestState(jtv) - } - mv[key] = parsedVal + default: + _, _ = key, value + + } } - *v = mv + *v = sv return nil } -func awsRestjson1_deserializeDocumentDatasourcePackageUsageInfo(v **types.DatasourcePackageUsageInfo, value interface{}) error { +func awsRestjson1_deserializeDocumentInvestigationDetail(v **types.InvestigationDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3874,92 +5211,80 @@ func awsRestjson1_deserializeDocumentDatasourcePackageUsageInfo(v **types.Dataso return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DatasourcePackageUsageInfo + var sv *types.InvestigationDetail if *v == nil { - sv = &types.DatasourcePackageUsageInfo{} + sv = &types.InvestigationDetail{} } else { sv = *v } for key, value := range shape { switch key { - case "VolumeUsageInBytes": + case "CreatedTime": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ByteValue to be json.Number, got %T instead", value) + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } - i64, err := jtv.Int64() + t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } - sv.VolumeUsageInBytes = ptr.Int64(i64) + sv.CreatedTime = ptr.Time(t) } - case "VolumeUsageUpdateTime": + case "EntityArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected EntityArn to be of type string, got %T instead", value) } - sv.VolumeUsageUpdateTime = ptr.Time(t) + sv.EntityArn = ptr.String(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentGraph(v **types.Graph, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + case "EntityType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityType to be of type string, got %T instead", value) + } + sv.EntityType = types.EntityType(jtv) + } - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "InvestigationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InvestigationId to be of type string, got %T instead", value) + } + sv.InvestigationId = ptr.String(jtv) + } - var sv *types.Graph - if *v == nil { - sv = &types.Graph{} - } else { - sv = *v - } + case "Severity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Severity to be of type string, got %T instead", value) + } + sv.Severity = types.Severity(jtv) + } - for key, value := range shape { - switch key { - case "Arn": + case "State": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GraphArn to be of type string, got %T instead", value) + return fmt.Errorf("expected State to be of type string, got %T instead", value) } - sv.Arn = ptr.String(jtv) + sv.State = types.State(jtv) } - case "CreatedTime": + case "Status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected Status to be of type string, got %T instead", value) } - sv.CreatedTime = ptr.Time(t) + sv.Status = types.Status(jtv) } default: @@ -3971,7 +5296,7 @@ func awsRestjson1_deserializeDocumentGraph(v **types.Graph, value interface{}) e return nil } -func awsRestjson1_deserializeDocumentGraphList(v *[]types.Graph, value interface{}) error { +func awsRestjson1_deserializeDocumentInvestigationDetails(v *[]types.InvestigationDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3984,17 +5309,17 @@ func awsRestjson1_deserializeDocumentGraphList(v *[]types.Graph, value interface return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Graph + var cv []types.InvestigationDetail if *v == nil { - cv = []types.Graph{} + cv = []types.InvestigationDetail{} } else { cv = *v } for _, value := range shape { - var col types.Graph + var col types.InvestigationDetail destAddr := &col - if err := awsRestjson1_deserializeDocumentGraph(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentInvestigationDetail(&destAddr, value); err != nil { return err } col = *destAddr @@ -4005,46 +5330,6 @@ func awsRestjson1_deserializeDocumentGraphList(v *[]types.Graph, value interface 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 ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - func awsRestjson1_deserializeDocumentLastIngestStateChangeDates(v *map[string]types.TimestampForCollection, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4205,82 +5490,311 @@ func awsRestjson1_deserializeDocumentMemberDetail(v **types.MemberDetail, value case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.PercentOfGraphUtilization = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Percentage to be a JSON Number, got %T instead", value) + + } + } + + case "PercentOfGraphUtilizationUpdatedTime": + 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.PercentOfGraphUtilizationUpdatedTime = ptr.Time(t) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MemberStatus to be of type string, got %T instead", value) + } + sv.Status = types.MemberStatus(jtv) + } + + case "UpdatedTime": + 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.UpdatedTime = ptr.Time(t) + } + + case "VolumeUsageByDatasourcePackage": + if err := awsRestjson1_deserializeDocumentVolumeUsageByDatasourcePackage(&sv.VolumeUsageByDatasourcePackage, value); err != nil { + return err + } + + case "VolumeUsageInBytes": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ByteValue to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.VolumeUsageInBytes = ptr.Int64(i64) + } + + case "VolumeUsageUpdatedTime": + 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.VolumeUsageUpdatedTime = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMemberDetailList(v *[]types.MemberDetail, 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.MemberDetail + if *v == nil { + cv = []types.MemberDetail{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MemberDetail + destAddr := &col + if err := awsRestjson1_deserializeDocumentMemberDetail(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentMembershipDatasources(v **types.MembershipDatasources, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.MembershipDatasources + if *v == nil { + sv = &types.MembershipDatasources{} + } 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 "DatasourcePackageIngestHistory": + if err := awsRestjson1_deserializeDocumentDatasourcePackageIngestHistory(&sv.DatasourcePackageIngestHistory, value); err != nil { + return err + } + + case "GraphArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GraphArn to be of type string, got %T instead", value) + } + sv.GraphArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMembershipDatasourcesList(v *[]types.MembershipDatasources, 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.MembershipDatasources + if *v == nil { + cv = []types.MembershipDatasources{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MembershipDatasources + destAddr := &col + if err := awsRestjson1_deserializeDocumentMembershipDatasources(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} - } - sv.PercentOfGraphUtilization = ptr.Float64(f64) +func awsRestjson1_deserializeDocumentNewAsoDetail(v **types.NewAsoDetail, 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 Percentage 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.NewAsoDetail + if *v == nil { + sv = &types.NewAsoDetail{} + } else { + sv = *v + } - case "PercentOfGraphUtilizationUpdatedTime": + for key, value := range shape { + switch key { + case "Aso": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + return fmt.Errorf("expected Aso to be of type string, got %T instead", value) } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err - } - sv.PercentOfGraphUtilizationUpdatedTime = ptr.Time(t) + sv.Aso = ptr.String(jtv) } - case "Status": + case "IsNewForEntireAccount": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected MemberStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected IsNewForEntireAccount to be of type *bool, got %T instead", value) } - sv.Status = types.MemberStatus(jtv) + sv.IsNewForEntireAccount = jtv } - case "UpdatedTime": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentNewGeolocationDetail(v **types.NewGeolocationDetail, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.NewGeolocationDetail + if *v == nil { + sv = &types.NewGeolocationDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "IpAddress": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + return fmt.Errorf("expected IpAddress to be of type string, got %T instead", value) } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err - } - sv.UpdatedTime = ptr.Time(t) - } - - case "VolumeUsageByDatasourcePackage": - if err := awsRestjson1_deserializeDocumentVolumeUsageByDatasourcePackage(&sv.VolumeUsageByDatasourcePackage, value); err != nil { - return err + sv.IpAddress = ptr.String(jtv) } - case "VolumeUsageInBytes": + case "IsNewForEntireAccount": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected ByteValue to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected IsNewForEntireAccount to be of type *bool, got %T instead", value) } - sv.VolumeUsageInBytes = ptr.Int64(i64) + sv.IsNewForEntireAccount = jtv } - case "VolumeUsageUpdatedTime": + case "Location": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected Location to be of type string, got %T instead", value) } - sv.VolumeUsageUpdatedTime = ptr.Time(t) + sv.Location = ptr.String(jtv) } default: @@ -4292,7 +5806,7 @@ func awsRestjson1_deserializeDocumentMemberDetail(v **types.MemberDetail, value return nil } -func awsRestjson1_deserializeDocumentMemberDetailList(v *[]types.MemberDetail, value interface{}) error { +func awsRestjson1_deserializeDocumentNewUserAgentDetail(v **types.NewUserAgentDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4300,33 +5814,48 @@ func awsRestjson1_deserializeDocumentMemberDetailList(v *[]types.MemberDetail, v 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.MemberDetail + var sv *types.NewUserAgentDetail if *v == nil { - cv = []types.MemberDetail{} + sv = &types.NewUserAgentDetail{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.MemberDetail - destAddr := &col - if err := awsRestjson1_deserializeDocumentMemberDetail(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "IsNewForEntireAccount": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected IsNewForEntireAccount to be of type *bool, got %T instead", value) + } + sv.IsNewForEntireAccount = jtv + } + + case "UserAgent": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UserAgent to be of type string, got %T instead", value) + } + sv.UserAgent = ptr.String(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentMembershipDatasources(v **types.MembershipDatasources, value interface{}) error { +func awsRestjson1_deserializeDocumentRelatedFindingDetail(v **types.RelatedFindingDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4339,36 +5868,40 @@ func awsRestjson1_deserializeDocumentMembershipDatasources(v **types.MembershipD return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.MembershipDatasources + var sv *types.RelatedFindingDetail if *v == nil { - sv = &types.MembershipDatasources{} + sv = &types.RelatedFindingDetail{} } else { sv = *v } for key, value := range shape { switch key { - case "AccountId": + case "Arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + return fmt.Errorf("expected EntityArn to be of type string, got %T instead", value) } - sv.AccountId = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "DatasourcePackageIngestHistory": - if err := awsRestjson1_deserializeDocumentDatasourcePackageIngestHistory(&sv.DatasourcePackageIngestHistory, value); err != nil { - return err + case "IpAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IpAddress to be of type string, got %T instead", value) + } + sv.IpAddress = ptr.String(jtv) } - case "GraphArn": + case "Type": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GraphArn to be of type string, got %T instead", value) + return fmt.Errorf("expected Type to be of type string, got %T instead", value) } - sv.GraphArn = ptr.String(jtv) + sv.Type = ptr.String(jtv) } default: @@ -4380,7 +5913,7 @@ func awsRestjson1_deserializeDocumentMembershipDatasources(v **types.MembershipD return nil } -func awsRestjson1_deserializeDocumentMembershipDatasourcesList(v *[]types.MembershipDatasources, value interface{}) error { +func awsRestjson1_deserializeDocumentRelatedFindingGroupDetail(v **types.RelatedFindingGroupDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4388,29 +5921,35 @@ func awsRestjson1_deserializeDocumentMembershipDatasourcesList(v *[]types.Member 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.MembershipDatasources + var sv *types.RelatedFindingGroupDetail if *v == nil { - cv = []types.MembershipDatasources{} + sv = &types.RelatedFindingGroupDetail{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.MembershipDatasources - destAddr := &col - if err := awsRestjson1_deserializeDocumentMembershipDatasources(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + 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) + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } @@ -4655,6 +6194,108 @@ func awsRestjson1_deserializeDocumentTooManyRequestsException(v **types.TooManyR return nil } +func awsRestjson1_deserializeDocumentTTPsObservedDetail(v **types.TTPsObservedDetail, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TTPsObservedDetail + if *v == nil { + sv = &types.TTPsObservedDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "APIFailureCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected APIFailureCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.APIFailureCount = i64 + } + + case "APIName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected APIName to be of type string, got %T instead", value) + } + sv.APIName = ptr.String(jtv) + } + + case "APISuccessCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected APISuccessCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.APISuccessCount = i64 + } + + case "IpAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IpAddress to be of type string, got %T instead", value) + } + sv.IpAddress = ptr.String(jtv) + } + + case "Procedure": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Procedure to be of type string, got %T instead", value) + } + sv.Procedure = ptr.String(jtv) + } + + case "Tactic": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Tactic to be of type string, got %T instead", value) + } + sv.Tactic = ptr.String(jtv) + } + + case "Technique": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Technique to be of type string, got %T instead", value) + } + sv.Technique = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentUnprocessedAccount(v **types.UnprocessedAccount, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/detective/endpoints.go b/service/detective/endpoints.go index 4ea2dbd63ea..4b2b271f06e 100644 --- a/service/detective/endpoints.go +++ b/service/detective/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://api.detective-fips.") diff --git a/service/detective/generated.json b/service/detective/generated.json index 57e90fb02aa..9709ed1643f 100644 --- a/service/detective/generated.json +++ b/service/detective/generated.json @@ -20,18 +20,23 @@ "api_op_DisableOrganizationAdminAccount.go", "api_op_DisassociateMembership.go", "api_op_EnableOrganizationAdminAccount.go", + "api_op_GetInvestigation.go", "api_op_GetMembers.go", "api_op_ListDatasourcePackages.go", "api_op_ListGraphs.go", + "api_op_ListIndicators.go", + "api_op_ListInvestigations.go", "api_op_ListInvitations.go", "api_op_ListMembers.go", "api_op_ListOrganizationAdminAccounts.go", "api_op_ListTagsForResource.go", "api_op_RejectInvitation.go", + "api_op_StartInvestigation.go", "api_op_StartMonitoringMember.go", "api_op_TagResource.go", "api_op_UntagResource.go", "api_op_UpdateDatasourcePackages.go", + "api_op_UpdateInvestigationState.go", "api_op_UpdateOrganizationConfiguration.go", "auth.go", "deserializers.go", diff --git a/service/detective/serializers.go b/service/detective/serializers.go index 3896e55d708..8afb24af4ec 100644 --- a/service/detective/serializers.go +++ b/service/detective/serializers.go @@ -11,6 +11,7 @@ import ( "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -851,6 +852,86 @@ func awsRestjson1_serializeOpDocumentEnableOrganizationAdminAccountInput(v *Enab return nil } +type awsRestjson1_serializeOpGetInvestigation struct { +} + +func (*awsRestjson1_serializeOpGetInvestigation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetInvestigation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetInvestigationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/investigations/getInvestigation") + 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_serializeOpDocumentGetInvestigationInput(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_serializeOpHttpBindingsGetInvestigationInput(v *GetInvestigationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetInvestigationInput(v *GetInvestigationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.GraphArn != nil { + ok := object.Key("GraphArn") + ok.String(*v.GraphArn) + } + + if v.InvestigationId != nil { + ok := object.Key("InvestigationId") + ok.String(*v.InvestigationId) + } + + return nil +} + type awsRestjson1_serializeOpGetMembers struct { } @@ -1098,6 +1179,200 @@ func awsRestjson1_serializeOpDocumentListGraphsInput(v *ListGraphsInput, value s return nil } +type awsRestjson1_serializeOpListIndicators struct { +} + +func (*awsRestjson1_serializeOpListIndicators) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListIndicators) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListIndicatorsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/investigations/listIndicators") + 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_serializeOpDocumentListIndicatorsInput(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_serializeOpHttpBindingsListIndicatorsInput(v *ListIndicatorsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListIndicatorsInput(v *ListIndicatorsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.GraphArn != nil { + ok := object.Key("GraphArn") + ok.String(*v.GraphArn) + } + + if len(v.IndicatorType) > 0 { + ok := object.Key("IndicatorType") + ok.String(string(v.IndicatorType)) + } + + if v.InvestigationId != nil { + ok := object.Key("InvestigationId") + ok.String(*v.InvestigationId) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListInvestigations struct { +} + +func (*awsRestjson1_serializeOpListInvestigations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListInvestigations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListInvestigationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/investigations/listInvestigations") + 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_serializeOpDocumentListInvestigationsInput(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_serializeOpHttpBindingsListInvestigationsInput(v *ListInvestigationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListInvestigationsInput(v *ListInvestigationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FilterCriteria != nil { + ok := object.Key("FilterCriteria") + if err := awsRestjson1_serializeDocumentFilterCriteria(v.FilterCriteria, ok); err != nil { + return err + } + } + + if v.GraphArn != nil { + ok := object.Key("GraphArn") + ok.String(*v.GraphArn) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.SortCriteria != nil { + ok := object.Key("SortCriteria") + if err := awsRestjson1_serializeDocumentSortCriteria(v.SortCriteria, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpListInvitations struct { } @@ -1483,6 +1758,96 @@ func awsRestjson1_serializeOpDocumentRejectInvitationInput(v *RejectInvitationIn return nil } +type awsRestjson1_serializeOpStartInvestigation struct { +} + +func (*awsRestjson1_serializeOpStartInvestigation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartInvestigation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartInvestigationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/investigations/startInvestigation") + 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_serializeOpDocumentStartInvestigationInput(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_serializeOpHttpBindingsStartInvestigationInput(v *StartInvestigationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartInvestigationInput(v *StartInvestigationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EntityArn != nil { + ok := object.Key("EntityArn") + ok.String(*v.EntityArn) + } + + if v.GraphArn != nil { + ok := object.Key("GraphArn") + ok.String(*v.GraphArn) + } + + if v.ScopeEndTime != nil { + ok := object.Key("ScopeEndTime") + ok.String(smithytime.FormatDateTime(*v.ScopeEndTime)) + } + + if v.ScopeStartTime != nil { + ok := object.Key("ScopeStartTime") + ok.String(smithytime.FormatDateTime(*v.ScopeStartTime)) + } + + return nil +} + type awsRestjson1_serializeOpStartMonitoringMember struct { } @@ -1806,6 +2171,91 @@ func awsRestjson1_serializeOpDocumentUpdateDatasourcePackagesInput(v *UpdateData return nil } +type awsRestjson1_serializeOpUpdateInvestigationState struct { +} + +func (*awsRestjson1_serializeOpUpdateInvestigationState) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateInvestigationState) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateInvestigationStateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/investigations/updateInvestigationState") + 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_serializeOpDocumentUpdateInvestigationStateInput(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_serializeOpHttpBindingsUpdateInvestigationStateInput(v *UpdateInvestigationStateInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateInvestigationStateInput(v *UpdateInvestigationStateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.GraphArn != nil { + ok := object.Key("GraphArn") + ok.String(*v.GraphArn) + } + + if v.InvestigationId != nil { + ok := object.Key("InvestigationId") + ok.String(*v.InvestigationId) + } + + if len(v.State) > 0 { + ok := object.Key("State") + ok.String(string(v.State)) + } + + return nil +} + type awsRestjson1_serializeOpUpdateOrganizationConfiguration struct { } @@ -1949,6 +2399,65 @@ func awsRestjson1_serializeDocumentDatasourcePackageList(v []types.DatasourcePac return nil } +func awsRestjson1_serializeDocumentDateFilter(v *types.DateFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndInclusive != nil { + ok := object.Key("EndInclusive") + ok.String(smithytime.FormatDateTime(*v.EndInclusive)) + } + + if v.StartInclusive != nil { + ok := object.Key("StartInclusive") + ok.String(smithytime.FormatDateTime(*v.StartInclusive)) + } + + return nil +} + +func awsRestjson1_serializeDocumentFilterCriteria(v *types.FilterCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CreatedTime != nil { + ok := object.Key("CreatedTime") + if err := awsRestjson1_serializeDocumentDateFilter(v.CreatedTime, ok); err != nil { + return err + } + } + + if v.EntityArn != nil { + ok := object.Key("EntityArn") + if err := awsRestjson1_serializeDocumentStringFilter(v.EntityArn, ok); err != nil { + return err + } + } + + if v.Severity != nil { + ok := object.Key("Severity") + if err := awsRestjson1_serializeDocumentStringFilter(v.Severity, ok); err != nil { + return err + } + } + + if v.State != nil { + ok := object.Key("State") + if err := awsRestjson1_serializeDocumentStringFilter(v.State, ok); err != nil { + return err + } + } + + if v.Status != nil { + ok := object.Key("Status") + if err := awsRestjson1_serializeDocumentStringFilter(v.Status, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentGraphArnList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1960,6 +2469,35 @@ func awsRestjson1_serializeDocumentGraphArnList(v []string, value smithyjson.Val return nil } +func awsRestjson1_serializeDocumentSortCriteria(v *types.SortCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Field) > 0 { + ok := object.Key("Field") + ok.String(string(v.Field)) + } + + if len(v.SortOrder) > 0 { + ok := object.Key("SortOrder") + ok.String(string(v.SortOrder)) + } + + return nil +} + +func awsRestjson1_serializeDocumentStringFilter(v *types.StringFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/detective/types/enums.go b/service/detective/types/enums.go index 7c445f6041f..75bfe3e4011 100644 --- a/service/detective/types/enums.go +++ b/service/detective/types/enums.go @@ -43,6 +43,24 @@ func (DatasourcePackageIngestState) Values() []DatasourcePackageIngestState { } } +type EntityType string + +// Enum values for EntityType +const ( + EntityTypeIamRole EntityType = "IAM_ROLE" + EntityTypeIamUser EntityType = "IAM_USER" +) + +// Values returns all known values for EntityType. 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 (EntityType) Values() []EntityType { + return []EntityType{ + "IAM_ROLE", + "IAM_USER", + } +} + type ErrorCode string // Enum values for ErrorCode @@ -63,6 +81,56 @@ func (ErrorCode) Values() []ErrorCode { } } +type Field string + +// Enum values for Field +const ( + FieldSeverity Field = "SEVERITY" + FieldStatus Field = "STATUS" + FieldCreatedTime Field = "CREATED_TIME" +) + +// Values returns all known values for Field. 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 (Field) Values() []Field { + return []Field{ + "SEVERITY", + "STATUS", + "CREATED_TIME", + } +} + +type IndicatorType string + +// Enum values for IndicatorType +const ( + IndicatorTypeTtpObserved IndicatorType = "TTP_OBSERVED" + IndicatorTypeImpossibleTravel IndicatorType = "IMPOSSIBLE_TRAVEL" + IndicatorTypeFlaggedIpAddress IndicatorType = "FLAGGED_IP_ADDRESS" + IndicatorTypeNewGeolocation IndicatorType = "NEW_GEOLOCATION" + IndicatorTypeNewAso IndicatorType = "NEW_ASO" + IndicatorTypeNewUserAgent IndicatorType = "NEW_USER_AGENT" + IndicatorTypeRelatedFinding IndicatorType = "RELATED_FINDING" + IndicatorTypeRelatedFindingGroup IndicatorType = "RELATED_FINDING_GROUP" +) + +// Values returns all known values for IndicatorType. 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 (IndicatorType) Values() []IndicatorType { + return []IndicatorType{ + "TTP_OBSERVED", + "IMPOSSIBLE_TRAVEL", + "FLAGGED_IP_ADDRESS", + "NEW_GEOLOCATION", + "NEW_ASO", + "NEW_USER_AGENT", + "RELATED_FINDING", + "RELATED_FINDING_GROUP", + } +} + type InvitationType string // Enum values for InvitationType @@ -122,3 +190,99 @@ func (MemberStatus) Values() []MemberStatus { "ACCEPTED_BUT_DISABLED", } } + +type Reason string + +// Enum values for Reason +const ( + ReasonAwsThreatIntelligence Reason = "AWS_THREAT_INTELLIGENCE" +) + +// Values returns all known values for Reason. 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 (Reason) Values() []Reason { + return []Reason{ + "AWS_THREAT_INTELLIGENCE", + } +} + +type Severity string + +// Enum values for Severity +const ( + SeverityInformational Severity = "INFORMATIONAL" + SeverityLow Severity = "LOW" + SeverityMedium Severity = "MEDIUM" + SeverityHigh Severity = "HIGH" + SeverityCritical Severity = "CRITICAL" +) + +// Values returns all known values for Severity. 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 (Severity) Values() []Severity { + return []Severity{ + "INFORMATIONAL", + "LOW", + "MEDIUM", + "HIGH", + "CRITICAL", + } +} + +type SortOrder string + +// Enum values for SortOrder +const ( + SortOrderAsc SortOrder = "ASC" + SortOrderDesc SortOrder = "DESC" +) + +// Values returns all known values for SortOrder. 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 (SortOrder) Values() []SortOrder { + return []SortOrder{ + "ASC", + "DESC", + } +} + +type State string + +// Enum values for State +const ( + StateActive State = "ACTIVE" + StateArchived State = "ARCHIVED" +) + +// Values returns all known values for State. 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 (State) Values() []State { + return []State{ + "ACTIVE", + "ARCHIVED", + } +} + +type Status string + +// Enum values for Status +const ( + StatusRunning Status = "RUNNING" + StatusFailed Status = "FAILED" + StatusSuccessful Status = "SUCCESSFUL" +) + +// Values returns all known values for Status. 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 (Status) Values() []Status { + return []Status{ + "RUNNING", + "FAILED", + "SUCCESSFUL", + } +} diff --git a/service/detective/types/types.go b/service/detective/types/types.go index 298e2dfeeae..b0d6c8534fe 100644 --- a/service/detective/types/types.go +++ b/service/detective/types/types.go @@ -67,6 +67,60 @@ type DatasourcePackageUsageInfo struct { noSmithyDocumentSerde } +// Contains details on the time range used to filter data. +type DateFilter struct { + + // A timestamp representing the end date of the time period until when data is + // filtered , including the end date. + // + // This member is required. + EndInclusive *time.Time + + // A timestamp representing the start of the time period from when data is + // filtered, including the start date. + // + // This member is required. + StartInclusive *time.Time + + noSmithyDocumentSerde +} + +// Details on the criteria used to define the filter for investigation results. +type FilterCriteria struct { + + // Filter the investigation results based on when the investigation was created. + CreatedTime *DateFilter + + // Filter the investigation results based on the Amazon Resource Name (ARN) of the + // entity. + EntityArn *StringFilter + + // Filter the investigation results based on the severity. + Severity *StringFilter + + // Filter the investigation results based on the state. + State *StringFilter + + // Filter the investigation results based on the status. + Status *StringFilter + + noSmithyDocumentSerde +} + +// Contains information on suspicious IP addresses identified as indicators of +// compromise. This indicator is derived from Amazon Web Services threat +// intelligence. +type FlaggedIpAddressDetail struct { + + // IP address of the suspicious entity. + IpAddress *string + + // Details the reason the IP address was flagged as suspicious. + Reason Reason + + noSmithyDocumentSerde +} + // A behavior graph in Detective. type Graph struct { @@ -80,6 +134,106 @@ type Graph struct { noSmithyDocumentSerde } +// Contains information on unusual and impossible travel in an account. +type ImpossibleTravelDetail struct { + + // IP address where the resource was last used in the impossible travel. + EndingIpAddress *string + + // Location where the resource was last used in the impossible travel. + EndingLocation *string + + // Returns the time difference between the first and last timestamp the resource + // was used. + HourlyTimeDelta *int32 + + // IP address where the resource was first used in the impossible travel + StartingIpAddress *string + + // Location where the resource was first used in the impossible travel + StartingLocation *string + + noSmithyDocumentSerde +} + +// Investigations triages indicators of compromises such as a finding and surfaces +// only the most critical and suspicious issues, so you can focus on high-level +// investigations. +type Indicator struct { + + // Details about the indicator of compromise. + IndicatorDetail *IndicatorDetail + + // The type of indicator. + IndicatorType IndicatorType + + noSmithyDocumentSerde +} + +// Details about the indicators of compromise which are used to determine if a +// resource is involved in a security incident. +type IndicatorDetail struct { + + // Suspicious IP addresses that are flagged, which indicates critical or severe + // threats based on threat intelligence by Detective. This indicator is derived + // from AWS threat intelligence. + FlaggedIpAddressDetail *FlaggedIpAddressDetail + + // Identifies unusual and impossible user activity for an account. + ImpossibleTravelDetail *ImpossibleTravelDetail + + // Contains details about the new Autonomous System Organization (ASO). + NewAsoDetail *NewAsoDetail + + // Contains details about the new geographic location. + NewGeolocationDetail *NewGeolocationDetail + + // Contains details about the new user agent. + NewUserAgentDetail *NewUserAgentDetail + + // Contains details about related findings. + RelatedFindingDetail *RelatedFindingDetail + + // Contains details about related finding groups. + RelatedFindingGroupDetail *RelatedFindingGroupDetail + + // Details about the indicator of compromise. + TTPsObservedDetail *TTPsObservedDetail + + noSmithyDocumentSerde +} + +// Details about the investigation related to a potential security event +// identified by Detective +type InvestigationDetail struct { + + // The UTC time stamp of the creation time of the investigation report. + CreatedTime *time.Time + + // The unique Amazon Resource Name (ARN) of the IAM user and IAM role. + EntityArn *string + + // Type of entity. For example, Amazon Web Services accounts, such as IAM user and + // role. + EntityType EntityType + + // The investigation ID of the investigation report. + InvestigationId *string + + // Severity based on the likelihood and impact of the indicators of compromise + // discovered in the investigation. + Severity Severity + + // The current state of the investigation. An archived investigation indicates you + // have completed reviewing the investigation. + State State + + // Status based on the completion status of the investigation. + Status Status + + noSmithyDocumentSerde +} + // Details about a member account in a behavior graph. type MemberDetail struct { @@ -210,6 +364,99 @@ type MembershipDatasources struct { noSmithyDocumentSerde } +// Details new Autonomous System Organizations (ASOs) used either at the resource +// or account level. +type NewAsoDetail struct { + + // Details about the new Autonomous System Organization (ASO). + Aso *string + + // Checks if the ASO is for new for the entire account. + IsNewForEntireAccount bool + + noSmithyDocumentSerde +} + +// Details new geolocations used either at the resource or account level. For +// example, lists an observed geolocation that is an infrequent or unused location +// based on previous user activity. +type NewGeolocationDetail struct { + + // IP address using which the resource was accessed. + IpAddress *string + + // Checks if the gelocation is new for the entire account. + IsNewForEntireAccount bool + + // Location where the resource was accessed. + Location *string + + noSmithyDocumentSerde +} + +// Details new user agents used either at the resource or account level. +type NewUserAgentDetail struct { + + // Checks if the user agent is new for the entire account. + IsNewForEntireAccount bool + + // New user agent which accessed the resource. + UserAgent *string + + noSmithyDocumentSerde +} + +// Details related activities associated with a potential security event. Lists +// all distinct categories of evidence that are connected to the resource or the +// finding group. +type RelatedFindingDetail struct { + + // The ARN of the related finding. + Arn *string + + // The IP address of the finding. + IpAddress *string + + // The type of finding. + Type *string + + noSmithyDocumentSerde +} + +// Details multiple activities as they related to a potential security event. +// Detective uses graph analysis technique that infers relationships between +// findings and entities, and groups them together as a finding group. +type RelatedFindingGroupDetail struct { + + // The unique identifier for the finding group. + Id *string + + noSmithyDocumentSerde +} + +// Details about the criteria used for sorting investigations. +type SortCriteria struct { + + // Represents the Field attribute to sort investigations. + Field Field + + // The order by which the sorted findings are displayed. + SortOrder SortOrder + + noSmithyDocumentSerde +} + +// A string for filtering Detective investigations. +type StringFilter struct { + + // The string filter value. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + // Details on when data collection began for a source package. type TimestampForCollection struct { @@ -220,6 +467,35 @@ type TimestampForCollection struct { noSmithyDocumentSerde } +// Details tactics, techniques, and procedures (TTPs) used in a potential security +// event. Tactics are based on MITRE ATT&CK Matrix for Enterprise (https://attack.mitre.org/matrices/enterprise/) +// . +type TTPsObservedDetail struct { + + // The total number of failed API requests. + APIFailureCount int64 + + // The name of the API where the TTP was observed. + APIName *string + + // The total number of successful API requests. + APISuccessCount int64 + + // The IP address where the TTP was observed. + IpAddress *string + + // The procedure used, identified by the investigation. + Procedure *string + + // The tactic used, identified by the investigation. + Tactic *string + + // The technique used, identified by the investigation. + Technique *string + + noSmithyDocumentSerde +} + // A member account that was included in a request but for which the request could // not be processed. type UnprocessedAccount struct { diff --git a/service/detective/validators.go b/service/detective/validators.go index 947dfdb8c39..e2af3f3e310 100644 --- a/service/detective/validators.go +++ b/service/detective/validators.go @@ -190,6 +190,26 @@ func (m *validateOpEnableOrganizationAdminAccount) HandleInitialize(ctx context. return next.HandleInitialize(ctx, in) } +type validateOpGetInvestigation struct { +} + +func (*validateOpGetInvestigation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetInvestigation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetInvestigationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetInvestigationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetMembers struct { } @@ -230,6 +250,46 @@ func (m *validateOpListDatasourcePackages) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpListIndicators struct { +} + +func (*validateOpListIndicators) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListIndicators) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListIndicatorsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListIndicatorsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListInvestigations struct { +} + +func (*validateOpListInvestigations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListInvestigations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListInvestigationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListInvestigationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListMembers struct { } @@ -290,6 +350,26 @@ func (m *validateOpRejectInvitation) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpStartInvestigation struct { +} + +func (*validateOpStartInvestigation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartInvestigation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartInvestigationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartInvestigationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartMonitoringMember struct { } @@ -370,6 +450,26 @@ func (m *validateOpUpdateDatasourcePackages) HandleInitialize(ctx context.Contex return next.HandleInitialize(ctx, in) } +type validateOpUpdateInvestigationState struct { +} + +func (*validateOpUpdateInvestigationState) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateInvestigationState) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateInvestigationStateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateInvestigationStateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateOrganizationConfiguration struct { } @@ -426,6 +526,10 @@ func addOpEnableOrganizationAdminAccountValidationMiddleware(stack *middleware.S return stack.Initialize.Add(&validateOpEnableOrganizationAdminAccount{}, middleware.After) } +func addOpGetInvestigationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetInvestigation{}, middleware.After) +} + func addOpGetMembersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetMembers{}, middleware.After) } @@ -434,6 +538,14 @@ func addOpListDatasourcePackagesValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpListDatasourcePackages{}, middleware.After) } +func addOpListIndicatorsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListIndicators{}, middleware.After) +} + +func addOpListInvestigationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListInvestigations{}, middleware.After) +} + func addOpListMembersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListMembers{}, middleware.After) } @@ -446,6 +558,10 @@ func addOpRejectInvitationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRejectInvitation{}, middleware.After) } +func addOpStartInvestigationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartInvestigation{}, middleware.After) +} + func addOpStartMonitoringMemberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartMonitoringMember{}, middleware.After) } @@ -462,6 +578,10 @@ func addOpUpdateDatasourcePackagesValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpUpdateDatasourcePackages{}, middleware.After) } +func addOpUpdateInvestigationStateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateInvestigationState{}, middleware.After) +} + func addOpUpdateOrganizationConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateOrganizationConfiguration{}, middleware.After) } @@ -501,6 +621,76 @@ func validateAccountList(v []types.Account) error { } } +func validateDateFilter(v *types.DateFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DateFilter"} + if v.StartInclusive == nil { + invalidParams.Add(smithy.NewErrParamRequired("StartInclusive")) + } + if v.EndInclusive == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndInclusive")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFilterCriteria(v *types.FilterCriteria) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FilterCriteria"} + if v.Severity != nil { + if err := validateStringFilter(v.Severity); err != nil { + invalidParams.AddNested("Severity", err.(smithy.InvalidParamsError)) + } + } + if v.Status != nil { + if err := validateStringFilter(v.Status); err != nil { + invalidParams.AddNested("Status", err.(smithy.InvalidParamsError)) + } + } + if v.State != nil { + if err := validateStringFilter(v.State); err != nil { + invalidParams.AddNested("State", err.(smithy.InvalidParamsError)) + } + } + if v.EntityArn != nil { + if err := validateStringFilter(v.EntityArn); err != nil { + invalidParams.AddNested("EntityArn", err.(smithy.InvalidParamsError)) + } + } + if v.CreatedTime != nil { + if err := validateDateFilter(v.CreatedTime); err != nil { + invalidParams.AddNested("CreatedTime", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStringFilter(v *types.StringFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StringFilter"} + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpAcceptInvitationInput(v *AcceptInvitationInput) error { if v == nil { return nil @@ -649,6 +839,24 @@ func validateOpEnableOrganizationAdminAccountInput(v *EnableOrganizationAdminAcc } } +func validateOpGetInvestigationInput(v *GetInvestigationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetInvestigationInput"} + if v.GraphArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("GraphArn")) + } + if v.InvestigationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InvestigationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetMembersInput(v *GetMembersInput) error { if v == nil { return nil @@ -682,6 +890,44 @@ func validateOpListDatasourcePackagesInput(v *ListDatasourcePackagesInput) error } } +func validateOpListIndicatorsInput(v *ListIndicatorsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListIndicatorsInput"} + if v.GraphArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("GraphArn")) + } + if v.InvestigationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InvestigationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListInvestigationsInput(v *ListInvestigationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListInvestigationsInput"} + if v.GraphArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("GraphArn")) + } + if v.FilterCriteria != nil { + if err := validateFilterCriteria(v.FilterCriteria); err != nil { + invalidParams.AddNested("FilterCriteria", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListMembersInput(v *ListMembersInput) error { if v == nil { return nil @@ -727,6 +973,30 @@ func validateOpRejectInvitationInput(v *RejectInvitationInput) error { } } +func validateOpStartInvestigationInput(v *StartInvestigationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartInvestigationInput"} + if v.GraphArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("GraphArn")) + } + if v.EntityArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("EntityArn")) + } + if v.ScopeStartTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScopeStartTime")) + } + if v.ScopeEndTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScopeEndTime")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartMonitoringMemberInput(v *StartMonitoringMemberInput) error { if v == nil { return nil @@ -799,6 +1069,27 @@ func validateOpUpdateDatasourcePackagesInput(v *UpdateDatasourcePackagesInput) e } } +func validateOpUpdateInvestigationStateInput(v *UpdateInvestigationStateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateInvestigationStateInput"} + if v.GraphArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("GraphArn")) + } + if v.InvestigationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InvestigationId")) + } + if len(v.State) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("State")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateOrganizationConfigurationInput(v *UpdateOrganizationConfigurationInput) error { if v == nil { return nil diff --git a/service/docdb/internal/endpoints/endpoints.go b/service/docdb/internal/endpoints/endpoints.go index 7259cbf8d0d..339cb6dc9a0 100644 --- a/service/docdb/internal/endpoints/endpoints.go +++ b/service/docdb/internal/endpoints/endpoints.go @@ -499,12 +499,96 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "rds-fips.us-iso-east-1", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds-fips.us-iso-west-1", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-iso-east-1", + }: endpoints.Endpoint{ + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-iso-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-iso-west-1", + }: endpoints.Endpoint{ + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-iso-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-west-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "us-iso-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + }, + endpoints.EndpointKey{ + Region: "us-iso-east-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-east-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "us-iso-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + }, + endpoints.EndpointKey{ + Region: "us-iso-west-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-west-1", + }, + Deprecated: aws.TrueTernary, + }, }, }, { @@ -528,9 +612,51 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "rds-fips.us-isob-east-1", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-isob-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-isob-east-1", + }: endpoints.Endpoint{ + CredentialScope: endpoints.CredentialScope{ + Region: "us-isob-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-isob-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-isob-east-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "us-isob-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-isob-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + }, + endpoints.EndpointKey{ + Region: "us-isob-east-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-isob-east-1", + }, + Deprecated: aws.TrueTernary, + }, }, }, { diff --git a/service/ecs/api_op_PutAccountSetting.go b/service/ecs/api_op_PutAccountSetting.go index f0bb45ca857..e6af721a79d 100644 --- a/service/ecs/api_op_PutAccountSetting.go +++ b/service/ecs/api_op_PutAccountSetting.go @@ -48,7 +48,12 @@ import ( // Use fargateTaskRetirementWaitPeriod to configure the wait time to retire a // Fargate task. For information about the Fargate tasks maintenance, see Amazon // Web Services Fargate task maintenance (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-maintenance.html) -// in the Amazon ECS Developer Guide. +// in the Amazon ECS Developer Guide. The guardDutyActivate parameter is read-only +// in Amazon ECS and indicates whether Amazon ECS Runtime Monitoring is enabled or +// disabled by your security administrator in your Amazon ECS account. Amazon +// GuardDuty controls this account setting on your behalf. For more information, +// see Protecting Amazon ECS workloads with Amazon ECS Runtime Monitoring (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-guard-duty-integration.html) +// . func (c *Client) PutAccountSetting(ctx context.Context, params *PutAccountSettingInput, optFns ...func(*Options)) (*PutAccountSettingOutput, error) { if params == nil { params = &PutAccountSettingInput{} @@ -80,7 +85,12 @@ type PutAccountSettingInput struct { // timeline, see Tagging authorization timeline (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#tag-resources) // in the Amazon ECS Developer Guide. If you specify // fargateTaskRetirementWaitPeriod , the wait time to retire a Fargate task is - // affected. + // affected. The guardDutyActivate parameter is read-only in Amazon ECS and + // indicates whether Amazon ECS Runtime Monitoring is enabled or disabled by your + // security administrator in your Amazon ECS account. Amazon GuardDuty controls + // this account setting on your behalf. For more information, see Protecting + // Amazon ECS workloads with Amazon ECS Runtime Monitoring (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-guard-duty-integration.html) + // . // // This member is required. Name types.SettingName diff --git a/service/ecs/api_op_PutAccountSettingDefault.go b/service/ecs/api_op_PutAccountSettingDefault.go index 950a2d39535..be23bbbee3d 100644 --- a/service/ecs/api_op_PutAccountSettingDefault.go +++ b/service/ecs/api_op_PutAccountSettingDefault.go @@ -56,7 +56,12 @@ type PutAccountSettingDefaultInput struct { // launched to replace them. Use fargateTaskRetirementWaitPeriod to set the wait // time to retire a Fargate task to the default. For information about the Fargate // tasks maintenance, see Amazon Web Services Fargate task maintenance (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-maintenance.html) - // in the Amazon ECS Developer Guide. + // in the Amazon ECS Developer Guide. The guardDutyActivate parameter is read-only + // in Amazon ECS and indicates whether Amazon ECS Runtime Monitoring is enabled or + // disabled by your security administrator in your Amazon ECS account. Amazon + // GuardDuty controls this account setting on your behalf. For more information, + // see Protecting Amazon ECS workloads with Amazon ECS Runtime Monitoring (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-guard-duty-integration.html) + // . // // This member is required. Name types.SettingName diff --git a/service/ecs/deserializers.go b/service/ecs/deserializers.go index 7dffa04a755..272b900f68b 100644 --- a/service/ecs/deserializers.go +++ b/service/ecs/deserializers.go @@ -15411,6 +15411,15 @@ func awsAwsjson11_deserializeDocumentSetting(v **types.Setting, value interface{ sv.PrincipalArn = ptr.String(jtv) } + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SettingType to be of type string, got %T instead", value) + } + sv.Type = types.SettingType(jtv) + } + case "value": if value != nil { jtv, ok := value.(string) diff --git a/service/ecs/types/enums.go b/service/ecs/types/enums.go index 9746d58968c..059121ff980 100644 --- a/service/ecs/types/enums.go +++ b/service/ecs/types/enums.go @@ -896,6 +896,7 @@ const ( SettingNameFargateFipsMode SettingName = "fargateFIPSMode" SettingNameTagResourceAuthorization SettingName = "tagResourceAuthorization" SettingNameFargateTaskRetirementWaitPeriod SettingName = "fargateTaskRetirementWaitPeriod" + SettingNameGuardDutyActivate SettingName = "guardDutyActivate" ) // Values returns all known values for SettingName. Note that this can be expanded @@ -911,6 +912,25 @@ func (SettingName) Values() []SettingName { "fargateFIPSMode", "tagResourceAuthorization", "fargateTaskRetirementWaitPeriod", + "guardDutyActivate", + } +} + +type SettingType string + +// Enum values for SettingType +const ( + SettingTypeUser SettingType = "user" + SettingTypeAwsManaged SettingType = "aws_managed" +) + +// Values returns all known values for SettingType. 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 (SettingType) Values() []SettingType { + return []SettingType{ + "user", + "aws_managed", } } diff --git a/service/ecs/types/types.go b/service/ecs/types/types.go index 8f88031606d..9642ca4f979 100644 --- a/service/ecs/types/types.go +++ b/service/ecs/types/types.go @@ -3335,6 +3335,12 @@ type Setting struct { // field is omitted, the authenticated user is assumed. PrincipalArn *string + // Indicates whether Amazon Web Services manages the account setting, or if the + // user manages it. aws_managed account settings are read-only, as Amazon Web + // Services manages such on the customer's behalf. Currently, the guardDutyActivate + // account setting is the only one Amazon Web Services manages. + Type SettingType + // Determines whether the account setting is on or off for the specified resource. Value *string diff --git a/service/efs/api_op_CreateAccessPoint.go b/service/efs/api_op_CreateAccessPoint.go index cf543f43fbb..a4a832245fa 100644 --- a/service/efs/api_op_CreateAccessPoint.go +++ b/service/efs/api_op_CreateAccessPoint.go @@ -64,16 +64,16 @@ type CreateAccessPointInput struct { // using the access point. PosixUser *types.PosixUser - // Specifies the directory on the Amazon EFS file system that the access point - // exposes as the root directory of your file system to NFS clients using the - // access point. The clients using the access point can only access the root - // directory and below. If the RootDirectory > Path specified does not exist, EFS - // creates it and applies the CreationInfo settings when a client connects to an - // access point. When specifying a RootDirectory , you must provide the Path , and - // the CreationInfo . Amazon EFS creates a root directory only if you have provided - // the CreationInfo: OwnUid, OwnGID, and permissions for the directory. If you do - // not provide this information, Amazon EFS does not create the root directory. If - // the root directory does not exist, attempts to mount using the access point will + // Specifies the directory on the EFS file system that the access point exposes as + // the root directory of your file system to NFS clients using the access point. + // The clients using the access point can only access the root directory and below. + // If the RootDirectory > Path specified does not exist, Amazon EFS creates it and + // applies the CreationInfo settings when a client connects to an access point. + // When specifying a RootDirectory , you must provide the Path , and the + // CreationInfo . Amazon EFS creates a root directory only if you have provided the + // CreationInfo: OwnUid, OwnGID, and permissions for the directory. If you do not + // provide this information, Amazon EFS does not create the root directory. If the + // root directory does not exist, attempts to mount using the access point will // fail. RootDirectory *types.RootDirectory @@ -115,8 +115,8 @@ type CreateAccessPointOutput struct { // using the access point. PosixUser *types.PosixUser - // The directory on the Amazon EFS file system that the access point exposes as - // the root directory to NFS clients using the access point. + // The directory on the EFS file system that the access point exposes as the root + // directory to NFS clients using the access point. RootDirectory *types.RootDirectory // The tags associated with the access point, presented as an array of Tag objects. diff --git a/service/efs/api_op_CreateFileSystem.go b/service/efs/api_op_CreateFileSystem.go index 9eab43eaf32..37f8c093f3d 100644 --- a/service/efs/api_op_CreateFileSystem.go +++ b/service/efs/api_op_CreateFileSystem.go @@ -37,10 +37,13 @@ import ( // creation status by calling the DescribeFileSystems operation, which among other // things returns the file system state. This operation accepts an optional // PerformanceMode parameter that you choose for your file system. We recommend -// generalPurpose performance mode for most file systems. File systems using the -// maxIO performance mode can scale to higher levels of aggregate throughput and -// operations per second with a tradeoff of slightly higher latencies for most file -// operations. The performance mode can't be changed after the file system has been +// generalPurpose performance mode for all file systems. File systems using the +// maxIO mode is a previous generation performance type that is designed for highly +// parallelized workloads that can tolerate higher latencies than the General +// Purpose mode. Max I/O mode is not supported for One Zone file systems or file +// systems that use Elastic throughput. Due to the higher per-operation latencies +// with Max I/O, we recommend using General Purpose performance mode for all file +// systems. The performance mode can't be changed after the file system has been // created. For more information, see Amazon EFS performance modes (https://docs.aws.amazon.com/efs/latest/ug/performance.html#performancemodes.html) // . You can set the throughput mode for the file system using the ThroughputMode // parameter. After the file system is fully created, Amazon EFS sets its lifecycle @@ -79,18 +82,18 @@ type CreateFileSystemInput struct { // This member is required. CreationToken *string - // Used to create a file system that uses One Zone storage classes. It specifies - // the Amazon Web Services Availability Zone in which to create the file system. - // Use the format us-east-1a to specify the Availability Zone. For more - // information about One Zone storage classes, see Using EFS storage classes (https://docs.aws.amazon.com/efs/latest/ug/storage-classes.html) - // in the Amazon EFS User Guide. One Zone storage classes are not available in all + // Used to create a One Zone file system. It specifies the Amazon Web Services + // Availability Zone in which to create the file system. Use the format us-east-1a + // to specify the Availability Zone. For more information about One Zone file + // systems, see Using EFS storage classes (https://docs.aws.amazon.com/efs/latest/ug/storage-classes.html) + // in the Amazon EFS User Guide. One Zone file systems are not available in all // Availability Zones in Amazon Web Services Regions where Amazon EFS is available. AvailabilityZoneName *string // Specifies whether automatic backups are enabled on the file system that you are // creating. Set the value to true to enable automatic backups. If you are - // creating a file system that uses One Zone storage classes, automatic backups are - // enabled by default. For more information, see Automatic backups (https://docs.aws.amazon.com/efs/latest/ug/awsbackup.html#automatic-backups) + // creating a One Zone file system, automatic backups are enabled by default. For + // more information, see Automatic backups (https://docs.aws.amazon.com/efs/latest/ug/awsbackup.html#automatic-backups) // in the Amazon EFS User Guide. Default is false . However, if you specify an // AvailabilityZoneName , the default is true . Backup is not available in all // Amazon Web Services Regions where Amazon EFS is available. @@ -120,13 +123,14 @@ type CreateFileSystemInput struct { // asymmetric KMS keys with Amazon EFS file systems. KmsKeyId *string - // The performance mode of the file system. We recommend generalPurpose - // performance mode for most file systems. File systems using the maxIO - // performance mode can scale to higher levels of aggregate throughput and - // operations per second with a tradeoff of slightly higher latencies for most file - // operations. The performance mode can't be changed after the file system has been - // created. The maxIO mode is not supported on file systems using One Zone storage - // classes. Default is generalPurpose . + // The Performance mode of the file system. We recommend generalPurpose + // performance mode for all file systems. File systems using the maxIO performance + // mode can scale to higher levels of aggregate throughput and operations per + // second with a tradeoff of slightly higher latencies for most file operations. + // The performance mode can't be changed after the file system has been created. + // The maxIO mode is not supported on One Zone file systems. Due to the higher + // per-operation latencies with Max I/O, we recommend using General Purpose + // performance mode for all file systems. Default is generalPurpose . PerformanceMode types.PerformanceMode // The throughput, measured in mebibytes per second (MiBps), that you want to @@ -147,9 +151,9 @@ type CreateFileSystemInput struct { // Specifies the throughput mode for the file system. The mode can be bursting , // provisioned , or elastic . If you set ThroughputMode to provisioned , you must // also set a value for ProvisionedThroughputInMibps . After you create the file - // system, you can decrease your file system's throughput in Provisioned Throughput - // mode or change between the throughput modes, with certain time restrictions. For - // more information, see Specifying throughput with provisioned mode (https://docs.aws.amazon.com/efs/latest/ug/performance.html#provisioned-throughput) + // system, you can decrease your file system's Provisioned throughput or change + // between the throughput modes, with certain time restrictions. For more + // information, see Specifying throughput with provisioned mode (https://docs.aws.amazon.com/efs/latest/ug/performance.html#provisioned-throughput) // in the Amazon EFS User Guide. Default is bursting . ThroughputMode types.ThroughputMode @@ -191,7 +195,7 @@ type CreateFileSystemOutput struct { // This member is required. OwnerId *string - // The performance mode of the file system. + // The Performance mode of the file system. // // This member is required. PerformanceMode types.PerformanceMode @@ -215,14 +219,14 @@ type CreateFileSystemOutput struct { Tags []types.Tag // The unique and consistent identifier of the Availability Zone in which the file - // system's One Zone storage classes exist. For example, use1-az1 is an - // Availability Zone ID for the us-east-1 Amazon Web Services Region, and it has - // the same location in every Amazon Web Services account. + // system is located, and is valid only for One Zone file systems. For example, + // use1-az1 is an Availability Zone ID for the us-east-1 Amazon Web Services + // Region, and it has the same location in every Amazon Web Services account. AvailabilityZoneId *string // Describes the Amazon Web Services Availability Zone in which the file system is - // located, and is valid only for file systems using One Zone storage classes. For - // more information, see Using EFS storage classes (https://docs.aws.amazon.com/efs/latest/ug/storage-classes.html) + // located, and is valid only for One Zone file systems. For more information, see + // Using EFS storage classes (https://docs.aws.amazon.com/efs/latest/ug/storage-classes.html) // in the Amazon EFS User Guide. AvailabilityZoneName *string diff --git a/service/efs/api_op_CreateMountTarget.go b/service/efs/api_op_CreateMountTarget.go index eba09a8ed87..3d4cc2453ae 100644 --- a/service/efs/api_op_CreateMountTarget.go +++ b/service/efs/api_op_CreateMountTarget.go @@ -19,12 +19,12 @@ import ( // have multiple subnets in an Availability Zone, you create a mount target in one // of the subnets. EC2 instances do not need to be in the same subnet as the mount // target in order to access their file system. You can create only one mount -// target for an EFS file system using One Zone storage classes. You must create -// that mount target in the same Availability Zone in which the file system is -// located. Use the AvailabilityZoneName and AvailabiltyZoneId properties in the -// DescribeFileSystems response object to get this information. Use the subnetId -// associated with the file system's Availability Zone when creating the mount -// target. For more information, see Amazon EFS: How it Works (https://docs.aws.amazon.com/efs/latest/ug/how-it-works.html) +// target for a One Zone file system. You must create that mount target in the same +// Availability Zone in which the file system is located. Use the +// AvailabilityZoneName and AvailabiltyZoneId properties in the DescribeFileSystems +// response object to get this information. Use the subnetId associated with the +// file system's Availability Zone when creating the mount target. For more +// information, see Amazon EFS: How it Works (https://docs.aws.amazon.com/efs/latest/ug/how-it-works.html) // . To create a mount target for a file system, the file system's lifecycle state // must be available . For more information, see DescribeFileSystems . In the // request, provide the following: @@ -110,9 +110,8 @@ type CreateMountTargetInput struct { // This member is required. FileSystemId *string - // The ID of the subnet to add the mount target in. For file systems that use One - // Zone storage classes, use the subnet that is associated with the file system's - // Availability Zone. + // The ID of the subnet to add the mount target in. For One Zone file systems, use + // the subnet that is associated with the file system's Availability Zone. // // This member is required. SubnetId *string diff --git a/service/efs/api_op_CreateReplicationConfiguration.go b/service/efs/api_op_CreateReplicationConfiguration.go index f3b0696abb8..073bc3855b9 100644 --- a/service/efs/api_op_CreateReplicationConfiguration.go +++ b/service/efs/api_op_CreateReplicationConfiguration.go @@ -32,9 +32,9 @@ import ( // more information, see Managing Amazon Web Services Regions (https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable) // in the Amazon Web Services General Reference Reference Guide // - Availability Zone - If you want the destination file system to use EFS One -// Zone availability and durability, you must specify the Availability Zone to -// create the file system in. For more information about EFS storage classes, see -// Amazon EFS storage classes (https://docs.aws.amazon.com/efs/latest/ug/storage-classes.html) +// Zone availability, you must specify the Availability Zone to create the file +// system in. For more information about EFS storage classes, see Amazon EFS +// storage classes (https://docs.aws.amazon.com/efs/latest/ug/storage-classes.html) // in the Amazon EFS User Guide. // - Encryption - All destination file systems are created with encryption at // rest enabled. You can specify the Key Management Service (KMS) key that is used @@ -52,11 +52,10 @@ import ( // the throughput mode. // // The following properties are turned off by default: -// - Lifecycle management - EFS lifecycle management and EFS Intelligent-Tiering -// are not enabled on the destination file system. After the destination file -// system is created, you can enable EFS lifecycle management and EFS -// Intelligent-Tiering. -// - Automatic backups - Automatic daily backups are enabled on the destination +// - Lifecycle management – Lifecycle management is not enabled on the +// destination file system. After the destination file system is created, you can +// enable it. +// - Automatic backups – Automatic daily backups are enabled on the destination // file system. After the file system is created, you can change this setting. // // For more information, see Amazon EFS replication (https://docs.aws.amazon.com/efs/latest/ug/efs-replication.html) @@ -107,8 +106,8 @@ type CreateReplicationConfigurationOutput struct { // This member is required. Destinations []types.Destination - // The Amazon Resource Name (ARN) of the original source Amazon EFS file system in - // the replication configuration. + // The Amazon Resource Name (ARN) of the original source EFS file system in the + // replication configuration. // // This member is required. OriginalSourceFileSystemArn *string @@ -124,8 +123,7 @@ type CreateReplicationConfigurationOutput struct { // This member is required. SourceFileSystemId *string - // The Amazon Web Services Region in which the source Amazon EFS file system is - // located. + // The Amazon Web Services Region in which the source EFS file system is located. // // This member is required. SourceFileSystemRegion *string diff --git a/service/efs/api_op_DescribeBackupPolicy.go b/service/efs/api_op_DescribeBackupPolicy.go index 96808518d49..0592647e49e 100644 --- a/service/efs/api_op_DescribeBackupPolicy.go +++ b/service/efs/api_op_DescribeBackupPolicy.go @@ -30,7 +30,7 @@ func (c *Client) DescribeBackupPolicy(ctx context.Context, params *DescribeBacku type DescribeBackupPolicyInput struct { - // Specifies which EFS file system to retrieve the BackupPolicy for. + // Specifies which EFS file system for which to retrieve the BackupPolicy . // // This member is required. FileSystemId *string diff --git a/service/efs/api_op_DescribeLifecycleConfiguration.go b/service/efs/api_op_DescribeLifecycleConfiguration.go index a835ad598c2..b6e474ba6a5 100644 --- a/service/efs/api_op_DescribeLifecycleConfiguration.go +++ b/service/efs/api_op_DescribeLifecycleConfiguration.go @@ -13,13 +13,11 @@ import ( ) // Returns the current LifecycleConfiguration object for the specified Amazon EFS -// file system. EFS lifecycle management uses the LifecycleConfiguration object to -// identify which files to move to the EFS Infrequent Access (IA) storage class. -// For a file system without a LifecycleConfiguration object, the call returns an -// empty array in the response. When EFS Intelligent-Tiering is enabled, -// TransitionToPrimaryStorageClass has a value of AFTER_1_ACCESS . This operation -// requires permissions for the elasticfilesystem:DescribeLifecycleConfiguration -// operation. +// file system. Llifecycle management uses the LifecycleConfiguration object to +// identify when to move files between storage classes. For a file system without a +// LifecycleConfiguration object, the call returns an empty array in the response. +// This operation requires permissions for the +// elasticfilesystem:DescribeLifecycleConfiguration operation. func (c *Client) DescribeLifecycleConfiguration(ctx context.Context, params *DescribeLifecycleConfigurationInput, optFns ...func(*Options)) (*DescribeLifecycleConfigurationOutput, error) { if params == nil { params = &DescribeLifecycleConfigurationInput{} diff --git a/service/efs/api_op_DescribeMountTargets.go b/service/efs/api_op_DescribeMountTargets.go index 543b449219e..9f37ec77c64 100644 --- a/service/efs/api_op_DescribeMountTargets.go +++ b/service/efs/api_op_DescribeMountTargets.go @@ -161,6 +161,100 @@ func (c *Client) addOperationDescribeMountTargetsMiddlewares(stack *middleware.S return nil } +// DescribeMountTargetsAPIClient is a client that implements the +// DescribeMountTargets operation. +type DescribeMountTargetsAPIClient interface { + DescribeMountTargets(context.Context, *DescribeMountTargetsInput, ...func(*Options)) (*DescribeMountTargetsOutput, error) +} + +var _ DescribeMountTargetsAPIClient = (*Client)(nil) + +// DescribeMountTargetsPaginatorOptions is the paginator options for +// DescribeMountTargets +type DescribeMountTargetsPaginatorOptions struct { + // (Optional) Maximum number of mount targets to return in the response. + // Currently, this number is automatically set to 10, and other values are ignored. + // The response is paginated at 100 per page if you have more than 100 mount + // targets. + 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 +} + +// DescribeMountTargetsPaginator is a paginator for DescribeMountTargets +type DescribeMountTargetsPaginator struct { + options DescribeMountTargetsPaginatorOptions + client DescribeMountTargetsAPIClient + params *DescribeMountTargetsInput + nextToken *string + firstPage bool +} + +// NewDescribeMountTargetsPaginator returns a new DescribeMountTargetsPaginator +func NewDescribeMountTargetsPaginator(client DescribeMountTargetsAPIClient, params *DescribeMountTargetsInput, optFns ...func(*DescribeMountTargetsPaginatorOptions)) *DescribeMountTargetsPaginator { + if params == nil { + params = &DescribeMountTargetsInput{} + } + + options := DescribeMountTargetsPaginatorOptions{} + if params.MaxItems != nil { + options.Limit = *params.MaxItems + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeMountTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMountTargetsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeMountTargets page. +func (p *DescribeMountTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMountTargetsOutput, 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.MaxItems = limit + + result, err := p.client.DescribeMountTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMountTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/efs/api_op_DescribeReplicationConfigurations.go b/service/efs/api_op_DescribeReplicationConfigurations.go index 7c396b34f2e..1d71fc244e1 100644 --- a/service/efs/api_op_DescribeReplicationConfigurations.go +++ b/service/efs/api_op_DescribeReplicationConfigurations.go @@ -138,6 +138,100 @@ func (c *Client) addOperationDescribeReplicationConfigurationsMiddlewares(stack return nil } +// DescribeReplicationConfigurationsAPIClient is a client that implements the +// DescribeReplicationConfigurations operation. +type DescribeReplicationConfigurationsAPIClient interface { + DescribeReplicationConfigurations(context.Context, *DescribeReplicationConfigurationsInput, ...func(*Options)) (*DescribeReplicationConfigurationsOutput, error) +} + +var _ DescribeReplicationConfigurationsAPIClient = (*Client)(nil) + +// DescribeReplicationConfigurationsPaginatorOptions is the paginator options for +// DescribeReplicationConfigurations +type DescribeReplicationConfigurationsPaginatorOptions struct { + // (Optional) To limit the number of objects returned in a response, you can + // specify the MaxItems parameter. The default value is 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeReplicationConfigurationsPaginator is a paginator for +// DescribeReplicationConfigurations +type DescribeReplicationConfigurationsPaginator struct { + options DescribeReplicationConfigurationsPaginatorOptions + client DescribeReplicationConfigurationsAPIClient + params *DescribeReplicationConfigurationsInput + nextToken *string + firstPage bool +} + +// NewDescribeReplicationConfigurationsPaginator returns a new +// DescribeReplicationConfigurationsPaginator +func NewDescribeReplicationConfigurationsPaginator(client DescribeReplicationConfigurationsAPIClient, params *DescribeReplicationConfigurationsInput, optFns ...func(*DescribeReplicationConfigurationsPaginatorOptions)) *DescribeReplicationConfigurationsPaginator { + if params == nil { + params = &DescribeReplicationConfigurationsInput{} + } + + options := DescribeReplicationConfigurationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeReplicationConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeReplicationConfigurations page. +func (p *DescribeReplicationConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationConfigurationsOutput, 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.DescribeReplicationConfigurations(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_opDescribeReplicationConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/efs/api_op_PutLifecycleConfiguration.go b/service/efs/api_op_PutLifecycleConfiguration.go index 572f79a568e..940ee927e47 100644 --- a/service/efs/api_op_PutLifecycleConfiguration.go +++ b/service/efs/api_op_PutLifecycleConfiguration.go @@ -12,30 +12,33 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Use this action to manage EFS lifecycle management and EFS Intelligent-Tiering. -// A LifecycleConfiguration consists of one or more LifecyclePolicy objects that -// define the following: -// - EFS Lifecycle management - When Amazon EFS automatically transitions files -// in a file system into the lower-cost EFS Infrequent Access (IA) storage class. -// To enable EFS Lifecycle management, set the value of TransitionToIA to one of -// the available options. -// - EFS Intelligent-Tiering - When Amazon EFS automatically transitions files -// from IA back into the file system's primary storage class (EFS Standard or EFS -// One Zone Standard). To enable EFS Intelligent-Tiering, set the value of -// TransitionToPrimaryStorageClass to AFTER_1_ACCESS . +// Use this action to manage storage of your file system. A LifecycleConfiguration +// consists of one or more LifecyclePolicy objects that define the following: +// - TransitionToIA – When to move files in the file system from primary storage +// (Standard storage class) into the Infrequent Access (IA) storage. +// - TransitionToArchive – When to move files in the file system from their +// current storage class (either IA or Standard storage) into the Archive storage. +// File systems cannot transition into Archive storage before transitioning into IA +// storage. Therefore, TransitionToArchive must either not be set or must be later +// than TransitionToIA. The Archive storage class is available only for file +// systems that use the Elastic Throughput mode and the General Purpose Performance +// mode. +// - TransitionToPrimaryStorageClass – Whether to move files in the file system +// back to primary storage (Standard storage class) after they are accessed in IA +// or Archive storage. // -// For more information, see EFS Lifecycle Management (https://docs.aws.amazon.com/efs/latest/ug/lifecycle-management-efs.html) +// For more information, see Managing file system storage (https://docs.aws.amazon.com/efs/latest/ug/lifecycle-management-efs.html) // . Each Amazon EFS file system supports one lifecycle configuration, which // applies to all files in the file system. If a LifecycleConfiguration object // already exists for the specified file system, a PutLifecycleConfiguration call // modifies the existing configuration. A PutLifecycleConfiguration call with an // empty LifecyclePolicies array in the request body deletes any existing -// LifecycleConfiguration and turns off lifecycle management and EFS -// Intelligent-Tiering for the file system. In the request, specify the following: +// LifecycleConfiguration for the file system. In the request, specify the +// following: // - The ID for the file system for which you are enabling, disabling, or -// modifying lifecycle management and EFS Intelligent-Tiering. -// - A LifecyclePolicies array of LifecyclePolicy objects that define when files -// are moved into IA storage, and when they are moved back to Standard storage. +// modifying Lifecycle management. +// - A LifecyclePolicies array of LifecyclePolicy objects that define when to +// move files to IA storage, to Archive storage, and back to primary storage. // Amazon EFS requires that each LifecyclePolicy object have only have a single // transition, so the LifecyclePolicies array needs to be structured with // separate LifecyclePolicy objects. See the example requests in the following @@ -70,17 +73,25 @@ type PutLifecycleConfigurationInput struct { // An array of LifecyclePolicy objects that define the file system's // LifecycleConfiguration object. A LifecycleConfiguration object informs EFS - // lifecycle management and EFS Intelligent-Tiering of the following: - // - When to move files in the file system from primary storage to the IA - // storage class. - // - When to move files that are in IA storage to primary storage. + // Lifecycle management of the following: + // - TransitionToIA – When to move files in the file system from primary storage + // (Standard storage class) into the Infrequent Access (IA) storage. + // - TransitionToArchive – When to move files in the file system from their + // current storage class (either IA or Standard storage) into the Archive storage. + // File systems cannot transition into Archive storage before transitioning into IA + // storage. Therefore, TransitionToArchive must either not be set or must be later + // than TransitionToIA. The Archive storage class is available only for file + // systems that use the Elastic Throughput mode and the General Purpose Performance + // mode. + // - TransitionToPrimaryStorageClass – Whether to move files in the file system + // back to primary storage (Standard storage class) after they are accessed in IA + // or Archive storage. // When using the put-lifecycle-configuration CLI command or the // PutLifecycleConfiguration API action, Amazon EFS requires that each // LifecyclePolicy object have only a single transition. This means that in a // request body, LifecyclePolicies must be structured as an array of - // LifecyclePolicy objects, one object for each transition, TransitionToIA , - // TransitionToPrimaryStorageClass . See the example requests in the following - // section for more information. + // LifecyclePolicy objects, one object for each storage transition. See the example + // requests in the following section for more information. // // This member is required. LifecyclePolicies []types.LifecyclePolicy diff --git a/service/efs/api_op_UpdateFileSystem.go b/service/efs/api_op_UpdateFileSystem.go index 856c852d805..13c23cacac0 100644 --- a/service/efs/api_op_UpdateFileSystem.go +++ b/service/efs/api_op_UpdateFileSystem.go @@ -90,7 +90,7 @@ type UpdateFileSystemOutput struct { // This member is required. OwnerId *string - // The performance mode of the file system. + // The Performance mode of the file system. // // This member is required. PerformanceMode types.PerformanceMode @@ -114,14 +114,14 @@ type UpdateFileSystemOutput struct { Tags []types.Tag // The unique and consistent identifier of the Availability Zone in which the file - // system's One Zone storage classes exist. For example, use1-az1 is an - // Availability Zone ID for the us-east-1 Amazon Web Services Region, and it has - // the same location in every Amazon Web Services account. + // system is located, and is valid only for One Zone file systems. For example, + // use1-az1 is an Availability Zone ID for the us-east-1 Amazon Web Services + // Region, and it has the same location in every Amazon Web Services account. AvailabilityZoneId *string // Describes the Amazon Web Services Availability Zone in which the file system is - // located, and is valid only for file systems using One Zone storage classes. For - // more information, see Using EFS storage classes (https://docs.aws.amazon.com/efs/latest/ug/storage-classes.html) + // located, and is valid only for One Zone file systems. For more information, see + // Using EFS storage classes (https://docs.aws.amazon.com/efs/latest/ug/storage-classes.html) // in the Amazon EFS User Guide. AvailabilityZoneName *string diff --git a/service/efs/deserializers.go b/service/efs/deserializers.go index 306eb94d978..fd17cda8bb9 100644 --- a/service/efs/deserializers.go +++ b/service/efs/deserializers.go @@ -7101,6 +7101,19 @@ func awsRestjson1_deserializeDocumentFileSystemSize(v **types.FileSystemSize, va sv.Value = i64 } + case "ValueInArchive": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected FileSystemNullableSizeValue to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ValueInArchive = ptr.Int64(i64) + } + case "ValueInIA": if value != nil { jtv, ok := value.(json.Number) @@ -7486,6 +7499,15 @@ func awsRestjson1_deserializeDocumentLifecyclePolicy(v **types.LifecyclePolicy, for key, value := range shape { switch key { + case "TransitionToArchive": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TransitionToArchiveRules to be of type string, got %T instead", value) + } + sv.TransitionToArchive = types.TransitionToArchiveRules(jtv) + } + case "TransitionToIA": if value != nil { jtv, ok := value.(string) diff --git a/service/efs/endpoints.go b/service/efs/endpoints.go index e6892a4d5e1..01698ef70b8 100644 --- a/service/efs/endpoints.go +++ b/service/efs/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://elasticfilesystem-fips.") diff --git a/service/efs/serializers.go b/service/efs/serializers.go index 89172006c82..5f371b8b04f 100644 --- a/service/efs/serializers.go +++ b/service/efs/serializers.go @@ -2498,6 +2498,11 @@ func awsRestjson1_serializeDocumentLifecyclePolicy(v *types.LifecyclePolicy, val object := value.Object() defer object.Close() + if len(v.TransitionToArchive) > 0 { + ok := object.Key("TransitionToArchive") + ok.String(string(v.TransitionToArchive)) + } + if len(v.TransitionToIA) > 0 { ok := object.Key("TransitionToIA") ok.String(string(v.TransitionToIA)) diff --git a/service/efs/types/enums.go b/service/efs/types/enums.go index 66196995019..8b0e6f14387 100644 --- a/service/efs/types/enums.go +++ b/service/efs/types/enums.go @@ -150,16 +150,51 @@ func (ThroughputMode) Values() []ThroughputMode { } } +type TransitionToArchiveRules string + +// Enum values for TransitionToArchiveRules +const ( + TransitionToArchiveRulesAfter1Day TransitionToArchiveRules = "AFTER_1_DAY" + TransitionToArchiveRulesAfter7Days TransitionToArchiveRules = "AFTER_7_DAYS" + TransitionToArchiveRulesAfter14Days TransitionToArchiveRules = "AFTER_14_DAYS" + TransitionToArchiveRulesAfter30Days TransitionToArchiveRules = "AFTER_30_DAYS" + TransitionToArchiveRulesAfter60Days TransitionToArchiveRules = "AFTER_60_DAYS" + TransitionToArchiveRulesAfter90Days TransitionToArchiveRules = "AFTER_90_DAYS" + TransitionToArchiveRulesAfter180Days TransitionToArchiveRules = "AFTER_180_DAYS" + TransitionToArchiveRulesAfter270Days TransitionToArchiveRules = "AFTER_270_DAYS" + TransitionToArchiveRulesAfter365Days TransitionToArchiveRules = "AFTER_365_DAYS" +) + +// Values returns all known values for TransitionToArchiveRules. 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 (TransitionToArchiveRules) Values() []TransitionToArchiveRules { + return []TransitionToArchiveRules{ + "AFTER_1_DAY", + "AFTER_7_DAYS", + "AFTER_14_DAYS", + "AFTER_30_DAYS", + "AFTER_60_DAYS", + "AFTER_90_DAYS", + "AFTER_180_DAYS", + "AFTER_270_DAYS", + "AFTER_365_DAYS", + } +} + type TransitionToIARules string // Enum values for TransitionToIARules const ( - TransitionToIARulesAfter7Days TransitionToIARules = "AFTER_7_DAYS" - TransitionToIARulesAfter14Days TransitionToIARules = "AFTER_14_DAYS" - TransitionToIARulesAfter30Days TransitionToIARules = "AFTER_30_DAYS" - TransitionToIARulesAfter60Days TransitionToIARules = "AFTER_60_DAYS" - TransitionToIARulesAfter90Days TransitionToIARules = "AFTER_90_DAYS" - TransitionToIARulesAfter1Day TransitionToIARules = "AFTER_1_DAY" + TransitionToIARulesAfter7Days TransitionToIARules = "AFTER_7_DAYS" + TransitionToIARulesAfter14Days TransitionToIARules = "AFTER_14_DAYS" + TransitionToIARulesAfter30Days TransitionToIARules = "AFTER_30_DAYS" + TransitionToIARulesAfter60Days TransitionToIARules = "AFTER_60_DAYS" + TransitionToIARulesAfter90Days TransitionToIARules = "AFTER_90_DAYS" + TransitionToIARulesAfter1Day TransitionToIARules = "AFTER_1_DAY" + TransitionToIARulesAfter180Days TransitionToIARules = "AFTER_180_DAYS" + TransitionToIARulesAfter270Days TransitionToIARules = "AFTER_270_DAYS" + TransitionToIARulesAfter365Days TransitionToIARules = "AFTER_365_DAYS" ) // Values returns all known values for TransitionToIARules. Note that this can be @@ -173,6 +208,9 @@ func (TransitionToIARules) Values() []TransitionToIARules { "AFTER_60_DAYS", "AFTER_90_DAYS", "AFTER_1_DAY", + "AFTER_180_DAYS", + "AFTER_270_DAYS", + "AFTER_365_DAYS", } } diff --git a/service/efs/types/types.go b/service/efs/types/types.go index bdf56896ef3..0d581c2bbed 100644 --- a/service/efs/types/types.go +++ b/service/efs/types/types.go @@ -36,8 +36,8 @@ type AccessPointDescription struct { // using the access point. PosixUser *PosixUser - // The directory on the Amazon EFS file system that the access point exposes as - // the root directory to NFS clients using the access point. + // The directory on the EFS file system that the access point exposes as the root + // directory to NFS clients using the access point. RootDirectory *RootDirectory // The tags associated with the access point, presented as an array of Tag objects. @@ -53,10 +53,10 @@ type AccessPointDescription struct { type BackupPolicy struct { // Describes the status of the file system's backup policy. - // - ENABLED - EFS is automatically backing up the file system. - // - ENABLING - EFS is turning on automatic backups for the file system. - // - DISABLED - Automatic back ups are turned off for the file system. - // - DISABLING - EFS is turning off automatic backups for the file system. + // - ENABLED – EFS is automatically backing up the file system. + // - ENABLING – EFS is turning on automatic backups for the file system. + // - DISABLED – Automatic back ups are turned off for the file system. + // - DISABLING – EFS is turning off automatic backups for the file system. // // This member is required. Status Status @@ -111,7 +111,7 @@ type Destination struct { // This member is required. Region *string - // Describes the status of the destination Amazon EFS file system. + // Describes the status of the destination EFS file system. // - The Paused state occurs as a result of opting out of the source or // destination Region after the replication configuration was created. To resume // replication for the file system, you need to again opt in to the Amazon Web @@ -142,7 +142,7 @@ type Destination struct { // configuration. type DestinationToCreate struct { - // To create a file system that uses EFS One Zone storage, specify the name of the + // To create a file system that uses One Zone storage, specify the name of the // Availability Zone in which to create the destination file system. AvailabilityZoneName *string @@ -202,7 +202,7 @@ type FileSystemDescription struct { // This member is required. OwnerId *string - // The performance mode of the file system. + // The Performance mode of the file system. // // This member is required. PerformanceMode PerformanceMode @@ -226,14 +226,14 @@ type FileSystemDescription struct { Tags []Tag // The unique and consistent identifier of the Availability Zone in which the file - // system's One Zone storage classes exist. For example, use1-az1 is an - // Availability Zone ID for the us-east-1 Amazon Web Services Region, and it has - // the same location in every Amazon Web Services account. + // system is located, and is valid only for One Zone file systems. For example, + // use1-az1 is an Availability Zone ID for the us-east-1 Amazon Web Services + // Region, and it has the same location in every Amazon Web Services account. AvailabilityZoneId *string // Describes the Amazon Web Services Availability Zone in which the file system is - // located, and is valid only for file systems using One Zone storage classes. For - // more information, see Using EFS storage classes (https://docs.aws.amazon.com/efs/latest/ug/storage-classes.html) + // located, and is valid only for One Zone file systems. For more information, see + // Using EFS storage classes (https://docs.aws.amazon.com/efs/latest/ug/storage-classes.html) // in the Amazon EFS User Guide. AvailabilityZoneName *string @@ -285,6 +285,10 @@ type FileSystemSize struct { // 1970-01-01T00:00:00Z. Timestamp *time.Time + // The latest known metered size (in bytes) of data stored in the Archive storage + // class. + ValueInArchive *int64 + // The latest known metered size (in bytes) of data stored in the Infrequent // Access storage class. ValueInIA *int64 @@ -296,27 +300,32 @@ type FileSystemSize struct { noSmithyDocumentSerde } -// Describes a policy used by EFS lifecycle management and EFS Intelligent-Tiering -// that specifies when to transition files into and out of the file system's -// Infrequent Access (IA) storage class. For more information, see EFS -// Intelligent‐Tiering and EFS Lifecycle Management (https://docs.aws.amazon.com/efs/latest/ug/lifecycle-management-efs.html) +// Describes a policy used by Lifecycle management that specifies when to +// transition files into and out of the Infrequent Access (IA) and Archive storage +// classes. For more information, see Managing file system storage (https://docs.aws.amazon.com/efs/latest/ug/lifecycle-management-efs.html) // . When using the put-lifecycle-configuration CLI command or the // PutLifecycleConfiguration API action, Amazon EFS requires that each // LifecyclePolicy object have only a single transition. This means that in a // request body, LifecyclePolicies must be structured as an array of -// LifecyclePolicy objects, one object for each transition, TransitionToIA , -// TransitionToPrimaryStorageClass . For more information, see the request examples -// in PutLifecycleConfiguration . +// LifecyclePolicy objects, one object for each transition. For more information, +// see the request examples in PutLifecycleConfiguration . type LifecyclePolicy struct { - // Describes the period of time that a file is not accessed, after which it - // transitions to IA storage. Metadata operations such as listing the contents of a - // directory don't count as file access events. - TransitionToIA TransitionToIARules + // The number of days after files were last accessed in primary storage (the + // Standard storage class) files at which to move them to Archive storage. Metadata + // operations such as listing the contents of a directory don't count as file + // access events. + TransitionToArchive TransitionToArchiveRules - // Describes when to transition a file from IA storage to primary storage. + // The number of days after files were last accessed in primary storage (the + // Standard storage class) at which to move them to Infrequent Access (IA) storage. // Metadata operations such as listing the contents of a directory don't count as // file access events. + TransitionToIA TransitionToIARules + + // Whether to move files back to primary (Standard) storage after they are + // accessed in IA or Archive storage. Metadata operations such as listing the + // contents of a directory don't count as file access events. TransitionToPrimaryStorageClass TransitionToPrimaryStorageClassRules noSmithyDocumentSerde @@ -408,8 +417,8 @@ type ReplicationConfigurationDescription struct { // This member is required. Destinations []Destination - // The Amazon Resource Name (ARN) of the original source Amazon EFS file system in - // the replication configuration. + // The Amazon Resource Name (ARN) of the original source EFS file system in the + // replication configuration. // // This member is required. OriginalSourceFileSystemArn *string @@ -425,8 +434,7 @@ type ReplicationConfigurationDescription struct { // This member is required. SourceFileSystemId *string - // The Amazon Web Services Region in which the source Amazon EFS file system is - // located. + // The Amazon Web Services Region in which the source EFS file system is located. // // This member is required. SourceFileSystemRegion *string diff --git a/service/eks/api_op_CreateCluster.go b/service/eks/api_op_CreateCluster.go index 3c7c87672ad..a1f91abb9e9 100644 --- a/service/eks/api_op_CreateCluster.go +++ b/service/eks/api_op_CreateCluster.go @@ -24,10 +24,22 @@ import ( // (for example, to support kubectl exec , logs , and proxy data flows). Amazon // EKS nodes run in your Amazon Web Services account and connect to your cluster's // control plane over the Kubernetes API server endpoint and a certificate file -// that is created for your cluster. In most cases, it takes several minutes to -// create a cluster. After you create an Amazon EKS cluster, you must configure -// your Kubernetes tooling to communicate with the API server and launch nodes into -// your cluster. For more information, see Managing Cluster Authentication (https://docs.aws.amazon.com/eks/latest/userguide/managing-auth.html) +// that is created for your cluster. You can use the endpointPublicAccess and +// endpointPrivateAccess parameters to enable or disable public and private access +// to your cluster's Kubernetes API server endpoint. By default, public access is +// enabled, and private access is disabled. For more information, see Amazon EKS +// Cluster Endpoint Access Control (https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html) +// in the Amazon EKS User Guide . You can use the logging parameter to enable or +// disable exporting the Kubernetes control plane logs for your cluster to +// CloudWatch Logs. By default, cluster control plane logs aren't exported to +// CloudWatch Logs. For more information, see Amazon EKS Cluster Control Plane Logs (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) +// in the Amazon EKS User Guide . CloudWatch Logs ingestion, archive storage, and +// data scanning rates apply to exported control plane logs. For more information, +// see CloudWatch Pricing (http://aws.amazon.com/cloudwatch/pricing/) . In most +// cases, it takes several minutes to create a cluster. After you create an Amazon +// EKS cluster, you must configure your Kubernetes tooling to communicate with the +// API server and launch nodes into your cluster. For more information, see +// Managing Cluster Authentication (https://docs.aws.amazon.com/eks/latest/userguide/managing-auth.html) // and Launching Amazon EKS nodes (https://docs.aws.amazon.com/eks/latest/userguide/launch-workers.html) // in the Amazon EKS User Guide. func (c *Client) CreateCluster(ctx context.Context, params *CreateClusterInput, optFns ...func(*Options)) (*CreateClusterOutput, error) { diff --git a/service/eks/api_op_CreateEksAnywhereSubscription.go b/service/eks/api_op_CreateEksAnywhereSubscription.go index d033fe2005c..1a186a3a1d7 100644 --- a/service/eks/api_op_CreateEksAnywhereSubscription.go +++ b/service/eks/api_op_CreateEksAnywhereSubscription.go @@ -61,8 +61,7 @@ type CreateEksAnywhereSubscriptionInput struct { ClientRequestToken *string // The number of licenses to purchase with the subscription. Valid values are - // between 1 and 1000. This value cannot be changed after creating the - // subscription. + // between 1 and 100. This value can't be changed after creating the subscription. LicenseQuantity int32 // The license type for all licenses in the subscription. Valid value is CLUSTER. @@ -71,7 +70,7 @@ type CreateEksAnywhereSubscriptionInput struct { LicenseType types.EksAnywhereSubscriptionLicenseType // The metadata for a subscription to assist with categorization and organization. - // Each tag consists of a key and an optional value. Subscription tags do not + // Each tag consists of a key and an optional value. Subscription tags don't // propagate to any other resources associated with the subscription. Tags map[string]string diff --git a/service/eks/api_op_CreatePodIdentityAssociation.go b/service/eks/api_op_CreatePodIdentityAssociation.go new file mode 100644 index 00000000000..f75ea8bbdb2 --- /dev/null +++ b/service/eks/api_op_CreatePodIdentityAssociation.go @@ -0,0 +1,229 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eks + +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/eks/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an EKS Pod Identity association between a service account in an Amazon +// EKS cluster and an IAM role with EKS Pod Identity. Use EKS Pod Identity to give +// temporary IAM credentials to pods and the credentials are rotated automatically. +// Amazon EKS Pod Identity associations provide the ability to manage credentials +// for your applications, similar to the way that 7EC2l instance profiles provide +// credentials to Amazon EC2 instances. If a pod uses a service account that has an +// association, Amazon EKS sets environment variables in the containers of the pod. +// The environment variables configure the Amazon Web Services SDKs, including the +// Command Line Interface, to use the EKS Pod Identity credentials. Pod Identity is +// a simpler method than IAM roles for service accounts, as this method doesn't use +// OIDC identity providers. Additionally, you can configure a role for Pod Identity +// once, and reuse it across clusters. +func (c *Client) CreatePodIdentityAssociation(ctx context.Context, params *CreatePodIdentityAssociationInput, optFns ...func(*Options)) (*CreatePodIdentityAssociationOutput, error) { + if params == nil { + params = &CreatePodIdentityAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreatePodIdentityAssociation", params, optFns, c.addOperationCreatePodIdentityAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreatePodIdentityAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreatePodIdentityAssociationInput struct { + + // The name of the cluster to create the association in. + // + // This member is required. + ClusterName *string + + // The name of the Kubernetes namespace inside the cluster to create the + // association in. The service account and the pods that use the service account + // must be in this namespace. + // + // This member is required. + Namespace *string + + // The Amazon Resource Name (ARN) of the IAM role to associate with the service + // account. The EKS Pod Identity agent manages credentials to assume this role for + // applications in the containers in the pods that use this service account. + // + // This member is required. + RoleArn *string + + // The name of the Kubernetes service account inside the cluster to associate the + // IAM credentials with. + // + // This member is required. + ServiceAccount *string + + // Unique, case-sensitive identifier that you provide to ensure the idempotency of + // the request. + ClientRequestToken *string + + // The metadata that you apply to a resource to assist with categorization and + // organization. Each tag consists of a key and an optional value. You define both. + // The following basic restrictions apply to tags: + // - Maximum number of tags per resource – 50 + // - For each resource, each tag key must be unique, and each tag key can have + // only one value. + // - Maximum key length – 128 Unicode characters in UTF-8 + // - Maximum value length – 256 Unicode characters in UTF-8 + // - If your tagging schema is used across multiple services and resources, + // remember that other services may have restrictions on allowed characters. + // Generally allowed characters are: letters, numbers, and spaces representable in + // UTF-8, and the following characters: + - = . _ : / @. + // - Tag keys and values are case-sensitive. + // - Do not use aws: , AWS: , or any upper or lowercase combination of such as a + // prefix for either keys or values as it is reserved for Amazon Web Services use. + // You cannot edit or delete tag keys or values with this prefix. Tags with this + // prefix do not count against your tags per resource limit. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreatePodIdentityAssociationOutput struct { + + // The full description of your new association. The description includes an ID + // for the association. Use the ID of the association in further actions to manage + // the association. + Association *types.PodIdentityAssociation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreatePodIdentityAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreatePodIdentityAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreatePodIdentityAssociation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreatePodIdentityAssociation"); 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_opCreatePodIdentityAssociationMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreatePodIdentityAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePodIdentityAssociation(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_initializeOpCreatePodIdentityAssociation struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreatePodIdentityAssociation) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreatePodIdentityAssociation) 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.(*CreatePodIdentityAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreatePodIdentityAssociationInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreatePodIdentityAssociationMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreatePodIdentityAssociation{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreatePodIdentityAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreatePodIdentityAssociation", + } +} diff --git a/service/eks/api_op_DeleteEksAnywhereSubscription.go b/service/eks/api_op_DeleteEksAnywhereSubscription.go index f2fe2a811b9..9a8022b897a 100644 --- a/service/eks/api_op_DeleteEksAnywhereSubscription.go +++ b/service/eks/api_op_DeleteEksAnywhereSubscription.go @@ -12,10 +12,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes an expired / inactive subscription. Deleting inactive subscriptions +// Deletes an expired or inactive subscription. Deleting inactive subscriptions // removes them from the Amazon Web Services Management Console view and from // list/describe API responses. Subscriptions can only be cancelled within 7 days -// of creation, and are cancelled by creating a ticket in the Amazon Web Services +// of creation and are cancelled by creating a ticket in the Amazon Web Services // Support Center. func (c *Client) DeleteEksAnywhereSubscription(ctx context.Context, params *DeleteEksAnywhereSubscriptionInput, optFns ...func(*Options)) (*DeleteEksAnywhereSubscriptionOutput, error) { if params == nil { diff --git a/service/eks/api_op_DeletePodIdentityAssociation.go b/service/eks/api_op_DeletePodIdentityAssociation.go new file mode 100644 index 00000000000..f99d701a6be --- /dev/null +++ b/service/eks/api_op_DeletePodIdentityAssociation.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eks + +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/eks/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a EKS Pod Identity association. The temporary Amazon Web Services +// credentials from the previous IAM role session might still be valid until the +// session expiry. If you need to immediately revoke the temporary session +// credentials, then go to the role in the IAM console. +func (c *Client) DeletePodIdentityAssociation(ctx context.Context, params *DeletePodIdentityAssociationInput, optFns ...func(*Options)) (*DeletePodIdentityAssociationOutput, error) { + if params == nil { + params = &DeletePodIdentityAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeletePodIdentityAssociation", params, optFns, c.addOperationDeletePodIdentityAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeletePodIdentityAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeletePodIdentityAssociationInput struct { + + // The ID of the association to be deleted. + // + // This member is required. + AssociationId *string + + // The cluster name that + // + // This member is required. + ClusterName *string + + noSmithyDocumentSerde +} + +type DeletePodIdentityAssociationOutput struct { + + // The full description of the EKS Pod Identity association that was deleted. + Association *types.PodIdentityAssociation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeletePodIdentityAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeletePodIdentityAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeletePodIdentityAssociation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeletePodIdentityAssociation"); 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 = addOpDeletePodIdentityAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePodIdentityAssociation(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_opDeletePodIdentityAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeletePodIdentityAssociation", + } +} diff --git a/service/eks/api_op_DescribeAddonVersions.go b/service/eks/api_op_DescribeAddonVersions.go index d25a4cf26e9..8425f21c240 100644 --- a/service/eks/api_op_DescribeAddonVersions.go +++ b/service/eks/api_op_DescribeAddonVersions.go @@ -72,12 +72,12 @@ type DescribeAddonVersionsOutput struct { // properties. Addons []types.AddonInfo - // The nextToken value returned from a previous paginated - // DescribeAddonVersionsResponse where maxResults was used and the results - // exceeded the value of that parameter. Pagination continues from the end of the - // previous results that returned the nextToken value. This token should be - // treated as an opaque identifier that is used only to retrieve the next items in - // a list and not for other programmatic purposes. + // The nextToken value to include in a future DescribeAddonVersions request. When + // the results of a DescribeAddonVersions request exceed maxResults , you can use + // this value to retrieve the next page of results. This value is null when there + // are no more results to return. This token should be treated as an opaque + // identifier that is used only to retrieve the next items in a list and not for + // other programmatic purposes. NextToken *string // Metadata pertaining to the operation's result. diff --git a/service/eks/api_op_DescribePodIdentityAssociation.go b/service/eks/api_op_DescribePodIdentityAssociation.go new file mode 100644 index 00000000000..ff7f9b5df00 --- /dev/null +++ b/service/eks/api_op_DescribePodIdentityAssociation.go @@ -0,0 +1,146 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eks + +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/eks/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns descriptive information about an EKS Pod Identity association. This +// action requires the ID of the association. You can get the ID from the response +// to the CreatePodIdentityAssocation for newly created associations. Or, you can +// list the IDs for associations with ListPodIdentityAssociations and filter the +// list by namespace or service account. +func (c *Client) DescribePodIdentityAssociation(ctx context.Context, params *DescribePodIdentityAssociationInput, optFns ...func(*Options)) (*DescribePodIdentityAssociationOutput, error) { + if params == nil { + params = &DescribePodIdentityAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribePodIdentityAssociation", params, optFns, c.addOperationDescribePodIdentityAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribePodIdentityAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribePodIdentityAssociationInput struct { + + // The ID of the association that you want the description of. + // + // This member is required. + AssociationId *string + + // The name of the cluster that the association is in. + // + // This member is required. + ClusterName *string + + noSmithyDocumentSerde +} + +type DescribePodIdentityAssociationOutput struct { + + // The full description of the EKS Pod Identity association. + Association *types.PodIdentityAssociation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribePodIdentityAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribePodIdentityAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribePodIdentityAssociation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribePodIdentityAssociation"); 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 = addOpDescribePodIdentityAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePodIdentityAssociation(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_opDescribePodIdentityAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribePodIdentityAssociation", + } +} diff --git a/service/eks/api_op_ListAddons.go b/service/eks/api_op_ListAddons.go index ae898fe5aa9..b5d4c13e5dc 100644 --- a/service/eks/api_op_ListAddons.go +++ b/service/eks/api_op_ListAddons.go @@ -59,12 +59,11 @@ type ListAddonsOutput struct { // A list of installed add-ons. Addons []string - // The nextToken value returned from a previous paginated ListAddonsResponse where - // maxResults was used and the results exceeded the value of that parameter. - // Pagination continues from the end of the previous results that returned the - // nextToken value. This token should be treated as an opaque identifier that is - // used only to retrieve the next items in a list and not for other programmatic - // purposes. + // The nextToken value to include in a future ListAddons request. When the results + // of a ListAddons request exceed maxResults , you can use this value to retrieve + // the next page of results. This value is null when there are no more results to + // return. This token should be treated as an opaque identifier that is used only + // to retrieve the next items in a list and not for other programmatic purposes. NextToken *string // Metadata pertaining to the operation's result. diff --git a/service/eks/api_op_ListEksAnywhereSubscriptions.go b/service/eks/api_op_ListEksAnywhereSubscriptions.go index 25e269a7855..dc3f133820c 100644 --- a/service/eks/api_op_ListEksAnywhereSubscriptions.go +++ b/service/eks/api_op_ListEksAnywhereSubscriptions.go @@ -43,10 +43,10 @@ type ListEksAnywhereSubscriptionsInput struct { // applicable. MaxResults *int32 - // The nextToken value to include in a future ListEksAnywhereSubscriptions - // request. When the results of a ListEksAnywhereSubscriptions request exceed - // maxResults, you can use this value to retrieve the next page of results. This - // value is null when there are no more results to return. + // The nextToken value returned from a previous paginated + // ListEksAnywhereSubscriptions request where maxResults was used and the results + // exceeded the value of that parameter. Pagination continues from the end of the + // previous results that returned the nextToken value. NextToken *string noSmithyDocumentSerde @@ -146,6 +146,106 @@ func (c *Client) addOperationListEksAnywhereSubscriptionsMiddlewares(stack *midd return nil } +// ListEksAnywhereSubscriptionsAPIClient is a client that implements the +// ListEksAnywhereSubscriptions operation. +type ListEksAnywhereSubscriptionsAPIClient interface { + ListEksAnywhereSubscriptions(context.Context, *ListEksAnywhereSubscriptionsInput, ...func(*Options)) (*ListEksAnywhereSubscriptionsOutput, error) +} + +var _ ListEksAnywhereSubscriptionsAPIClient = (*Client)(nil) + +// ListEksAnywhereSubscriptionsPaginatorOptions is the paginator options for +// ListEksAnywhereSubscriptions +type ListEksAnywhereSubscriptionsPaginatorOptions struct { + // The maximum number of cluster results returned by ListEksAnywhereSubscriptions + // in paginated output. When you use this parameter, ListEksAnywhereSubscriptions + // returns only maxResults results in a single page along with a nextToken response + // element. You can see the remaining results of the initial request by sending + // another ListEksAnywhereSubscriptions request with the returned nextToken value. + // This value can be between 1 and 100. If you don't use this parameter, + // ListEksAnywhereSubscriptions returns up to 10 results and a nextToken value if + // applicable. + 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 +} + +// ListEksAnywhereSubscriptionsPaginator is a paginator for +// ListEksAnywhereSubscriptions +type ListEksAnywhereSubscriptionsPaginator struct { + options ListEksAnywhereSubscriptionsPaginatorOptions + client ListEksAnywhereSubscriptionsAPIClient + params *ListEksAnywhereSubscriptionsInput + nextToken *string + firstPage bool +} + +// NewListEksAnywhereSubscriptionsPaginator returns a new +// ListEksAnywhereSubscriptionsPaginator +func NewListEksAnywhereSubscriptionsPaginator(client ListEksAnywhereSubscriptionsAPIClient, params *ListEksAnywhereSubscriptionsInput, optFns ...func(*ListEksAnywhereSubscriptionsPaginatorOptions)) *ListEksAnywhereSubscriptionsPaginator { + if params == nil { + params = &ListEksAnywhereSubscriptionsInput{} + } + + options := ListEksAnywhereSubscriptionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListEksAnywhereSubscriptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEksAnywhereSubscriptionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListEksAnywhereSubscriptions page. +func (p *ListEksAnywhereSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEksAnywhereSubscriptionsOutput, 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.ListEksAnywhereSubscriptions(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_opListEksAnywhereSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/eks/api_op_ListIdentityProviderConfigs.go b/service/eks/api_op_ListIdentityProviderConfigs.go index 7019103e6cc..55acd7f7b6d 100644 --- a/service/eks/api_op_ListIdentityProviderConfigs.go +++ b/service/eks/api_op_ListIdentityProviderConfigs.go @@ -59,10 +59,10 @@ type ListIdentityProviderConfigsOutput struct { // The identity provider configurations for the cluster. IdentityProviderConfigs []types.IdentityProviderConfig - // The nextToken value returned from a previous paginated - // ListIdentityProviderConfigsResponse where maxResults was used and the results - // exceeded the value of that parameter. Pagination continues from the end of the - // previous results that returned the nextToken value. + // The nextToken value to include in a future ListIdentityProviderConfigsResponse + // request. When the results of a ListIdentityProviderConfigsResponse request + // exceed maxResults , you can use this value to retrieve the next page of results. + // This value is null when there are no more results to return. NextToken *string // Metadata pertaining to the operation's result. diff --git a/service/eks/api_op_ListPodIdentityAssociations.go b/service/eks/api_op_ListPodIdentityAssociations.go new file mode 100644 index 00000000000..2e864781b20 --- /dev/null +++ b/service/eks/api_op_ListPodIdentityAssociations.go @@ -0,0 +1,278 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eks + +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/eks/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List the EKS Pod Identity associations in a cluster. You can filter the list by +// the namespace that the association is in or the service account that the +// association uses. +func (c *Client) ListPodIdentityAssociations(ctx context.Context, params *ListPodIdentityAssociationsInput, optFns ...func(*Options)) (*ListPodIdentityAssociationsOutput, error) { + if params == nil { + params = &ListPodIdentityAssociationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListPodIdentityAssociations", params, optFns, c.addOperationListPodIdentityAssociationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListPodIdentityAssociationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListPodIdentityAssociationsInput struct { + + // The name of the cluster that the associations are in. + // + // This member is required. + ClusterName *string + + // The maximum number of EKS Pod Identity association results returned by + // ListPodIdentityAssociations in paginated output. When you use this parameter, + // ListPodIdentityAssociations returns only maxResults results in a single page + // along with a nextToken response element. You can see the remaining results of + // the initial request by sending another ListPodIdentityAssociations request with + // the returned nextToken value. This value can be between 1 and 100. If you don't + // use this parameter, ListPodIdentityAssociations returns up to 100 results and a + // nextToken value if applicable. + MaxResults *int32 + + // The name of the Kubernetes namespace inside the cluster that the associations + // are in. + Namespace *string + + // The nextToken value returned from a previous paginated ListUpdates request + // where maxResults was used and the results exceeded the value of that parameter. + // Pagination continues from the end of the previous results that returned the + // nextToken value. This token should be treated as an opaque identifier that is + // used only to retrieve the next items in a list and not for other programmatic + // purposes. + NextToken *string + + // The name of the Kubernetes service account that the associations use. + ServiceAccount *string + + noSmithyDocumentSerde +} + +type ListPodIdentityAssociationsOutput struct { + + // The list of summarized descriptions of the associations that are in the cluster + // and match any filters that you provided. Each summary is simplified by removing + // these fields compared to the full PodIdentityAssociation : + // - The IAM role: roleArn + // - The timestamp that the association was created at: createdAt + // - The most recent timestamp that the association was modified at:. modifiedAt + // - The tags on the association: tags + Associations []types.PodIdentityAssociationSummary + + // The nextToken value to include in a future ListPodIdentityAssociations request. + // When the results of a ListPodIdentityAssociations request exceed maxResults , + // you can use this value to retrieve the next page of results. This value is null + // when there are no more results to return. This token should be treated as an + // opaque identifier that is used only to retrieve the next items in a list and not + // for other programmatic purposes. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListPodIdentityAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListPodIdentityAssociations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPodIdentityAssociations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListPodIdentityAssociations"); 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 = addOpListPodIdentityAssociationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPodIdentityAssociations(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 +} + +// ListPodIdentityAssociationsAPIClient is a client that implements the +// ListPodIdentityAssociations operation. +type ListPodIdentityAssociationsAPIClient interface { + ListPodIdentityAssociations(context.Context, *ListPodIdentityAssociationsInput, ...func(*Options)) (*ListPodIdentityAssociationsOutput, error) +} + +var _ ListPodIdentityAssociationsAPIClient = (*Client)(nil) + +// ListPodIdentityAssociationsPaginatorOptions is the paginator options for +// ListPodIdentityAssociations +type ListPodIdentityAssociationsPaginatorOptions struct { + // The maximum number of EKS Pod Identity association results returned by + // ListPodIdentityAssociations in paginated output. When you use this parameter, + // ListPodIdentityAssociations returns only maxResults results in a single page + // along with a nextToken response element. You can see the remaining results of + // the initial request by sending another ListPodIdentityAssociations request with + // the returned nextToken value. This value can be between 1 and 100. If you don't + // use this parameter, ListPodIdentityAssociations returns up to 100 results and a + // nextToken value if applicable. + 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 +} + +// ListPodIdentityAssociationsPaginator is a paginator for +// ListPodIdentityAssociations +type ListPodIdentityAssociationsPaginator struct { + options ListPodIdentityAssociationsPaginatorOptions + client ListPodIdentityAssociationsAPIClient + params *ListPodIdentityAssociationsInput + nextToken *string + firstPage bool +} + +// NewListPodIdentityAssociationsPaginator returns a new +// ListPodIdentityAssociationsPaginator +func NewListPodIdentityAssociationsPaginator(client ListPodIdentityAssociationsAPIClient, params *ListPodIdentityAssociationsInput, optFns ...func(*ListPodIdentityAssociationsPaginatorOptions)) *ListPodIdentityAssociationsPaginator { + if params == nil { + params = &ListPodIdentityAssociationsInput{} + } + + options := ListPodIdentityAssociationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListPodIdentityAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPodIdentityAssociationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListPodIdentityAssociations page. +func (p *ListPodIdentityAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPodIdentityAssociationsOutput, 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.ListPodIdentityAssociations(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_opListPodIdentityAssociations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListPodIdentityAssociations", + } +} diff --git a/service/eks/api_op_UpdateClusterConfig.go b/service/eks/api_op_UpdateClusterConfig.go index 22b9c465752..e7b097b57d4 100644 --- a/service/eks/api_op_UpdateClusterConfig.go +++ b/service/eks/api_op_UpdateClusterConfig.go @@ -26,8 +26,13 @@ import ( // your cluster's Kubernetes API server endpoint. By default, public access is // enabled, and private access is disabled. For more information, see Amazon EKS // cluster endpoint access control (https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html) -// in the Amazon EKS User Guide . You can't update the subnets or security group -// IDs for an existing cluster. Cluster updates are asynchronous, and they should +// in the Amazon EKS User Guide . You can also use this API operation to choose +// different subnets and security groups for the cluster. You must specify at least +// two subnets that are in different Availability Zones. You can't change which VPC +// the subnets are from, the subnets must be in the same VPC as the subnets that +// the cluster was created with. For more information about the VPC requirements, +// see https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html (https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html) +// in the Amazon EKS User Guide . Cluster updates are asynchronous, and they should // finish within a few minutes. During an update, the cluster status moves to // UPDATING (this status transition is eventually consistent). When the update is // complete (either Failed or Successful ), the cluster status moves to Active . diff --git a/service/eks/api_op_UpdateEksAnywhereSubscription.go b/service/eks/api_op_UpdateEksAnywhereSubscription.go index 1d30ca9dd64..26470274ab5 100644 --- a/service/eks/api_op_UpdateEksAnywhereSubscription.go +++ b/service/eks/api_op_UpdateEksAnywhereSubscription.go @@ -36,7 +36,7 @@ type UpdateEksAnywhereSubscriptionInput struct { // This member is required. AutoRenew bool - // + // The ID of the subscription. // // This member is required. Id *string diff --git a/service/eks/api_op_UpdatePodIdentityAssociation.go b/service/eks/api_op_UpdatePodIdentityAssociation.go new file mode 100644 index 00000000000..9f7c910f988 --- /dev/null +++ b/service/eks/api_op_UpdatePodIdentityAssociation.go @@ -0,0 +1,188 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eks + +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/eks/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a EKS Pod Identity association. Only the IAM role can be changed; an +// association can't be moved between clusters, namespaces, or service accounts. If +// you need to edit the namespace or service account, you need to remove the +// association and then create a new association with your desired settings. +func (c *Client) UpdatePodIdentityAssociation(ctx context.Context, params *UpdatePodIdentityAssociationInput, optFns ...func(*Options)) (*UpdatePodIdentityAssociationOutput, error) { + if params == nil { + params = &UpdatePodIdentityAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdatePodIdentityAssociation", params, optFns, c.addOperationUpdatePodIdentityAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdatePodIdentityAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdatePodIdentityAssociationInput struct { + + // The ID of the association to be updated. + // + // This member is required. + AssociationId *string + + // The name of the cluster that you want to update the association in. + // + // This member is required. + ClusterName *string + + // Unique, case-sensitive identifier that you provide to ensure the idempotency of + // the request. + ClientRequestToken *string + + // The new IAM role to change the + RoleArn *string + + noSmithyDocumentSerde +} + +type UpdatePodIdentityAssociationOutput struct { + + // The full description of the EKS Pod Identity association that was updated. + Association *types.PodIdentityAssociation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdatePodIdentityAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdatePodIdentityAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdatePodIdentityAssociation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdatePodIdentityAssociation"); 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_opUpdatePodIdentityAssociationMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdatePodIdentityAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePodIdentityAssociation(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_initializeOpUpdatePodIdentityAssociation struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpUpdatePodIdentityAssociation) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpUpdatePodIdentityAssociation) 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.(*UpdatePodIdentityAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdatePodIdentityAssociationInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opUpdatePodIdentityAssociationMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpUpdatePodIdentityAssociation{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opUpdatePodIdentityAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdatePodIdentityAssociation", + } +} diff --git a/service/eks/deserializers.go b/service/eks/deserializers.go index 18efa2f2edc..9c567d633cb 100644 --- a/service/eks/deserializers.go +++ b/service/eks/deserializers.go @@ -1161,6 +1161,168 @@ func awsRestjson1_deserializeOpDocumentCreateNodegroupOutput(v **CreateNodegroup return nil } +type awsRestjson1_deserializeOpCreatePodIdentityAssociation struct { +} + +func (*awsRestjson1_deserializeOpCreatePodIdentityAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreatePodIdentityAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreatePodIdentityAssociation(response, &metadata) + } + output := &CreatePodIdentityAssociationOutput{} + 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_deserializeOpDocumentCreatePodIdentityAssociationOutput(&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_deserializeOpErrorCreatePodIdentityAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsRestjson1_deserializeErrorServerException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreatePodIdentityAssociationOutput(v **CreatePodIdentityAssociationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreatePodIdentityAssociationOutput + if *v == nil { + sv = &CreatePodIdentityAssociationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "association": + if err := awsRestjson1_deserializeDocumentPodIdentityAssociation(&sv.Association, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpDeleteAddon struct { } @@ -1953,6 +2115,162 @@ func awsRestjson1_deserializeOpDocumentDeleteNodegroupOutput(v **DeleteNodegroup return nil } +type awsRestjson1_deserializeOpDeletePodIdentityAssociation struct { +} + +func (*awsRestjson1_deserializeOpDeletePodIdentityAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeletePodIdentityAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeletePodIdentityAssociation(response, &metadata) + } + output := &DeletePodIdentityAssociationOutput{} + 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_deserializeOpDocumentDeletePodIdentityAssociationOutput(&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_deserializeOpErrorDeletePodIdentityAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsRestjson1_deserializeErrorServerException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeletePodIdentityAssociationOutput(v **DeletePodIdentityAssociationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeletePodIdentityAssociationOutput + if *v == nil { + sv = &DeletePodIdentityAssociationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "association": + if err := awsRestjson1_deserializeDocumentPodIdentityAssociation(&sv.Association, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpDeregisterCluster struct { } @@ -2811,7 +3129,163 @@ func (m *awsRestjson1_deserializeOpDescribeEksAnywhereSubscription) HandleDeseri return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeEksAnywhereSubscriptionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeEksAnywhereSubscriptionOutput(&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_deserializeOpErrorDescribeEksAnywhereSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsRestjson1_deserializeErrorServerException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDescribeEksAnywhereSubscriptionOutput(v **DescribeEksAnywhereSubscriptionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeEksAnywhereSubscriptionOutput + if *v == nil { + sv = &DescribeEksAnywhereSubscriptionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "subscription": + if err := awsRestjson1_deserializeDocumentEksAnywhereSubscription(&sv.Subscription, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDescribeFargateProfile struct { +} + +func (*awsRestjson1_deserializeOpDescribeFargateProfile) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribeFargateProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDescribeFargateProfile(response, &metadata) + } + output := &DescribeFargateProfileOutput{} + 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_deserializeOpDocumentDescribeFargateProfileOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2824,7 +3298,7 @@ func (m *awsRestjson1_deserializeOpDescribeEksAnywhereSubscription) HandleDeseri return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeEksAnywhereSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeFargateProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2868,15 +3342,15 @@ func awsRestjson1_deserializeOpErrorDescribeEksAnywhereSubscription(response *sm case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServerException", errorCode): return awsRestjson1_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2887,7 +3361,7 @@ func awsRestjson1_deserializeOpErrorDescribeEksAnywhereSubscription(response *sm } } -func awsRestjson1_deserializeOpDocumentDescribeEksAnywhereSubscriptionOutput(v **DescribeEksAnywhereSubscriptionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeFargateProfileOutput(v **DescribeFargateProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2900,17 +3374,17 @@ func awsRestjson1_deserializeOpDocumentDescribeEksAnywhereSubscriptionOutput(v * return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeEksAnywhereSubscriptionOutput + var sv *DescribeFargateProfileOutput if *v == nil { - sv = &DescribeEksAnywhereSubscriptionOutput{} + sv = &DescribeFargateProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "subscription": - if err := awsRestjson1_deserializeDocumentEksAnywhereSubscription(&sv.Subscription, value); err != nil { + case "fargateProfile": + if err := awsRestjson1_deserializeDocumentFargateProfile(&sv.FargateProfile, value); err != nil { return err } @@ -2923,14 +3397,14 @@ func awsRestjson1_deserializeOpDocumentDescribeEksAnywhereSubscriptionOutput(v * return nil } -type awsRestjson1_deserializeOpDescribeFargateProfile struct { +type awsRestjson1_deserializeOpDescribeIdentityProviderConfig struct { } -func (*awsRestjson1_deserializeOpDescribeFargateProfile) ID() string { +func (*awsRestjson1_deserializeOpDescribeIdentityProviderConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeFargateProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeIdentityProviderConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2944,9 +3418,9 @@ func (m *awsRestjson1_deserializeOpDescribeFargateProfile) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeFargateProfile(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeIdentityProviderConfig(response, &metadata) } - output := &DescribeFargateProfileOutput{} + output := &DescribeIdentityProviderConfigOutput{} out.Result = output var buff [1024]byte @@ -2967,7 +3441,7 @@ func (m *awsRestjson1_deserializeOpDescribeFargateProfile) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeFargateProfileOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeIdentityProviderConfigOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2980,7 +3454,7 @@ func (m *awsRestjson1_deserializeOpDescribeFargateProfile) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeFargateProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeIdentityProviderConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3033,6 +3507,9 @@ func awsRestjson1_deserializeOpErrorDescribeFargateProfile(response *smithyhttp. case strings.EqualFold("ServerException", errorCode): return awsRestjson1_deserializeErrorServerException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3043,7 +3520,7 @@ func awsRestjson1_deserializeOpErrorDescribeFargateProfile(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentDescribeFargateProfileOutput(v **DescribeFargateProfileOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeIdentityProviderConfigOutput(v **DescribeIdentityProviderConfigOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3056,17 +3533,17 @@ func awsRestjson1_deserializeOpDocumentDescribeFargateProfileOutput(v **Describe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeFargateProfileOutput + var sv *DescribeIdentityProviderConfigOutput if *v == nil { - sv = &DescribeFargateProfileOutput{} + sv = &DescribeIdentityProviderConfigOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "fargateProfile": - if err := awsRestjson1_deserializeDocumentFargateProfile(&sv.FargateProfile, value); err != nil { + case "identityProviderConfig": + if err := awsRestjson1_deserializeDocumentIdentityProviderConfigResponse(&sv.IdentityProviderConfig, value); err != nil { return err } @@ -3079,14 +3556,14 @@ func awsRestjson1_deserializeOpDocumentDescribeFargateProfileOutput(v **Describe return nil } -type awsRestjson1_deserializeOpDescribeIdentityProviderConfig struct { +type awsRestjson1_deserializeOpDescribeNodegroup struct { } -func (*awsRestjson1_deserializeOpDescribeIdentityProviderConfig) ID() string { +func (*awsRestjson1_deserializeOpDescribeNodegroup) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeIdentityProviderConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeNodegroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3100,9 +3577,9 @@ func (m *awsRestjson1_deserializeOpDescribeIdentityProviderConfig) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeIdentityProviderConfig(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeNodegroup(response, &metadata) } - output := &DescribeIdentityProviderConfigOutput{} + output := &DescribeNodegroupOutput{} out.Result = output var buff [1024]byte @@ -3123,7 +3600,7 @@ func (m *awsRestjson1_deserializeOpDescribeIdentityProviderConfig) HandleDeseria return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeIdentityProviderConfigOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeNodegroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3136,7 +3613,7 @@ func (m *awsRestjson1_deserializeOpDescribeIdentityProviderConfig) HandleDeseria return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeIdentityProviderConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeNodegroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3202,7 +3679,7 @@ func awsRestjson1_deserializeOpErrorDescribeIdentityProviderConfig(response *smi } } -func awsRestjson1_deserializeOpDocumentDescribeIdentityProviderConfigOutput(v **DescribeIdentityProviderConfigOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeNodegroupOutput(v **DescribeNodegroupOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3215,17 +3692,17 @@ func awsRestjson1_deserializeOpDocumentDescribeIdentityProviderConfigOutput(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeIdentityProviderConfigOutput + var sv *DescribeNodegroupOutput if *v == nil { - sv = &DescribeIdentityProviderConfigOutput{} + sv = &DescribeNodegroupOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "identityProviderConfig": - if err := awsRestjson1_deserializeDocumentIdentityProviderConfigResponse(&sv.IdentityProviderConfig, value); err != nil { + case "nodegroup": + if err := awsRestjson1_deserializeDocumentNodegroup(&sv.Nodegroup, value); err != nil { return err } @@ -3238,14 +3715,14 @@ func awsRestjson1_deserializeOpDocumentDescribeIdentityProviderConfigOutput(v ** return nil } -type awsRestjson1_deserializeOpDescribeNodegroup struct { +type awsRestjson1_deserializeOpDescribePodIdentityAssociation struct { } -func (*awsRestjson1_deserializeOpDescribeNodegroup) ID() string { +func (*awsRestjson1_deserializeOpDescribePodIdentityAssociation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeNodegroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribePodIdentityAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3259,9 +3736,9 @@ func (m *awsRestjson1_deserializeOpDescribeNodegroup) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeNodegroup(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribePodIdentityAssociation(response, &metadata) } - output := &DescribeNodegroupOutput{} + output := &DescribePodIdentityAssociationOutput{} out.Result = output var buff [1024]byte @@ -3282,7 +3759,7 @@ func (m *awsRestjson1_deserializeOpDescribeNodegroup) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeNodegroupOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribePodIdentityAssociationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3295,7 +3772,7 @@ func (m *awsRestjson1_deserializeOpDescribeNodegroup) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeNodegroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribePodIdentityAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3336,21 +3813,18 @@ func awsRestjson1_deserializeOpErrorDescribeNodegroup(response *smithyhttp.Respo } switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServerException", errorCode): return awsRestjson1_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3361,7 +3835,7 @@ func awsRestjson1_deserializeOpErrorDescribeNodegroup(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentDescribeNodegroupOutput(v **DescribeNodegroupOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribePodIdentityAssociationOutput(v **DescribePodIdentityAssociationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3374,17 +3848,17 @@ func awsRestjson1_deserializeOpDocumentDescribeNodegroupOutput(v **DescribeNodeg return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeNodegroupOutput + var sv *DescribePodIdentityAssociationOutput if *v == nil { - sv = &DescribeNodegroupOutput{} + sv = &DescribePodIdentityAssociationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nodegroup": - if err := awsRestjson1_deserializeDocumentNodegroup(&sv.Nodegroup, value); err != nil { + case "association": + if err := awsRestjson1_deserializeDocumentPodIdentityAssociation(&sv.Association, value); err != nil { return err } @@ -4199,11 +4673,176 @@ func awsRestjson1_deserializeOpDocumentListEksAnywhereSubscriptionsOutput(v **Li sv.NextToken = ptr.String(jtv) } - case "subscriptions": - if err := awsRestjson1_deserializeDocumentEksAnywhereSubscriptionList(&sv.Subscriptions, value); err != nil { - return err - } - + case "subscriptions": + if err := awsRestjson1_deserializeDocumentEksAnywhereSubscriptionList(&sv.Subscriptions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListFargateProfiles struct { +} + +func (*awsRestjson1_deserializeOpListFargateProfiles) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListFargateProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListFargateProfiles(response, &metadata) + } + output := &ListFargateProfilesOutput{} + 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_deserializeOpDocumentListFargateProfilesOutput(&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_deserializeOpErrorListFargateProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsRestjson1_deserializeErrorServerException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListFargateProfilesOutput(v **ListFargateProfilesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListFargateProfilesOutput + if *v == nil { + sv = &ListFargateProfilesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fargateProfileNames": + if err := awsRestjson1_deserializeDocumentStringList(&sv.FargateProfileNames, 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 @@ -4213,14 +4852,14 @@ func awsRestjson1_deserializeOpDocumentListEksAnywhereSubscriptionsOutput(v **Li return nil } -type awsRestjson1_deserializeOpListFargateProfiles struct { +type awsRestjson1_deserializeOpListIdentityProviderConfigs struct { } -func (*awsRestjson1_deserializeOpListFargateProfiles) ID() string { +func (*awsRestjson1_deserializeOpListIdentityProviderConfigs) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListFargateProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListIdentityProviderConfigs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4234,9 +4873,9 @@ func (m *awsRestjson1_deserializeOpListFargateProfiles) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListFargateProfiles(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListIdentityProviderConfigs(response, &metadata) } - output := &ListFargateProfilesOutput{} + output := &ListIdentityProviderConfigsOutput{} out.Result = output var buff [1024]byte @@ -4257,7 +4896,7 @@ func (m *awsRestjson1_deserializeOpListFargateProfiles) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListFargateProfilesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListIdentityProviderConfigsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4270,7 +4909,7 @@ func (m *awsRestjson1_deserializeOpListFargateProfiles) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListFargateProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListIdentityProviderConfigs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4323,6 +4962,9 @@ func awsRestjson1_deserializeOpErrorListFargateProfiles(response *smithyhttp.Res case strings.EqualFold("ServerException", errorCode): return awsRestjson1_deserializeErrorServerException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4333,7 +4975,7 @@ func awsRestjson1_deserializeOpErrorListFargateProfiles(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListFargateProfilesOutput(v **ListFargateProfilesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListIdentityProviderConfigsOutput(v **ListIdentityProviderConfigsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4346,17 +4988,17 @@ func awsRestjson1_deserializeOpDocumentListFargateProfilesOutput(v **ListFargate return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListFargateProfilesOutput + var sv *ListIdentityProviderConfigsOutput if *v == nil { - sv = &ListFargateProfilesOutput{} + sv = &ListIdentityProviderConfigsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "fargateProfileNames": - if err := awsRestjson1_deserializeDocumentStringList(&sv.FargateProfileNames, value); err != nil { + case "identityProviderConfigs": + if err := awsRestjson1_deserializeDocumentIdentityProviderConfigs(&sv.IdentityProviderConfigs, value); err != nil { return err } @@ -4378,14 +5020,14 @@ func awsRestjson1_deserializeOpDocumentListFargateProfilesOutput(v **ListFargate return nil } -type awsRestjson1_deserializeOpListIdentityProviderConfigs struct { +type awsRestjson1_deserializeOpListNodegroups struct { } -func (*awsRestjson1_deserializeOpListIdentityProviderConfigs) ID() string { +func (*awsRestjson1_deserializeOpListNodegroups) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListIdentityProviderConfigs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListNodegroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4399,9 +5041,9 @@ func (m *awsRestjson1_deserializeOpListIdentityProviderConfigs) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListIdentityProviderConfigs(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListNodegroups(response, &metadata) } - output := &ListIdentityProviderConfigsOutput{} + output := &ListNodegroupsOutput{} out.Result = output var buff [1024]byte @@ -4422,7 +5064,7 @@ func (m *awsRestjson1_deserializeOpListIdentityProviderConfigs) HandleDeserializ return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListIdentityProviderConfigsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListNodegroupsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4435,7 +5077,7 @@ func (m *awsRestjson1_deserializeOpListIdentityProviderConfigs) HandleDeserializ return out, metadata, err } -func awsRestjson1_deserializeOpErrorListIdentityProviderConfigs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListNodegroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4501,7 +5143,7 @@ func awsRestjson1_deserializeOpErrorListIdentityProviderConfigs(response *smithy } } -func awsRestjson1_deserializeOpDocumentListIdentityProviderConfigsOutput(v **ListIdentityProviderConfigsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListNodegroupsOutput(v **ListNodegroupsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4514,20 +5156,15 @@ func awsRestjson1_deserializeOpDocumentListIdentityProviderConfigsOutput(v **Lis return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListIdentityProviderConfigsOutput + var sv *ListNodegroupsOutput if *v == nil { - sv = &ListIdentityProviderConfigsOutput{} + sv = &ListNodegroupsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "identityProviderConfigs": - if err := awsRestjson1_deserializeDocumentIdentityProviderConfigs(&sv.IdentityProviderConfigs, value); err != nil { - return err - } - case "nextToken": if value != nil { jtv, ok := value.(string) @@ -4537,6 +5174,11 @@ func awsRestjson1_deserializeOpDocumentListIdentityProviderConfigsOutput(v **Lis sv.NextToken = ptr.String(jtv) } + case "nodegroups": + if err := awsRestjson1_deserializeDocumentStringList(&sv.Nodegroups, value); err != nil { + return err + } + default: _, _ = key, value @@ -4546,14 +5188,14 @@ func awsRestjson1_deserializeOpDocumentListIdentityProviderConfigsOutput(v **Lis return nil } -type awsRestjson1_deserializeOpListNodegroups struct { +type awsRestjson1_deserializeOpListPodIdentityAssociations struct { } -func (*awsRestjson1_deserializeOpListNodegroups) ID() string { +func (*awsRestjson1_deserializeOpListPodIdentityAssociations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListNodegroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPodIdentityAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4567,9 +5209,9 @@ func (m *awsRestjson1_deserializeOpListNodegroups) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListNodegroups(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListPodIdentityAssociations(response, &metadata) } - output := &ListNodegroupsOutput{} + output := &ListPodIdentityAssociationsOutput{} out.Result = output var buff [1024]byte @@ -4590,7 +5232,7 @@ func (m *awsRestjson1_deserializeOpListNodegroups) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListNodegroupsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPodIdentityAssociationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4603,7 +5245,7 @@ func (m *awsRestjson1_deserializeOpListNodegroups) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListNodegroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPodIdentityAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4644,21 +5286,18 @@ func awsRestjson1_deserializeOpErrorListNodegroups(response *smithyhttp.Response } switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServerException", errorCode): return awsRestjson1_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4669,7 +5308,7 @@ func awsRestjson1_deserializeOpErrorListNodegroups(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListNodegroupsOutput(v **ListNodegroupsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPodIdentityAssociationsOutput(v **ListPodIdentityAssociationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4682,15 +5321,20 @@ func awsRestjson1_deserializeOpDocumentListNodegroupsOutput(v **ListNodegroupsOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListNodegroupsOutput + var sv *ListPodIdentityAssociationsOutput if *v == nil { - sv = &ListNodegroupsOutput{} + sv = &ListPodIdentityAssociationsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "associations": + if err := awsRestjson1_deserializeDocumentPodIdentityAssociationSummaries(&sv.Associations, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -4700,11 +5344,6 @@ func awsRestjson1_deserializeOpDocumentListNodegroupsOutput(v **ListNodegroupsOu sv.NextToken = ptr.String(jtv) } - case "nodegroups": - if err := awsRestjson1_deserializeDocumentStringList(&sv.Nodegroups, value); err != nil { - return err - } - default: _, _ = key, value @@ -5991,17 +6630,179 @@ func awsRestjson1_deserializeOpDocumentUpdateEksAnywhereSubscriptionOutput(v **U return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateEksAnywhereSubscriptionOutput + var sv *UpdateEksAnywhereSubscriptionOutput + if *v == nil { + sv = &UpdateEksAnywhereSubscriptionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "subscription": + if err := awsRestjson1_deserializeDocumentEksAnywhereSubscription(&sv.Subscription, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateNodegroupConfig struct { +} + +func (*awsRestjson1_deserializeOpUpdateNodegroupConfig) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateNodegroupConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateNodegroupConfig(response, &metadata) + } + output := &UpdateNodegroupConfigOutput{} + 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_deserializeOpDocumentUpdateNodegroupConfigOutput(&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_deserializeOpErrorUpdateNodegroupConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsRestjson1_deserializeErrorServerException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateNodegroupConfigOutput(v **UpdateNodegroupConfigOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateNodegroupConfigOutput if *v == nil { - sv = &UpdateEksAnywhereSubscriptionOutput{} + sv = &UpdateNodegroupConfigOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "subscription": - if err := awsRestjson1_deserializeDocumentEksAnywhereSubscription(&sv.Subscription, value); err != nil { + case "update": + if err := awsRestjson1_deserializeDocumentUpdate(&sv.Update, value); err != nil { return err } @@ -6014,14 +6815,14 @@ func awsRestjson1_deserializeOpDocumentUpdateEksAnywhereSubscriptionOutput(v **U return nil } -type awsRestjson1_deserializeOpUpdateNodegroupConfig struct { +type awsRestjson1_deserializeOpUpdateNodegroupVersion struct { } -func (*awsRestjson1_deserializeOpUpdateNodegroupConfig) ID() string { +func (*awsRestjson1_deserializeOpUpdateNodegroupVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateNodegroupConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateNodegroupVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6035,9 +6836,9 @@ func (m *awsRestjson1_deserializeOpUpdateNodegroupConfig) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateNodegroupConfig(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateNodegroupVersion(response, &metadata) } - output := &UpdateNodegroupConfigOutput{} + output := &UpdateNodegroupVersionOutput{} out.Result = output var buff [1024]byte @@ -6058,7 +6859,7 @@ func (m *awsRestjson1_deserializeOpUpdateNodegroupConfig) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateNodegroupConfigOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateNodegroupVersionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6071,7 +6872,7 @@ func (m *awsRestjson1_deserializeOpUpdateNodegroupConfig) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateNodegroupConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateNodegroupVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6140,7 +6941,7 @@ func awsRestjson1_deserializeOpErrorUpdateNodegroupConfig(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentUpdateNodegroupConfigOutput(v **UpdateNodegroupConfigOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateNodegroupVersionOutput(v **UpdateNodegroupVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6153,9 +6954,9 @@ func awsRestjson1_deserializeOpDocumentUpdateNodegroupConfigOutput(v **UpdateNod return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateNodegroupConfigOutput + var sv *UpdateNodegroupVersionOutput if *v == nil { - sv = &UpdateNodegroupConfigOutput{} + sv = &UpdateNodegroupVersionOutput{} } else { sv = *v } @@ -6176,14 +6977,14 @@ func awsRestjson1_deserializeOpDocumentUpdateNodegroupConfigOutput(v **UpdateNod return nil } -type awsRestjson1_deserializeOpUpdateNodegroupVersion struct { +type awsRestjson1_deserializeOpUpdatePodIdentityAssociation struct { } -func (*awsRestjson1_deserializeOpUpdateNodegroupVersion) ID() string { +func (*awsRestjson1_deserializeOpUpdatePodIdentityAssociation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateNodegroupVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdatePodIdentityAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6197,9 +6998,9 @@ func (m *awsRestjson1_deserializeOpUpdateNodegroupVersion) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateNodegroupVersion(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdatePodIdentityAssociation(response, &metadata) } - output := &UpdateNodegroupVersionOutput{} + output := &UpdatePodIdentityAssociationOutput{} out.Result = output var buff [1024]byte @@ -6220,7 +7021,7 @@ func (m *awsRestjson1_deserializeOpUpdateNodegroupVersion) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateNodegroupVersionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdatePodIdentityAssociationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6233,7 +7034,7 @@ func (m *awsRestjson1_deserializeOpUpdateNodegroupVersion) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateNodegroupVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdatePodIdentityAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6274,18 +7075,12 @@ func awsRestjson1_deserializeOpErrorUpdateNodegroupVersion(response *smithyhttp. } switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -6302,7 +7097,7 @@ func awsRestjson1_deserializeOpErrorUpdateNodegroupVersion(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentUpdateNodegroupVersionOutput(v **UpdateNodegroupVersionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdatePodIdentityAssociationOutput(v **UpdatePodIdentityAssociationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6315,17 +7110,17 @@ func awsRestjson1_deserializeOpDocumentUpdateNodegroupVersionOutput(v **UpdateNo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateNodegroupVersionOutput + var sv *UpdatePodIdentityAssociationOutput if *v == nil { - sv = &UpdateNodegroupVersionOutput{} + sv = &UpdatePodIdentityAssociationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "update": - if err := awsRestjson1_deserializeDocumentUpdate(&sv.Update, value); err != nil { + case "association": + if err := awsRestjson1_deserializeDocumentPodIdentityAssociation(&sv.Association, value); err != nil { return err } @@ -10137,6 +10932,238 @@ func awsRestjson1_deserializeDocumentOutpostConfigResponse(v **types.OutpostConf return nil } +func awsRestjson1_deserializeDocumentPodIdentityAssociation(v **types.PodIdentityAssociation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PodIdentityAssociation + if *v == nil { + sv = &types.PodIdentityAssociation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "associationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AssociationArn = ptr.String(jtv) + } + + case "associationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AssociationId = ptr.String(jtv) + } + + case "clusterName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ClusterName = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "modifiedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "namespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Namespace = ptr.String(jtv) + } + + case "roleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + + case "serviceAccount": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceAccount = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPodIdentityAssociationSummaries(v *[]types.PodIdentityAssociationSummary, 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.PodIdentityAssociationSummary + if *v == nil { + cv = []types.PodIdentityAssociationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PodIdentityAssociationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentPodIdentityAssociationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPodIdentityAssociationSummary(v **types.PodIdentityAssociationSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PodIdentityAssociationSummary + if *v == nil { + sv = &types.PodIdentityAssociationSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "associationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AssociationArn = ptr.String(jtv) + } + + case "associationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AssociationId = ptr.String(jtv) + } + + case "clusterName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ClusterName = ptr.String(jtv) + } + + case "namespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Namespace = ptr.String(jtv) + } + + case "serviceAccount": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceAccount = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentProvider(v **types.Provider, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/eks/generated.json b/service/eks/generated.json index 38f0a139c34..ea4edd39ab6 100644 --- a/service/eks/generated.json +++ b/service/eks/generated.json @@ -17,11 +17,13 @@ "api_op_CreateEksAnywhereSubscription.go", "api_op_CreateFargateProfile.go", "api_op_CreateNodegroup.go", + "api_op_CreatePodIdentityAssociation.go", "api_op_DeleteAddon.go", "api_op_DeleteCluster.go", "api_op_DeleteEksAnywhereSubscription.go", "api_op_DeleteFargateProfile.go", "api_op_DeleteNodegroup.go", + "api_op_DeletePodIdentityAssociation.go", "api_op_DeregisterCluster.go", "api_op_DescribeAddon.go", "api_op_DescribeAddonConfiguration.go", @@ -31,6 +33,7 @@ "api_op_DescribeFargateProfile.go", "api_op_DescribeIdentityProviderConfig.go", "api_op_DescribeNodegroup.go", + "api_op_DescribePodIdentityAssociation.go", "api_op_DescribeUpdate.go", "api_op_DisassociateIdentityProviderConfig.go", "api_op_ListAddons.go", @@ -39,6 +42,7 @@ "api_op_ListFargateProfiles.go", "api_op_ListIdentityProviderConfigs.go", "api_op_ListNodegroups.go", + "api_op_ListPodIdentityAssociations.go", "api_op_ListTagsForResource.go", "api_op_ListUpdates.go", "api_op_RegisterCluster.go", @@ -50,6 +54,7 @@ "api_op_UpdateEksAnywhereSubscription.go", "api_op_UpdateNodegroupConfig.go", "api_op_UpdateNodegroupVersion.go", + "api_op_UpdatePodIdentityAssociation.go", "auth.go", "deserializers.go", "doc.go", diff --git a/service/eks/serializers.go b/service/eks/serializers.go index 950e9d2be02..781838fa6db 100644 --- a/service/eks/serializers.go +++ b/service/eks/serializers.go @@ -877,6 +877,116 @@ func awsRestjson1_serializeOpDocumentCreateNodegroupInput(v *CreateNodegroupInpu return nil } +type awsRestjson1_serializeOpCreatePodIdentityAssociation struct { +} + +func (*awsRestjson1_serializeOpCreatePodIdentityAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreatePodIdentityAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreatePodIdentityAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/pod-identity-associations") + 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_serializeOpHttpBindingsCreatePodIdentityAssociationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreatePodIdentityAssociationInput(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_serializeOpHttpBindingsCreatePodIdentityAssociationInput(v *CreatePodIdentityAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ClusterName == nil || len(*v.ClusterName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} + } + if v.ClusterName != nil { + if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreatePodIdentityAssociationInput(v *CreatePodIdentityAssociationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("clientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.Namespace != nil { + ok := object.Key("namespace") + ok.String(*v.Namespace) + } + + if v.RoleArn != nil { + ok := object.Key("roleArn") + ok.String(*v.RoleArn) + } + + if v.ServiceAccount != nil { + ok := object.Key("serviceAccount") + ok.String(*v.ServiceAccount) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteAddon struct { } @@ -1233,6 +1343,80 @@ func awsRestjson1_serializeOpHttpBindingsDeleteNodegroupInput(v *DeleteNodegroup return nil } +type awsRestjson1_serializeOpDeletePodIdentityAssociation struct { +} + +func (*awsRestjson1_serializeOpDeletePodIdentityAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeletePodIdentityAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeletePodIdentityAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/pod-identity-associations/{associationId}") + 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_serializeOpHttpBindingsDeletePodIdentityAssociationInput(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_serializeOpHttpBindingsDeletePodIdentityAssociationInput(v *DeletePodIdentityAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssociationId == nil || len(*v.AssociationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member associationId must not be empty")} + } + if v.AssociationId != nil { + if err := encoder.SetURI("associationId").String(*v.AssociationId); err != nil { + return err + } + } + + if v.ClusterName == nil || len(*v.ClusterName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} + } + if v.ClusterName != nil { + if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeregisterCluster struct { } @@ -1894,6 +2078,80 @@ func awsRestjson1_serializeOpHttpBindingsDescribeNodegroupInput(v *DescribeNodeg return nil } +type awsRestjson1_serializeOpDescribePodIdentityAssociation struct { +} + +func (*awsRestjson1_serializeOpDescribePodIdentityAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribePodIdentityAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribePodIdentityAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/pod-identity-associations/{associationId}") + 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_serializeOpHttpBindingsDescribePodIdentityAssociationInput(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_serializeOpHttpBindingsDescribePodIdentityAssociationInput(v *DescribePodIdentityAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssociationId == nil || len(*v.AssociationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member associationId must not be empty")} + } + if v.AssociationId != nil { + if err := encoder.SetURI("associationId").String(*v.AssociationId); err != nil { + return err + } + } + + if v.ClusterName == nil || len(*v.ClusterName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} + } + if v.ClusterName != nil { + if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDescribeUpdate struct { } @@ -2503,6 +2761,87 @@ func awsRestjson1_serializeOpHttpBindingsListNodegroupsInput(v *ListNodegroupsIn return nil } +type awsRestjson1_serializeOpListPodIdentityAssociations struct { +} + +func (*awsRestjson1_serializeOpListPodIdentityAssociations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListPodIdentityAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListPodIdentityAssociationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/pod-identity-associations") + 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_serializeOpHttpBindingsListPodIdentityAssociationsInput(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_serializeOpHttpBindingsListPodIdentityAssociationsInput(v *ListPodIdentityAssociationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ClusterName == nil || len(*v.ClusterName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} + } + if v.ClusterName != nil { + if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.Namespace != nil { + encoder.SetQuery("namespace").String(*v.Namespace) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.ServiceAccount != nil { + encoder.SetQuery("serviceAccount").String(*v.ServiceAccount) + } + + return nil +} + type awsRestjson1_serializeOpListTagsForResource struct { } @@ -3553,6 +3892,108 @@ func awsRestjson1_serializeOpDocumentUpdateNodegroupVersionInput(v *UpdateNodegr return nil } +type awsRestjson1_serializeOpUpdatePodIdentityAssociation struct { +} + +func (*awsRestjson1_serializeOpUpdatePodIdentityAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdatePodIdentityAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdatePodIdentityAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/pod-identity-associations/{associationId}") + 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_serializeOpHttpBindingsUpdatePodIdentityAssociationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdatePodIdentityAssociationInput(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_serializeOpHttpBindingsUpdatePodIdentityAssociationInput(v *UpdatePodIdentityAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssociationId == nil || len(*v.AssociationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member associationId must not be empty")} + } + if v.AssociationId != nil { + if err := encoder.SetURI("associationId").String(*v.AssociationId); err != nil { + return err + } + } + + if v.ClusterName == nil || len(*v.ClusterName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} + } + if v.ClusterName != nil { + if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdatePodIdentityAssociationInput(v *UpdatePodIdentityAssociationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("clientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.RoleArn != nil { + ok := object.Key("roleArn") + ok.String(*v.RoleArn) + } + + return nil +} + func awsRestjson1_serializeDocumentConnectorConfigRequest(v *types.ConnectorConfigRequest, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/eks/types/types.go b/service/eks/types/types.go index f79ad81b18f..4e78c3ced5b 100644 --- a/service/eks/types/types.go +++ b/service/eks/types/types.go @@ -364,11 +364,11 @@ type EksAnywhereSubscription struct { // UUID identifying a subscription. Id *string - // License Manager License ARNs associated with the subscription. + // Amazon Web Services License Manager ARN associated with the subscription. LicenseArns []string // The number of licenses included in a subscription. Valid values are between 1 - // and 1000. + // and 100. LicenseQuantity int32 // The type of licenses included in the subscription. Valid value is CLUSTER. With @@ -400,7 +400,7 @@ type EksAnywhereSubscriptionTerm struct { // 12 month or 36 month subscription. Duration int32 - // The term unit of the subscription. Valid value is MONTHS. + // The term unit of the subscription. Valid value is MONTHS . Unit EksAnywhereSubscriptionTermUnit noSmithyDocumentSerde @@ -1084,6 +1084,91 @@ type OutpostConfigResponse struct { noSmithyDocumentSerde } +// Amazon EKS Pod Identity associations provide the ability to manage credentials +// for your applications, similar to the way that 7EC2l instance profiles provide +// credentials to Amazon EC2 instances. +type PodIdentityAssociation struct { + + // The Amazon Resource Name (ARN) of the association. + AssociationArn *string + + // The ID of the association. + AssociationId *string + + // The name of the cluster that the association is in. + ClusterName *string + + // The timestamp that the association was created at. + CreatedAt *time.Time + + // The most recent timestamp that the association was modified at + ModifiedAt *time.Time + + // The name of the Kubernetes namespace inside the cluster to create the + // association in. The service account and the pods that use the service account + // must be in this namespace. + Namespace *string + + // The Amazon Resource Name (ARN) of the IAM role to associate with the service + // account. The EKS Pod Identity agent manages credentials to assume this role for + // applications in the containers in the pods that use this service account. + RoleArn *string + + // The name of the Kubernetes service account inside the cluster to associate the + // IAM credentials with. + ServiceAccount *string + + // The metadata that you apply to a resource to assist with categorization and + // organization. Each tag consists of a key and an optional value. You define both. + // The following basic restrictions apply to tags: + // - Maximum number of tags per resource – 50 + // - For each resource, each tag key must be unique, and each tag key can have + // only one value. + // - Maximum key length – 128 Unicode characters in UTF-8 + // - Maximum value length – 256 Unicode characters in UTF-8 + // - If your tagging schema is used across multiple services and resources, + // remember that other services may have restrictions on allowed characters. + // Generally allowed characters are: letters, numbers, and spaces representable in + // UTF-8, and the following characters: + - = . _ : / @. + // - Tag keys and values are case-sensitive. + // - Do not use aws: , AWS: , or any upper or lowercase combination of such as a + // prefix for either keys or values as it is reserved for Amazon Web Services use. + // You cannot edit or delete tag keys or values with this prefix. Tags with this + // prefix do not count against your tags per resource limit. + Tags map[string]string + + noSmithyDocumentSerde +} + +// The summarized description of the association. Each summary is simplified by +// removing these fields compared to the full PodIdentityAssociation : +// - The IAM role: roleArn +// - The timestamp that the association was created at: createdAt +// - The most recent timestamp that the association was modified at:. modifiedAt +// - The tags on the association: tags +type PodIdentityAssociationSummary struct { + + // The Amazon Resource Name (ARN) of the association. + AssociationArn *string + + // The ID of the association. + AssociationId *string + + // The name of the cluster that the association is in. + ClusterName *string + + // The name of the Kubernetes namespace inside the cluster to create the + // association in. The service account and the pods that use the service account + // must be in this namespace. + Namespace *string + + // The name of the Kubernetes service account inside the cluster to associate the + // IAM credentials with. + ServiceAccount *string + + noSmithyDocumentSerde +} + // Identifies the Key Management Service (KMS) key used to encrypt the secrets. type Provider struct { diff --git a/service/eks/validators.go b/service/eks/validators.go index d7bc907cc70..f92ded1acb6 100644 --- a/service/eks/validators.go +++ b/service/eks/validators.go @@ -150,6 +150,26 @@ func (m *validateOpCreateNodegroup) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpCreatePodIdentityAssociation struct { +} + +func (*validateOpCreatePodIdentityAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreatePodIdentityAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreatePodIdentityAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreatePodIdentityAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteAddon struct { } @@ -250,6 +270,26 @@ func (m *validateOpDeleteNodegroup) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpDeletePodIdentityAssociation struct { +} + +func (*validateOpDeletePodIdentityAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeletePodIdentityAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeletePodIdentityAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeletePodIdentityAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeregisterCluster struct { } @@ -410,6 +450,26 @@ func (m *validateOpDescribeNodegroup) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpDescribePodIdentityAssociation struct { +} + +func (*validateOpDescribePodIdentityAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribePodIdentityAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribePodIdentityAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribePodIdentityAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeUpdate struct { } @@ -530,6 +590,26 @@ func (m *validateOpListNodegroups) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpListPodIdentityAssociations struct { +} + +func (*validateOpListPodIdentityAssociations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListPodIdentityAssociations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListPodIdentityAssociationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListPodIdentityAssociationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -750,6 +830,26 @@ func (m *validateOpUpdateNodegroupVersion) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpUpdatePodIdentityAssociation struct { +} + +func (*validateOpUpdatePodIdentityAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdatePodIdentityAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdatePodIdentityAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdatePodIdentityAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + func addOpAssociateEncryptionConfigValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateEncryptionConfig{}, middleware.After) } @@ -778,6 +878,10 @@ func addOpCreateNodegroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateNodegroup{}, middleware.After) } +func addOpCreatePodIdentityAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreatePodIdentityAssociation{}, middleware.After) +} + func addOpDeleteAddonValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAddon{}, middleware.After) } @@ -798,6 +902,10 @@ func addOpDeleteNodegroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteNodegroup{}, middleware.After) } +func addOpDeletePodIdentityAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeletePodIdentityAssociation{}, middleware.After) +} + func addOpDeregisterClusterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeregisterCluster{}, middleware.After) } @@ -830,6 +938,10 @@ func addOpDescribeNodegroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeNodegroup{}, middleware.After) } +func addOpDescribePodIdentityAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribePodIdentityAssociation{}, middleware.After) +} + func addOpDescribeUpdateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeUpdate{}, middleware.After) } @@ -854,6 +966,10 @@ func addOpListNodegroupsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListNodegroups{}, middleware.After) } +func addOpListPodIdentityAssociationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListPodIdentityAssociations{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -898,6 +1014,10 @@ func addOpUpdateNodegroupVersionValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpUpdateNodegroupVersion{}, middleware.After) } +func addOpUpdatePodIdentityAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdatePodIdentityAssociation{}, middleware.After) +} + func validateConnectorConfigRequest(v *types.ConnectorConfigRequest) error { if v == nil { return nil @@ -1120,6 +1240,30 @@ func validateOpCreateNodegroupInput(v *CreateNodegroupInput) error { } } +func validateOpCreatePodIdentityAssociationInput(v *CreatePodIdentityAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreatePodIdentityAssociationInput"} + if v.ClusterName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) + } + if v.Namespace == nil { + invalidParams.Add(smithy.NewErrParamRequired("Namespace")) + } + if v.ServiceAccount == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceAccount")) + } + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteAddonInput(v *DeleteAddonInput) error { if v == nil { return nil @@ -1204,6 +1348,24 @@ func validateOpDeleteNodegroupInput(v *DeleteNodegroupInput) error { } } +func validateOpDeletePodIdentityAssociationInput(v *DeletePodIdentityAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeletePodIdentityAssociationInput"} + if v.ClusterName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) + } + if v.AssociationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeregisterClusterInput(v *DeregisterClusterInput) error { if v == nil { return nil @@ -1343,6 +1505,24 @@ func validateOpDescribeNodegroupInput(v *DescribeNodegroupInput) error { } } +func validateOpDescribePodIdentityAssociationInput(v *DescribePodIdentityAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribePodIdentityAssociationInput"} + if v.ClusterName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) + } + if v.AssociationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeUpdateInput(v *DescribeUpdateInput) error { if v == nil { return nil @@ -1443,6 +1623,21 @@ func validateOpListNodegroupsInput(v *ListNodegroupsInput) error { } } +func validateOpListPodIdentityAssociationsInput(v *ListPodIdentityAssociationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListPodIdentityAssociationsInput"} + if v.ClusterName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil @@ -1632,3 +1827,21 @@ func validateOpUpdateNodegroupVersionInput(v *UpdateNodegroupVersionInput) error return nil } } + +func validateOpUpdatePodIdentityAssociationInput(v *UpdatePodIdentityAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePodIdentityAssociationInput"} + if v.ClusterName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) + } + if v.AssociationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/eksauth/LICENSE.txt b/service/eksauth/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/eksauth/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/eksauth/api_client.go b/service/eksauth/api_client.go new file mode 100644 index 00000000000..41cae0fdd82 --- /dev/null +++ b/service/eksauth/api_client.go @@ -0,0 +1,454 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eksauth + +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 = "EKS Auth" +const ServiceAPIVersion = "2023-11-26" + +// Client provides the API client to make operations call for Amazon EKS Auth. +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, "eksauth", 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/eksauth/api_client_test.go b/service/eksauth/api_client_test.go new file mode 100644 index 00000000000..5565b26608f --- /dev/null +++ b/service/eksauth/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eksauth + +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/eksauth/api_op_AssumeRoleForPodIdentity.go b/service/eksauth/api_op_AssumeRoleForPodIdentity.go new file mode 100644 index 00000000000..6fa2cad9ac1 --- /dev/null +++ b/service/eksauth/api_op_AssumeRoleForPodIdentity.go @@ -0,0 +1,176 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eksauth + +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/eksauth/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// The Amazon EKS Auth API and the AssumeRoleForPodIdentity action are only used +// by the EKS Pod Identity Agent. We recommend that applications use the Amazon Web +// Services SDKs to connect to Amazon Web Services services; if credentials from an +// EKS Pod Identity association are available in the pod, the latest versions of +// the SDKs use them automatically. +func (c *Client) AssumeRoleForPodIdentity(ctx context.Context, params *AssumeRoleForPodIdentityInput, optFns ...func(*Options)) (*AssumeRoleForPodIdentityOutput, error) { + if params == nil { + params = &AssumeRoleForPodIdentityInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssumeRoleForPodIdentity", params, optFns, c.addOperationAssumeRoleForPodIdentityMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssumeRoleForPodIdentityOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssumeRoleForPodIdentityInput struct { + + // The name of the cluster for the request. + // + // This member is required. + ClusterName *string + + // The token of the Kubernetes service account for the pod. + // + // This member is required. + Token *string + + noSmithyDocumentSerde +} + +type AssumeRoleForPodIdentityOutput struct { + + // An object with the permanent IAM role identity and the temporary session name. + // The ARN of the IAM role that the temporary credentials authenticate to. The + // session name of the temporary session requested to STS. The value is a unique + // identifier that contains the role ID, a colon ( : ), and the role session name + // of the role that is being assumed. The role ID is generated by IAM when the role + // is created. The role session name part of the value follows this format: + // eks-clustername-podname-random UUID + // + // This member is required. + AssumedRoleUser *types.AssumedRoleUser + + // The identity that is allowed to use the credentials. This value is always + // pods.eks.amazonaws.com . + // + // This member is required. + Audience *string + + // The Amazon Web Services Signature Version 4 type of temporary credentials. + // + // This member is required. + Credentials *types.Credentials + + // The Amazon Resource Name (ARN) and ID of the EKS Pod Identity association. + // + // This member is required. + PodIdentityAssociation *types.PodIdentityAssociation + + // The name of the Kubernetes service account inside the cluster to associate the + // IAM credentials with. + // + // This member is required. + Subject *types.Subject + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssumeRoleForPodIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpAssumeRoleForPodIdentity{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssumeRoleForPodIdentity{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRoleForPodIdentity"); 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 = addOpAssumeRoleForPodIdentityValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoleForPodIdentity(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_opAssumeRoleForPodIdentity(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AssumeRoleForPodIdentity", + } +} diff --git a/service/eksauth/auth.go b/service/eksauth/auth.go new file mode 100644 index 00000000000..613367c1f10 --- /dev/null +++ b/service/eksauth/auth.go @@ -0,0 +1,256 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eksauth + +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, "eks-auth") + 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/eksauth/deserializers.go b/service/eksauth/deserializers.go new file mode 100644 index 00000000000..dd4de9ade1f --- /dev/null +++ b/service/eksauth/deserializers.go @@ -0,0 +1,1120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eksauth + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/eksauth/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strings" +) + +type awsRestjson1_deserializeOpAssumeRoleForPodIdentity struct { +} + +func (*awsRestjson1_deserializeOpAssumeRoleForPodIdentity) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAssumeRoleForPodIdentity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorAssumeRoleForPodIdentity(response, &metadata) + } + output := &AssumeRoleForPodIdentityOutput{} + 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_deserializeOpDocumentAssumeRoleForPodIdentityOutput(&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_deserializeOpErrorAssumeRoleForPodIdentity(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("ExpiredTokenException", errorCode): + return awsRestjson1_deserializeErrorExpiredTokenException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("InvalidTokenException", errorCode): + return awsRestjson1_deserializeErrorInvalidTokenException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentAssumeRoleForPodIdentityOutput(v **AssumeRoleForPodIdentityOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *AssumeRoleForPodIdentityOutput + if *v == nil { + sv = &AssumeRoleForPodIdentityOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assumedRoleUser": + if err := awsRestjson1_deserializeDocumentAssumedRoleUser(&sv.AssumedRoleUser, value); err != nil { + return err + } + + case "audience": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Audience = ptr.String(jtv) + } + + case "credentials": + if err := awsRestjson1_deserializeDocumentCredentials(&sv.Credentials, value); err != nil { + return err + } + + case "podIdentityAssociation": + if err := awsRestjson1_deserializeDocumentPodIdentityAssociation(&sv.PodIdentityAssociation, value); err != nil { + return err + } + + case "subject": + if err := awsRestjson1_deserializeDocumentSubject(&sv.Subject, 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_deserializeErrorExpiredTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ExpiredTokenException{} + 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_deserializeDocumentExpiredTokenException(&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_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidParameterException{} + 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_deserializeDocumentInvalidParameterException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRequestException{} + 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_deserializeDocumentInvalidRequestException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInvalidTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidTokenException{} + 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_deserializeDocumentInvalidTokenException(&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_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceUnavailableException{} + 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_deserializeDocumentServiceUnavailableException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func 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_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_deserializeDocumentAssumedRoleUser(v **types.AssumedRoleUser, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AssumedRoleUser + if *v == nil { + sv = &types.AssumedRoleUser{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "assumeRoleId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AssumeRoleId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCredentials(v **types.Credentials, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Credentials + if *v == nil { + sv = &types.Credentials{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accessKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AccessKeyId = ptr.String(jtv) + } + + case "expiration": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Expiration = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "secretAccessKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretAccessKey = ptr.String(jtv) + } + + case "sessionToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SessionToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentExpiredTokenException(v **types.ExpiredTokenException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ExpiredTokenException + if *v == nil { + sv = &types.ExpiredTokenException{} + } 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_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidParameterException + if *v == nil { + sv = &types.InvalidParameterException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidRequestException + if *v == nil { + sv = &types.InvalidRequestException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidTokenException(v **types.InvalidTokenException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidTokenException + if *v == nil { + sv = &types.InvalidTokenException{} + } 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_deserializeDocumentPodIdentityAssociation(v **types.PodIdentityAssociation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PodIdentityAssociation + if *v == nil { + sv = &types.PodIdentityAssociation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "associationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AssociationArn = ptr.String(jtv) + } + + case "associationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AssociationId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceUnavailableException + if *v == nil { + sv = &types.ServiceUnavailableException{} + } 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_deserializeDocumentSubject(v **types.Subject, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Subject + if *v == nil { + sv = &types.Subject{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "namespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Namespace = ptr.String(jtv) + } + + case "serviceAccount": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceAccount = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + 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 +} diff --git a/service/eksauth/doc.go b/service/eksauth/doc.go new file mode 100644 index 00000000000..a1aa63b8046 --- /dev/null +++ b/service/eksauth/doc.go @@ -0,0 +1,8 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package eksauth provides the API client, operations, and parameter types for +// Amazon EKS Auth. +// +// The Amazon EKS Auth API and the AssumeRoleForPodIdentity action are only used +// by the EKS Pod Identity Agent. +package eksauth diff --git a/service/eksauth/endpoints.go b/service/eksauth/endpoints.go new file mode 100644 index 00000000000..3003c7a6536 --- /dev/null +++ b/service/eksauth/endpoints.go @@ -0,0 +1,480 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eksauth + +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/eksauth/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 = "eks-auth" + } + 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_EKS_AUTH") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "EKS Auth", 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, 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.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.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) + } + _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") + } + 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 true == _PartitionResult.SupportsDualStack { + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://eks-auth-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 is enabled but this partition does not support FIPS") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://eks-auth.") + 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 + } + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://eks-auth-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") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://eks-auth.") + 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.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/eksauth/endpoints_config_test.go b/service/eksauth/endpoints_config_test.go new file mode 100644 index 00000000000..169c23ea810 --- /dev/null +++ b/service/eksauth/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eksauth + +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-eks-auth.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-eks-auth.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-eks-auth.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-eks-auth.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-eks-auth.dev", + expectURL: aws.String("https://env-eks-auth.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-eks-auth.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-eks-auth.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-eks-auth.dev", + expectURL: aws.String("http://config-eks-auth.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-eks-auth.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-eks-auth.dev", + clientEndpoint: aws.String("https://client-eks-auth.dev"), + expectURL: aws.String("https://client-eks-auth.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_EKS_AUTH", 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/eksauth/endpoints_test.go b/service/eksauth/endpoints_test.go new file mode 100644 index 00000000000..99ad9ecfd2f --- /dev/null +++ b/service/eksauth/endpoints_test.go @@ -0,0 +1,356 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eksauth + +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), + } + + 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://eks-auth-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 disabled and DualStack enabled +func TestEndpointCase1(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: 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://eks-auth.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 cn-north-1 with FIPS enabled and DualStack enabled +func TestEndpointCase2(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: 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://eks-auth-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 disabled and DualStack enabled +func TestEndpointCase3(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: 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://eks-auth.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 us-gov-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase4(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: 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://eks-auth-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 disabled and DualStack enabled +func TestEndpointCase5(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: 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://eks-auth.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 custom endpoint with region set and fips disabled and dualstack disabled +func TestEndpointCase6(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: 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 TestEndpointCase7(t *testing.T) { + var params = EndpointParameters{ + UseFIPS: 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 TestEndpointCase8(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: 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: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// Missing region +func TestEndpointCase9(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/eksauth/generated.json b/service/eksauth/generated.json new file mode 100644 index 00000000000..1d42b39137d --- /dev/null +++ b/service/eksauth/generated.json @@ -0,0 +1,32 @@ +{ + "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_AssumeRoleForPodIdentity.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/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/eksauth", + "unstable": false +} diff --git a/service/eksauth/go.mod b/service/eksauth/go.mod new file mode 100644 index 00000000000..f2486aa0425 --- /dev/null +++ b/service/eksauth/go.mod @@ -0,0 +1,17 @@ +module github.com/aws/aws-sdk-go-v2/service/eksauth + +go 1.19 + +require ( + github.com/aws/aws-sdk-go-v2 v1.23.1 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4 + 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/eksauth/go.sum b/service/eksauth/go.sum new file mode 100644 index 00000000000..42e4fc806b4 --- /dev/null +++ b/service/eksauth/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/eksauth/go_module_metadata.go b/service/eksauth/go_module_metadata.go new file mode 100644 index 00000000000..c7483213d56 --- /dev/null +++ b/service/eksauth/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package eksauth + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/eksauth/internal/endpoints/endpoints.go b/service/eksauth/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..2bd8f6307da --- /dev/null +++ b/service/eksauth/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 EKS Auth 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: "eks-auth.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "eks-auth-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "eks-auth-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "eks-auth.{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: "eks-auth.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "eks-auth-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "eks-auth-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "eks-auth.{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: "eks-auth-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "eks-auth.{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: "eks-auth-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "eks-auth.{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: "eks-auth-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "eks-auth.{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: "eks-auth-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "eks-auth.{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: "eks-auth.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "eks-auth-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "eks-auth-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "eks-auth.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/eksauth/internal/endpoints/endpoints_test.go b/service/eksauth/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/eksauth/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/eksauth/options.go b/service/eksauth/options.go new file mode 100644 index 00000000000..a5f0adb1df2 --- /dev/null +++ b/service/eksauth/options.go @@ -0,0 +1,219 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eksauth + +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/eksauth/protocol_test.go b/service/eksauth/protocol_test.go new file mode 100644 index 00000000000..a47fb419cd4 --- /dev/null +++ b/service/eksauth/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eksauth diff --git a/service/eksauth/serializers.go b/service/eksauth/serializers.go new file mode 100644 index 00000000000..85f451cdf5f --- /dev/null +++ b/service/eksauth/serializers.go @@ -0,0 +1,102 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eksauth + +import ( + "bytes" + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpAssumeRoleForPodIdentity struct { +} + +func (*awsRestjson1_serializeOpAssumeRoleForPodIdentity) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAssumeRoleForPodIdentity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssumeRoleForPodIdentityInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/assume-role-for-pod-identity") + 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_serializeOpHttpBindingsAssumeRoleForPodIdentityInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAssumeRoleForPodIdentityInput(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_serializeOpHttpBindingsAssumeRoleForPodIdentityInput(v *AssumeRoleForPodIdentityInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ClusterName == nil || len(*v.ClusterName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} + } + if v.ClusterName != nil { + if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAssumeRoleForPodIdentityInput(v *AssumeRoleForPodIdentityInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Token != nil { + ok := object.Key("token") + ok.String(*v.Token) + } + + return nil +} diff --git a/service/eksauth/types/errors.go b/service/eksauth/types/errors.go new file mode 100644 index 00000000000..d068a1758b8 --- /dev/null +++ b/service/eksauth/types/errors.go @@ -0,0 +1,249 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// You don't have permissions to perform the requested operation. The IAM +// principal making the request must have at least one IAM permissions policy +// attached that grants the required permissions. For more information, see Access +// management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) in the +// IAM User Guide. +type AccessDeniedException struct { + Message *string + + 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 } + +// The specified Kubernetes service account token is expired. +type ExpiredTokenException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ExpiredTokenException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ExpiredTokenException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ExpiredTokenException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ExpiredTokenException" + } + return *e.ErrorCodeOverride +} +func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// These errors are usually caused by a server-side issue. +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 specified parameter is invalid. Review the available parameters for the API +// request. +type InvalidParameterException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidParameterException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidParameterException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidParameterException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// This exception is thrown if the request contains a semantic error. The precise +// meaning will depend on the API, and will be documented in the error message. +type InvalidRequestException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidRequestException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidRequestException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRequestException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified Kubernetes service account token is invalid. +type InvalidTokenException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidTokenException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidTokenException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidTokenException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidTokenException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified resource could not be 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 } + +// The service is unavailable. Back off and retry the operation. +type ServiceUnavailableException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceUnavailableException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceUnavailableException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceUnavailableException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The request was denied because your request rate is too high. Reduce the +// frequency of requests. +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 } diff --git a/service/eksauth/types/types.go b/service/eksauth/types/types.go new file mode 100644 index 00000000000..2f0c7f933a2 --- /dev/null +++ b/service/eksauth/types/types.go @@ -0,0 +1,95 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// An object with the permanent IAM role identity and the temporary session name. +type AssumedRoleUser struct { + + // The ARN of the IAM role that the temporary credentials authenticate to. + // + // This member is required. + Arn *string + + // The session name of the temporary session requested to STS. The value is a + // unique identifier that contains the role ID, a colon ( : ), and the role session + // name of the role that is being assumed. The role ID is generated by IAM when the + // role is created. The role session name part of the value follows this format: + // eks-clustername-podname-random UUID + // + // This member is required. + AssumeRoleId *string + + noSmithyDocumentSerde +} + +// The Amazon Web Services Signature Version 4 type of temporary credentials. +type Credentials struct { + + // The access key ID that identifies the temporary security credentials. + // + // This member is required. + AccessKeyId *string + + // The Unix epoch timestamp in seconds when the current credentials expire. + // + // This member is required. + Expiration *time.Time + + // The secret access key that applications inside the pods use to sign requests. + // + // This member is required. + SecretAccessKey *string + + // The token that applications inside the pods must pass to any service API to use + // the temporary credentials. + // + // This member is required. + SessionToken *string + + noSmithyDocumentSerde +} + +// Amazon EKS Pod Identity associations provide the ability to manage credentials +// for your applications, similar to the way that Amazon EC2 instance profiles +// provide credentials to Amazon EC2 instances. +type PodIdentityAssociation struct { + + // The Amazon Resource Name (ARN) of the EKS Pod Identity association. + // + // This member is required. + AssociationArn *string + + // The ID of the association. + // + // This member is required. + AssociationId *string + + noSmithyDocumentSerde +} + +// An object containing the name of the Kubernetes service account inside the +// cluster to associate the IAM credentials with. +type Subject struct { + + // The name of the Kubernetes namespace inside the cluster to create the + // association in. The service account and the pods that use the service account + // must be in this namespace. + // + // This member is required. + Namespace *string + + // The name of the Kubernetes service account inside the cluster to associate the + // IAM credentials with. + // + // This member is required. + ServiceAccount *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/eksauth/validators.go b/service/eksauth/validators.go new file mode 100644 index 00000000000..f7e897fb7ef --- /dev/null +++ b/service/eksauth/validators.go @@ -0,0 +1,52 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eksauth + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpAssumeRoleForPodIdentity struct { +} + +func (*validateOpAssumeRoleForPodIdentity) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssumeRoleForPodIdentity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssumeRoleForPodIdentityInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssumeRoleForPodIdentityInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpAssumeRoleForPodIdentityValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssumeRoleForPodIdentity{}, middleware.After) +} + +func validateOpAssumeRoleForPodIdentityInput(v *AssumeRoleForPodIdentityInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssumeRoleForPodIdentityInput"} + if v.ClusterName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) + } + if v.Token == nil { + invalidParams.Add(smithy.NewErrParamRequired("Token")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/elasticloadbalancingv2/api_op_AddTags.go b/service/elasticloadbalancingv2/api_op_AddTags.go index cb3ec54ce40..ddde5721512 100644 --- a/service/elasticloadbalancingv2/api_op_AddTags.go +++ b/service/elasticloadbalancingv2/api_op_AddTags.go @@ -14,9 +14,9 @@ import ( // Adds the specified tags to the specified Elastic Load Balancing resource. You // can tag your Application Load Balancers, Network Load Balancers, Gateway Load -// Balancers, target groups, listeners, and rules. Each tag consists of a key and -// an optional value. If a resource already has a tag with the same key, AddTags -// updates its value. +// Balancers, target groups, trust stores, listeners, and rules. Each tag consists +// of a key and an optional value. If a resource already has a tag with the same +// key, AddTags updates its value. func (c *Client) AddTags(ctx context.Context, params *AddTagsInput, optFns ...func(*Options)) (*AddTagsOutput, error) { if params == nil { params = &AddTagsInput{} diff --git a/service/elasticloadbalancingv2/api_op_AddTrustStoreRevocations.go b/service/elasticloadbalancingv2/api_op_AddTrustStoreRevocations.go new file mode 100644 index 00000000000..80c64781e24 --- /dev/null +++ b/service/elasticloadbalancingv2/api_op_AddTrustStoreRevocations.go @@ -0,0 +1,140 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancingv2 + +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/elasticloadbalancingv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds the specified revocation file to the specified trust store. +func (c *Client) AddTrustStoreRevocations(ctx context.Context, params *AddTrustStoreRevocationsInput, optFns ...func(*Options)) (*AddTrustStoreRevocationsOutput, error) { + if params == nil { + params = &AddTrustStoreRevocationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AddTrustStoreRevocations", params, optFns, c.addOperationAddTrustStoreRevocationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AddTrustStoreRevocationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AddTrustStoreRevocationsInput struct { + + // The Amazon Resource Name (ARN) of the trust store. + // + // This member is required. + TrustStoreArn *string + + // The revocation file to add. + RevocationContents []types.RevocationContent + + noSmithyDocumentSerde +} + +type AddTrustStoreRevocationsOutput struct { + + // Information about the revocation file added to the trust store. + TrustStoreRevocations []types.TrustStoreRevocation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAddTrustStoreRevocationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpAddTrustStoreRevocations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAddTrustStoreRevocations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AddTrustStoreRevocations"); 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 = addOpAddTrustStoreRevocationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddTrustStoreRevocations(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_opAddTrustStoreRevocations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AddTrustStoreRevocations", + } +} diff --git a/service/elasticloadbalancingv2/api_op_CreateListener.go b/service/elasticloadbalancingv2/api_op_CreateListener.go index 6aa9c7b576b..d08f68e6de5 100644 --- a/service/elasticloadbalancingv2/api_op_CreateListener.go +++ b/service/elasticloadbalancingv2/api_op_CreateListener.go @@ -64,6 +64,9 @@ type CreateListenerInput struct { // do not set IsDefault . Certificates []types.Certificate + // The mutual authentication configuration information. + MutualAuthentication *types.MutualAuthenticationAttributes + // The port on which the load balancer is listening. You cannot specify a port for // a Gateway Load Balancer. Port *int32 diff --git a/service/elasticloadbalancingv2/api_op_CreateTrustStore.go b/service/elasticloadbalancingv2/api_op_CreateTrustStore.go new file mode 100644 index 00000000000..25a23ad9344 --- /dev/null +++ b/service/elasticloadbalancingv2/api_op_CreateTrustStore.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancingv2 + +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/elasticloadbalancingv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a trust store. +func (c *Client) CreateTrustStore(ctx context.Context, params *CreateTrustStoreInput, optFns ...func(*Options)) (*CreateTrustStoreOutput, error) { + if params == nil { + params = &CreateTrustStoreInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateTrustStore", params, optFns, c.addOperationCreateTrustStoreMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateTrustStoreOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateTrustStoreInput struct { + + // The Amazon S3 bucket for the ca certificates bundle. + // + // This member is required. + CaCertificatesBundleS3Bucket *string + + // The Amazon S3 path for the ca certificates bundle. + // + // This member is required. + CaCertificatesBundleS3Key *string + + // The name of the trust store. This name must be unique per region and cannot be + // changed after creation. + // + // This member is required. + Name *string + + // The Amazon S3 object version for the ca certificates bundle. If undefined the + // current version is used. + CaCertificatesBundleS3ObjectVersion *string + + // The tags to assign to the trust store. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateTrustStoreOutput struct { + + // Information about the trust store created. + TrustStores []types.TrustStore + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateTrustStoreMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateTrustStore{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateTrustStore{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTrustStore"); 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 = addOpCreateTrustStoreValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTrustStore(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_opCreateTrustStore(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateTrustStore", + } +} diff --git a/service/elasticloadbalancingv2/api_op_DeleteTrustStore.go b/service/elasticloadbalancingv2/api_op_DeleteTrustStore.go new file mode 100644 index 00000000000..2df02fe2852 --- /dev/null +++ b/service/elasticloadbalancingv2/api_op_DeleteTrustStore.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancingv2 + +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 trust store. +func (c *Client) DeleteTrustStore(ctx context.Context, params *DeleteTrustStoreInput, optFns ...func(*Options)) (*DeleteTrustStoreOutput, error) { + if params == nil { + params = &DeleteTrustStoreInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteTrustStore", params, optFns, c.addOperationDeleteTrustStoreMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteTrustStoreOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteTrustStoreInput struct { + + // The Amazon Resource Name (ARN) of the trust store. + // + // This member is required. + TrustStoreArn *string + + noSmithyDocumentSerde +} + +type DeleteTrustStoreOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteTrustStoreMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteTrustStore{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteTrustStore{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTrustStore"); 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 = addOpDeleteTrustStoreValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTrustStore(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_opDeleteTrustStore(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteTrustStore", + } +} diff --git a/service/elasticloadbalancingv2/api_op_DescribeTargetHealth.go b/service/elasticloadbalancingv2/api_op_DescribeTargetHealth.go index 40497651a40..05e6b2bba3d 100644 --- a/service/elasticloadbalancingv2/api_op_DescribeTargetHealth.go +++ b/service/elasticloadbalancingv2/api_op_DescribeTargetHealth.go @@ -41,6 +41,9 @@ type DescribeTargetHealthInput struct { // This member is required. TargetGroupArn *string + // Used to inclue anomaly detection information. + Include []types.DescribeTargetHealthInputIncludeEnum + // The targets. Targets []types.TargetDescription diff --git a/service/elasticloadbalancingv2/api_op_DescribeTrustStoreAssociations.go b/service/elasticloadbalancingv2/api_op_DescribeTrustStoreAssociations.go new file mode 100644 index 00000000000..fe6f2548939 --- /dev/null +++ b/service/elasticloadbalancingv2/api_op_DescribeTrustStoreAssociations.go @@ -0,0 +1,241 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancingv2 + +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/elasticloadbalancingv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes all resources associated with the specified trust store. +func (c *Client) DescribeTrustStoreAssociations(ctx context.Context, params *DescribeTrustStoreAssociationsInput, optFns ...func(*Options)) (*DescribeTrustStoreAssociationsOutput, error) { + if params == nil { + params = &DescribeTrustStoreAssociationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeTrustStoreAssociations", params, optFns, c.addOperationDescribeTrustStoreAssociationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeTrustStoreAssociationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeTrustStoreAssociationsInput struct { + + // The Amazon Resource Name (ARN) of the trust store. + // + // This member is required. + TrustStoreArn *string + + // The marker for the next set of results. (You received this marker from a + // previous call.) + Marker *string + + // The maximum number of results to return with this call. + PageSize *int32 + + noSmithyDocumentSerde +} + +type DescribeTrustStoreAssociationsOutput struct { + + // If there are additional results, this is the marker for the next set of + // results. Otherwise, this is null. + NextMarker *string + + // Information about the resources the trust store is associated to. + TrustStoreAssociations []types.TrustStoreAssociation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeTrustStoreAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeTrustStoreAssociations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeTrustStoreAssociations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTrustStoreAssociations"); 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 = addOpDescribeTrustStoreAssociationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTrustStoreAssociations(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 +} + +// DescribeTrustStoreAssociationsAPIClient is a client that implements the +// DescribeTrustStoreAssociations operation. +type DescribeTrustStoreAssociationsAPIClient interface { + DescribeTrustStoreAssociations(context.Context, *DescribeTrustStoreAssociationsInput, ...func(*Options)) (*DescribeTrustStoreAssociationsOutput, error) +} + +var _ DescribeTrustStoreAssociationsAPIClient = (*Client)(nil) + +// DescribeTrustStoreAssociationsPaginatorOptions is the paginator options for +// DescribeTrustStoreAssociations +type DescribeTrustStoreAssociationsPaginatorOptions struct { + // The maximum number of results 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 +} + +// DescribeTrustStoreAssociationsPaginator is a paginator for +// DescribeTrustStoreAssociations +type DescribeTrustStoreAssociationsPaginator struct { + options DescribeTrustStoreAssociationsPaginatorOptions + client DescribeTrustStoreAssociationsAPIClient + params *DescribeTrustStoreAssociationsInput + nextToken *string + firstPage bool +} + +// NewDescribeTrustStoreAssociationsPaginator returns a new +// DescribeTrustStoreAssociationsPaginator +func NewDescribeTrustStoreAssociationsPaginator(client DescribeTrustStoreAssociationsAPIClient, params *DescribeTrustStoreAssociationsInput, optFns ...func(*DescribeTrustStoreAssociationsPaginatorOptions)) *DescribeTrustStoreAssociationsPaginator { + if params == nil { + params = &DescribeTrustStoreAssociationsInput{} + } + + options := DescribeTrustStoreAssociationsPaginatorOptions{} + if params.PageSize != nil { + options.Limit = *params.PageSize + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeTrustStoreAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTrustStoreAssociationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeTrustStoreAssociations page. +func (p *DescribeTrustStoreAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTrustStoreAssociationsOutput, 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.PageSize = limit + + result, err := p.client.DescribeTrustStoreAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opDescribeTrustStoreAssociations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeTrustStoreAssociations", + } +} diff --git a/service/elasticloadbalancingv2/api_op_DescribeTrustStoreRevocations.go b/service/elasticloadbalancingv2/api_op_DescribeTrustStoreRevocations.go new file mode 100644 index 00000000000..7f3378eb164 --- /dev/null +++ b/service/elasticloadbalancingv2/api_op_DescribeTrustStoreRevocations.go @@ -0,0 +1,245 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancingv2 + +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/elasticloadbalancingv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the revocation files in use by the specified trust store arn, or +// revocation ID. +func (c *Client) DescribeTrustStoreRevocations(ctx context.Context, params *DescribeTrustStoreRevocationsInput, optFns ...func(*Options)) (*DescribeTrustStoreRevocationsOutput, error) { + if params == nil { + params = &DescribeTrustStoreRevocationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeTrustStoreRevocations", params, optFns, c.addOperationDescribeTrustStoreRevocationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeTrustStoreRevocationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeTrustStoreRevocationsInput struct { + + // The Amazon Resource Name (ARN) of the trust store. + // + // This member is required. + TrustStoreArn *string + + // The marker for the next set of results. (You received this marker from a + // previous call.) + Marker *string + + // The maximum number of results to return with this call. + PageSize *int32 + + // The revocation IDs of the revocation files you want to describe. + RevocationIds []int64 + + noSmithyDocumentSerde +} + +type DescribeTrustStoreRevocationsOutput struct { + + // If there are additional results, this is the marker for the next set of + // results. Otherwise, this is null. + NextMarker *string + + // Information about the revocation file in the trust store. + TrustStoreRevocations []types.DescribeTrustStoreRevocation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeTrustStoreRevocationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeTrustStoreRevocations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeTrustStoreRevocations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTrustStoreRevocations"); 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 = addOpDescribeTrustStoreRevocationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTrustStoreRevocations(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 +} + +// DescribeTrustStoreRevocationsAPIClient is a client that implements the +// DescribeTrustStoreRevocations operation. +type DescribeTrustStoreRevocationsAPIClient interface { + DescribeTrustStoreRevocations(context.Context, *DescribeTrustStoreRevocationsInput, ...func(*Options)) (*DescribeTrustStoreRevocationsOutput, error) +} + +var _ DescribeTrustStoreRevocationsAPIClient = (*Client)(nil) + +// DescribeTrustStoreRevocationsPaginatorOptions is the paginator options for +// DescribeTrustStoreRevocations +type DescribeTrustStoreRevocationsPaginatorOptions struct { + // The maximum number of results 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 +} + +// DescribeTrustStoreRevocationsPaginator is a paginator for +// DescribeTrustStoreRevocations +type DescribeTrustStoreRevocationsPaginator struct { + options DescribeTrustStoreRevocationsPaginatorOptions + client DescribeTrustStoreRevocationsAPIClient + params *DescribeTrustStoreRevocationsInput + nextToken *string + firstPage bool +} + +// NewDescribeTrustStoreRevocationsPaginator returns a new +// DescribeTrustStoreRevocationsPaginator +func NewDescribeTrustStoreRevocationsPaginator(client DescribeTrustStoreRevocationsAPIClient, params *DescribeTrustStoreRevocationsInput, optFns ...func(*DescribeTrustStoreRevocationsPaginatorOptions)) *DescribeTrustStoreRevocationsPaginator { + if params == nil { + params = &DescribeTrustStoreRevocationsInput{} + } + + options := DescribeTrustStoreRevocationsPaginatorOptions{} + if params.PageSize != nil { + options.Limit = *params.PageSize + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeTrustStoreRevocationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTrustStoreRevocationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeTrustStoreRevocations page. +func (p *DescribeTrustStoreRevocationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTrustStoreRevocationsOutput, 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.PageSize = limit + + result, err := p.client.DescribeTrustStoreRevocations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opDescribeTrustStoreRevocations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeTrustStoreRevocations", + } +} diff --git a/service/elasticloadbalancingv2/api_op_DescribeTrustStores.go b/service/elasticloadbalancingv2/api_op_DescribeTrustStores.go new file mode 100644 index 00000000000..0a5ab2bd104 --- /dev/null +++ b/service/elasticloadbalancingv2/api_op_DescribeTrustStores.go @@ -0,0 +1,237 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancingv2 + +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/elasticloadbalancingv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes all trust stores for a given account by trust store arn’s or name. +func (c *Client) DescribeTrustStores(ctx context.Context, params *DescribeTrustStoresInput, optFns ...func(*Options)) (*DescribeTrustStoresOutput, error) { + if params == nil { + params = &DescribeTrustStoresInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeTrustStores", params, optFns, c.addOperationDescribeTrustStoresMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeTrustStoresOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeTrustStoresInput struct { + + // The marker for the next set of results. (You received this marker from a + // previous call.) + Marker *string + + // The names of the trust stores. + Names []string + + // The maximum number of results to return with this call. + PageSize *int32 + + // The Amazon Resource Name (ARN) of the trust store. + TrustStoreArns []string + + noSmithyDocumentSerde +} + +type DescribeTrustStoresOutput struct { + + // If there are additional results, this is the marker for the next set of + // results. Otherwise, this is null. + NextMarker *string + + // Information about the trust stores. + TrustStores []types.TrustStore + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeTrustStoresMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeTrustStores{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeTrustStores{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTrustStores"); 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_opDescribeTrustStores(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 +} + +// DescribeTrustStoresAPIClient is a client that implements the +// DescribeTrustStores operation. +type DescribeTrustStoresAPIClient interface { + DescribeTrustStores(context.Context, *DescribeTrustStoresInput, ...func(*Options)) (*DescribeTrustStoresOutput, error) +} + +var _ DescribeTrustStoresAPIClient = (*Client)(nil) + +// DescribeTrustStoresPaginatorOptions is the paginator options for +// DescribeTrustStores +type DescribeTrustStoresPaginatorOptions struct { + // The maximum number of results 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 +} + +// DescribeTrustStoresPaginator is a paginator for DescribeTrustStores +type DescribeTrustStoresPaginator struct { + options DescribeTrustStoresPaginatorOptions + client DescribeTrustStoresAPIClient + params *DescribeTrustStoresInput + nextToken *string + firstPage bool +} + +// NewDescribeTrustStoresPaginator returns a new DescribeTrustStoresPaginator +func NewDescribeTrustStoresPaginator(client DescribeTrustStoresAPIClient, params *DescribeTrustStoresInput, optFns ...func(*DescribeTrustStoresPaginatorOptions)) *DescribeTrustStoresPaginator { + if params == nil { + params = &DescribeTrustStoresInput{} + } + + options := DescribeTrustStoresPaginatorOptions{} + if params.PageSize != nil { + options.Limit = *params.PageSize + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeTrustStoresPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTrustStoresPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeTrustStores page. +func (p *DescribeTrustStoresPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTrustStoresOutput, 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.PageSize = limit + + result, err := p.client.DescribeTrustStores(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opDescribeTrustStores(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeTrustStores", + } +} diff --git a/service/elasticloadbalancingv2/api_op_GetTrustStoreCaCertificatesBundle.go b/service/elasticloadbalancingv2/api_op_GetTrustStoreCaCertificatesBundle.go new file mode 100644 index 00000000000..75cfd023d21 --- /dev/null +++ b/service/elasticloadbalancingv2/api_op_GetTrustStoreCaCertificatesBundle.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancingv2 + +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" +) + +// Retrieves the ca certificate bundle. This action returns a pre-signed S3 URI +// which is active for ten minutes. +func (c *Client) GetTrustStoreCaCertificatesBundle(ctx context.Context, params *GetTrustStoreCaCertificatesBundleInput, optFns ...func(*Options)) (*GetTrustStoreCaCertificatesBundleOutput, error) { + if params == nil { + params = &GetTrustStoreCaCertificatesBundleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetTrustStoreCaCertificatesBundle", params, optFns, c.addOperationGetTrustStoreCaCertificatesBundleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetTrustStoreCaCertificatesBundleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetTrustStoreCaCertificatesBundleInput struct { + + // The Amazon Resource Name (ARN) of the trust store. + // + // This member is required. + TrustStoreArn *string + + noSmithyDocumentSerde +} + +type GetTrustStoreCaCertificatesBundleOutput struct { + + // The ca certificate bundles Amazon S3 URI. + Location *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetTrustStoreCaCertificatesBundleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetTrustStoreCaCertificatesBundle{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetTrustStoreCaCertificatesBundle{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetTrustStoreCaCertificatesBundle"); 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 = addOpGetTrustStoreCaCertificatesBundleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTrustStoreCaCertificatesBundle(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_opGetTrustStoreCaCertificatesBundle(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetTrustStoreCaCertificatesBundle", + } +} diff --git a/service/elasticloadbalancingv2/api_op_GetTrustStoreRevocationContent.go b/service/elasticloadbalancingv2/api_op_GetTrustStoreRevocationContent.go new file mode 100644 index 00000000000..85ececd44d3 --- /dev/null +++ b/service/elasticloadbalancingv2/api_op_GetTrustStoreRevocationContent.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancingv2 + +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" +) + +// Retrieves the specified revocation file. This action returns a pre-signed S3 +// URI which is active for ten minutes. +func (c *Client) GetTrustStoreRevocationContent(ctx context.Context, params *GetTrustStoreRevocationContentInput, optFns ...func(*Options)) (*GetTrustStoreRevocationContentOutput, error) { + if params == nil { + params = &GetTrustStoreRevocationContentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetTrustStoreRevocationContent", params, optFns, c.addOperationGetTrustStoreRevocationContentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetTrustStoreRevocationContentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetTrustStoreRevocationContentInput struct { + + // The revocation ID of the revocation file. + // + // This member is required. + RevocationId *int64 + + // The Amazon Resource Name (ARN) of the trust store. + // + // This member is required. + TrustStoreArn *string + + noSmithyDocumentSerde +} + +type GetTrustStoreRevocationContentOutput struct { + + // The revocation files Amazon S3 URI. + Location *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetTrustStoreRevocationContentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetTrustStoreRevocationContent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetTrustStoreRevocationContent{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetTrustStoreRevocationContent"); 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 = addOpGetTrustStoreRevocationContentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTrustStoreRevocationContent(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_opGetTrustStoreRevocationContent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetTrustStoreRevocationContent", + } +} diff --git a/service/elasticloadbalancingv2/api_op_ModifyListener.go b/service/elasticloadbalancingv2/api_op_ModifyListener.go index c9793026228..661d4e52c41 100644 --- a/service/elasticloadbalancingv2/api_op_ModifyListener.go +++ b/service/elasticloadbalancingv2/api_op_ModifyListener.go @@ -61,6 +61,9 @@ type ModifyListenerInput struct { // The actions for the default rule. DefaultActions []types.Action + // The mutual authentication configuration information. + MutualAuthentication *types.MutualAuthenticationAttributes + // The port for connections from clients to the load balancer. You cannot specify // a port for a Gateway Load Balancer. Port *int32 diff --git a/service/elasticloadbalancingv2/api_op_ModifyTrustStore.go b/service/elasticloadbalancingv2/api_op_ModifyTrustStore.go new file mode 100644 index 00000000000..27804b56f05 --- /dev/null +++ b/service/elasticloadbalancingv2/api_op_ModifyTrustStore.go @@ -0,0 +1,151 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancingv2 + +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/elasticloadbalancingv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update the ca certificate bundle for a given trust store. +func (c *Client) ModifyTrustStore(ctx context.Context, params *ModifyTrustStoreInput, optFns ...func(*Options)) (*ModifyTrustStoreOutput, error) { + if params == nil { + params = &ModifyTrustStoreInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyTrustStore", params, optFns, c.addOperationModifyTrustStoreMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyTrustStoreOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyTrustStoreInput struct { + + // The Amazon S3 bucket for the ca certificates bundle. + // + // This member is required. + CaCertificatesBundleS3Bucket *string + + // The Amazon S3 path for the ca certificates bundle. + // + // This member is required. + CaCertificatesBundleS3Key *string + + // The Amazon Resource Name (ARN) of the trust store. + // + // This member is required. + TrustStoreArn *string + + // The Amazon S3 object version for the ca certificates bundle. If undefined the + // current version is used. + CaCertificatesBundleS3ObjectVersion *string + + noSmithyDocumentSerde +} + +type ModifyTrustStoreOutput struct { + + // Information about the modified trust store. + TrustStores []types.TrustStore + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyTrustStoreMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyTrustStore{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyTrustStore{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyTrustStore"); 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 = addOpModifyTrustStoreValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyTrustStore(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_opModifyTrustStore(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyTrustStore", + } +} diff --git a/service/elasticloadbalancingv2/api_op_RemoveTrustStoreRevocations.go b/service/elasticloadbalancingv2/api_op_RemoveTrustStoreRevocations.go new file mode 100644 index 00000000000..51e7c5f0bc1 --- /dev/null +++ b/service/elasticloadbalancingv2/api_op_RemoveTrustStoreRevocations.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancingv2 + +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" +) + +// Removes the specified revocation file from the specified trust store. +func (c *Client) RemoveTrustStoreRevocations(ctx context.Context, params *RemoveTrustStoreRevocationsInput, optFns ...func(*Options)) (*RemoveTrustStoreRevocationsOutput, error) { + if params == nil { + params = &RemoveTrustStoreRevocationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RemoveTrustStoreRevocations", params, optFns, c.addOperationRemoveTrustStoreRevocationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RemoveTrustStoreRevocationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RemoveTrustStoreRevocationsInput struct { + + // The revocation IDs of the revocation files you want to remove. + // + // This member is required. + RevocationIds []int64 + + // The Amazon Resource Name (ARN) of the trust store. + // + // This member is required. + TrustStoreArn *string + + noSmithyDocumentSerde +} + +type RemoveTrustStoreRevocationsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRemoveTrustStoreRevocationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRemoveTrustStoreRevocations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRemoveTrustStoreRevocations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RemoveTrustStoreRevocations"); 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 = addOpRemoveTrustStoreRevocationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveTrustStoreRevocations(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_opRemoveTrustStoreRevocations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RemoveTrustStoreRevocations", + } +} diff --git a/service/elasticloadbalancingv2/deserializers.go b/service/elasticloadbalancingv2/deserializers.go index f2a1e264a71..464e78992f3 100644 --- a/service/elasticloadbalancingv2/deserializers.go +++ b/service/elasticloadbalancingv2/deserializers.go @@ -249,6 +249,126 @@ func awsAwsquery_deserializeOpErrorAddTags(response *smithyhttp.Response, metada case strings.EqualFold("TooManyTags", errorCode): return awsAwsquery_deserializeErrorTooManyTagsException(response, errorBody) + case strings.EqualFold("TrustStoreNotFound", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpAddTrustStoreRevocations struct { +} + +func (*awsAwsquery_deserializeOpAddTrustStoreRevocations) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpAddTrustStoreRevocations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorAddTrustStoreRevocations(response, &metadata) + } + output := &AddTrustStoreRevocationsOutput{} + 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("AddTrustStoreRevocationsResult") + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpDocumentAddTrustStoreRevocationsOutput(&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_deserializeOpErrorAddTrustStoreRevocations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InvalidRevocationContent", errorCode): + return awsAwsquery_deserializeErrorInvalidRevocationContentException(response, errorBody) + + case strings.EqualFold("RevocationContentNotFound", errorCode): + return awsAwsquery_deserializeErrorRevocationContentNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyTrustStoreRevocationEntries", errorCode): + return awsAwsquery_deserializeErrorTooManyTrustStoreRevocationEntriesException(response, errorBody) + + case strings.EqualFold("TrustStoreNotFound", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -405,6 +525,12 @@ func awsAwsquery_deserializeOpErrorCreateListener(response *smithyhttp.Response, case strings.EqualFold("TooManyUniqueTargetGroupsPerLoadBalancer", errorCode): return awsAwsquery_deserializeErrorTooManyUniqueTargetGroupsPerLoadBalancerException(response, errorBody) + case strings.EqualFold("TrustStoreNotFound", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotFoundException(response, errorBody) + + case strings.EqualFold("TrustStoreNotReady", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotReadyException(response, errorBody) + case strings.EqualFold("UnsupportedProtocol", errorCode): return awsAwsquery_deserializeErrorUnsupportedProtocolException(response, errorBody) @@ -829,14 +955,14 @@ func awsAwsquery_deserializeOpErrorCreateTargetGroup(response *smithyhttp.Respon } } -type awsAwsquery_deserializeOpDeleteListener struct { +type awsAwsquery_deserializeOpCreateTrustStore struct { } -func (*awsAwsquery_deserializeOpDeleteListener) ID() string { +func (*awsAwsquery_deserializeOpCreateTrustStore) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpDeleteListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpCreateTrustStore) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -850,9 +976,9 @@ func (m *awsAwsquery_deserializeOpDeleteListener) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorDeleteListener(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorCreateTrustStore(response, &metadata) } - output := &DeleteListenerOutput{} + output := &CreateTrustStoreOutput{} out.Result = output var buff [1024]byte @@ -873,7 +999,7 @@ func (m *awsAwsquery_deserializeOpDeleteListener) HandleDeserialize(ctx context. } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("DeleteListenerResult") + t, err = decoder.GetElement("CreateTrustStoreResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -885,7 +1011,7 @@ func (m *awsAwsquery_deserializeOpDeleteListener) HandleDeserialize(ctx context. } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentDeleteListenerOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentCreateTrustStoreOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -899,7 +1025,7 @@ func (m *awsAwsquery_deserializeOpDeleteListener) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsquery_deserializeOpErrorDeleteListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorCreateTrustStore(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -924,11 +1050,23 @@ func awsAwsquery_deserializeOpErrorDeleteListener(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("ListenerNotFound", errorCode): - return awsAwsquery_deserializeErrorListenerNotFoundException(response, errorBody) + case strings.EqualFold("CaCertificatesBundleNotFound", errorCode): + return awsAwsquery_deserializeErrorCaCertificatesBundleNotFoundException(response, errorBody) - case strings.EqualFold("ResourceInUse", errorCode): - return awsAwsquery_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("DuplicateTagKeys", errorCode): + return awsAwsquery_deserializeErrorDuplicateTagKeysException(response, errorBody) + + case strings.EqualFold("DuplicateTrustStoreName", errorCode): + return awsAwsquery_deserializeErrorDuplicateTrustStoreNameException(response, errorBody) + + case strings.EqualFold("InvalidCaCertificatesBundle", errorCode): + return awsAwsquery_deserializeErrorInvalidCaCertificatesBundleException(response, errorBody) + + case strings.EqualFold("TooManyTags", errorCode): + return awsAwsquery_deserializeErrorTooManyTagsException(response, errorBody) + + case strings.EqualFold("TooManyTrustStores", errorCode): + return awsAwsquery_deserializeErrorTooManyTrustStoresException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -940,14 +1078,14 @@ func awsAwsquery_deserializeOpErrorDeleteListener(response *smithyhttp.Response, } } -type awsAwsquery_deserializeOpDeleteLoadBalancer struct { +type awsAwsquery_deserializeOpDeleteListener struct { } -func (*awsAwsquery_deserializeOpDeleteLoadBalancer) ID() string { +func (*awsAwsquery_deserializeOpDeleteListener) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpDeleteLoadBalancer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpDeleteListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -961,9 +1099,9 @@ func (m *awsAwsquery_deserializeOpDeleteLoadBalancer) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorDeleteLoadBalancer(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorDeleteListener(response, &metadata) } - output := &DeleteLoadBalancerOutput{} + output := &DeleteListenerOutput{} out.Result = output var buff [1024]byte @@ -984,7 +1122,7 @@ func (m *awsAwsquery_deserializeOpDeleteLoadBalancer) HandleDeserialize(ctx cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("DeleteLoadBalancerResult") + t, err = decoder.GetElement("DeleteListenerResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -996,7 +1134,7 @@ func (m *awsAwsquery_deserializeOpDeleteLoadBalancer) HandleDeserialize(ctx cont } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentDeleteLoadBalancerOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentDeleteListenerOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1010,7 +1148,7 @@ func (m *awsAwsquery_deserializeOpDeleteLoadBalancer) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsquery_deserializeOpErrorDeleteLoadBalancer(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorDeleteListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1035,11 +1173,8 @@ func awsAwsquery_deserializeOpErrorDeleteLoadBalancer(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("LoadBalancerNotFound", errorCode): - return awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response, errorBody) - - case strings.EqualFold("OperationNotPermitted", errorCode): - return awsAwsquery_deserializeErrorOperationNotPermittedException(response, errorBody) + case strings.EqualFold("ListenerNotFound", errorCode): + return awsAwsquery_deserializeErrorListenerNotFoundException(response, errorBody) case strings.EqualFold("ResourceInUse", errorCode): return awsAwsquery_deserializeErrorResourceInUseException(response, errorBody) @@ -1054,14 +1189,14 @@ func awsAwsquery_deserializeOpErrorDeleteLoadBalancer(response *smithyhttp.Respo } } -type awsAwsquery_deserializeOpDeleteRule struct { +type awsAwsquery_deserializeOpDeleteLoadBalancer struct { } -func (*awsAwsquery_deserializeOpDeleteRule) ID() string { +func (*awsAwsquery_deserializeOpDeleteLoadBalancer) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpDeleteRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpDeleteLoadBalancer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1075,9 +1210,9 @@ func (m *awsAwsquery_deserializeOpDeleteRule) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorDeleteRule(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorDeleteLoadBalancer(response, &metadata) } - output := &DeleteRuleOutput{} + output := &DeleteLoadBalancerOutput{} out.Result = output var buff [1024]byte @@ -1098,7 +1233,7 @@ func (m *awsAwsquery_deserializeOpDeleteRule) HandleDeserialize(ctx context.Cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("DeleteRuleResult") + t, err = decoder.GetElement("DeleteLoadBalancerResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1110,7 +1245,7 @@ func (m *awsAwsquery_deserializeOpDeleteRule) HandleDeserialize(ctx context.Cont } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentDeleteRuleOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentDeleteLoadBalancerOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1124,7 +1259,7 @@ func (m *awsAwsquery_deserializeOpDeleteRule) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsAwsquery_deserializeOpErrorDeleteRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorDeleteLoadBalancer(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1149,11 +1284,14 @@ func awsAwsquery_deserializeOpErrorDeleteRule(response *smithyhttp.Response, met } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response, errorBody) + case strings.EqualFold("OperationNotPermitted", errorCode): return awsAwsquery_deserializeErrorOperationNotPermittedException(response, errorBody) - case strings.EqualFold("RuleNotFound", errorCode): - return awsAwsquery_deserializeErrorRuleNotFoundException(response, errorBody) + case strings.EqualFold("ResourceInUse", errorCode): + return awsAwsquery_deserializeErrorResourceInUseException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -1165,14 +1303,14 @@ func awsAwsquery_deserializeOpErrorDeleteRule(response *smithyhttp.Response, met } } -type awsAwsquery_deserializeOpDeleteTargetGroup struct { +type awsAwsquery_deserializeOpDeleteRule struct { } -func (*awsAwsquery_deserializeOpDeleteTargetGroup) ID() string { +func (*awsAwsquery_deserializeOpDeleteRule) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpDeleteTargetGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpDeleteRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1186,9 +1324,9 @@ func (m *awsAwsquery_deserializeOpDeleteTargetGroup) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorDeleteTargetGroup(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorDeleteRule(response, &metadata) } - output := &DeleteTargetGroupOutput{} + output := &DeleteRuleOutput{} out.Result = output var buff [1024]byte @@ -1209,7 +1347,7 @@ func (m *awsAwsquery_deserializeOpDeleteTargetGroup) HandleDeserialize(ctx conte } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("DeleteTargetGroupResult") + t, err = decoder.GetElement("DeleteRuleResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1221,7 +1359,7 @@ func (m *awsAwsquery_deserializeOpDeleteTargetGroup) HandleDeserialize(ctx conte } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentDeleteTargetGroupOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentDeleteRuleOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1235,7 +1373,7 @@ func (m *awsAwsquery_deserializeOpDeleteTargetGroup) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsquery_deserializeOpErrorDeleteTargetGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorDeleteRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1260,8 +1398,11 @@ func awsAwsquery_deserializeOpErrorDeleteTargetGroup(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("ResourceInUse", errorCode): - return awsAwsquery_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("OperationNotPermitted", errorCode): + return awsAwsquery_deserializeErrorOperationNotPermittedException(response, errorBody) + + case strings.EqualFold("RuleNotFound", errorCode): + return awsAwsquery_deserializeErrorRuleNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -1273,14 +1414,14 @@ func awsAwsquery_deserializeOpErrorDeleteTargetGroup(response *smithyhttp.Respon } } -type awsAwsquery_deserializeOpDeregisterTargets struct { +type awsAwsquery_deserializeOpDeleteTargetGroup struct { } -func (*awsAwsquery_deserializeOpDeregisterTargets) ID() string { +func (*awsAwsquery_deserializeOpDeleteTargetGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpDeregisterTargets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpDeleteTargetGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1294,9 +1435,9 @@ func (m *awsAwsquery_deserializeOpDeregisterTargets) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorDeregisterTargets(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorDeleteTargetGroup(response, &metadata) } - output := &DeregisterTargetsOutput{} + output := &DeleteTargetGroupOutput{} out.Result = output var buff [1024]byte @@ -1317,7 +1458,7 @@ func (m *awsAwsquery_deserializeOpDeregisterTargets) HandleDeserialize(ctx conte } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("DeregisterTargetsResult") + t, err = decoder.GetElement("DeleteTargetGroupResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1329,7 +1470,7 @@ func (m *awsAwsquery_deserializeOpDeregisterTargets) HandleDeserialize(ctx conte } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentDeregisterTargetsOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentDeleteTargetGroupOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1343,7 +1484,7 @@ func (m *awsAwsquery_deserializeOpDeregisterTargets) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsquery_deserializeOpErrorDeregisterTargets(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorDeleteTargetGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1368,11 +1509,8 @@ func awsAwsquery_deserializeOpErrorDeregisterTargets(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("InvalidTarget", errorCode): - return awsAwsquery_deserializeErrorInvalidTargetException(response, errorBody) - - case strings.EqualFold("TargetGroupNotFound", errorCode): - return awsAwsquery_deserializeErrorTargetGroupNotFoundException(response, errorBody) + case strings.EqualFold("ResourceInUse", errorCode): + return awsAwsquery_deserializeErrorResourceInUseException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -1384,14 +1522,14 @@ func awsAwsquery_deserializeOpErrorDeregisterTargets(response *smithyhttp.Respon } } -type awsAwsquery_deserializeOpDescribeAccountLimits struct { +type awsAwsquery_deserializeOpDeleteTrustStore struct { } -func (*awsAwsquery_deserializeOpDescribeAccountLimits) ID() string { +func (*awsAwsquery_deserializeOpDeleteTrustStore) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpDescribeAccountLimits) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpDeleteTrustStore) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1405,9 +1543,9 @@ func (m *awsAwsquery_deserializeOpDescribeAccountLimits) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorDescribeAccountLimits(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorDeleteTrustStore(response, &metadata) } - output := &DescribeAccountLimitsOutput{} + output := &DeleteTrustStoreOutput{} out.Result = output var buff [1024]byte @@ -1428,7 +1566,7 @@ func (m *awsAwsquery_deserializeOpDescribeAccountLimits) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("DescribeAccountLimitsResult") + t, err = decoder.GetElement("DeleteTrustStoreResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1440,7 +1578,7 @@ func (m *awsAwsquery_deserializeOpDescribeAccountLimits) HandleDeserialize(ctx c } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentDescribeAccountLimitsOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentDeleteTrustStoreOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1454,7 +1592,7 @@ func (m *awsAwsquery_deserializeOpDescribeAccountLimits) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsquery_deserializeOpErrorDescribeAccountLimits(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorDeleteTrustStore(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1479,6 +1617,12 @@ func awsAwsquery_deserializeOpErrorDescribeAccountLimits(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("TrustStoreInUse", errorCode): + return awsAwsquery_deserializeErrorTrustStoreInUseException(response, errorBody) + + case strings.EqualFold("TrustStoreNotFound", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1489,14 +1633,14 @@ func awsAwsquery_deserializeOpErrorDescribeAccountLimits(response *smithyhttp.Re } } -type awsAwsquery_deserializeOpDescribeListenerCertificates struct { +type awsAwsquery_deserializeOpDeregisterTargets struct { } -func (*awsAwsquery_deserializeOpDescribeListenerCertificates) ID() string { +func (*awsAwsquery_deserializeOpDeregisterTargets) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpDescribeListenerCertificates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpDeregisterTargets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1510,9 +1654,9 @@ func (m *awsAwsquery_deserializeOpDescribeListenerCertificates) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorDescribeListenerCertificates(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorDeregisterTargets(response, &metadata) } - output := &DescribeListenerCertificatesOutput{} + output := &DeregisterTargetsOutput{} out.Result = output var buff [1024]byte @@ -1533,7 +1677,7 @@ func (m *awsAwsquery_deserializeOpDescribeListenerCertificates) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("DescribeListenerCertificatesResult") + t, err = decoder.GetElement("DeregisterTargetsResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1545,7 +1689,7 @@ func (m *awsAwsquery_deserializeOpDescribeListenerCertificates) HandleDeserializ } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentDescribeListenerCertificatesOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentDeregisterTargetsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1559,7 +1703,7 @@ func (m *awsAwsquery_deserializeOpDescribeListenerCertificates) HandleDeserializ return out, metadata, err } -func awsAwsquery_deserializeOpErrorDescribeListenerCertificates(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorDeregisterTargets(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1584,8 +1728,11 @@ func awsAwsquery_deserializeOpErrorDescribeListenerCertificates(response *smithy } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("ListenerNotFound", errorCode): - return awsAwsquery_deserializeErrorListenerNotFoundException(response, errorBody) + case strings.EqualFold("InvalidTarget", errorCode): + return awsAwsquery_deserializeErrorInvalidTargetException(response, errorBody) + + case strings.EqualFold("TargetGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorTargetGroupNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -1597,14 +1744,14 @@ func awsAwsquery_deserializeOpErrorDescribeListenerCertificates(response *smithy } } -type awsAwsquery_deserializeOpDescribeListeners struct { +type awsAwsquery_deserializeOpDescribeAccountLimits struct { } -func (*awsAwsquery_deserializeOpDescribeListeners) ID() string { +func (*awsAwsquery_deserializeOpDescribeAccountLimits) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpDescribeListeners) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpDescribeAccountLimits) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1618,7 +1765,220 @@ func (m *awsAwsquery_deserializeOpDescribeListeners) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorDescribeListeners(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorDescribeAccountLimits(response, &metadata) + } + output := &DescribeAccountLimitsOutput{} + 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("DescribeAccountLimitsResult") + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpDocumentDescribeAccountLimitsOutput(&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_deserializeOpErrorDescribeAccountLimits(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeListenerCertificates struct { +} + +func (*awsAwsquery_deserializeOpDescribeListenerCertificates) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeListenerCertificates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDescribeListenerCertificates(response, &metadata) + } + output := &DescribeListenerCertificatesOutput{} + 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("DescribeListenerCertificatesResult") + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpDocumentDescribeListenerCertificatesOutput(&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_deserializeOpErrorDescribeListenerCertificates(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("ListenerNotFound", errorCode): + return awsAwsquery_deserializeErrorListenerNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeListeners struct { +} + +func (*awsAwsquery_deserializeOpDescribeListeners) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeListeners) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDescribeListeners(response, &metadata) } output := &DescribeListenersOutput{} out.Result = output @@ -2256,6 +2616,9 @@ func awsAwsquery_deserializeOpErrorDescribeTags(response *smithyhttp.Response, m case strings.EqualFold("TargetGroupNotFound", errorCode): return awsAwsquery_deserializeErrorTargetGroupNotFoundException(response, errorBody) + case strings.EqualFold("TrustStoreNotFound", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2599,14 +2962,14 @@ func awsAwsquery_deserializeOpErrorDescribeTargetHealth(response *smithyhttp.Res } } -type awsAwsquery_deserializeOpModifyListener struct { +type awsAwsquery_deserializeOpDescribeTrustStoreAssociations struct { } -func (*awsAwsquery_deserializeOpModifyListener) ID() string { +func (*awsAwsquery_deserializeOpDescribeTrustStoreAssociations) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpModifyListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpDescribeTrustStoreAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2620,9 +2983,9 @@ func (m *awsAwsquery_deserializeOpModifyListener) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorModifyListener(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorDescribeTrustStoreAssociations(response, &metadata) } - output := &ModifyListenerOutput{} + output := &DescribeTrustStoreAssociationsOutput{} out.Result = output var buff [1024]byte @@ -2643,7 +3006,7 @@ func (m *awsAwsquery_deserializeOpModifyListener) HandleDeserialize(ctx context. } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("ModifyListenerResult") + t, err = decoder.GetElement("DescribeTrustStoreAssociationsResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2655,7 +3018,7 @@ func (m *awsAwsquery_deserializeOpModifyListener) HandleDeserialize(ctx context. } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentModifyListenerOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentDescribeTrustStoreAssociationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2669,7 +3032,7 @@ func (m *awsAwsquery_deserializeOpModifyListener) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsquery_deserializeOpErrorModifyListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorDescribeTrustStoreAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2694,81 +3057,33 @@ func awsAwsquery_deserializeOpErrorModifyListener(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("ALPNPolicyNotFound", errorCode): - return awsAwsquery_deserializeErrorALPNPolicyNotSupportedException(response, errorBody) - - case strings.EqualFold("CertificateNotFound", errorCode): - return awsAwsquery_deserializeErrorCertificateNotFoundException(response, errorBody) + case strings.EqualFold("TrustStoreNotFound", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotFoundException(response, errorBody) - case strings.EqualFold("DuplicateListener", errorCode): - return awsAwsquery_deserializeErrorDuplicateListenerException(response, errorBody) + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError - case strings.EqualFold("IncompatibleProtocols", errorCode): - return awsAwsquery_deserializeErrorIncompatibleProtocolsException(response, errorBody) + } +} - case strings.EqualFold("InvalidConfigurationRequest", errorCode): - return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) +type awsAwsquery_deserializeOpDescribeTrustStoreRevocations struct { +} - case strings.EqualFold("InvalidLoadBalancerAction", errorCode): - return awsAwsquery_deserializeErrorInvalidLoadBalancerActionException(response, errorBody) +func (*awsAwsquery_deserializeOpDescribeTrustStoreRevocations) ID() string { + return "OperationDeserializer" +} - case strings.EqualFold("ListenerNotFound", errorCode): - return awsAwsquery_deserializeErrorListenerNotFoundException(response, errorBody) - - case strings.EqualFold("SSLPolicyNotFound", errorCode): - return awsAwsquery_deserializeErrorSSLPolicyNotFoundException(response, errorBody) - - case strings.EqualFold("TargetGroupAssociationLimit", errorCode): - return awsAwsquery_deserializeErrorTargetGroupAssociationLimitException(response, errorBody) - - case strings.EqualFold("TargetGroupNotFound", errorCode): - return awsAwsquery_deserializeErrorTargetGroupNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyActions", errorCode): - return awsAwsquery_deserializeErrorTooManyActionsException(response, errorBody) - - case strings.EqualFold("TooManyCertificates", errorCode): - return awsAwsquery_deserializeErrorTooManyCertificatesException(response, errorBody) - - case strings.EqualFold("TooManyListeners", errorCode): - return awsAwsquery_deserializeErrorTooManyListenersException(response, errorBody) - - case strings.EqualFold("TooManyRegistrationsForTargetId", errorCode): - return awsAwsquery_deserializeErrorTooManyRegistrationsForTargetIdException(response, errorBody) - - case strings.EqualFold("TooManyTargets", errorCode): - return awsAwsquery_deserializeErrorTooManyTargetsException(response, errorBody) - - case strings.EqualFold("TooManyUniqueTargetGroupsPerLoadBalancer", errorCode): - return awsAwsquery_deserializeErrorTooManyUniqueTargetGroupsPerLoadBalancerException(response, errorBody) - - case strings.EqualFold("UnsupportedProtocol", errorCode): - return awsAwsquery_deserializeErrorUnsupportedProtocolException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsquery_deserializeOpModifyLoadBalancerAttributes struct { -} - -func (*awsAwsquery_deserializeOpModifyLoadBalancerAttributes) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsquery_deserializeOpModifyLoadBalancerAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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 (m *awsAwsquery_deserializeOpDescribeTrustStoreRevocations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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 { @@ -2776,9 +3091,9 @@ func (m *awsAwsquery_deserializeOpModifyLoadBalancerAttributes) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorModifyLoadBalancerAttributes(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorDescribeTrustStoreRevocations(response, &metadata) } - output := &ModifyLoadBalancerAttributesOutput{} + output := &DescribeTrustStoreRevocationsOutput{} out.Result = output var buff [1024]byte @@ -2799,7 +3114,7 @@ func (m *awsAwsquery_deserializeOpModifyLoadBalancerAttributes) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("ModifyLoadBalancerAttributesResult") + t, err = decoder.GetElement("DescribeTrustStoreRevocationsResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2811,7 +3126,7 @@ func (m *awsAwsquery_deserializeOpModifyLoadBalancerAttributes) HandleDeserializ } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentModifyLoadBalancerAttributesOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentDescribeTrustStoreRevocationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2825,7 +3140,7 @@ func (m *awsAwsquery_deserializeOpModifyLoadBalancerAttributes) HandleDeserializ return out, metadata, err } -func awsAwsquery_deserializeOpErrorModifyLoadBalancerAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorDescribeTrustStoreRevocations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2850,11 +3165,11 @@ func awsAwsquery_deserializeOpErrorModifyLoadBalancerAttributes(response *smithy } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("InvalidConfigurationRequest", errorCode): - return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + case strings.EqualFold("RevocationIdNotFound", errorCode): + return awsAwsquery_deserializeErrorRevocationIdNotFoundException(response, errorBody) - case strings.EqualFold("LoadBalancerNotFound", errorCode): - return awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response, errorBody) + case strings.EqualFold("TrustStoreNotFound", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -2866,14 +3181,14 @@ func awsAwsquery_deserializeOpErrorModifyLoadBalancerAttributes(response *smithy } } -type awsAwsquery_deserializeOpModifyRule struct { +type awsAwsquery_deserializeOpDescribeTrustStores struct { } -func (*awsAwsquery_deserializeOpModifyRule) ID() string { +func (*awsAwsquery_deserializeOpDescribeTrustStores) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpModifyRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpDescribeTrustStores) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2887,9 +3202,9 @@ func (m *awsAwsquery_deserializeOpModifyRule) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorModifyRule(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorDescribeTrustStores(response, &metadata) } - output := &ModifyRuleOutput{} + output := &DescribeTrustStoresOutput{} out.Result = output var buff [1024]byte @@ -2910,7 +3225,7 @@ func (m *awsAwsquery_deserializeOpModifyRule) HandleDeserialize(ctx context.Cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("ModifyRuleResult") + t, err = decoder.GetElement("DescribeTrustStoresResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2922,7 +3237,7 @@ func (m *awsAwsquery_deserializeOpModifyRule) HandleDeserialize(ctx context.Cont } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentModifyRuleOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentDescribeTrustStoresOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2936,7 +3251,7 @@ func (m *awsAwsquery_deserializeOpModifyRule) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsAwsquery_deserializeOpErrorModifyRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorDescribeTrustStores(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2961,38 +3276,8 @@ func awsAwsquery_deserializeOpErrorModifyRule(response *smithyhttp.Response, met } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("IncompatibleProtocols", errorCode): - return awsAwsquery_deserializeErrorIncompatibleProtocolsException(response, errorBody) - - case strings.EqualFold("InvalidLoadBalancerAction", errorCode): - return awsAwsquery_deserializeErrorInvalidLoadBalancerActionException(response, errorBody) - - case strings.EqualFold("OperationNotPermitted", errorCode): - return awsAwsquery_deserializeErrorOperationNotPermittedException(response, errorBody) - - case strings.EqualFold("RuleNotFound", errorCode): - return awsAwsquery_deserializeErrorRuleNotFoundException(response, errorBody) - - case strings.EqualFold("TargetGroupAssociationLimit", errorCode): - return awsAwsquery_deserializeErrorTargetGroupAssociationLimitException(response, errorBody) - - case strings.EqualFold("TargetGroupNotFound", errorCode): - return awsAwsquery_deserializeErrorTargetGroupNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyActions", errorCode): - return awsAwsquery_deserializeErrorTooManyActionsException(response, errorBody) - - case strings.EqualFold("TooManyRegistrationsForTargetId", errorCode): - return awsAwsquery_deserializeErrorTooManyRegistrationsForTargetIdException(response, errorBody) - - case strings.EqualFold("TooManyTargets", errorCode): - return awsAwsquery_deserializeErrorTooManyTargetsException(response, errorBody) - - case strings.EqualFold("TooManyUniqueTargetGroupsPerLoadBalancer", errorCode): - return awsAwsquery_deserializeErrorTooManyUniqueTargetGroupsPerLoadBalancerException(response, errorBody) - - case strings.EqualFold("UnsupportedProtocol", errorCode): - return awsAwsquery_deserializeErrorUnsupportedProtocolException(response, errorBody) + case strings.EqualFold("TrustStoreNotFound", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3004,14 +3289,14 @@ func awsAwsquery_deserializeOpErrorModifyRule(response *smithyhttp.Response, met } } -type awsAwsquery_deserializeOpModifyTargetGroup struct { +type awsAwsquery_deserializeOpGetTrustStoreCaCertificatesBundle struct { } -func (*awsAwsquery_deserializeOpModifyTargetGroup) ID() string { +func (*awsAwsquery_deserializeOpGetTrustStoreCaCertificatesBundle) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpModifyTargetGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpGetTrustStoreCaCertificatesBundle) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3025,9 +3310,9 @@ func (m *awsAwsquery_deserializeOpModifyTargetGroup) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorModifyTargetGroup(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorGetTrustStoreCaCertificatesBundle(response, &metadata) } - output := &ModifyTargetGroupOutput{} + output := &GetTrustStoreCaCertificatesBundleOutput{} out.Result = output var buff [1024]byte @@ -3048,7 +3333,7 @@ func (m *awsAwsquery_deserializeOpModifyTargetGroup) HandleDeserialize(ctx conte } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("ModifyTargetGroupResult") + t, err = decoder.GetElement("GetTrustStoreCaCertificatesBundleResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3060,7 +3345,7 @@ func (m *awsAwsquery_deserializeOpModifyTargetGroup) HandleDeserialize(ctx conte } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentModifyTargetGroupOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentGetTrustStoreCaCertificatesBundleOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3074,7 +3359,7 @@ func (m *awsAwsquery_deserializeOpModifyTargetGroup) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsquery_deserializeOpErrorModifyTargetGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorGetTrustStoreCaCertificatesBundle(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3099,11 +3384,8 @@ func awsAwsquery_deserializeOpErrorModifyTargetGroup(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("InvalidConfigurationRequest", errorCode): - return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) - - case strings.EqualFold("TargetGroupNotFound", errorCode): - return awsAwsquery_deserializeErrorTargetGroupNotFoundException(response, errorBody) + case strings.EqualFold("TrustStoreNotFound", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3115,14 +3397,14 @@ func awsAwsquery_deserializeOpErrorModifyTargetGroup(response *smithyhttp.Respon } } -type awsAwsquery_deserializeOpModifyTargetGroupAttributes struct { +type awsAwsquery_deserializeOpGetTrustStoreRevocationContent struct { } -func (*awsAwsquery_deserializeOpModifyTargetGroupAttributes) ID() string { +func (*awsAwsquery_deserializeOpGetTrustStoreRevocationContent) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpModifyTargetGroupAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpGetTrustStoreRevocationContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3136,9 +3418,9 @@ func (m *awsAwsquery_deserializeOpModifyTargetGroupAttributes) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorModifyTargetGroupAttributes(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorGetTrustStoreRevocationContent(response, &metadata) } - output := &ModifyTargetGroupAttributesOutput{} + output := &GetTrustStoreRevocationContentOutput{} out.Result = output var buff [1024]byte @@ -3159,7 +3441,7 @@ func (m *awsAwsquery_deserializeOpModifyTargetGroupAttributes) HandleDeserialize } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("ModifyTargetGroupAttributesResult") + t, err = decoder.GetElement("GetTrustStoreRevocationContentResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3171,7 +3453,7 @@ func (m *awsAwsquery_deserializeOpModifyTargetGroupAttributes) HandleDeserialize } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentModifyTargetGroupAttributesOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentGetTrustStoreRevocationContentOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3185,7 +3467,7 @@ func (m *awsAwsquery_deserializeOpModifyTargetGroupAttributes) HandleDeserialize return out, metadata, err } -func awsAwsquery_deserializeOpErrorModifyTargetGroupAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorGetTrustStoreRevocationContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3210,11 +3492,11 @@ func awsAwsquery_deserializeOpErrorModifyTargetGroupAttributes(response *smithyh } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("InvalidConfigurationRequest", errorCode): - return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + case strings.EqualFold("RevocationIdNotFound", errorCode): + return awsAwsquery_deserializeErrorRevocationIdNotFoundException(response, errorBody) - case strings.EqualFold("TargetGroupNotFound", errorCode): - return awsAwsquery_deserializeErrorTargetGroupNotFoundException(response, errorBody) + case strings.EqualFold("TrustStoreNotFound", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3226,14 +3508,14 @@ func awsAwsquery_deserializeOpErrorModifyTargetGroupAttributes(response *smithyh } } -type awsAwsquery_deserializeOpRegisterTargets struct { +type awsAwsquery_deserializeOpModifyListener struct { } -func (*awsAwsquery_deserializeOpRegisterTargets) ID() string { +func (*awsAwsquery_deserializeOpModifyListener) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpRegisterTargets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpModifyListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3247,9 +3529,9 @@ func (m *awsAwsquery_deserializeOpRegisterTargets) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorRegisterTargets(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorModifyListener(response, &metadata) } - output := &RegisterTargetsOutput{} + output := &ModifyListenerOutput{} out.Result = output var buff [1024]byte @@ -3270,7 +3552,7 @@ func (m *awsAwsquery_deserializeOpRegisterTargets) HandleDeserialize(ctx context } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("RegisterTargetsResult") + t, err = decoder.GetElement("ModifyListenerResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3282,7 +3564,7 @@ func (m *awsAwsquery_deserializeOpRegisterTargets) HandleDeserialize(ctx context } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentRegisterTargetsOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentModifyListenerOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3296,7 +3578,7 @@ func (m *awsAwsquery_deserializeOpRegisterTargets) HandleDeserialize(ctx context return out, metadata, err } -func awsAwsquery_deserializeOpErrorRegisterTargets(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorModifyListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3321,18 +3603,63 @@ func awsAwsquery_deserializeOpErrorRegisterTargets(response *smithyhttp.Response } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("InvalidTarget", errorCode): - return awsAwsquery_deserializeErrorInvalidTargetException(response, errorBody) + case strings.EqualFold("ALPNPolicyNotFound", errorCode): + return awsAwsquery_deserializeErrorALPNPolicyNotSupportedException(response, errorBody) + + case strings.EqualFold("CertificateNotFound", errorCode): + return awsAwsquery_deserializeErrorCertificateNotFoundException(response, errorBody) + + case strings.EqualFold("DuplicateListener", errorCode): + return awsAwsquery_deserializeErrorDuplicateListenerException(response, errorBody) + + case strings.EqualFold("IncompatibleProtocols", errorCode): + return awsAwsquery_deserializeErrorIncompatibleProtocolsException(response, errorBody) + + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("InvalidLoadBalancerAction", errorCode): + return awsAwsquery_deserializeErrorInvalidLoadBalancerActionException(response, errorBody) + + case strings.EqualFold("ListenerNotFound", errorCode): + return awsAwsquery_deserializeErrorListenerNotFoundException(response, errorBody) + + case strings.EqualFold("SSLPolicyNotFound", errorCode): + return awsAwsquery_deserializeErrorSSLPolicyNotFoundException(response, errorBody) + + case strings.EqualFold("TargetGroupAssociationLimit", errorCode): + return awsAwsquery_deserializeErrorTargetGroupAssociationLimitException(response, errorBody) case strings.EqualFold("TargetGroupNotFound", errorCode): return awsAwsquery_deserializeErrorTargetGroupNotFoundException(response, errorBody) + case strings.EqualFold("TooManyActions", errorCode): + return awsAwsquery_deserializeErrorTooManyActionsException(response, errorBody) + + case strings.EqualFold("TooManyCertificates", errorCode): + return awsAwsquery_deserializeErrorTooManyCertificatesException(response, errorBody) + + case strings.EqualFold("TooManyListeners", errorCode): + return awsAwsquery_deserializeErrorTooManyListenersException(response, errorBody) + case strings.EqualFold("TooManyRegistrationsForTargetId", errorCode): return awsAwsquery_deserializeErrorTooManyRegistrationsForTargetIdException(response, errorBody) case strings.EqualFold("TooManyTargets", errorCode): return awsAwsquery_deserializeErrorTooManyTargetsException(response, errorBody) + case strings.EqualFold("TooManyUniqueTargetGroupsPerLoadBalancer", errorCode): + return awsAwsquery_deserializeErrorTooManyUniqueTargetGroupsPerLoadBalancerException(response, errorBody) + + case strings.EqualFold("TrustStoreNotFound", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotFoundException(response, errorBody) + + case strings.EqualFold("TrustStoreNotReady", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotReadyException(response, errorBody) + + case strings.EqualFold("UnsupportedProtocol", errorCode): + return awsAwsquery_deserializeErrorUnsupportedProtocolException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3343,14 +3670,14 @@ func awsAwsquery_deserializeOpErrorRegisterTargets(response *smithyhttp.Response } } -type awsAwsquery_deserializeOpRemoveListenerCertificates struct { +type awsAwsquery_deserializeOpModifyLoadBalancerAttributes struct { } -func (*awsAwsquery_deserializeOpRemoveListenerCertificates) ID() string { +func (*awsAwsquery_deserializeOpModifyLoadBalancerAttributes) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpRemoveListenerCertificates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpModifyLoadBalancerAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3364,9 +3691,9 @@ func (m *awsAwsquery_deserializeOpRemoveListenerCertificates) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorRemoveListenerCertificates(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorModifyLoadBalancerAttributes(response, &metadata) } - output := &RemoveListenerCertificatesOutput{} + output := &ModifyLoadBalancerAttributesOutput{} out.Result = output var buff [1024]byte @@ -3387,7 +3714,7 @@ func (m *awsAwsquery_deserializeOpRemoveListenerCertificates) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("RemoveListenerCertificatesResult") + t, err = decoder.GetElement("ModifyLoadBalancerAttributesResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3399,7 +3726,7 @@ func (m *awsAwsquery_deserializeOpRemoveListenerCertificates) HandleDeserialize( } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentRemoveListenerCertificatesOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentModifyLoadBalancerAttributesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3413,7 +3740,7 @@ func (m *awsAwsquery_deserializeOpRemoveListenerCertificates) HandleDeserialize( return out, metadata, err } -func awsAwsquery_deserializeOpErrorRemoveListenerCertificates(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorModifyLoadBalancerAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3438,11 +3765,11 @@ func awsAwsquery_deserializeOpErrorRemoveListenerCertificates(response *smithyht } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("ListenerNotFound", errorCode): - return awsAwsquery_deserializeErrorListenerNotFoundException(response, errorBody) + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) - case strings.EqualFold("OperationNotPermitted", errorCode): - return awsAwsquery_deserializeErrorOperationNotPermittedException(response, errorBody) + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3454,14 +3781,14 @@ func awsAwsquery_deserializeOpErrorRemoveListenerCertificates(response *smithyht } } -type awsAwsquery_deserializeOpRemoveTags struct { +type awsAwsquery_deserializeOpModifyRule struct { } -func (*awsAwsquery_deserializeOpRemoveTags) ID() string { +func (*awsAwsquery_deserializeOpModifyRule) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpRemoveTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpModifyRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3475,9 +3802,9 @@ func (m *awsAwsquery_deserializeOpRemoveTags) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorRemoveTags(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorModifyRule(response, &metadata) } - output := &RemoveTagsOutput{} + output := &ModifyRuleOutput{} out.Result = output var buff [1024]byte @@ -3498,7 +3825,7 @@ func (m *awsAwsquery_deserializeOpRemoveTags) HandleDeserialize(ctx context.Cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("RemoveTagsResult") + t, err = decoder.GetElement("ModifyRuleResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3510,7 +3837,7 @@ func (m *awsAwsquery_deserializeOpRemoveTags) HandleDeserialize(ctx context.Cont } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentRemoveTagsOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentModifyRuleOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3524,7 +3851,7 @@ func (m *awsAwsquery_deserializeOpRemoveTags) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsAwsquery_deserializeOpErrorRemoveTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorModifyRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3549,39 +3876,57 @@ func awsAwsquery_deserializeOpErrorRemoveTags(response *smithyhttp.Response, met } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("ListenerNotFound", errorCode): - return awsAwsquery_deserializeErrorListenerNotFoundException(response, errorBody) + case strings.EqualFold("IncompatibleProtocols", errorCode): + return awsAwsquery_deserializeErrorIncompatibleProtocolsException(response, errorBody) - case strings.EqualFold("LoadBalancerNotFound", errorCode): - return awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response, errorBody) + case strings.EqualFold("InvalidLoadBalancerAction", errorCode): + return awsAwsquery_deserializeErrorInvalidLoadBalancerActionException(response, errorBody) + + case strings.EqualFold("OperationNotPermitted", errorCode): + return awsAwsquery_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("RuleNotFound", errorCode): return awsAwsquery_deserializeErrorRuleNotFoundException(response, errorBody) + case strings.EqualFold("TargetGroupAssociationLimit", errorCode): + return awsAwsquery_deserializeErrorTargetGroupAssociationLimitException(response, errorBody) + case strings.EqualFold("TargetGroupNotFound", errorCode): return awsAwsquery_deserializeErrorTargetGroupNotFoundException(response, errorBody) - case strings.EqualFold("TooManyTags", errorCode): - return awsAwsquery_deserializeErrorTooManyTagsException(response, errorBody) + case strings.EqualFold("TooManyActions", errorCode): + return awsAwsquery_deserializeErrorTooManyActionsException(response, errorBody) - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError + case strings.EqualFold("TooManyRegistrationsForTargetId", errorCode): + return awsAwsquery_deserializeErrorTooManyRegistrationsForTargetIdException(response, errorBody) - } + case strings.EqualFold("TooManyTargets", errorCode): + return awsAwsquery_deserializeErrorTooManyTargetsException(response, errorBody) + + case strings.EqualFold("TooManyUniqueTargetGroupsPerLoadBalancer", errorCode): + return awsAwsquery_deserializeErrorTooManyUniqueTargetGroupsPerLoadBalancerException(response, errorBody) + + case strings.EqualFold("UnsupportedProtocol", errorCode): + return awsAwsquery_deserializeErrorUnsupportedProtocolException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } } -type awsAwsquery_deserializeOpSetIpAddressType struct { +type awsAwsquery_deserializeOpModifyTargetGroup struct { } -func (*awsAwsquery_deserializeOpSetIpAddressType) ID() string { +func (*awsAwsquery_deserializeOpModifyTargetGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpSetIpAddressType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpModifyTargetGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3595,9 +3940,9 @@ func (m *awsAwsquery_deserializeOpSetIpAddressType) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorSetIpAddressType(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorModifyTargetGroup(response, &metadata) } - output := &SetIpAddressTypeOutput{} + output := &ModifyTargetGroupOutput{} out.Result = output var buff [1024]byte @@ -3618,7 +3963,7 @@ func (m *awsAwsquery_deserializeOpSetIpAddressType) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("SetIpAddressTypeResult") + t, err = decoder.GetElement("ModifyTargetGroupResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3630,7 +3975,7 @@ func (m *awsAwsquery_deserializeOpSetIpAddressType) HandleDeserialize(ctx contex } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentSetIpAddressTypeOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentModifyTargetGroupOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3644,7 +3989,7 @@ func (m *awsAwsquery_deserializeOpSetIpAddressType) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsquery_deserializeOpErrorSetIpAddressType(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorModifyTargetGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3672,11 +4017,8 @@ func awsAwsquery_deserializeOpErrorSetIpAddressType(response *smithyhttp.Respons case strings.EqualFold("InvalidConfigurationRequest", errorCode): return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) - case strings.EqualFold("InvalidSubnet", errorCode): - return awsAwsquery_deserializeErrorInvalidSubnetException(response, errorBody) - - case strings.EqualFold("LoadBalancerNotFound", errorCode): - return awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response, errorBody) + case strings.EqualFold("TargetGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorTargetGroupNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3688,14 +4030,14 @@ func awsAwsquery_deserializeOpErrorSetIpAddressType(response *smithyhttp.Respons } } -type awsAwsquery_deserializeOpSetRulePriorities struct { +type awsAwsquery_deserializeOpModifyTargetGroupAttributes struct { } -func (*awsAwsquery_deserializeOpSetRulePriorities) ID() string { +func (*awsAwsquery_deserializeOpModifyTargetGroupAttributes) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpSetRulePriorities) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpModifyTargetGroupAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3709,9 +4051,9 @@ func (m *awsAwsquery_deserializeOpSetRulePriorities) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorSetRulePriorities(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorModifyTargetGroupAttributes(response, &metadata) } - output := &SetRulePrioritiesOutput{} + output := &ModifyTargetGroupAttributesOutput{} out.Result = output var buff [1024]byte @@ -3732,7 +4074,7 @@ func (m *awsAwsquery_deserializeOpSetRulePriorities) HandleDeserialize(ctx conte } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("SetRulePrioritiesResult") + t, err = decoder.GetElement("ModifyTargetGroupAttributesResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3744,7 +4086,7 @@ func (m *awsAwsquery_deserializeOpSetRulePriorities) HandleDeserialize(ctx conte } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentSetRulePrioritiesOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentModifyTargetGroupAttributesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3758,7 +4100,7 @@ func (m *awsAwsquery_deserializeOpSetRulePriorities) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsquery_deserializeOpErrorSetRulePriorities(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorModifyTargetGroupAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3783,14 +4125,11 @@ func awsAwsquery_deserializeOpErrorSetRulePriorities(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("OperationNotPermitted", errorCode): - return awsAwsquery_deserializeErrorOperationNotPermittedException(response, errorBody) - - case strings.EqualFold("PriorityInUse", errorCode): - return awsAwsquery_deserializeErrorPriorityInUseException(response, errorBody) + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) - case strings.EqualFold("RuleNotFound", errorCode): - return awsAwsquery_deserializeErrorRuleNotFoundException(response, errorBody) + case strings.EqualFold("TargetGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorTargetGroupNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3802,14 +4141,14 @@ func awsAwsquery_deserializeOpErrorSetRulePriorities(response *smithyhttp.Respon } } -type awsAwsquery_deserializeOpSetSecurityGroups struct { +type awsAwsquery_deserializeOpModifyTrustStore struct { } -func (*awsAwsquery_deserializeOpSetSecurityGroups) ID() string { +func (*awsAwsquery_deserializeOpModifyTrustStore) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpSetSecurityGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpModifyTrustStore) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3823,9 +4162,9 @@ func (m *awsAwsquery_deserializeOpSetSecurityGroups) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorSetSecurityGroups(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorModifyTrustStore(response, &metadata) } - output := &SetSecurityGroupsOutput{} + output := &ModifyTrustStoreOutput{} out.Result = output var buff [1024]byte @@ -3846,7 +4185,7 @@ func (m *awsAwsquery_deserializeOpSetSecurityGroups) HandleDeserialize(ctx conte } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("SetSecurityGroupsResult") + t, err = decoder.GetElement("ModifyTrustStoreResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3858,7 +4197,7 @@ func (m *awsAwsquery_deserializeOpSetSecurityGroups) HandleDeserialize(ctx conte } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentSetSecurityGroupsOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentModifyTrustStoreOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3872,7 +4211,7 @@ func (m *awsAwsquery_deserializeOpSetSecurityGroups) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsquery_deserializeOpErrorSetSecurityGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorModifyTrustStore(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3897,14 +4236,14 @@ func awsAwsquery_deserializeOpErrorSetSecurityGroups(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("InvalidConfigurationRequest", errorCode): - return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + case strings.EqualFold("CaCertificatesBundleNotFound", errorCode): + return awsAwsquery_deserializeErrorCaCertificatesBundleNotFoundException(response, errorBody) - case strings.EqualFold("InvalidSecurityGroup", errorCode): - return awsAwsquery_deserializeErrorInvalidSecurityGroupException(response, errorBody) + case strings.EqualFold("InvalidCaCertificatesBundle", errorCode): + return awsAwsquery_deserializeErrorInvalidCaCertificatesBundleException(response, errorBody) - case strings.EqualFold("LoadBalancerNotFound", errorCode): - return awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response, errorBody) + case strings.EqualFold("TrustStoreNotFound", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3916,14 +4255,14 @@ func awsAwsquery_deserializeOpErrorSetSecurityGroups(response *smithyhttp.Respon } } -type awsAwsquery_deserializeOpSetSubnets struct { +type awsAwsquery_deserializeOpRegisterTargets struct { } -func (*awsAwsquery_deserializeOpSetSubnets) ID() string { +func (*awsAwsquery_deserializeOpRegisterTargets) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpSetSubnets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpRegisterTargets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3937,9 +4276,9 @@ func (m *awsAwsquery_deserializeOpSetSubnets) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorSetSubnets(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorRegisterTargets(response, &metadata) } - output := &SetSubnetsOutput{} + output := &RegisterTargetsOutput{} out.Result = output var buff [1024]byte @@ -3960,7 +4299,7 @@ func (m *awsAwsquery_deserializeOpSetSubnets) HandleDeserialize(ctx context.Cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("SetSubnetsResult") + t, err = decoder.GetElement("RegisterTargetsResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3972,7 +4311,7 @@ func (m *awsAwsquery_deserializeOpSetSubnets) HandleDeserialize(ctx context.Cont } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentSetSubnetsOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentRegisterTargetsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3986,7 +4325,7 @@ func (m *awsAwsquery_deserializeOpSetSubnets) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsAwsquery_deserializeOpErrorSetSubnets(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorRegisterTargets(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4011,23 +4350,17 @@ func awsAwsquery_deserializeOpErrorSetSubnets(response *smithyhttp.Response, met } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("AllocationIdNotFound", errorCode): - return awsAwsquery_deserializeErrorAllocationIdNotFoundException(response, errorBody) - - case strings.EqualFold("AvailabilityZoneNotSupported", errorCode): - return awsAwsquery_deserializeErrorAvailabilityZoneNotSupportedException(response, errorBody) - - case strings.EqualFold("InvalidConfigurationRequest", errorCode): - return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + case strings.EqualFold("InvalidTarget", errorCode): + return awsAwsquery_deserializeErrorInvalidTargetException(response, errorBody) - case strings.EqualFold("InvalidSubnet", errorCode): - return awsAwsquery_deserializeErrorInvalidSubnetException(response, errorBody) + case strings.EqualFold("TargetGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorTargetGroupNotFoundException(response, errorBody) - case strings.EqualFold("LoadBalancerNotFound", errorCode): - return awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response, errorBody) + case strings.EqualFold("TooManyRegistrationsForTargetId", errorCode): + return awsAwsquery_deserializeErrorTooManyRegistrationsForTargetIdException(response, errorBody) - case strings.EqualFold("SubnetNotFound", errorCode): - return awsAwsquery_deserializeErrorSubnetNotFoundException(response, errorBody) + case strings.EqualFold("TooManyTargets", errorCode): + return awsAwsquery_deserializeErrorTooManyTargetsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4039,580 +4372,818 @@ func awsAwsquery_deserializeOpErrorSetSubnets(response *smithyhttp.Response, met } } -func awsAwsquery_deserializeErrorAllocationIdNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.AllocationIdNotFoundException{} +type awsAwsquery_deserializeOpRemoveListenerCertificates struct { +} + +func (*awsAwsquery_deserializeOpRemoveListenerCertificates) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRemoveListenerCertificates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorRemoveListenerCertificates(response, &metadata) + } + output := &RemoveListenerCertificatesOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) rootDecoder := xml.NewDecoder(body) t, err := smithyxml.FetchRootElement(rootDecoder) if err == io.EOF { - return output + return out, metadata, nil } if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + 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("Error") + t, err = decoder.GetElement("RemoveListenerCertificatesResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + 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_deserializeDocumentAllocationIdNotFoundException(&output, decoder) + err = awsAwsquery_deserializeOpDocumentRemoveListenerCertificatesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } + return out, metadata, err } - return output + return out, metadata, err } -func awsAwsquery_deserializeErrorALPNPolicyNotSupportedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ALPNPolicyNotSupportedException{} +func awsAwsquery_deserializeOpErrorRemoveListenerCertificates(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("ListenerNotFound", errorCode): + return awsAwsquery_deserializeErrorListenerNotFoundException(response, errorBody) + + case strings.EqualFold("OperationNotPermitted", errorCode): + return awsAwsquery_deserializeErrorOperationNotPermittedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRemoveTags struct { +} + +func (*awsAwsquery_deserializeOpRemoveTags) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRemoveTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorRemoveTags(response, &metadata) + } + output := &RemoveTagsOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) rootDecoder := xml.NewDecoder(body) t, err := smithyxml.FetchRootElement(rootDecoder) if err == io.EOF { - return output + return out, metadata, nil } if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + 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("Error") + t, err = decoder.GetElement("RemoveTagsResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + 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_deserializeDocumentALPNPolicyNotSupportedException(&output, decoder) + err = awsAwsquery_deserializeOpDocumentRemoveTagsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } + return out, metadata, err } - return output + return out, metadata, err } -func awsAwsquery_deserializeErrorAvailabilityZoneNotSupportedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.AvailabilityZoneNotSupportedException{} - 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(), - } +func awsAwsquery_deserializeOpErrorRemoveTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } + errorBody := bytes.NewReader(errorBuffer.Bytes()) - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) 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 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("ListenerNotFound", errorCode): + return awsAwsquery_deserializeErrorListenerNotFoundException(response, errorBody) - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentAvailabilityZoneNotSupportedException(&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(), + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response, errorBody) + + case strings.EqualFold("RuleNotFound", errorCode): + return awsAwsquery_deserializeErrorRuleNotFoundException(response, errorBody) + + case strings.EqualFold("TargetGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorTargetGroupNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyTags", errorCode): + return awsAwsquery_deserializeErrorTooManyTagsException(response, errorBody) + + case strings.EqualFold("TrustStoreNotFound", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } + return genericError + } +} - return output +type awsAwsquery_deserializeOpRemoveTrustStoreRevocations struct { } -func awsAwsquery_deserializeErrorCertificateNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.CertificateNotFoundException{} - 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(), - } - } +func (*awsAwsquery_deserializeOpRemoveTrustStoreRevocations) ID() string { + return "OperationDeserializer" +} - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") +func (m *awsAwsquery_deserializeOpRemoveTrustStoreRevocations) HandleDeserialize(ctx context.Context, 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) - return &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_deserializeDocumentCertificateNotFoundException(&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(), - } + 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, awsAwsquery_deserializeOpErrorRemoveTrustStoreRevocations(response, &metadata) + } + output := &RemoveTrustStoreRevocationsOutput{} + out.Result = output -func awsAwsquery_deserializeErrorDuplicateListenerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.DuplicateListenerException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) rootDecoder := xml.NewDecoder(body) t, err := smithyxml.FetchRootElement(rootDecoder) if err == io.EOF { - return output + return out, metadata, nil } if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + 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("Error") + t, err = decoder.GetElement("RemoveTrustStoreRevocationsResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + 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_deserializeDocumentDuplicateListenerException(&output, decoder) + err = awsAwsquery_deserializeOpDocumentRemoveTrustStoreRevocationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } + return out, metadata, err } - return output + return out, metadata, err } -func awsAwsquery_deserializeErrorDuplicateLoadBalancerNameException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.DuplicateLoadBalancerNameException{} - 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 +func awsAwsquery_deserializeOpErrorRemoveTrustStoreRevocations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 { - 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 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("RevocationIdNotFound", errorCode): + return awsAwsquery_deserializeErrorRevocationIdNotFoundException(response, errorBody) - 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(), + case strings.EqualFold("TrustStoreNotFound", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } + return genericError + } +} - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentDuplicateLoadBalancerNameException(&output, decoder) +type awsAwsquery_deserializeOpSetIpAddressType struct { +} + +func (*awsAwsquery_deserializeOpSetIpAddressType) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSetIpAddressType) HandleDeserialize(ctx context.Context, 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) - return &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } + return out, metadata, err } - 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, awsAwsquery_deserializeOpErrorSetIpAddressType(response, &metadata) + } + output := &SetIpAddressTypeOutput{} + out.Result = output -func awsAwsquery_deserializeErrorDuplicateTagKeysException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.DuplicateTagKeysException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) rootDecoder := xml.NewDecoder(body) t, err := smithyxml.FetchRootElement(rootDecoder) if err == io.EOF { - return output + return out, metadata, nil } if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + 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("Error") + t, err = decoder.GetElement("SetIpAddressTypeResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + 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_deserializeDocumentDuplicateTagKeysException(&output, decoder) + err = awsAwsquery_deserializeOpDocumentSetIpAddressTypeOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } + return out, metadata, err } - return output + return out, metadata, err } -func awsAwsquery_deserializeErrorDuplicateTargetGroupNameException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.DuplicateTargetGroupNameException{} - 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(), - } +func awsAwsquery_deserializeOpErrorSetIpAddressType(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } + errorBody := bytes.NewReader(errorBuffer.Bytes()) - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) 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 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("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentDuplicateTargetGroupNameException(&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(), + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnetException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } + return genericError + } +} - return output +type awsAwsquery_deserializeOpSetRulePriorities struct { } -func awsAwsquery_deserializeErrorHealthUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.HealthUnavailableException{} - 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(), - } - } +func (*awsAwsquery_deserializeOpSetRulePriorities) ID() string { + return "OperationDeserializer" +} - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") +func (m *awsAwsquery_deserializeOpSetRulePriorities) HandleDeserialize(ctx context.Context, 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) - return &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_deserializeDocumentHealthUnavailableException(&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(), - } + 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, awsAwsquery_deserializeOpErrorSetRulePriorities(response, &metadata) + } + output := &SetRulePrioritiesOutput{} + out.Result = output -func awsAwsquery_deserializeErrorIncompatibleProtocolsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.IncompatibleProtocolsException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) rootDecoder := xml.NewDecoder(body) t, err := smithyxml.FetchRootElement(rootDecoder) if err == io.EOF { - return output + return out, metadata, nil } if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + 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("Error") + t, err = decoder.GetElement("SetRulePrioritiesResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + 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_deserializeDocumentIncompatibleProtocolsException(&output, decoder) + err = awsAwsquery_deserializeOpDocumentSetRulePrioritiesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } + return out, metadata, err } - return output + return out, metadata, err } -func awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidConfigurationRequestException{} - 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 +func awsAwsquery_deserializeOpErrorSetRulePriorities(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 { - 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 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("OperationNotPermitted", errorCode): + return awsAwsquery_deserializeErrorOperationNotPermittedException(response, errorBody) - 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(), + case strings.EqualFold("PriorityInUse", errorCode): + return awsAwsquery_deserializeErrorPriorityInUseException(response, errorBody) + + case strings.EqualFold("RuleNotFound", errorCode): + return awsAwsquery_deserializeErrorRuleNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } + return genericError + } +} - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentInvalidConfigurationRequestException(&output, decoder) +type awsAwsquery_deserializeOpSetSecurityGroups struct { +} + +func (*awsAwsquery_deserializeOpSetSecurityGroups) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSetSecurityGroups) HandleDeserialize(ctx context.Context, 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) - return &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } + return out, metadata, err } - 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, awsAwsquery_deserializeOpErrorSetSecurityGroups(response, &metadata) + } + output := &SetSecurityGroupsOutput{} + out.Result = output -func awsAwsquery_deserializeErrorInvalidLoadBalancerActionException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidLoadBalancerActionException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) rootDecoder := xml.NewDecoder(body) t, err := smithyxml.FetchRootElement(rootDecoder) if err == io.EOF { - return output + return out, metadata, nil } if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + 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("Error") + t, err = decoder.GetElement("SetSecurityGroupsResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + 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_deserializeDocumentInvalidLoadBalancerActionException(&output, decoder) + err = awsAwsquery_deserializeOpDocumentSetSecurityGroupsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } + return out, metadata, err } - return output + return out, metadata, err } -func awsAwsquery_deserializeErrorInvalidSchemeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidSchemeException{} - 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 +func awsAwsquery_deserializeOpErrorSetSecurityGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("InvalidSecurityGroup", errorCode): + return awsAwsquery_deserializeErrorInvalidSecurityGroupException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSetSubnets struct { +} + +func (*awsAwsquery_deserializeOpSetSubnets) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSetSubnets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorSetSubnets(response, &metadata) + } + output := &SetSubnetsOutput{} + 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 &smithy.DeserializationError{ + 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("Error") + t, err = decoder.GetElement("SetSubnetsResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + 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_deserializeDocumentInvalidSchemeException(&output, decoder) + err = awsAwsquery_deserializeOpDocumentSetSubnetsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } + return out, metadata, err } - return output + return out, metadata, err } -func awsAwsquery_deserializeErrorInvalidSecurityGroupException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidSecurityGroupException{} +func awsAwsquery_deserializeOpErrorSetSubnets(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("AllocationIdNotFound", errorCode): + return awsAwsquery_deserializeErrorAllocationIdNotFoundException(response, errorBody) + + case strings.EqualFold("AvailabilityZoneNotSupported", errorCode): + return awsAwsquery_deserializeErrorAvailabilityZoneNotSupportedException(response, errorBody) + + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnetException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response, errorBody) + + case strings.EqualFold("SubnetNotFound", errorCode): + return awsAwsquery_deserializeErrorSubnetNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsquery_deserializeErrorAllocationIdNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AllocationIdNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -4642,7 +5213,7 @@ func awsAwsquery_deserializeErrorInvalidSecurityGroupException(response *smithyh } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentInvalidSecurityGroupException(&output, decoder) + err = awsAwsquery_deserializeDocumentAllocationIdNotFoundException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4655,8 +5226,8 @@ func awsAwsquery_deserializeErrorInvalidSecurityGroupException(response *smithyh return output } -func awsAwsquery_deserializeErrorInvalidSubnetException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidSubnetException{} +func awsAwsquery_deserializeErrorALPNPolicyNotSupportedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ALPNPolicyNotSupportedException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -4686,7 +5257,7 @@ func awsAwsquery_deserializeErrorInvalidSubnetException(response *smithyhttp.Res } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentInvalidSubnetException(&output, decoder) + err = awsAwsquery_deserializeDocumentALPNPolicyNotSupportedException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4699,8 +5270,8 @@ func awsAwsquery_deserializeErrorInvalidSubnetException(response *smithyhttp.Res return output } -func awsAwsquery_deserializeErrorInvalidTargetException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidTargetException{} +func awsAwsquery_deserializeErrorAvailabilityZoneNotSupportedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AvailabilityZoneNotSupportedException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -4730,7 +5301,7 @@ func awsAwsquery_deserializeErrorInvalidTargetException(response *smithyhttp.Res } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentInvalidTargetException(&output, decoder) + err = awsAwsquery_deserializeDocumentAvailabilityZoneNotSupportedException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4743,8 +5314,8 @@ func awsAwsquery_deserializeErrorInvalidTargetException(response *smithyhttp.Res return output } -func awsAwsquery_deserializeErrorListenerNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ListenerNotFoundException{} +func awsAwsquery_deserializeErrorCaCertificatesBundleNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CaCertificatesBundleNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -4774,7 +5345,7 @@ func awsAwsquery_deserializeErrorListenerNotFoundException(response *smithyhttp. } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentListenerNotFoundException(&output, decoder) + err = awsAwsquery_deserializeDocumentCaCertificatesBundleNotFoundException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4787,8 +5358,8 @@ func awsAwsquery_deserializeErrorListenerNotFoundException(response *smithyhttp. return output } -func awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.LoadBalancerNotFoundException{} +func awsAwsquery_deserializeErrorCertificateNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CertificateNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -4818,7 +5389,7 @@ func awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response *smithyh } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentLoadBalancerNotFoundException(&output, decoder) + err = awsAwsquery_deserializeDocumentCertificateNotFoundException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4831,8 +5402,8 @@ func awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response *smithyh return output } -func awsAwsquery_deserializeErrorOperationNotPermittedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.OperationNotPermittedException{} +func awsAwsquery_deserializeErrorDuplicateListenerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DuplicateListenerException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -4862,7 +5433,7 @@ func awsAwsquery_deserializeErrorOperationNotPermittedException(response *smithy } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentOperationNotPermittedException(&output, decoder) + err = awsAwsquery_deserializeDocumentDuplicateListenerException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4875,8 +5446,8 @@ func awsAwsquery_deserializeErrorOperationNotPermittedException(response *smithy return output } -func awsAwsquery_deserializeErrorPriorityInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.PriorityInUseException{} +func awsAwsquery_deserializeErrorDuplicateLoadBalancerNameException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DuplicateLoadBalancerNameException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -4906,7 +5477,7 @@ func awsAwsquery_deserializeErrorPriorityInUseException(response *smithyhttp.Res } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentPriorityInUseException(&output, decoder) + err = awsAwsquery_deserializeDocumentDuplicateLoadBalancerNameException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4919,8 +5490,8 @@ func awsAwsquery_deserializeErrorPriorityInUseException(response *smithyhttp.Res return output } -func awsAwsquery_deserializeErrorResourceInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceInUseException{} +func awsAwsquery_deserializeErrorDuplicateTagKeysException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DuplicateTagKeysException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -4950,7 +5521,7 @@ func awsAwsquery_deserializeErrorResourceInUseException(response *smithyhttp.Res } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentResourceInUseException(&output, decoder) + err = awsAwsquery_deserializeDocumentDuplicateTagKeysException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4963,8 +5534,8 @@ func awsAwsquery_deserializeErrorResourceInUseException(response *smithyhttp.Res return output } -func awsAwsquery_deserializeErrorRuleNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.RuleNotFoundException{} +func awsAwsquery_deserializeErrorDuplicateTargetGroupNameException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DuplicateTargetGroupNameException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -4994,7 +5565,7 @@ func awsAwsquery_deserializeErrorRuleNotFoundException(response *smithyhttp.Resp } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentRuleNotFoundException(&output, decoder) + err = awsAwsquery_deserializeDocumentDuplicateTargetGroupNameException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5007,8 +5578,8 @@ func awsAwsquery_deserializeErrorRuleNotFoundException(response *smithyhttp.Resp return output } -func awsAwsquery_deserializeErrorSSLPolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.SSLPolicyNotFoundException{} +func awsAwsquery_deserializeErrorDuplicateTrustStoreNameException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DuplicateTrustStoreNameException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -5038,7 +5609,7 @@ func awsAwsquery_deserializeErrorSSLPolicyNotFoundException(response *smithyhttp } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentSSLPolicyNotFoundException(&output, decoder) + err = awsAwsquery_deserializeDocumentDuplicateTrustStoreNameException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5051,8 +5622,8 @@ func awsAwsquery_deserializeErrorSSLPolicyNotFoundException(response *smithyhttp return output } -func awsAwsquery_deserializeErrorSubnetNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.SubnetNotFoundException{} +func awsAwsquery_deserializeErrorHealthUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.HealthUnavailableException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -5082,7 +5653,7 @@ func awsAwsquery_deserializeErrorSubnetNotFoundException(response *smithyhttp.Re } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentSubnetNotFoundException(&output, decoder) + err = awsAwsquery_deserializeDocumentHealthUnavailableException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5095,8 +5666,8 @@ func awsAwsquery_deserializeErrorSubnetNotFoundException(response *smithyhttp.Re return output } -func awsAwsquery_deserializeErrorTargetGroupAssociationLimitException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TargetGroupAssociationLimitException{} +func awsAwsquery_deserializeErrorIncompatibleProtocolsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.IncompatibleProtocolsException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -5126,7 +5697,7 @@ func awsAwsquery_deserializeErrorTargetGroupAssociationLimitException(response * } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTargetGroupAssociationLimitException(&output, decoder) + err = awsAwsquery_deserializeDocumentIncompatibleProtocolsException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5139,8 +5710,8 @@ func awsAwsquery_deserializeErrorTargetGroupAssociationLimitException(response * return output } -func awsAwsquery_deserializeErrorTargetGroupNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TargetGroupNotFoundException{} +func awsAwsquery_deserializeErrorInvalidCaCertificatesBundleException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidCaCertificatesBundleException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -5170,7 +5741,7 @@ func awsAwsquery_deserializeErrorTargetGroupNotFoundException(response *smithyht } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTargetGroupNotFoundException(&output, decoder) + err = awsAwsquery_deserializeDocumentInvalidCaCertificatesBundleException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5183,8 +5754,8 @@ func awsAwsquery_deserializeErrorTargetGroupNotFoundException(response *smithyht return output } -func awsAwsquery_deserializeErrorTooManyActionsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyActionsException{} +func awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidConfigurationRequestException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -5214,7 +5785,7 @@ func awsAwsquery_deserializeErrorTooManyActionsException(response *smithyhttp.Re } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTooManyActionsException(&output, decoder) + err = awsAwsquery_deserializeDocumentInvalidConfigurationRequestException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5227,8 +5798,8 @@ func awsAwsquery_deserializeErrorTooManyActionsException(response *smithyhttp.Re return output } -func awsAwsquery_deserializeErrorTooManyCertificatesException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyCertificatesException{} +func awsAwsquery_deserializeErrorInvalidLoadBalancerActionException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidLoadBalancerActionException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -5258,7 +5829,7 @@ func awsAwsquery_deserializeErrorTooManyCertificatesException(response *smithyht } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTooManyCertificatesException(&output, decoder) + err = awsAwsquery_deserializeDocumentInvalidLoadBalancerActionException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5271,8 +5842,8 @@ func awsAwsquery_deserializeErrorTooManyCertificatesException(response *smithyht return output } -func awsAwsquery_deserializeErrorTooManyListenersException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyListenersException{} +func awsAwsquery_deserializeErrorInvalidRevocationContentException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRevocationContentException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -5302,7 +5873,7 @@ func awsAwsquery_deserializeErrorTooManyListenersException(response *smithyhttp. } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTooManyListenersException(&output, decoder) + err = awsAwsquery_deserializeDocumentInvalidRevocationContentException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5315,8 +5886,8 @@ func awsAwsquery_deserializeErrorTooManyListenersException(response *smithyhttp. return output } -func awsAwsquery_deserializeErrorTooManyLoadBalancersException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyLoadBalancersException{} +func awsAwsquery_deserializeErrorInvalidSchemeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidSchemeException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -5346,7 +5917,7 @@ func awsAwsquery_deserializeErrorTooManyLoadBalancersException(response *smithyh } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTooManyLoadBalancersException(&output, decoder) + err = awsAwsquery_deserializeDocumentInvalidSchemeException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5359,8 +5930,8 @@ func awsAwsquery_deserializeErrorTooManyLoadBalancersException(response *smithyh return output } -func awsAwsquery_deserializeErrorTooManyRegistrationsForTargetIdException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyRegistrationsForTargetIdException{} +func awsAwsquery_deserializeErrorInvalidSecurityGroupException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidSecurityGroupException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -5390,7 +5961,7 @@ func awsAwsquery_deserializeErrorTooManyRegistrationsForTargetIdException(respon } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTooManyRegistrationsForTargetIdException(&output, decoder) + err = awsAwsquery_deserializeDocumentInvalidSecurityGroupException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5403,8 +5974,8 @@ func awsAwsquery_deserializeErrorTooManyRegistrationsForTargetIdException(respon return output } -func awsAwsquery_deserializeErrorTooManyRulesException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyRulesException{} +func awsAwsquery_deserializeErrorInvalidSubnetException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidSubnetException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -5434,7 +6005,7 @@ func awsAwsquery_deserializeErrorTooManyRulesException(response *smithyhttp.Resp } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTooManyRulesException(&output, decoder) + err = awsAwsquery_deserializeDocumentInvalidSubnetException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5447,8 +6018,8 @@ func awsAwsquery_deserializeErrorTooManyRulesException(response *smithyhttp.Resp return output } -func awsAwsquery_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyTagsException{} +func awsAwsquery_deserializeErrorInvalidTargetException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidTargetException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -5478,7 +6049,7 @@ func awsAwsquery_deserializeErrorTooManyTagsException(response *smithyhttp.Respo } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTooManyTagsException(&output, decoder) + err = awsAwsquery_deserializeDocumentInvalidTargetException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5491,8 +6062,8 @@ func awsAwsquery_deserializeErrorTooManyTagsException(response *smithyhttp.Respo return output } -func awsAwsquery_deserializeErrorTooManyTargetGroupsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyTargetGroupsException{} +func awsAwsquery_deserializeErrorListenerNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ListenerNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -5522,7 +6093,7 @@ func awsAwsquery_deserializeErrorTooManyTargetGroupsException(response *smithyht } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTooManyTargetGroupsException(&output, decoder) + err = awsAwsquery_deserializeDocumentListenerNotFoundException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5535,8 +6106,8 @@ func awsAwsquery_deserializeErrorTooManyTargetGroupsException(response *smithyht return output } -func awsAwsquery_deserializeErrorTooManyTargetsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyTargetsException{} +func awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.LoadBalancerNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -5566,7 +6137,7 @@ func awsAwsquery_deserializeErrorTooManyTargetsException(response *smithyhttp.Re } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTooManyTargetsException(&output, decoder) + err = awsAwsquery_deserializeDocumentLoadBalancerNotFoundException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5579,8 +6150,8 @@ func awsAwsquery_deserializeErrorTooManyTargetsException(response *smithyhttp.Re return output } -func awsAwsquery_deserializeErrorTooManyUniqueTargetGroupsPerLoadBalancerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyUniqueTargetGroupsPerLoadBalancerException{} +func awsAwsquery_deserializeErrorOperationNotPermittedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.OperationNotPermittedException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -5610,7 +6181,7 @@ func awsAwsquery_deserializeErrorTooManyUniqueTargetGroupsPerLoadBalancerExcepti } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTooManyUniqueTargetGroupsPerLoadBalancerException(&output, decoder) + err = awsAwsquery_deserializeDocumentOperationNotPermittedException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5623,8 +6194,8 @@ func awsAwsquery_deserializeErrorTooManyUniqueTargetGroupsPerLoadBalancerExcepti return output } -func awsAwsquery_deserializeErrorUnsupportedProtocolException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.UnsupportedProtocolException{} +func awsAwsquery_deserializeErrorPriorityInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.PriorityInUseException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -5654,7 +6225,7 @@ func awsAwsquery_deserializeErrorUnsupportedProtocolException(response *smithyht } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentUnsupportedProtocolException(&output, decoder) + err = awsAwsquery_deserializeDocumentPriorityInUseException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5667,190 +6238,2574 @@ func awsAwsquery_deserializeErrorUnsupportedProtocolException(response *smithyht return output } -func awsAwsquery_deserializeDocumentAction(v **types.Action, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) +func awsAwsquery_deserializeErrorResourceInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceInUseException{} + 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 } - var sv *types.Action - if *v == nil { - sv = &types.Action{} - } else { - sv = *v + 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(), + } } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break + 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(), } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("AuthenticateCognitoConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentAuthenticateCognitoActionConfig(&sv.AuthenticateCognitoConfig, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("AuthenticateOidcConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentAuthenticateOidcActionConfig(&sv.AuthenticateOidcConfig, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("FixedResponseConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentFixedResponseActionConfig(&sv.FixedResponseConfig, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ForwardConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentForwardActionConfig(&sv.ForwardConfig, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("Order", 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.Order = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("RedirectConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentRedirectActionConfig(&sv.RedirectConfig, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("TargetGroupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TargetGroupArn = ptr.String(xtv) - } - - case strings.EqualFold("Type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = types.ActionTypeEnum(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + } + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentResourceInUseException(&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(), } - decoder = originalDecoder } - *v = sv - return nil + + return output } -func awsAwsquery_deserializeDocumentActions(v *[]types.Action, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) +func awsAwsquery_deserializeErrorRevocationContentNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.RevocationContentNotFoundException{} + 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 } - var sv []types.Action - if *v == nil { - sv = make([]types.Action, 0) - } else { - sv = *v + 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(), + } } - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break + 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(), } - switch { - case strings.EqualFold("member", t.Name.Local): - var col types.Action - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsAwsquery_deserializeDocumentAction(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } + } + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentRevocationContentNotFoundException(&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(), } - decoder = originalDecoder } - *v = sv - return nil + + return output } -func awsAwsquery_deserializeDocumentActionsUnwrapped(v *[]types.Action, decoder smithyxml.NodeDecoder) error { - var sv []types.Action - if *v == nil { - sv = make([]types.Action, 0) - } else { - sv = *v +func awsAwsquery_deserializeErrorRevocationIdNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.RevocationIdNotFoundException{} + 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 } - - switch { - default: - var mv types.Action - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsAwsquery_deserializeDocumentAction(&destAddr, nodeDecoder); err != nil { - return err + 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(), } - mv = *destAddr - sv = append(sv, mv) + } + + 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_deserializeDocumentRevocationIdNotFoundException(&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_deserializeErrorRuleNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.RuleNotFoundException{} + 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_deserializeDocumentRuleNotFoundException(&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_deserializeErrorSSLPolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SSLPolicyNotFoundException{} + 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_deserializeDocumentSSLPolicyNotFoundException(&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_deserializeErrorSubnetNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SubnetNotFoundException{} + 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_deserializeDocumentSubnetNotFoundException(&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_deserializeErrorTargetGroupAssociationLimitException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TargetGroupAssociationLimitException{} + 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_deserializeDocumentTargetGroupAssociationLimitException(&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_deserializeErrorTargetGroupNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TargetGroupNotFoundException{} + 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_deserializeDocumentTargetGroupNotFoundException(&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_deserializeErrorTooManyActionsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyActionsException{} + 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_deserializeDocumentTooManyActionsException(&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_deserializeErrorTooManyCertificatesException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyCertificatesException{} + 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_deserializeDocumentTooManyCertificatesException(&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_deserializeErrorTooManyListenersException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyListenersException{} + 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_deserializeDocumentTooManyListenersException(&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_deserializeErrorTooManyLoadBalancersException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyLoadBalancersException{} + 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_deserializeDocumentTooManyLoadBalancersException(&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_deserializeErrorTooManyRegistrationsForTargetIdException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyRegistrationsForTargetIdException{} + 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_deserializeDocumentTooManyRegistrationsForTargetIdException(&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_deserializeErrorTooManyRulesException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyRulesException{} + 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_deserializeDocumentTooManyRulesException(&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_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyTagsException{} + 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_deserializeDocumentTooManyTagsException(&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_deserializeErrorTooManyTargetGroupsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyTargetGroupsException{} + 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_deserializeDocumentTooManyTargetGroupsException(&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_deserializeErrorTooManyTargetsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyTargetsException{} + 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_deserializeDocumentTooManyTargetsException(&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_deserializeErrorTooManyTrustStoreRevocationEntriesException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyTrustStoreRevocationEntriesException{} + 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_deserializeDocumentTooManyTrustStoreRevocationEntriesException(&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_deserializeErrorTooManyTrustStoresException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyTrustStoresException{} + 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_deserializeDocumentTooManyTrustStoresException(&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_deserializeErrorTooManyUniqueTargetGroupsPerLoadBalancerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyUniqueTargetGroupsPerLoadBalancerException{} + 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_deserializeDocumentTooManyUniqueTargetGroupsPerLoadBalancerException(&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_deserializeErrorTrustStoreInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TrustStoreInUseException{} + 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_deserializeDocumentTrustStoreInUseException(&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_deserializeErrorTrustStoreNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TrustStoreNotFoundException{} + 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_deserializeDocumentTrustStoreNotFoundException(&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_deserializeErrorTrustStoreNotReadyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TrustStoreNotReadyException{} + 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_deserializeDocumentTrustStoreNotReadyException(&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_deserializeErrorUnsupportedProtocolException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.UnsupportedProtocolException{} + 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_deserializeDocumentUnsupportedProtocolException(&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_deserializeDocumentAction(v **types.Action, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Action + if *v == nil { + sv = &types.Action{} + } 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("AuthenticateCognitoConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAuthenticateCognitoActionConfig(&sv.AuthenticateCognitoConfig, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("AuthenticateOidcConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAuthenticateOidcActionConfig(&sv.AuthenticateOidcConfig, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("FixedResponseConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentFixedResponseActionConfig(&sv.FixedResponseConfig, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ForwardConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentForwardActionConfig(&sv.ForwardConfig, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Order", 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.Order = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("RedirectConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRedirectActionConfig(&sv.RedirectConfig, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TargetGroupArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TargetGroupArn = ptr.String(xtv) + } + + case strings.EqualFold("Type", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Type = types.ActionTypeEnum(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_deserializeDocumentActions(v *[]types.Action, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Action + if *v == nil { + sv = make([]types.Action, 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.Action + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentAction(&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_deserializeDocumentActionsUnwrapped(v *[]types.Action, decoder smithyxml.NodeDecoder) error { + var sv []types.Action + if *v == nil { + sv = make([]types.Action, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Action + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentAction(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentAllocationIdNotFoundException(v **types.AllocationIdNotFoundException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AllocationIdNotFoundException + if *v == nil { + sv = &types.AllocationIdNotFoundException{} + } 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_deserializeDocumentAlpnPolicyName(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_deserializeDocumentAlpnPolicyNameUnwrapped(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_deserializeDocumentALPNPolicyNotSupportedException(v **types.ALPNPolicyNotSupportedException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ALPNPolicyNotSupportedException + if *v == nil { + sv = &types.ALPNPolicyNotSupportedException{} + } 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_deserializeDocumentAnomalyDetection(v **types.AnomalyDetection, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AnomalyDetection + if *v == nil { + sv = &types.AnomalyDetection{} + } 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("MitigationInEffect", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MitigationInEffect = types.MitigationInEffectEnum(xtv) + } + + case strings.EqualFold("Result", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Result = types.AnomalyResultEnum(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_deserializeDocumentAuthenticateCognitoActionAuthenticationRequestExtraParams(v *map[string]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv map[string]string + if *v == nil { + sv = make(map[string]string, 0) + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("entry", t.Name.Local): + entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAuthenticateCognitoActionAuthenticationRequestExtraParamsUnwrapped(&sv, entryDecoder); err != nil { + return err + } + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAuthenticateCognitoActionAuthenticationRequestExtraParamsUnwrapped(v *map[string]string, decoder smithyxml.NodeDecoder) error { + var sv map[string]string + if *v == nil { + sv = make(map[string]string, 0) + } else { + sv = *v + } + + var ek string + var ev string + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + sv[ek] = ev + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("key", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + ek = xtv + } + + case strings.EqualFold("value", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + ev = xtv + } + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentAuthenticateCognitoActionConfig(v **types.AuthenticateCognitoActionConfig, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AuthenticateCognitoActionConfig + if *v == nil { + sv = &types.AuthenticateCognitoActionConfig{} + } 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("AuthenticationRequestExtraParams", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAuthenticateCognitoActionAuthenticationRequestExtraParams(&sv.AuthenticationRequestExtraParams, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("OnUnauthenticatedRequest", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OnUnauthenticatedRequest = types.AuthenticateCognitoActionConditionalBehaviorEnum(xtv) + } + + case strings.EqualFold("Scope", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Scope = ptr.String(xtv) + } + + case strings.EqualFold("SessionCookieName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SessionCookieName = ptr.String(xtv) + } + + case strings.EqualFold("SessionTimeout", 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.SessionTimeout = ptr.Int64(i64) + } + + case strings.EqualFold("UserPoolArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.UserPoolArn = ptr.String(xtv) + } + + case strings.EqualFold("UserPoolClientId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.UserPoolClientId = ptr.String(xtv) + } + + case strings.EqualFold("UserPoolDomain", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.UserPoolDomain = 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_deserializeDocumentAuthenticateOidcActionAuthenticationRequestExtraParams(v *map[string]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv map[string]string + if *v == nil { + sv = make(map[string]string, 0) + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("entry", t.Name.Local): + entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAuthenticateOidcActionAuthenticationRequestExtraParamsUnwrapped(&sv, entryDecoder); err != nil { + return err + } + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAuthenticateOidcActionAuthenticationRequestExtraParamsUnwrapped(v *map[string]string, decoder smithyxml.NodeDecoder) error { + var sv map[string]string + if *v == nil { + sv = make(map[string]string, 0) + } else { + sv = *v + } + + var ek string + var ev string + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + sv[ek] = ev + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("key", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + ek = xtv + } + + case strings.EqualFold("value", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + ev = xtv + } + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentAuthenticateOidcActionConfig(v **types.AuthenticateOidcActionConfig, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AuthenticateOidcActionConfig + if *v == nil { + sv = &types.AuthenticateOidcActionConfig{} + } 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("AuthenticationRequestExtraParams", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAuthenticateOidcActionAuthenticationRequestExtraParams(&sv.AuthenticationRequestExtraParams, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("AuthorizationEndpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AuthorizationEndpoint = ptr.String(xtv) + } + + case strings.EqualFold("ClientId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ClientId = ptr.String(xtv) + } + + case strings.EqualFold("ClientSecret", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ClientSecret = ptr.String(xtv) + } + + case strings.EqualFold("Issuer", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Issuer = ptr.String(xtv) + } + + case strings.EqualFold("OnUnauthenticatedRequest", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OnUnauthenticatedRequest = types.AuthenticateOidcActionConditionalBehaviorEnum(xtv) + } + + case strings.EqualFold("Scope", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Scope = ptr.String(xtv) + } + + case strings.EqualFold("SessionCookieName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SessionCookieName = ptr.String(xtv) + } + + case strings.EqualFold("SessionTimeout", 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.SessionTimeout = ptr.Int64(i64) + } + + case strings.EqualFold("TokenEndpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TokenEndpoint = ptr.String(xtv) + } + + case strings.EqualFold("UseExistingClientSecret", 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 AuthenticateOidcActionUseExistingClientSecret to be of type *bool, got %T instead", val) + } + sv.UseExistingClientSecret = ptr.Bool(xtv) + } + + case strings.EqualFold("UserInfoEndpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.UserInfoEndpoint = 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_deserializeDocumentAvailabilityZone(v **types.AvailabilityZone, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AvailabilityZone + if *v == nil { + sv = &types.AvailabilityZone{} + } 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("LoadBalancerAddresses", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLoadBalancerAddresses(&sv.LoadBalancerAddresses, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("OutpostId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OutpostId = 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("ZoneName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ZoneName = 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_deserializeDocumentAvailabilityZoneNotSupportedException(v **types.AvailabilityZoneNotSupportedException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AvailabilityZoneNotSupportedException + if *v == nil { + sv = &types.AvailabilityZoneNotSupportedException{} + } 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_deserializeDocumentAvailabilityZones(v *[]types.AvailabilityZone, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.AvailabilityZone + if *v == nil { + sv = make([]types.AvailabilityZone, 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.AvailabilityZone + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentAvailabilityZone(&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_deserializeDocumentAvailabilityZonesUnwrapped(v *[]types.AvailabilityZone, decoder smithyxml.NodeDecoder) error { + var sv []types.AvailabilityZone + if *v == nil { + sv = make([]types.AvailabilityZone, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.AvailabilityZone + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentAvailabilityZone(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentCaCertificatesBundleNotFoundException(v **types.CaCertificatesBundleNotFoundException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CaCertificatesBundleNotFoundException + if *v == nil { + sv = &types.CaCertificatesBundleNotFoundException{} + } 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_deserializeDocumentCertificate(v **types.Certificate, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Certificate + if *v == nil { + sv = &types.Certificate{} + } 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("CertificateArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CertificateArn = ptr.String(xtv) + } + + case strings.EqualFold("IsDefault", 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 Default to be of type *bool, got %T instead", val) + } + sv.IsDefault = ptr.Bool(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_deserializeDocumentCertificateList(v *[]types.Certificate, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Certificate + if *v == nil { + sv = make([]types.Certificate, 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.Certificate + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentCertificate(&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_deserializeDocumentCertificateListUnwrapped(v *[]types.Certificate, decoder smithyxml.NodeDecoder) error { + var sv []types.Certificate + if *v == nil { + sv = make([]types.Certificate, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Certificate + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentCertificate(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentCertificateNotFoundException(v **types.CertificateNotFoundException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CertificateNotFoundException + if *v == nil { + sv = &types.CertificateNotFoundException{} + } 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_deserializeDocumentCipher(v **types.Cipher, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Cipher + if *v == nil { + sv = &types.Cipher{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("Priority", 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.Priority = 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 awsAwsquery_deserializeDocumentCiphers(v *[]types.Cipher, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Cipher + if *v == nil { + sv = make([]types.Cipher, 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.Cipher + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentCipher(&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_deserializeDocumentCiphersUnwrapped(v *[]types.Cipher, decoder smithyxml.NodeDecoder) error { + var sv []types.Cipher + if *v == nil { + sv = make([]types.Cipher, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Cipher + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentCipher(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) } *v = sv return nil } -func awsAwsquery_deserializeDocumentAllocationIdNotFoundException(v **types.AllocationIdNotFoundException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentDescribeTrustStoreRevocation(v **types.DescribeTrustStoreRevocation, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.AllocationIdNotFoundException + var sv *types.DescribeTrustStoreRevocation if *v == nil { - sv = &types.AllocationIdNotFoundException{} + sv = &types.DescribeTrustStoreRevocation{} } else { sv = *v } @@ -5866,7 +8821,7 @@ func awsAwsquery_deserializeDocumentAllocationIdNotFoundException(v **types.Allo originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): + case strings.EqualFold("NumberOfRevokedEntries", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -5876,7 +8831,54 @@ func awsAwsquery_deserializeDocumentAllocationIdNotFoundException(v **types.Allo } { xtv := string(val) - sv.Message = ptr.String(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.NumberOfRevokedEntries = ptr.Int64(i64) + } + + case strings.EqualFold("RevocationId", 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.RevocationId = ptr.Int64(i64) + } + + case strings.EqualFold("RevocationType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.RevocationType = types.RevocationType(xtv) + } + + case strings.EqualFold("TrustStoreArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TrustStoreArn = ptr.String(xtv) } default: @@ -5893,13 +8895,13 @@ func awsAwsquery_deserializeDocumentAllocationIdNotFoundException(v **types.Allo return nil } -func awsAwsquery_deserializeDocumentAlpnPolicyName(v *[]string, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentDescribeTrustStoreRevocationResponse(v *[]types.DescribeTrustStoreRevocation, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []string + var sv []types.DescribeTrustStoreRevocation if *v == nil { - sv = make([]string, 0) + sv = make([]types.DescribeTrustStoreRevocation, 0) } else { sv = *v } @@ -5913,22 +8915,15 @@ func awsAwsquery_deserializeDocumentAlpnPolicyName(v *[]string, decoder smithyxm 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 { + var col types.DescribeTrustStoreRevocation + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDescribeTrustStoreRevocation(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } + col = *destAddr sv = append(sv, col) default: @@ -5944,42 +8939,37 @@ func awsAwsquery_deserializeDocumentAlpnPolicyName(v *[]string, decoder smithyxm return nil } -func awsAwsquery_deserializeDocumentAlpnPolicyNameUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string +func awsAwsquery_deserializeDocumentDescribeTrustStoreRevocationResponseUnwrapped(v *[]types.DescribeTrustStoreRevocation, decoder smithyxml.NodeDecoder) error { + var sv []types.DescribeTrustStoreRevocation if *v == nil { - sv = make([]string, 0) + sv = make([]types.DescribeTrustStoreRevocation, 0) } else { sv = *v } switch { default: - var mv string + var mv types.DescribeTrustStoreRevocation t := decoder.StartEl _ = t - val, err := decoder.Value() - if err != nil { + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDescribeTrustStoreRevocation(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } + mv = *destAddr sv = append(sv, mv) } *v = sv return nil } -func awsAwsquery_deserializeDocumentALPNPolicyNotSupportedException(v **types.ALPNPolicyNotSupportedException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentDuplicateListenerException(v **types.DuplicateListenerException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.ALPNPolicyNotSupportedException + var sv *types.DuplicateListenerException if *v == nil { - sv = &types.ALPNPolicyNotSupportedException{} + sv = &types.DuplicateListenerException{} } else { sv = *v } @@ -6022,13 +9012,13 @@ func awsAwsquery_deserializeDocumentALPNPolicyNotSupportedException(v **types.AL return nil } -func awsAwsquery_deserializeDocumentAuthenticateCognitoActionAuthenticationRequestExtraParams(v *map[string]string, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentDuplicateLoadBalancerNameException(v **types.DuplicateLoadBalancerNameException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv map[string]string + var sv *types.DuplicateLoadBalancerNameException if *v == nil { - sv = make(map[string]string, 0) + sv = &types.DuplicateLoadBalancerNameException{} } else { sv = *v } @@ -6041,61 +9031,59 @@ func awsAwsquery_deserializeDocumentAuthenticateCognitoActionAuthenticationReque if done { break } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("entry", t.Name.Local): - entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentAuthenticateCognitoActionAuthenticationRequestExtraParamsUnwrapped(&sv, entryDecoder); err != nil { + 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_deserializeDocumentAuthenticateCognitoActionAuthenticationRequestExtraParamsUnwrapped(v *map[string]string, decoder smithyxml.NodeDecoder) error { - var sv map[string]string +func awsAwsquery_deserializeDocumentDuplicateTagKeysException(v **types.DuplicateTagKeysException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DuplicateTagKeysException if *v == nil { - sv = make(map[string]string, 0) + sv = &types.DuplicateTagKeysException{} } else { sv = *v } - var ek string - var ev string for { t, done, err := decoder.Token() if err != nil { return err } if done { - sv[ek] = ev break } originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("key", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - ek = xtv - } - - case strings.EqualFold("value", t.Name.Local): + case strings.EqualFold("Message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -6105,10 +9093,11 @@ func awsAwsquery_deserializeDocumentAuthenticateCognitoActionAuthenticationReque } { xtv := string(val) - ev = xtv + sv.Message = ptr.String(xtv) } default: + // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -6120,13 +9109,14 @@ func awsAwsquery_deserializeDocumentAuthenticateCognitoActionAuthenticationReque *v = sv return nil } -func awsAwsquery_deserializeDocumentAuthenticateCognitoActionConfig(v **types.AuthenticateCognitoActionConfig, decoder smithyxml.NodeDecoder) error { + +func awsAwsquery_deserializeDocumentDuplicateTargetGroupNameException(v **types.DuplicateTargetGroupNameException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.AuthenticateCognitoActionConfig + var sv *types.DuplicateTargetGroupNameException if *v == nil { - sv = &types.AuthenticateCognitoActionConfig{} + sv = &types.DuplicateTargetGroupNameException{} } else { sv = *v } @@ -6141,96 +9131,8 @@ func awsAwsquery_deserializeDocumentAuthenticateCognitoActionConfig(v **types.Au } originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("AuthenticationRequestExtraParams", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentAuthenticateCognitoActionAuthenticationRequestExtraParams(&sv.AuthenticationRequestExtraParams, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("OnUnauthenticatedRequest", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OnUnauthenticatedRequest = types.AuthenticateCognitoActionConditionalBehaviorEnum(xtv) - } - - case strings.EqualFold("Scope", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Scope = ptr.String(xtv) - } - - case strings.EqualFold("SessionCookieName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SessionCookieName = ptr.String(xtv) - } - - case strings.EqualFold("SessionTimeout", 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.SessionTimeout = ptr.Int64(i64) - } - - case strings.EqualFold("UserPoolArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UserPoolArn = ptr.String(xtv) - } - - case strings.EqualFold("UserPoolClientId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.UserPoolClientId = ptr.String(xtv) - } - - case strings.EqualFold("UserPoolDomain", t.Name.Local): + switch { + case strings.EqualFold("Message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -6240,7 +9142,7 @@ func awsAwsquery_deserializeDocumentAuthenticateCognitoActionConfig(v **types.Au } { xtv := string(val) - sv.UserPoolDomain = ptr.String(xtv) + sv.Message = ptr.String(xtv) } default: @@ -6257,13 +9159,13 @@ func awsAwsquery_deserializeDocumentAuthenticateCognitoActionConfig(v **types.Au return nil } -func awsAwsquery_deserializeDocumentAuthenticateOidcActionAuthenticationRequestExtraParams(v *map[string]string, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentDuplicateTrustStoreNameException(v **types.DuplicateTrustStoreNameException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv map[string]string + var sv *types.DuplicateTrustStoreNameException if *v == nil { - sv = make(map[string]string, 0) + sv = &types.DuplicateTrustStoreNameException{} } else { sv = *v } @@ -6276,48 +9178,59 @@ func awsAwsquery_deserializeDocumentAuthenticateOidcActionAuthenticationRequestE if done { break } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("entry", t.Name.Local): - entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentAuthenticateOidcActionAuthenticationRequestExtraParamsUnwrapped(&sv, entryDecoder); err != nil { + 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_deserializeDocumentAuthenticateOidcActionAuthenticationRequestExtraParamsUnwrapped(v *map[string]string, decoder smithyxml.NodeDecoder) error { - var sv map[string]string +func awsAwsquery_deserializeDocumentFixedResponseActionConfig(v **types.FixedResponseActionConfig, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.FixedResponseActionConfig if *v == nil { - sv = make(map[string]string, 0) + sv = &types.FixedResponseActionConfig{} } else { sv = *v } - var ek string - var ev string for { t, done, err := decoder.Token() if err != nil { return err } if done { - sv[ek] = ev break } originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("key", t.Name.Local): + case strings.EqualFold("ContentType", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -6327,10 +9240,10 @@ func awsAwsquery_deserializeDocumentAuthenticateOidcActionAuthenticationRequestE } { xtv := string(val) - ek = xtv + sv.ContentType = ptr.String(xtv) } - case strings.EqualFold("value", t.Name.Local): + case strings.EqualFold("MessageBody", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -6340,10 +9253,24 @@ func awsAwsquery_deserializeDocumentAuthenticateOidcActionAuthenticationRequestE } { xtv := string(val) - ev = xtv + sv.MessageBody = ptr.String(xtv) + } + + case strings.EqualFold("StatusCode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StatusCode = ptr.String(xtv) } default: + // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -6355,13 +9282,14 @@ func awsAwsquery_deserializeDocumentAuthenticateOidcActionAuthenticationRequestE *v = sv return nil } -func awsAwsquery_deserializeDocumentAuthenticateOidcActionConfig(v **types.AuthenticateOidcActionConfig, decoder smithyxml.NodeDecoder) error { + +func awsAwsquery_deserializeDocumentForwardActionConfig(v **types.ForwardActionConfig, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.AuthenticateOidcActionConfig + var sv *types.ForwardActionConfig if *v == nil { - sv = &types.AuthenticateOidcActionConfig{} + sv = &types.ForwardActionConfig{} } else { sv = *v } @@ -6377,65 +9305,55 @@ func awsAwsquery_deserializeDocumentAuthenticateOidcActionConfig(v **types.Authe originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("AuthenticationRequestExtraParams", t.Name.Local): + case strings.EqualFold("TargetGroups", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentAuthenticateOidcActionAuthenticationRequestExtraParams(&sv.AuthenticationRequestExtraParams, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTargetGroupList(&sv.TargetGroups, nodeDecoder); err != nil { return err } - case strings.EqualFold("AuthorizationEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("TargetGroupStickinessConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTargetGroupStickinessConfig(&sv.TargetGroupStickinessConfig, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.AuthorizationEndpoint = ptr.String(xtv) - } - case strings.EqualFold("ClientId", 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.ClientId = ptr.String(xtv) - } - case strings.EqualFold("ClientSecret", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ClientSecret = ptr.String(xtv) - } + } + decoder = originalDecoder + } + *v = sv + return nil +} - case strings.EqualFold("Issuer", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Issuer = ptr.String(xtv) - } +func awsAwsquery_deserializeDocumentHealthUnavailableException(v **types.HealthUnavailableException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.HealthUnavailableException + if *v == nil { + sv = &types.HealthUnavailableException{} + } else { + sv = *v + } - case strings.EqualFold("OnUnauthenticatedRequest", t.Name.Local): + 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 @@ -6445,66 +9363,88 @@ func awsAwsquery_deserializeDocumentAuthenticateOidcActionConfig(v **types.Authe } { xtv := string(val) - sv.OnUnauthenticatedRequest = types.AuthenticateOidcActionConditionalBehaviorEnum(xtv) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("Scope", 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.Scope = ptr.String(xtv) - } - case strings.EqualFold("SessionCookieName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SessionCookieName = ptr.String(xtv) - } + } + decoder = originalDecoder + } + *v = sv + return nil +} - case strings.EqualFold("SessionTimeout", t.Name.Local): - val, err := decoder.Value() - if err != nil { +func awsAwsquery_deserializeDocumentHostHeaderConditionConfig(v **types.HostHeaderConditionConfig, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.HostHeaderConditionConfig + if *v == nil { + sv = &types.HostHeaderConditionConfig{} + } 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("Values", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentListOfString(&sv.Values, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.SessionTimeout = ptr.Int64(i64) - } - case strings.EqualFold("TokenEndpoint", 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.TokenEndpoint = ptr.String(xtv) - } - case strings.EqualFold("UseExistingClientSecret", t.Name.Local): + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentHttpHeaderConditionConfig(v **types.HttpHeaderConditionConfig, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.HttpHeaderConditionConfig + if *v == nil { + sv = &types.HttpHeaderConditionConfig{} + } 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("HttpHeaderName", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -6513,25 +9453,15 @@ func awsAwsquery_deserializeDocumentAuthenticateOidcActionConfig(v **types.Authe break } { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected AuthenticateOidcActionUseExistingClientSecret to be of type *bool, got %T instead", val) - } - sv.UseExistingClientSecret = ptr.Bool(xtv) + xtv := string(val) + sv.HttpHeaderName = ptr.String(xtv) } - case strings.EqualFold("UserInfoEndpoint", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("Values", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentListOfString(&sv.Values, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.UserInfoEndpoint = ptr.String(xtv) - } default: // Do nothing and ignore the unexpected tag element @@ -6547,13 +9477,13 @@ func awsAwsquery_deserializeDocumentAuthenticateOidcActionConfig(v **types.Authe return nil } -func awsAwsquery_deserializeDocumentAvailabilityZone(v **types.AvailabilityZone, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentHttpRequestMethodConditionConfig(v **types.HttpRequestMethodConditionConfig, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.AvailabilityZone + var sv *types.HttpRequestMethodConditionConfig if *v == nil { - sv = &types.AvailabilityZone{} + sv = &types.HttpRequestMethodConditionConfig{} } else { sv = *v } @@ -6569,26 +9499,49 @@ func awsAwsquery_deserializeDocumentAvailabilityZone(v **types.AvailabilityZone, originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("LoadBalancerAddresses", t.Name.Local): + case strings.EqualFold("Values", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentLoadBalancerAddresses(&sv.LoadBalancerAddresses, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentListOfString(&sv.Values, nodeDecoder); err != nil { return err } - case strings.EqualFold("OutpostId", 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.OutpostId = ptr.String(xtv) - } - case strings.EqualFold("SubnetId", t.Name.Local): + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIncompatibleProtocolsException(v **types.IncompatibleProtocolsException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IncompatibleProtocolsException + if *v == nil { + sv = &types.IncompatibleProtocolsException{} + } 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 @@ -6598,10 +9551,46 @@ func awsAwsquery_deserializeDocumentAvailabilityZone(v **types.AvailabilityZone, } { xtv := string(val) - sv.SubnetId = ptr.String(xtv) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("ZoneName", t.Name.Local): + 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_deserializeDocumentInvalidCaCertificatesBundleException(v **types.InvalidCaCertificatesBundleException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidCaCertificatesBundleException + if *v == nil { + sv = &types.InvalidCaCertificatesBundleException{} + } 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 @@ -6611,7 +9600,7 @@ func awsAwsquery_deserializeDocumentAvailabilityZone(v **types.AvailabilityZone, } { xtv := string(val) - sv.ZoneName = ptr.String(xtv) + sv.Message = ptr.String(xtv) } default: @@ -6628,13 +9617,13 @@ func awsAwsquery_deserializeDocumentAvailabilityZone(v **types.AvailabilityZone, return nil } -func awsAwsquery_deserializeDocumentAvailabilityZoneNotSupportedException(v **types.AvailabilityZoneNotSupportedException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentInvalidConfigurationRequestException(v **types.InvalidConfigurationRequestException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.AvailabilityZoneNotSupportedException + var sv *types.InvalidConfigurationRequestException if *v == nil { - sv = &types.AvailabilityZoneNotSupportedException{} + sv = &types.InvalidConfigurationRequestException{} } else { sv = *v } @@ -6677,18 +9666,17 @@ func awsAwsquery_deserializeDocumentAvailabilityZoneNotSupportedException(v **ty return nil } -func awsAwsquery_deserializeDocumentAvailabilityZones(v *[]types.AvailabilityZone, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentInvalidLoadBalancerActionException(v **types.InvalidLoadBalancerActionException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.AvailabilityZone + var sv *types.InvalidLoadBalancerActionException if *v == nil { - sv = make([]types.AvailabilityZone, 0) + sv = &types.InvalidLoadBalancerActionException{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -6697,18 +9685,24 @@ func awsAwsquery_deserializeDocumentAvailabilityZones(v *[]types.AvailabilityZon if done { break } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("member", t.Name.Local): - var col types.AvailabilityZone - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsAwsquery_deserializeDocumentAvailabilityZone(&destAddr, nodeDecoder); err != nil { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - col = *destAddr - sv = append(sv, col) + 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 @@ -6721,37 +9715,62 @@ func awsAwsquery_deserializeDocumentAvailabilityZones(v *[]types.AvailabilityZon return nil } -func awsAwsquery_deserializeDocumentAvailabilityZonesUnwrapped(v *[]types.AvailabilityZone, decoder smithyxml.NodeDecoder) error { - var sv []types.AvailabilityZone +func awsAwsquery_deserializeDocumentInvalidRevocationContentException(v **types.InvalidRevocationContentException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidRevocationContentException if *v == nil { - sv = make([]types.AvailabilityZone, 0) + sv = &types.InvalidRevocationContentException{} } else { sv = *v } - switch { - default: - var mv types.AvailabilityZone - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsAwsquery_deserializeDocumentAvailabilityZone(&destAddr, nodeDecoder); err != nil { + for { + t, done, err := decoder.Token() + if err != nil { return err } - mv = *destAddr - sv = append(sv, mv) + 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_deserializeDocumentCertificate(v **types.Certificate, decoder smithyxml.NodeDecoder) error { + +func awsAwsquery_deserializeDocumentInvalidSchemeException(v **types.InvalidSchemeException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.Certificate + var sv *types.InvalidSchemeException if *v == nil { - sv = &types.Certificate{} + sv = &types.InvalidSchemeException{} } else { sv = *v } @@ -6767,7 +9786,7 @@ func awsAwsquery_deserializeDocumentCertificate(v **types.Certificate, decoder s originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("CertificateArn", t.Name.Local): + case strings.EqualFold("Message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -6777,10 +9796,46 @@ func awsAwsquery_deserializeDocumentCertificate(v **types.Certificate, decoder s } { xtv := string(val) - sv.CertificateArn = ptr.String(xtv) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("IsDefault", t.Name.Local): + 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_deserializeDocumentInvalidSecurityGroupException(v **types.InvalidSecurityGroupException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidSecurityGroupException + if *v == nil { + sv = &types.InvalidSecurityGroupException{} + } 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 @@ -6789,11 +9844,8 @@ func awsAwsquery_deserializeDocumentCertificate(v **types.Certificate, decoder s break } { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Default to be of type *bool, got %T instead", val) - } - sv.IsDefault = ptr.Bool(xtv) + xtv := string(val) + sv.Message = ptr.String(xtv) } default: @@ -6810,18 +9862,17 @@ func awsAwsquery_deserializeDocumentCertificate(v **types.Certificate, decoder s return nil } -func awsAwsquery_deserializeDocumentCertificateList(v *[]types.Certificate, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentInvalidSubnetException(v **types.InvalidSubnetException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.Certificate + var sv *types.InvalidSubnetException if *v == nil { - sv = make([]types.Certificate, 0) + sv = &types.InvalidSubnetException{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -6830,18 +9881,24 @@ func awsAwsquery_deserializeDocumentCertificateList(v *[]types.Certificate, deco if done { break } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("member", t.Name.Local): - var col types.Certificate - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsAwsquery_deserializeDocumentCertificate(&destAddr, nodeDecoder); err != nil { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - col = *destAddr - sv = append(sv, col) + 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 @@ -6854,37 +9911,13 @@ func awsAwsquery_deserializeDocumentCertificateList(v *[]types.Certificate, deco return nil } -func awsAwsquery_deserializeDocumentCertificateListUnwrapped(v *[]types.Certificate, decoder smithyxml.NodeDecoder) error { - var sv []types.Certificate - if *v == nil { - sv = make([]types.Certificate, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Certificate - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsAwsquery_deserializeDocumentCertificate(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsAwsquery_deserializeDocumentCertificateNotFoundException(v **types.CertificateNotFoundException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentInvalidTargetException(v **types.InvalidTargetException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.CertificateNotFoundException + var sv *types.InvalidTargetException if *v == nil { - sv = &types.CertificateNotFoundException{} + sv = &types.InvalidTargetException{} } else { sv = *v } @@ -6927,13 +9960,13 @@ func awsAwsquery_deserializeDocumentCertificateNotFoundException(v **types.Certi return nil } -func awsAwsquery_deserializeDocumentCipher(v **types.Cipher, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentLimit(v **types.Limit, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.Cipher + var sv *types.Limit if *v == nil { - sv = &types.Cipher{} + sv = &types.Limit{} } else { sv = *v } @@ -6949,7 +9982,7 @@ func awsAwsquery_deserializeDocumentCipher(v **types.Cipher, decoder smithyxml.N originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Name", t.Name.Local): + case strings.EqualFold("Max", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -6959,10 +9992,10 @@ func awsAwsquery_deserializeDocumentCipher(v **types.Cipher, decoder smithyxml.N } { xtv := string(val) - sv.Name = ptr.String(xtv) + sv.Max = ptr.String(xtv) } - case strings.EqualFold("Priority", t.Name.Local): + case strings.EqualFold("Name", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -6972,11 +10005,7 @@ func awsAwsquery_deserializeDocumentCipher(v **types.Cipher, decoder smithyxml.N } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Priority = ptr.Int32(int32(i64)) + sv.Name = ptr.String(xtv) } default: @@ -6993,13 +10022,13 @@ func awsAwsquery_deserializeDocumentCipher(v **types.Cipher, decoder smithyxml.N return nil } -func awsAwsquery_deserializeDocumentCiphers(v *[]types.Cipher, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentLimits(v *[]types.Limit, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.Cipher + var sv []types.Limit if *v == nil { - sv = make([]types.Cipher, 0) + sv = make([]types.Limit, 0) } else { sv = *v } @@ -7015,10 +10044,10 @@ func awsAwsquery_deserializeDocumentCiphers(v *[]types.Cipher, decoder smithyxml } switch { case strings.EqualFold("member", t.Name.Local): - var col types.Cipher + var col types.Limit nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col - if err := awsAwsquery_deserializeDocumentCipher(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentLimit(&destAddr, nodeDecoder); err != nil { return err } col = *destAddr @@ -7037,22 +10066,22 @@ func awsAwsquery_deserializeDocumentCiphers(v *[]types.Cipher, decoder smithyxml return nil } -func awsAwsquery_deserializeDocumentCiphersUnwrapped(v *[]types.Cipher, decoder smithyxml.NodeDecoder) error { - var sv []types.Cipher +func awsAwsquery_deserializeDocumentLimitsUnwrapped(v *[]types.Limit, decoder smithyxml.NodeDecoder) error { + var sv []types.Limit if *v == nil { - sv = make([]types.Cipher, 0) + sv = make([]types.Limit, 0) } else { sv = *v } switch { default: - var mv types.Cipher + var mv types.Limit t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv - if err := awsAwsquery_deserializeDocumentCipher(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentLimit(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr @@ -7061,13 +10090,13 @@ func awsAwsquery_deserializeDocumentCiphersUnwrapped(v *[]types.Cipher, decoder *v = sv return nil } -func awsAwsquery_deserializeDocumentDuplicateListenerException(v **types.DuplicateListenerException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentListener(v **types.Listener, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.DuplicateListenerException + var sv *types.Listener if *v == nil { - sv = &types.DuplicateListenerException{} + sv = &types.Listener{} } else { sv = *v } @@ -7083,7 +10112,25 @@ func awsAwsquery_deserializeDocumentDuplicateListenerException(v **types.Duplica originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): + case strings.EqualFold("AlpnPolicy", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAlpnPolicyName(&sv.AlpnPolicy, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Certificates", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCertificateList(&sv.Certificates, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("DefaultActions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentActions(&sv.DefaultActions, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ListenerArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -7093,7 +10140,69 @@ func awsAwsquery_deserializeDocumentDuplicateListenerException(v **types.Duplica } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.ListenerArn = ptr.String(xtv) + } + + case strings.EqualFold("LoadBalancerArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LoadBalancerArn = ptr.String(xtv) + } + + case strings.EqualFold("MutualAuthentication", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentMutualAuthenticationAttributes(&sv.MutualAuthentication, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Port", 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.Port = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Protocol", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Protocol = types.ProtocolEnum(xtv) + } + + case strings.EqualFold("SslPolicy", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SslPolicy = ptr.String(xtv) } default: @@ -7110,13 +10219,13 @@ func awsAwsquery_deserializeDocumentDuplicateListenerException(v **types.Duplica return nil } -func awsAwsquery_deserializeDocumentDuplicateLoadBalancerNameException(v **types.DuplicateLoadBalancerNameException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentListenerNotFoundException(v **types.ListenerNotFoundException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.DuplicateLoadBalancerNameException + var sv *types.ListenerNotFoundException if *v == nil { - sv = &types.DuplicateLoadBalancerNameException{} + sv = &types.ListenerNotFoundException{} } else { sv = *v } @@ -7159,17 +10268,86 @@ func awsAwsquery_deserializeDocumentDuplicateLoadBalancerNameException(v **types return nil } -func awsAwsquery_deserializeDocumentDuplicateTagKeysException(v **types.DuplicateTagKeysException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentListeners(v *[]types.Listener, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Listener + if *v == nil { + sv = make([]types.Listener, 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.Listener + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentListener(&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_deserializeDocumentListenersUnwrapped(v *[]types.Listener, decoder smithyxml.NodeDecoder) error { + var sv []types.Listener + if *v == nil { + sv = make([]types.Listener, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Listener + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentListener(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentListOfString(v *[]string, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.DuplicateTagKeysException + var sv []string if *v == nil { - sv = &types.DuplicateTagKeysException{} + sv = make([]string, 0) } else { sv = *v } + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -7178,10 +10356,11 @@ func awsAwsquery_deserializeDocumentDuplicateTagKeysException(v **types.Duplicat if done { break } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder switch { - case strings.EqualFold("Message", t.Name.Local): + case strings.EqualFold("member", t.Name.Local): + var col string val, err := decoder.Value() if err != nil { return err @@ -7191,11 +10370,11 @@ func awsAwsquery_deserializeDocumentDuplicateTagKeysException(v **types.Duplicat } { xtv := string(val) - sv.Message = ptr.String(xtv) + col = xtv } + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -7208,13 +10387,42 @@ func awsAwsquery_deserializeDocumentDuplicateTagKeysException(v **types.Duplicat return nil } -func awsAwsquery_deserializeDocumentDuplicateTargetGroupNameException(v **types.DuplicateTargetGroupNameException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentListOfStringUnwrapped(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_deserializeDocumentLoadBalancer(v **types.LoadBalancer, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.DuplicateTargetGroupNameException + var sv *types.LoadBalancer if *v == nil { - sv = &types.DuplicateTargetGroupNameException{} + sv = &types.LoadBalancer{} } else { sv = *v } @@ -7230,7 +10438,13 @@ func awsAwsquery_deserializeDocumentDuplicateTargetGroupNameException(v **types. originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): + case strings.EqualFold("AvailabilityZones", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAvailabilityZones(&sv.AvailabilityZones, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("CanonicalHostedZoneId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -7240,46 +10454,53 @@ func awsAwsquery_deserializeDocumentDuplicateTargetGroupNameException(v **types. } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.CanonicalHostedZoneId = ptr.String(xtv) } - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() + case strings.EqualFold("CreatedTime", 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.CreatedTime = ptr.Time(t) + } - } - decoder = originalDecoder - } - *v = sv - return nil -} + case strings.EqualFold("CustomerOwnedIpv4Pool", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CustomerOwnedIpv4Pool = ptr.String(xtv) + } -func awsAwsquery_deserializeDocumentFixedResponseActionConfig(v **types.FixedResponseActionConfig, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.FixedResponseActionConfig - if *v == nil { - sv = &types.FixedResponseActionConfig{} - } else { - sv = *v - } + case strings.EqualFold("DNSName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DNSName = ptr.String(xtv) + } - 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("ContentType", t.Name.Local): + case strings.EqualFold("EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -7289,10 +10510,10 @@ func awsAwsquery_deserializeDocumentFixedResponseActionConfig(v **types.FixedRes } { xtv := string(val) - sv.ContentType = ptr.String(xtv) + sv.EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic = ptr.String(xtv) } - case strings.EqualFold("MessageBody", t.Name.Local): + case strings.EqualFold("IpAddressType", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -7302,10 +10523,10 @@ func awsAwsquery_deserializeDocumentFixedResponseActionConfig(v **types.FixedRes } { xtv := string(val) - sv.MessageBody = ptr.String(xtv) + sv.IpAddressType = types.IpAddressType(xtv) } - case strings.EqualFold("StatusCode", t.Name.Local): + case strings.EqualFold("LoadBalancerArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -7315,7 +10536,71 @@ func awsAwsquery_deserializeDocumentFixedResponseActionConfig(v **types.FixedRes } { xtv := string(val) - sv.StatusCode = ptr.String(xtv) + sv.LoadBalancerArn = ptr.String(xtv) + } + + case strings.EqualFold("LoadBalancerName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LoadBalancerName = ptr.String(xtv) + } + + case strings.EqualFold("Scheme", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Scheme = types.LoadBalancerSchemeEnum(xtv) + } + + case strings.EqualFold("SecurityGroups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSecurityGroups(&sv.SecurityGroups, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("State", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLoadBalancerState(&sv.State, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Type", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Type = types.LoadBalancerTypeEnum(xtv) + } + + 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: @@ -7332,13 +10617,13 @@ func awsAwsquery_deserializeDocumentFixedResponseActionConfig(v **types.FixedRes return nil } -func awsAwsquery_deserializeDocumentForwardActionConfig(v **types.ForwardActionConfig, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentLoadBalancerAddress(v **types.LoadBalancerAddress, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.ForwardActionConfig + var sv *types.LoadBalancerAddress if *v == nil { - sv = &types.ForwardActionConfig{} + sv = &types.LoadBalancerAddress{} } else { sv = *v } @@ -7354,55 +10639,46 @@ func awsAwsquery_deserializeDocumentForwardActionConfig(v **types.ForwardActionC originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("TargetGroups", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentTargetGroupList(&sv.TargetGroups, nodeDecoder); err != nil { + case strings.EqualFold("AllocationId", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - - case strings.EqualFold("TargetGroupStickinessConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentTargetGroupStickinessConfig(&sv.TargetGroupStickinessConfig, nodeDecoder); err != nil { - return err + if val == nil { + break + } + { + xtv := string(val) + sv.AllocationId = ptr.String(xtv) } - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() + case strings.EqualFold("IpAddress", t.Name.Local): + val, err := decoder.Value() if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.IpAddress = ptr.String(xtv) + } - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeDocumentHealthUnavailableException(v **types.HealthUnavailableException, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.HealthUnavailableException - if *v == nil { - sv = &types.HealthUnavailableException{} - } else { - sv = *v - } + case strings.EqualFold("IPv6Address", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IPv6Address = ptr.String(xtv) + } - 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): + case strings.EqualFold("PrivateIPv4Address", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -7412,7 +10688,7 @@ func awsAwsquery_deserializeDocumentHealthUnavailableException(v **types.HealthU } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.PrivateIPv4Address = ptr.String(xtv) } default: @@ -7429,17 +10705,18 @@ func awsAwsquery_deserializeDocumentHealthUnavailableException(v **types.HealthU return nil } -func awsAwsquery_deserializeDocumentHostHeaderConditionConfig(v **types.HostHeaderConditionConfig, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentLoadBalancerAddresses(v *[]types.LoadBalancerAddress, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HostHeaderConditionConfig + var sv []types.LoadBalancerAddress if *v == nil { - sv = &types.HostHeaderConditionConfig{} + sv = make([]types.LoadBalancerAddress, 0) } else { sv = *v } + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -7448,17 +10725,18 @@ func awsAwsquery_deserializeDocumentHostHeaderConditionConfig(v **types.HostHead if done { break } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Values", t.Name.Local): + case strings.EqualFold("member", t.Name.Local): + var col types.LoadBalancerAddress nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentListOfString(&sv.Values, nodeDecoder); err != nil { + destAddr := &col + if err := awsAwsquery_deserializeDocumentLoadBalancerAddress(&destAddr, nodeDecoder); err != nil { return err } + col = *destAddr + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -7471,17 +10749,42 @@ func awsAwsquery_deserializeDocumentHostHeaderConditionConfig(v **types.HostHead return nil } -func awsAwsquery_deserializeDocumentHttpHeaderConditionConfig(v **types.HttpHeaderConditionConfig, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentLoadBalancerAddressesUnwrapped(v *[]types.LoadBalancerAddress, decoder smithyxml.NodeDecoder) error { + var sv []types.LoadBalancerAddress + if *v == nil { + sv = make([]types.LoadBalancerAddress, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.LoadBalancerAddress + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentLoadBalancerAddress(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentLoadBalancerArns(v *[]string, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HttpHeaderConditionConfig + var sv []string if *v == nil { - sv = &types.HttpHeaderConditionConfig{} + sv = make([]string, 0) } else { sv = *v } + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -7490,10 +10793,11 @@ func awsAwsquery_deserializeDocumentHttpHeaderConditionConfig(v **types.HttpHead if done { break } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder switch { - case strings.EqualFold("HttpHeaderName", t.Name.Local): + case strings.EqualFold("member", t.Name.Local): + var col string val, err := decoder.Value() if err != nil { return err @@ -7503,17 +10807,11 @@ func awsAwsquery_deserializeDocumentHttpHeaderConditionConfig(v **types.HttpHead } { xtv := string(val) - sv.HttpHeaderName = ptr.String(xtv) - } - - case strings.EqualFold("Values", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentListOfString(&sv.Values, nodeDecoder); err != nil { - return err + col = xtv } + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -7526,55 +10824,42 @@ func awsAwsquery_deserializeDocumentHttpHeaderConditionConfig(v **types.HttpHead return nil } -func awsAwsquery_deserializeDocumentHttpRequestMethodConditionConfig(v **types.HttpRequestMethodConditionConfig, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.HttpRequestMethodConditionConfig +func awsAwsquery_deserializeDocumentLoadBalancerArnsUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string if *v == nil { - sv = &types.HttpRequestMethodConditionConfig{} + sv = make([]string, 0) } else { sv = *v } - for { - t, done, err := decoder.Token() + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() if err != nil { return err } - if done { + if val == nil { break } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Values", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentListOfString(&sv.Values, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - + { + xtv := string(val) + mv = xtv } - decoder = originalDecoder + sv = append(sv, mv) } *v = sv return nil } - -func awsAwsquery_deserializeDocumentIncompatibleProtocolsException(v **types.IncompatibleProtocolsException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentLoadBalancerAttribute(v **types.LoadBalancerAttribute, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.IncompatibleProtocolsException + var sv *types.LoadBalancerAttribute if *v == nil { - sv = &types.IncompatibleProtocolsException{} + sv = &types.LoadBalancerAttribute{} } else { sv = *v } @@ -7590,7 +10875,7 @@ func awsAwsquery_deserializeDocumentIncompatibleProtocolsException(v **types.Inc originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): + case strings.EqualFold("Key", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -7600,7 +10885,20 @@ func awsAwsquery_deserializeDocumentIncompatibleProtocolsException(v **types.Inc } { xtv := string(val) - sv.Message = ptr.String(xtv) + 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: @@ -7617,17 +10915,18 @@ func awsAwsquery_deserializeDocumentIncompatibleProtocolsException(v **types.Inc return nil } -func awsAwsquery_deserializeDocumentInvalidConfigurationRequestException(v **types.InvalidConfigurationRequestException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentLoadBalancerAttributes(v *[]types.LoadBalancerAttribute, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidConfigurationRequestException + var sv []types.LoadBalancerAttribute if *v == nil { - sv = &types.InvalidConfigurationRequestException{} + sv = make([]types.LoadBalancerAttribute, 0) } else { sv = *v } + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -7636,24 +10935,18 @@ func awsAwsquery_deserializeDocumentInvalidConfigurationRequestException(v **typ 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 { + case strings.EqualFold("member", t.Name.Local): + var col types.LoadBalancerAttribute + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentLoadBalancerAttribute(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } + col = *destAddr + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -7666,13 +10959,37 @@ func awsAwsquery_deserializeDocumentInvalidConfigurationRequestException(v **typ return nil } -func awsAwsquery_deserializeDocumentInvalidLoadBalancerActionException(v **types.InvalidLoadBalancerActionException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentLoadBalancerAttributesUnwrapped(v *[]types.LoadBalancerAttribute, decoder smithyxml.NodeDecoder) error { + var sv []types.LoadBalancerAttribute + if *v == nil { + sv = make([]types.LoadBalancerAttribute, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.LoadBalancerAttribute + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentLoadBalancerAttribute(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentLoadBalancerNotFoundException(v **types.LoadBalancerNotFoundException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidLoadBalancerActionException + var sv *types.LoadBalancerNotFoundException if *v == nil { - sv = &types.InvalidLoadBalancerActionException{} + sv = &types.LoadBalancerNotFoundException{} } else { sv = *v } @@ -7715,17 +11032,18 @@ func awsAwsquery_deserializeDocumentInvalidLoadBalancerActionException(v **types return nil } -func awsAwsquery_deserializeDocumentInvalidSchemeException(v **types.InvalidSchemeException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentLoadBalancers(v *[]types.LoadBalancer, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidSchemeException + var sv []types.LoadBalancer if *v == nil { - sv = &types.InvalidSchemeException{} + sv = make([]types.LoadBalancer, 0) } else { sv = *v } + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -7734,43 +11052,61 @@ func awsAwsquery_deserializeDocumentInvalidSchemeException(v **types.InvalidSche 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 { + case strings.EqualFold("member", t.Name.Local): + var col types.LoadBalancer + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentLoadBalancer(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } + col = *destAddr + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err } } - decoder = originalDecoder + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentLoadBalancersUnwrapped(v *[]types.LoadBalancer, decoder smithyxml.NodeDecoder) error { + var sv []types.LoadBalancer + if *v == nil { + sv = make([]types.LoadBalancer, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.LoadBalancer + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentLoadBalancer(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) } *v = sv return nil } - -func awsAwsquery_deserializeDocumentInvalidSecurityGroupException(v **types.InvalidSecurityGroupException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentLoadBalancerState(v **types.LoadBalancerState, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidSecurityGroupException + var sv *types.LoadBalancerState if *v == nil { - sv = &types.InvalidSecurityGroupException{} + sv = &types.LoadBalancerState{} } else { sv = *v } @@ -7786,7 +11122,7 @@ func awsAwsquery_deserializeDocumentInvalidSecurityGroupException(v **types.Inva originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): + case strings.EqualFold("Code", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -7796,7 +11132,20 @@ func awsAwsquery_deserializeDocumentInvalidSecurityGroupException(v **types.Inva } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.Code = types.LoadBalancerStateEnum(xtv) + } + + case strings.EqualFold("Reason", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Reason = ptr.String(xtv) } default: @@ -7813,13 +11162,13 @@ func awsAwsquery_deserializeDocumentInvalidSecurityGroupException(v **types.Inva return nil } -func awsAwsquery_deserializeDocumentInvalidSubnetException(v **types.InvalidSubnetException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentMatcher(v **types.Matcher, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidSubnetException + var sv *types.Matcher if *v == nil { - sv = &types.InvalidSubnetException{} + sv = &types.Matcher{} } else { sv = *v } @@ -7835,7 +11184,7 @@ func awsAwsquery_deserializeDocumentInvalidSubnetException(v **types.InvalidSubn originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): + case strings.EqualFold("GrpcCode", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -7845,7 +11194,20 @@ func awsAwsquery_deserializeDocumentInvalidSubnetException(v **types.InvalidSubn } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.GrpcCode = ptr.String(xtv) + } + + case strings.EqualFold("HttpCode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.HttpCode = ptr.String(xtv) } default: @@ -7862,13 +11224,13 @@ func awsAwsquery_deserializeDocumentInvalidSubnetException(v **types.InvalidSubn return nil } -func awsAwsquery_deserializeDocumentInvalidTargetException(v **types.InvalidTargetException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentMutualAuthenticationAttributes(v **types.MutualAuthenticationAttributes, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidTargetException + var sv *types.MutualAuthenticationAttributes if *v == nil { - sv = &types.InvalidTargetException{} + sv = &types.MutualAuthenticationAttributes{} } else { sv = *v } @@ -7884,7 +11246,23 @@ func awsAwsquery_deserializeDocumentInvalidTargetException(v **types.InvalidTarg originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): + case strings.EqualFold("IgnoreClientCertificateExpiry", 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 IgnoreClientCertificateExpiry to be of type *bool, got %T instead", val) + } + sv.IgnoreClientCertificateExpiry = ptr.Bool(xtv) + } + + case strings.EqualFold("Mode", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -7894,7 +11272,20 @@ func awsAwsquery_deserializeDocumentInvalidTargetException(v **types.InvalidTarg } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.Mode = ptr.String(xtv) + } + + case strings.EqualFold("TrustStoreArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TrustStoreArn = ptr.String(xtv) } default: @@ -7911,13 +11302,13 @@ func awsAwsquery_deserializeDocumentInvalidTargetException(v **types.InvalidTarg return nil } -func awsAwsquery_deserializeDocumentLimit(v **types.Limit, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentOperationNotPermittedException(v **types.OperationNotPermittedException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.Limit + var sv *types.OperationNotPermittedException if *v == nil { - sv = &types.Limit{} + sv = &types.OperationNotPermittedException{} } else { sv = *v } @@ -7933,20 +11324,7 @@ func awsAwsquery_deserializeDocumentLimit(v **types.Limit, decoder smithyxml.Nod originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Max", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Max = ptr.String(xtv) - } - - case strings.EqualFold("Name", t.Name.Local): + case strings.EqualFold("Message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -7956,7 +11334,7 @@ func awsAwsquery_deserializeDocumentLimit(v **types.Limit, decoder smithyxml.Nod } { xtv := string(val) - sv.Name = ptr.String(xtv) + sv.Message = ptr.String(xtv) } default: @@ -7973,18 +11351,17 @@ func awsAwsquery_deserializeDocumentLimit(v **types.Limit, decoder smithyxml.Nod return nil } -func awsAwsquery_deserializeDocumentLimits(v *[]types.Limit, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentPathPatternConditionConfig(v **types.PathPatternConditionConfig, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.Limit + var sv *types.PathPatternConditionConfig if *v == nil { - sv = make([]types.Limit, 0) + sv = &types.PathPatternConditionConfig{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -7993,18 +11370,17 @@ func awsAwsquery_deserializeDocumentLimits(v *[]types.Limit, decoder smithyxml.N if done { break } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("member", t.Name.Local): - var col types.Limit + case strings.EqualFold("Values", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsAwsquery_deserializeDocumentLimit(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentListOfString(&sv.Values, nodeDecoder); err != nil { return err } - col = *destAddr - sv = append(sv, col) default: + // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -8017,37 +11393,13 @@ func awsAwsquery_deserializeDocumentLimits(v *[]types.Limit, decoder smithyxml.N return nil } -func awsAwsquery_deserializeDocumentLimitsUnwrapped(v *[]types.Limit, decoder smithyxml.NodeDecoder) error { - var sv []types.Limit - if *v == nil { - sv = make([]types.Limit, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Limit - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsAwsquery_deserializeDocumentLimit(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsAwsquery_deserializeDocumentListener(v **types.Listener, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentPriorityInUseException(v **types.PriorityInUseException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.Listener + var sv *types.PriorityInUseException if *v == nil { - sv = &types.Listener{} + sv = &types.PriorityInUseException{} } else { sv = *v } @@ -8063,81 +11415,7 @@ func awsAwsquery_deserializeDocumentListener(v **types.Listener, decoder smithyx originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("AlpnPolicy", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentAlpnPolicyName(&sv.AlpnPolicy, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("Certificates", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentCertificateList(&sv.Certificates, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("DefaultActions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentActions(&sv.DefaultActions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ListenerArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ListenerArn = ptr.String(xtv) - } - - case strings.EqualFold("LoadBalancerArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.LoadBalancerArn = ptr.String(xtv) - } - - case strings.EqualFold("Port", 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.Port = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("Protocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Protocol = types.ProtocolEnum(xtv) - } - - case strings.EqualFold("SslPolicy", t.Name.Local): + case strings.EqualFold("Message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -8147,7 +11425,7 @@ func awsAwsquery_deserializeDocumentListener(v **types.Listener, decoder smithyx } { xtv := string(val) - sv.SslPolicy = ptr.String(xtv) + sv.Message = ptr.String(xtv) } default: @@ -8164,13 +11442,13 @@ func awsAwsquery_deserializeDocumentListener(v **types.Listener, decoder smithyx return nil } -func awsAwsquery_deserializeDocumentListenerNotFoundException(v **types.ListenerNotFoundException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentQueryStringConditionConfig(v **types.QueryStringConditionConfig, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.ListenerNotFoundException + var sv *types.QueryStringConditionConfig if *v == nil { - sv = &types.ListenerNotFoundException{} + sv = &types.QueryStringConditionConfig{} } else { sv = *v } @@ -8186,18 +11464,11 @@ func awsAwsquery_deserializeDocumentListenerNotFoundException(v **types.Listener originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("Values", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentQueryStringKeyValuePairList(&sv.Values, nodeDecoder); 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 @@ -8213,18 +11484,17 @@ func awsAwsquery_deserializeDocumentListenerNotFoundException(v **types.Listener return nil } -func awsAwsquery_deserializeDocumentListeners(v *[]types.Listener, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentQueryStringKeyValuePair(v **types.QueryStringKeyValuePair, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.Listener + var sv *types.QueryStringKeyValuePair if *v == nil { - sv = make([]types.Listener, 0) + sv = &types.QueryStringKeyValuePair{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -8233,18 +11503,37 @@ func awsAwsquery_deserializeDocumentListeners(v *[]types.Listener, decoder smith if done { break } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("member", t.Name.Local): - var col types.Listener - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsAwsquery_deserializeDocumentListener(&destAddr, nodeDecoder); err != nil { + case strings.EqualFold("Key", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - col = *destAddr - sv = append(sv, col) + 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 @@ -8257,37 +11546,13 @@ func awsAwsquery_deserializeDocumentListeners(v *[]types.Listener, decoder smith return nil } -func awsAwsquery_deserializeDocumentListenersUnwrapped(v *[]types.Listener, decoder smithyxml.NodeDecoder) error { - var sv []types.Listener - if *v == nil { - sv = make([]types.Listener, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Listener - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsAwsquery_deserializeDocumentListener(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsAwsquery_deserializeDocumentListOfString(v *[]string, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentQueryStringKeyValuePairList(v *[]types.QueryStringKeyValuePair, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []string + var sv []types.QueryStringKeyValuePair if *v == nil { - sv = make([]string, 0) + sv = make([]types.QueryStringKeyValuePair, 0) } else { sv = *v } @@ -8301,22 +11566,15 @@ func awsAwsquery_deserializeDocumentListOfString(v *[]string, decoder smithyxml. 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 { + var col types.QueryStringKeyValuePair + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentQueryStringKeyValuePair(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } + col = *destAddr sv = append(sv, col) default: @@ -8332,42 +11590,37 @@ func awsAwsquery_deserializeDocumentListOfString(v *[]string, decoder smithyxml. return nil } -func awsAwsquery_deserializeDocumentListOfStringUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string +func awsAwsquery_deserializeDocumentQueryStringKeyValuePairListUnwrapped(v *[]types.QueryStringKeyValuePair, decoder smithyxml.NodeDecoder) error { + var sv []types.QueryStringKeyValuePair if *v == nil { - sv = make([]string, 0) + sv = make([]types.QueryStringKeyValuePair, 0) } else { sv = *v } switch { default: - var mv string + var mv types.QueryStringKeyValuePair t := decoder.StartEl _ = t - val, err := decoder.Value() - if err != nil { + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentQueryStringKeyValuePair(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } + mv = *destAddr sv = append(sv, mv) } *v = sv return nil } -func awsAwsquery_deserializeDocumentLoadBalancer(v **types.LoadBalancer, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentRedirectActionConfig(v **types.RedirectActionConfig, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.LoadBalancer + var sv *types.RedirectActionConfig if *v == nil { - sv = &types.LoadBalancer{} + sv = &types.RedirectActionConfig{} } else { sv = *v } @@ -8383,13 +11636,7 @@ func awsAwsquery_deserializeDocumentLoadBalancer(v **types.LoadBalancer, decoder originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("AvailabilityZones", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentAvailabilityZones(&sv.AvailabilityZones, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("CanonicalHostedZoneId", t.Name.Local): + case strings.EqualFold("Host", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -8399,10 +11646,10 @@ func awsAwsquery_deserializeDocumentLoadBalancer(v **types.LoadBalancer, decoder } { xtv := string(val) - sv.CanonicalHostedZoneId = ptr.String(xtv) + sv.Host = ptr.String(xtv) } - case strings.EqualFold("CreatedTime", t.Name.Local): + case strings.EqualFold("Path", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -8412,14 +11659,10 @@ func awsAwsquery_deserializeDocumentLoadBalancer(v **types.LoadBalancer, decoder } { xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreatedTime = ptr.Time(t) + sv.Path = ptr.String(xtv) } - case strings.EqualFold("CustomerOwnedIpv4Pool", t.Name.Local): + case strings.EqualFold("Port", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -8429,10 +11672,10 @@ func awsAwsquery_deserializeDocumentLoadBalancer(v **types.LoadBalancer, decoder } { xtv := string(val) - sv.CustomerOwnedIpv4Pool = ptr.String(xtv) + sv.Port = ptr.String(xtv) } - case strings.EqualFold("DNSName", t.Name.Local): + case strings.EqualFold("Protocol", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -8442,10 +11685,10 @@ func awsAwsquery_deserializeDocumentLoadBalancer(v **types.LoadBalancer, decoder } { xtv := string(val) - sv.DNSName = ptr.String(xtv) + sv.Protocol = ptr.String(xtv) } - case strings.EqualFold("EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic", t.Name.Local): + case strings.EqualFold("Query", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -8455,10 +11698,10 @@ func awsAwsquery_deserializeDocumentLoadBalancer(v **types.LoadBalancer, decoder } { xtv := string(val) - sv.EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic = ptr.String(xtv) + sv.Query = ptr.String(xtv) } - case strings.EqualFold("IpAddressType", t.Name.Local): + case strings.EqualFold("StatusCode", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -8468,10 +11711,46 @@ func awsAwsquery_deserializeDocumentLoadBalancer(v **types.LoadBalancer, decoder } { xtv := string(val) - sv.IpAddressType = types.IpAddressType(xtv) + sv.StatusCode = types.RedirectActionStatusCodeEnum(xtv) } - case strings.EqualFold("LoadBalancerArn", t.Name.Local): + 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_deserializeDocumentResourceInUseException(v **types.ResourceInUseException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ResourceInUseException + if *v == nil { + sv = &types.ResourceInUseException{} + } 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 @@ -8481,10 +11760,46 @@ func awsAwsquery_deserializeDocumentLoadBalancer(v **types.LoadBalancer, decoder } { xtv := string(val) - sv.LoadBalancerArn = ptr.String(xtv) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("LoadBalancerName", t.Name.Local): + 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_deserializeDocumentRevocationContentNotFoundException(v **types.RevocationContentNotFoundException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.RevocationContentNotFoundException + if *v == nil { + sv = &types.RevocationContentNotFoundException{} + } 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 @@ -8494,10 +11809,46 @@ func awsAwsquery_deserializeDocumentLoadBalancer(v **types.LoadBalancer, decoder } { xtv := string(val) - sv.LoadBalancerName = ptr.String(xtv) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("Scheme", t.Name.Local): + 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_deserializeDocumentRevocationIdNotFoundException(v **types.RevocationIdNotFoundException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.RevocationIdNotFoundException + if *v == nil { + sv = &types.RevocationIdNotFoundException{} + } 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 @@ -8507,22 +11858,74 @@ func awsAwsquery_deserializeDocumentLoadBalancer(v **types.LoadBalancer, decoder } { xtv := string(val) - sv.Scheme = types.LoadBalancerSchemeEnum(xtv) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("SecurityGroups", t.Name.Local): + 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_deserializeDocumentRule(v **types.Rule, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Rule + if *v == nil { + sv = &types.Rule{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Actions", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentSecurityGroups(&sv.SecurityGroups, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentActions(&sv.Actions, nodeDecoder); err != nil { return err } - case strings.EqualFold("State", t.Name.Local): + case strings.EqualFold("Conditions", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentLoadBalancerState(&sv.State, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentRuleConditionList(&sv.Conditions, nodeDecoder); err != nil { return err } - case strings.EqualFold("Type", t.Name.Local): + case strings.EqualFold("IsDefault", 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 IsDefault to be of type *bool, got %T instead", val) + } + sv.IsDefault = ptr.Bool(xtv) + } + + case strings.EqualFold("Priority", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -8532,10 +11935,10 @@ func awsAwsquery_deserializeDocumentLoadBalancer(v **types.LoadBalancer, decoder } { xtv := string(val) - sv.Type = types.LoadBalancerTypeEnum(xtv) + sv.Priority = ptr.String(xtv) } - case strings.EqualFold("VpcId", t.Name.Local): + case strings.EqualFold("RuleArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -8545,7 +11948,7 @@ func awsAwsquery_deserializeDocumentLoadBalancer(v **types.LoadBalancer, decoder } { xtv := string(val) - sv.VpcId = ptr.String(xtv) + sv.RuleArn = ptr.String(xtv) } default: @@ -8562,13 +11965,13 @@ func awsAwsquery_deserializeDocumentLoadBalancer(v **types.LoadBalancer, decoder return nil } -func awsAwsquery_deserializeDocumentLoadBalancerAddress(v **types.LoadBalancerAddress, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentRuleCondition(v **types.RuleCondition, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.LoadBalancerAddress + var sv *types.RuleCondition if *v == nil { - sv = &types.LoadBalancerAddress{} + sv = &types.RuleCondition{} } else { sv = *v } @@ -8584,7 +11987,7 @@ func awsAwsquery_deserializeDocumentLoadBalancerAddress(v **types.LoadBalancerAd originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("AllocationId", t.Name.Local): + case strings.EqualFold("Field", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -8594,46 +11997,49 @@ func awsAwsquery_deserializeDocumentLoadBalancerAddress(v **types.LoadBalancerAd } { xtv := string(val) - sv.AllocationId = ptr.String(xtv) + sv.Field = ptr.String(xtv) } - case strings.EqualFold("IpAddress", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("HostHeaderConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentHostHeaderConditionConfig(&sv.HostHeaderConfig, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.IpAddress = ptr.String(xtv) - } - case strings.EqualFold("IPv6Address", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("HttpHeaderConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentHttpHeaderConditionConfig(&sv.HttpHeaderConfig, nodeDecoder); err != nil { return err } - if val == nil { - break + + case strings.EqualFold("HttpRequestMethodConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentHttpRequestMethodConditionConfig(&sv.HttpRequestMethodConfig, nodeDecoder); err != nil { + return err } - { - xtv := string(val) - sv.IPv6Address = ptr.String(xtv) + + case strings.EqualFold("PathPatternConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPathPatternConditionConfig(&sv.PathPatternConfig, nodeDecoder); err != nil { + return err } - case strings.EqualFold("PrivateIPv4Address", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("QueryStringConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentQueryStringConditionConfig(&sv.QueryStringConfig, nodeDecoder); err != nil { return err } - if val == nil { - break + + case strings.EqualFold("SourceIpConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSourceIpConditionConfig(&sv.SourceIpConfig, nodeDecoder); err != nil { + return err } - { - xtv := string(val) - sv.PrivateIPv4Address = ptr.String(xtv) + + case strings.EqualFold("Values", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentListOfString(&sv.Values, nodeDecoder); err != nil { + return err } default: @@ -8650,13 +12056,13 @@ func awsAwsquery_deserializeDocumentLoadBalancerAddress(v **types.LoadBalancerAd return nil } -func awsAwsquery_deserializeDocumentLoadBalancerAddresses(v *[]types.LoadBalancerAddress, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentRuleConditionList(v *[]types.RuleCondition, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.LoadBalancerAddress + var sv []types.RuleCondition if *v == nil { - sv = make([]types.LoadBalancerAddress, 0) + sv = make([]types.RuleCondition, 0) } else { sv = *v } @@ -8672,10 +12078,10 @@ func awsAwsquery_deserializeDocumentLoadBalancerAddresses(v *[]types.LoadBalance } switch { case strings.EqualFold("member", t.Name.Local): - var col types.LoadBalancerAddress + var col types.RuleCondition nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col - if err := awsAwsquery_deserializeDocumentLoadBalancerAddress(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentRuleCondition(&destAddr, nodeDecoder); err != nil { return err } col = *destAddr @@ -8694,22 +12100,22 @@ func awsAwsquery_deserializeDocumentLoadBalancerAddresses(v *[]types.LoadBalance return nil } -func awsAwsquery_deserializeDocumentLoadBalancerAddressesUnwrapped(v *[]types.LoadBalancerAddress, decoder smithyxml.NodeDecoder) error { - var sv []types.LoadBalancerAddress +func awsAwsquery_deserializeDocumentRuleConditionListUnwrapped(v *[]types.RuleCondition, decoder smithyxml.NodeDecoder) error { + var sv []types.RuleCondition if *v == nil { - sv = make([]types.LoadBalancerAddress, 0) + sv = make([]types.RuleCondition, 0) } else { sv = *v } switch { default: - var mv types.LoadBalancerAddress + var mv types.RuleCondition t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv - if err := awsAwsquery_deserializeDocumentLoadBalancerAddress(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentRuleCondition(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr @@ -8718,18 +12124,17 @@ func awsAwsquery_deserializeDocumentLoadBalancerAddressesUnwrapped(v *[]types.Lo *v = sv return nil } -func awsAwsquery_deserializeDocumentLoadBalancerArns(v *[]string, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentRuleNotFoundException(v **types.RuleNotFoundException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []string + var sv *types.RuleNotFoundException if *v == nil { - sv = make([]string, 0) + sv = &types.RuleNotFoundException{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -8738,11 +12143,10 @@ func awsAwsquery_deserializeDocumentLoadBalancerArns(v *[]string, decoder smithy if done { break } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("member", t.Name.Local): - var col string + case strings.EqualFold("Message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -8752,11 +12156,11 @@ func awsAwsquery_deserializeDocumentLoadBalancerArns(v *[]string, decoder smithy } { xtv := string(val) - col = xtv + sv.Message = ptr.String(xtv) } - sv = append(sv, col) default: + // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -8769,46 +12173,18 @@ func awsAwsquery_deserializeDocumentLoadBalancerArns(v *[]string, decoder smithy return nil } -func awsAwsquery_deserializeDocumentLoadBalancerArnsUnwrapped(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_deserializeDocumentLoadBalancerAttribute(v **types.LoadBalancerAttribute, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentRules(v *[]types.Rule, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.LoadBalancerAttribute + var sv []types.Rule if *v == nil { - sv = &types.LoadBalancerAttribute{} + sv = make([]types.Rule, 0) } else { sv = *v } + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -8817,56 +12193,61 @@ func awsAwsquery_deserializeDocumentLoadBalancerAttribute(v **types.LoadBalancer 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 { + case strings.EqualFold("member", t.Name.Local): + var col types.Rule + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentRule(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.Value = ptr.String(xtv) - } + col = *destAddr + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err } } - decoder = originalDecoder + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRulesUnwrapped(v *[]types.Rule, decoder smithyxml.NodeDecoder) error { + var sv []types.Rule + if *v == nil { + sv = make([]types.Rule, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Rule + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentRule(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) } *v = sv return nil } - -func awsAwsquery_deserializeDocumentLoadBalancerAttributes(v *[]types.LoadBalancerAttribute, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentSecurityGroups(v *[]string, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.LoadBalancerAttribute + var sv []string if *v == nil { - sv = make([]types.LoadBalancerAttribute, 0) + sv = make([]string, 0) } else { sv = *v } @@ -8880,15 +12261,22 @@ func awsAwsquery_deserializeDocumentLoadBalancerAttributes(v *[]types.LoadBalanc if done { break } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder switch { case strings.EqualFold("member", t.Name.Local): - var col types.LoadBalancerAttribute - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsAwsquery_deserializeDocumentLoadBalancerAttribute(&destAddr, nodeDecoder); err != nil { + var col string + val, err := decoder.Value() + if err != nil { return err } - col = *destAddr + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } sv = append(sv, col) default: @@ -8904,37 +12292,42 @@ func awsAwsquery_deserializeDocumentLoadBalancerAttributes(v *[]types.LoadBalanc return nil } -func awsAwsquery_deserializeDocumentLoadBalancerAttributesUnwrapped(v *[]types.LoadBalancerAttribute, decoder smithyxml.NodeDecoder) error { - var sv []types.LoadBalancerAttribute +func awsAwsquery_deserializeDocumentSecurityGroupsUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string if *v == nil { - sv = make([]types.LoadBalancerAttribute, 0) + sv = make([]string, 0) } else { sv = *v } switch { default: - var mv types.LoadBalancerAttribute + var mv string t := decoder.StartEl _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsAwsquery_deserializeDocumentLoadBalancerAttribute(&destAddr, nodeDecoder); err != nil { + val, err := decoder.Value() + if err != nil { return err } - mv = *destAddr + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } sv = append(sv, mv) } *v = sv return nil } -func awsAwsquery_deserializeDocumentLoadBalancerNotFoundException(v **types.LoadBalancerNotFoundException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentSourceIpConditionConfig(v **types.SourceIpConditionConfig, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.LoadBalancerNotFoundException + var sv *types.SourceIpConditionConfig if *v == nil { - sv = &types.LoadBalancerNotFoundException{} + sv = &types.SourceIpConditionConfig{} } else { sv = *v } @@ -8950,18 +12343,11 @@ func awsAwsquery_deserializeDocumentLoadBalancerNotFoundException(v **types.Load originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("Values", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentListOfString(&sv.Values, nodeDecoder); 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 @@ -8977,13 +12363,13 @@ func awsAwsquery_deserializeDocumentLoadBalancerNotFoundException(v **types.Load return nil } -func awsAwsquery_deserializeDocumentLoadBalancers(v *[]types.LoadBalancer, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentSslPolicies(v *[]types.SslPolicy, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.LoadBalancer + var sv []types.SslPolicy if *v == nil { - sv = make([]types.LoadBalancer, 0) + sv = make([]types.SslPolicy, 0) } else { sv = *v } @@ -8999,10 +12385,10 @@ func awsAwsquery_deserializeDocumentLoadBalancers(v *[]types.LoadBalancer, decod } switch { case strings.EqualFold("member", t.Name.Local): - var col types.LoadBalancer + var col types.SslPolicy nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col - if err := awsAwsquery_deserializeDocumentLoadBalancer(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentSslPolicy(&destAddr, nodeDecoder); err != nil { return err } col = *destAddr @@ -9021,22 +12407,22 @@ func awsAwsquery_deserializeDocumentLoadBalancers(v *[]types.LoadBalancer, decod return nil } -func awsAwsquery_deserializeDocumentLoadBalancersUnwrapped(v *[]types.LoadBalancer, decoder smithyxml.NodeDecoder) error { - var sv []types.LoadBalancer +func awsAwsquery_deserializeDocumentSslPoliciesUnwrapped(v *[]types.SslPolicy, decoder smithyxml.NodeDecoder) error { + var sv []types.SslPolicy if *v == nil { - sv = make([]types.LoadBalancer, 0) + sv = make([]types.SslPolicy, 0) } else { sv = *v } switch { default: - var mv types.LoadBalancer + var mv types.SslPolicy t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv - if err := awsAwsquery_deserializeDocumentLoadBalancer(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentSslPolicy(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr @@ -9045,13 +12431,13 @@ func awsAwsquery_deserializeDocumentLoadBalancersUnwrapped(v *[]types.LoadBalanc *v = sv return nil } -func awsAwsquery_deserializeDocumentLoadBalancerState(v **types.LoadBalancerState, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentSslPolicy(v **types.SslPolicy, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.LoadBalancerState + var sv *types.SslPolicy if *v == nil { - sv = &types.LoadBalancerState{} + sv = &types.SslPolicy{} } else { sv = *v } @@ -9067,7 +12453,13 @@ func awsAwsquery_deserializeDocumentLoadBalancerState(v **types.LoadBalancerStat originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Code", t.Name.Local): + case strings.EqualFold("Ciphers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCiphers(&sv.Ciphers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Name", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -9077,20 +12469,19 @@ func awsAwsquery_deserializeDocumentLoadBalancerState(v **types.LoadBalancerStat } { xtv := string(val) - sv.Code = types.LoadBalancerStateEnum(xtv) + sv.Name = ptr.String(xtv) } - case strings.EqualFold("Reason", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("SslProtocols", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSslProtocols(&sv.SslProtocols, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.Reason = ptr.String(xtv) + + case strings.EqualFold("SupportedLoadBalancerTypes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentListOfString(&sv.SupportedLoadBalancerTypes, nodeDecoder); err != nil { + return err } default: @@ -9107,13 +12498,13 @@ func awsAwsquery_deserializeDocumentLoadBalancerState(v **types.LoadBalancerStat return nil } -func awsAwsquery_deserializeDocumentMatcher(v **types.Matcher, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentSSLPolicyNotFoundException(v **types.SSLPolicyNotFoundException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.Matcher + var sv *types.SSLPolicyNotFoundException if *v == nil { - sv = &types.Matcher{} + sv = &types.SSLPolicyNotFoundException{} } else { sv = *v } @@ -9129,20 +12520,7 @@ func awsAwsquery_deserializeDocumentMatcher(v **types.Matcher, decoder smithyxml originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("GrpcCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.GrpcCode = ptr.String(xtv) - } - - case strings.EqualFold("HttpCode", t.Name.Local): + case strings.EqualFold("Message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -9152,7 +12530,7 @@ func awsAwsquery_deserializeDocumentMatcher(v **types.Matcher, decoder smithyxml } { xtv := string(val) - sv.HttpCode = ptr.String(xtv) + sv.Message = ptr.String(xtv) } default: @@ -9169,17 +12547,18 @@ func awsAwsquery_deserializeDocumentMatcher(v **types.Matcher, decoder smithyxml return nil } -func awsAwsquery_deserializeDocumentOperationNotPermittedException(v **types.OperationNotPermittedException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentSslProtocols(v *[]string, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.OperationNotPermittedException + var sv []string if *v == nil { - sv = &types.OperationNotPermittedException{} + sv = make([]string, 0) } else { sv = *v } + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -9188,10 +12567,11 @@ func awsAwsquery_deserializeDocumentOperationNotPermittedException(v **types.Ope if done { break } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder switch { - case strings.EqualFold("Message", t.Name.Local): + case strings.EqualFold("member", t.Name.Local): + var col string val, err := decoder.Value() if err != nil { return err @@ -9201,11 +12581,11 @@ func awsAwsquery_deserializeDocumentOperationNotPermittedException(v **types.Ope } { xtv := string(val) - sv.Message = ptr.String(xtv) + col = xtv } + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -9218,13 +12598,42 @@ func awsAwsquery_deserializeDocumentOperationNotPermittedException(v **types.Ope return nil } -func awsAwsquery_deserializeDocumentPathPatternConditionConfig(v **types.PathPatternConditionConfig, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentSslProtocolsUnwrapped(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_deserializeDocumentSubnetNotFoundException(v **types.SubnetNotFoundException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.PathPatternConditionConfig + var sv *types.SubnetNotFoundException if *v == nil { - sv = &types.PathPatternConditionConfig{} + sv = &types.SubnetNotFoundException{} } else { sv = *v } @@ -9240,11 +12649,18 @@ func awsAwsquery_deserializeDocumentPathPatternConditionConfig(v **types.PathPat originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Values", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentListOfString(&sv.Values, nodeDecoder); err != nil { + 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 @@ -9260,13 +12676,13 @@ func awsAwsquery_deserializeDocumentPathPatternConditionConfig(v **types.PathPat return nil } -func awsAwsquery_deserializeDocumentPriorityInUseException(v **types.PriorityInUseException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTag(v **types.Tag, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.PriorityInUseException + var sv *types.Tag if *v == nil { - sv = &types.PriorityInUseException{} + sv = &types.Tag{} } else { sv = *v } @@ -9282,7 +12698,7 @@ func awsAwsquery_deserializeDocumentPriorityInUseException(v **types.PriorityInU originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): + case strings.EqualFold("Key", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -9292,7 +12708,20 @@ func awsAwsquery_deserializeDocumentPriorityInUseException(v **types.PriorityInU } { xtv := string(val) - sv.Message = ptr.String(xtv) + 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: @@ -9309,13 +12738,13 @@ func awsAwsquery_deserializeDocumentPriorityInUseException(v **types.PriorityInU return nil } -func awsAwsquery_deserializeDocumentQueryStringConditionConfig(v **types.QueryStringConditionConfig, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTagDescription(v **types.TagDescription, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.QueryStringConditionConfig + var sv *types.TagDescription if *v == nil { - sv = &types.QueryStringConditionConfig{} + sv = &types.TagDescription{} } else { sv = *v } @@ -9331,9 +12760,22 @@ func awsAwsquery_deserializeDocumentQueryStringConditionConfig(v **types.QuerySt originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Values", t.Name.Local): + case strings.EqualFold("ResourceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ResourceArn = ptr.String(xtv) + } + + case strings.EqualFold("Tags", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentQueryStringKeyValuePairList(&sv.Values, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { return err } @@ -9351,17 +12793,18 @@ func awsAwsquery_deserializeDocumentQueryStringConditionConfig(v **types.QuerySt return nil } -func awsAwsquery_deserializeDocumentQueryStringKeyValuePair(v **types.QueryStringKeyValuePair, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTagDescriptions(v *[]types.TagDescription, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.QueryStringKeyValuePair + var sv []types.TagDescription if *v == nil { - sv = &types.QueryStringKeyValuePair{} + sv = make([]types.TagDescription, 0) } else { sv = *v } + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -9370,37 +12813,18 @@ func awsAwsquery_deserializeDocumentQueryStringKeyValuePair(v **types.QueryStrin 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 { + case strings.EqualFold("member", t.Name.Local): + var col types.TagDescription + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentTagDescription(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.Value = ptr.String(xtv) - } + col = *destAddr + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -9413,13 +12837,37 @@ func awsAwsquery_deserializeDocumentQueryStringKeyValuePair(v **types.QueryStrin return nil } -func awsAwsquery_deserializeDocumentQueryStringKeyValuePairList(v *[]types.QueryStringKeyValuePair, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTagDescriptionsUnwrapped(v *[]types.TagDescription, decoder smithyxml.NodeDecoder) error { + var sv []types.TagDescription + if *v == nil { + sv = make([]types.TagDescription, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.TagDescription + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentTagDescription(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentTagList(v *[]types.Tag, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.QueryStringKeyValuePair + var sv []types.Tag if *v == nil { - sv = make([]types.QueryStringKeyValuePair, 0) + sv = make([]types.Tag, 0) } else { sv = *v } @@ -9435,10 +12883,10 @@ func awsAwsquery_deserializeDocumentQueryStringKeyValuePairList(v *[]types.Query } switch { case strings.EqualFold("member", t.Name.Local): - var col types.QueryStringKeyValuePair + var col types.Tag nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col - if err := awsAwsquery_deserializeDocumentQueryStringKeyValuePair(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil { return err } col = *destAddr @@ -9457,22 +12905,22 @@ func awsAwsquery_deserializeDocumentQueryStringKeyValuePairList(v *[]types.Query return nil } -func awsAwsquery_deserializeDocumentQueryStringKeyValuePairListUnwrapped(v *[]types.QueryStringKeyValuePair, decoder smithyxml.NodeDecoder) error { - var sv []types.QueryStringKeyValuePair +func awsAwsquery_deserializeDocumentTagListUnwrapped(v *[]types.Tag, decoder smithyxml.NodeDecoder) error { + var sv []types.Tag if *v == nil { - sv = make([]types.QueryStringKeyValuePair, 0) + sv = make([]types.Tag, 0) } else { sv = *v } switch { default: - var mv types.QueryStringKeyValuePair + var mv types.Tag t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv - if err := awsAwsquery_deserializeDocumentQueryStringKeyValuePair(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr @@ -9481,13 +12929,13 @@ func awsAwsquery_deserializeDocumentQueryStringKeyValuePairListUnwrapped(v *[]ty *v = sv return nil } -func awsAwsquery_deserializeDocumentRedirectActionConfig(v **types.RedirectActionConfig, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTargetDescription(v **types.TargetDescription, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.RedirectActionConfig + var sv *types.TargetDescription if *v == nil { - sv = &types.RedirectActionConfig{} + sv = &types.TargetDescription{} } else { sv = *v } @@ -9503,7 +12951,7 @@ func awsAwsquery_deserializeDocumentRedirectActionConfig(v **types.RedirectActio originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Host", t.Name.Local): + case strings.EqualFold("AvailabilityZone", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -9513,10 +12961,10 @@ func awsAwsquery_deserializeDocumentRedirectActionConfig(v **types.RedirectActio } { xtv := string(val) - sv.Host = ptr.String(xtv) + sv.AvailabilityZone = ptr.String(xtv) } - case strings.EqualFold("Path", t.Name.Local): + case strings.EqualFold("Id", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -9526,7 +12974,7 @@ func awsAwsquery_deserializeDocumentRedirectActionConfig(v **types.RedirectActio } { xtv := string(val) - sv.Path = ptr.String(xtv) + sv.Id = ptr.String(xtv) } case strings.EqualFold("Port", t.Name.Local): @@ -9539,10 +12987,50 @@ func awsAwsquery_deserializeDocumentRedirectActionConfig(v **types.RedirectActio } { xtv := string(val) - sv.Port = ptr.String(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) } - case strings.EqualFold("Protocol", t.Name.Local): + 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_deserializeDocumentTargetGroup(v **types.TargetGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TargetGroup + if *v == nil { + sv = &types.TargetGroup{} + } 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("HealthCheckEnabled", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -9551,11 +13039,14 @@ func awsAwsquery_deserializeDocumentRedirectActionConfig(v **types.RedirectActio break } { - xtv := string(val) - sv.Protocol = ptr.String(xtv) + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected HealthCheckEnabled to be of type *bool, got %T instead", val) + } + sv.HealthCheckEnabled = ptr.Bool(xtv) } - case strings.EqualFold("Query", t.Name.Local): + case strings.EqualFold("HealthCheckIntervalSeconds", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -9565,10 +13056,14 @@ func awsAwsquery_deserializeDocumentRedirectActionConfig(v **types.RedirectActio } { xtv := string(val) - sv.Query = ptr.String(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.HealthCheckIntervalSeconds = ptr.Int32(int32(i64)) } - case strings.EqualFold("StatusCode", t.Name.Local): + case strings.EqualFold("HealthCheckPath", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -9578,46 +13073,23 @@ func awsAwsquery_deserializeDocumentRedirectActionConfig(v **types.RedirectActio } { xtv := string(val) - sv.StatusCode = types.RedirectActionStatusCodeEnum(xtv) + sv.HealthCheckPath = ptr.String(xtv) } - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() + case strings.EqualFold("HealthCheckPort", t.Name.Local): + val, err := decoder.Value() if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.HealthCheckPort = ptr.String(xtv) + } - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeDocumentResourceInUseException(v **types.ResourceInUseException, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.ResourceInUseException - if *v == nil { - sv = &types.ResourceInUseException{} - } 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): + case strings.EqualFold("HealthCheckProtocol", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -9627,58 +13099,69 @@ func awsAwsquery_deserializeDocumentResourceInUseException(v **types.ResourceInU } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.HealthCheckProtocol = types.ProtocolEnum(xtv) } - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() + case strings.EqualFold("HealthCheckTimeoutSeconds", 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.HealthCheckTimeoutSeconds = ptr.Int32(int32(i64)) + } - } - decoder = originalDecoder - } - *v = sv - return nil -} + case strings.EqualFold("HealthyThresholdCount", 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.HealthyThresholdCount = ptr.Int32(int32(i64)) + } -func awsAwsquery_deserializeDocumentRule(v **types.Rule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Rule - if *v == nil { - sv = &types.Rule{} - } else { - sv = *v - } + case strings.EqualFold("IpAddressType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IpAddressType = types.TargetGroupIpAddressTypeEnum(xtv) + } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Actions", t.Name.Local): + case strings.EqualFold("LoadBalancerArns", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentActions(&sv.Actions, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentLoadBalancerArns(&sv.LoadBalancerArns, nodeDecoder); err != nil { return err } - case strings.EqualFold("Conditions", t.Name.Local): + case strings.EqualFold("Matcher", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentRuleConditionList(&sv.Conditions, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentMatcher(&sv.Matcher, nodeDecoder); err != nil { return err } - case strings.EqualFold("IsDefault", t.Name.Local): + case strings.EqualFold("Port", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -9687,14 +13170,15 @@ func awsAwsquery_deserializeDocumentRule(v **types.Rule, decoder smithyxml.NodeD break } { - xtv, err := strconv.ParseBool(string(val)) + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) if err != nil { - return fmt.Errorf("expected IsDefault to be of type *bool, got %T instead", val) + return err } - sv.IsDefault = ptr.Bool(xtv) + sv.Port = ptr.Int32(int32(i64)) } - case strings.EqualFold("Priority", t.Name.Local): + case strings.EqualFold("Protocol", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -9704,10 +13188,10 @@ func awsAwsquery_deserializeDocumentRule(v **types.Rule, decoder smithyxml.NodeD } { xtv := string(val) - sv.Priority = ptr.String(xtv) + sv.Protocol = types.ProtocolEnum(xtv) } - case strings.EqualFold("RuleArn", t.Name.Local): + case strings.EqualFold("ProtocolVersion", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -9717,46 +13201,23 @@ func awsAwsquery_deserializeDocumentRule(v **types.Rule, decoder smithyxml.NodeD } { xtv := string(val) - sv.RuleArn = ptr.String(xtv) + sv.ProtocolVersion = ptr.String(xtv) } - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() + case strings.EqualFold("TargetGroupArn", t.Name.Local): + val, err := decoder.Value() if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.TargetGroupArn = ptr.String(xtv) + } - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeDocumentRuleCondition(v **types.RuleCondition, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.RuleCondition - if *v == nil { - sv = &types.RuleCondition{} - } 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("Field", t.Name.Local): + case strings.EqualFold("TargetGroupName", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -9766,50 +13227,51 @@ func awsAwsquery_deserializeDocumentRuleCondition(v **types.RuleCondition, decod } { xtv := string(val) - sv.Field = ptr.String(xtv) + sv.TargetGroupName = ptr.String(xtv) } - case strings.EqualFold("HostHeaderConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentHostHeaderConditionConfig(&sv.HostHeaderConfig, nodeDecoder); err != nil { + case strings.EqualFold("TargetType", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - - case strings.EqualFold("HttpHeaderConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentHttpHeaderConditionConfig(&sv.HttpHeaderConfig, nodeDecoder); err != nil { - return err + if val == nil { + break } - - case strings.EqualFold("HttpRequestMethodConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentHttpRequestMethodConditionConfig(&sv.HttpRequestMethodConfig, nodeDecoder); err != nil { - return err + { + xtv := string(val) + sv.TargetType = types.TargetTypeEnum(xtv) } - case strings.EqualFold("PathPatternConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentPathPatternConditionConfig(&sv.PathPatternConfig, nodeDecoder); err != nil { + case strings.EqualFold("UnhealthyThresholdCount", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - - case strings.EqualFold("QueryStringConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentQueryStringConditionConfig(&sv.QueryStringConfig, nodeDecoder); err != nil { - return err + if val == nil { + break } - - case strings.EqualFold("SourceIpConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentSourceIpConditionConfig(&sv.SourceIpConfig, nodeDecoder); err != nil { - return err + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.UnhealthyThresholdCount = ptr.Int32(int32(i64)) } - case strings.EqualFold("Values", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentListOfString(&sv.Values, nodeDecoder); err != nil { + 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 @@ -9825,18 +13287,17 @@ func awsAwsquery_deserializeDocumentRuleCondition(v **types.RuleCondition, decod return nil } -func awsAwsquery_deserializeDocumentRuleConditionList(v *[]types.RuleCondition, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTargetGroupAssociationLimitException(v **types.TargetGroupAssociationLimitException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.RuleCondition + var sv *types.TargetGroupAssociationLimitException if *v == nil { - sv = make([]types.RuleCondition, 0) + sv = &types.TargetGroupAssociationLimitException{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -9845,18 +13306,24 @@ func awsAwsquery_deserializeDocumentRuleConditionList(v *[]types.RuleCondition, if done { break } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("member", t.Name.Local): - var col types.RuleCondition - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsAwsquery_deserializeDocumentRuleCondition(&destAddr, nodeDecoder); err != nil { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - col = *destAddr - sv = append(sv, col) + 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 @@ -9869,37 +13336,13 @@ func awsAwsquery_deserializeDocumentRuleConditionList(v *[]types.RuleCondition, return nil } -func awsAwsquery_deserializeDocumentRuleConditionListUnwrapped(v *[]types.RuleCondition, decoder smithyxml.NodeDecoder) error { - var sv []types.RuleCondition - if *v == nil { - sv = make([]types.RuleCondition, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.RuleCondition - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsAwsquery_deserializeDocumentRuleCondition(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsAwsquery_deserializeDocumentRuleNotFoundException(v **types.RuleNotFoundException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTargetGroupAttribute(v **types.TargetGroupAttribute, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.RuleNotFoundException + var sv *types.TargetGroupAttribute if *v == nil { - sv = &types.RuleNotFoundException{} + sv = &types.TargetGroupAttribute{} } else { sv = *v } @@ -9915,7 +13358,7 @@ func awsAwsquery_deserializeDocumentRuleNotFoundException(v **types.RuleNotFound originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): + case strings.EqualFold("Key", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -9925,7 +13368,20 @@ func awsAwsquery_deserializeDocumentRuleNotFoundException(v **types.RuleNotFound } { xtv := string(val) - sv.Message = ptr.String(xtv) + 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: @@ -9942,13 +13398,13 @@ func awsAwsquery_deserializeDocumentRuleNotFoundException(v **types.RuleNotFound return nil } -func awsAwsquery_deserializeDocumentRules(v *[]types.Rule, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTargetGroupAttributes(v *[]types.TargetGroupAttribute, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.Rule + var sv []types.TargetGroupAttribute if *v == nil { - sv = make([]types.Rule, 0) + sv = make([]types.TargetGroupAttribute, 0) } else { sv = *v } @@ -9964,10 +13420,10 @@ func awsAwsquery_deserializeDocumentRules(v *[]types.Rule, decoder smithyxml.Nod } switch { case strings.EqualFold("member", t.Name.Local): - var col types.Rule + var col types.TargetGroupAttribute nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col - if err := awsAwsquery_deserializeDocumentRule(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTargetGroupAttribute(&destAddr, nodeDecoder); err != nil { return err } col = *destAddr @@ -9986,22 +13442,22 @@ func awsAwsquery_deserializeDocumentRules(v *[]types.Rule, decoder smithyxml.Nod return nil } -func awsAwsquery_deserializeDocumentRulesUnwrapped(v *[]types.Rule, decoder smithyxml.NodeDecoder) error { - var sv []types.Rule +func awsAwsquery_deserializeDocumentTargetGroupAttributesUnwrapped(v *[]types.TargetGroupAttribute, decoder smithyxml.NodeDecoder) error { + var sv []types.TargetGroupAttribute if *v == nil { - sv = make([]types.Rule, 0) + sv = make([]types.TargetGroupAttribute, 0) } else { sv = *v } switch { default: - var mv types.Rule + var mv types.TargetGroupAttribute t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv - if err := awsAwsquery_deserializeDocumentRule(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTargetGroupAttribute(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr @@ -10010,13 +13466,13 @@ func awsAwsquery_deserializeDocumentRulesUnwrapped(v *[]types.Rule, decoder smit *v = sv return nil } -func awsAwsquery_deserializeDocumentSecurityGroups(v *[]string, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTargetGroupList(v *[]types.TargetGroupTuple, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []string + var sv []types.TargetGroupTuple if *v == nil { - sv = make([]string, 0) + sv = make([]types.TargetGroupTuple, 0) } else { sv = *v } @@ -10030,22 +13486,15 @@ func awsAwsquery_deserializeDocumentSecurityGroups(v *[]string, decoder smithyxm 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 { + var col types.TargetGroupTuple + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentTargetGroupTuple(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } + col = *destAddr sv = append(sv, col) default: @@ -10061,42 +13510,37 @@ func awsAwsquery_deserializeDocumentSecurityGroups(v *[]string, decoder smithyxm return nil } -func awsAwsquery_deserializeDocumentSecurityGroupsUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string +func awsAwsquery_deserializeDocumentTargetGroupListUnwrapped(v *[]types.TargetGroupTuple, decoder smithyxml.NodeDecoder) error { + var sv []types.TargetGroupTuple if *v == nil { - sv = make([]string, 0) + sv = make([]types.TargetGroupTuple, 0) } else { sv = *v } switch { default: - var mv string + var mv types.TargetGroupTuple t := decoder.StartEl _ = t - val, err := decoder.Value() - if err != nil { + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentTargetGroupTuple(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } + mv = *destAddr sv = append(sv, mv) } *v = sv return nil } -func awsAwsquery_deserializeDocumentSourceIpConditionConfig(v **types.SourceIpConditionConfig, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTargetGroupNotFoundException(v **types.TargetGroupNotFoundException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.SourceIpConditionConfig + var sv *types.TargetGroupNotFoundException if *v == nil { - sv = &types.SourceIpConditionConfig{} + sv = &types.TargetGroupNotFoundException{} } else { sv = *v } @@ -10112,11 +13556,18 @@ func awsAwsquery_deserializeDocumentSourceIpConditionConfig(v **types.SourceIpCo originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Values", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentListOfString(&sv.Values, nodeDecoder); err != nil { + 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 @@ -10132,13 +13583,13 @@ func awsAwsquery_deserializeDocumentSourceIpConditionConfig(v **types.SourceIpCo return nil } -func awsAwsquery_deserializeDocumentSslPolicies(v *[]types.SslPolicy, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTargetGroups(v *[]types.TargetGroup, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.SslPolicy + var sv []types.TargetGroup if *v == nil { - sv = make([]types.SslPolicy, 0) + sv = make([]types.TargetGroup, 0) } else { sv = *v } @@ -10154,10 +13605,10 @@ func awsAwsquery_deserializeDocumentSslPolicies(v *[]types.SslPolicy, decoder sm } switch { case strings.EqualFold("member", t.Name.Local): - var col types.SslPolicy + var col types.TargetGroup nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col - if err := awsAwsquery_deserializeDocumentSslPolicy(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTargetGroup(&destAddr, nodeDecoder); err != nil { return err } col = *destAddr @@ -10176,22 +13627,22 @@ func awsAwsquery_deserializeDocumentSslPolicies(v *[]types.SslPolicy, decoder sm return nil } -func awsAwsquery_deserializeDocumentSslPoliciesUnwrapped(v *[]types.SslPolicy, decoder smithyxml.NodeDecoder) error { - var sv []types.SslPolicy +func awsAwsquery_deserializeDocumentTargetGroupsUnwrapped(v *[]types.TargetGroup, decoder smithyxml.NodeDecoder) error { + var sv []types.TargetGroup if *v == nil { - sv = make([]types.SslPolicy, 0) + sv = make([]types.TargetGroup, 0) } else { sv = *v } switch { default: - var mv types.SslPolicy + var mv types.TargetGroup t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv - if err := awsAwsquery_deserializeDocumentSslPolicy(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTargetGroup(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr @@ -10200,13 +13651,13 @@ func awsAwsquery_deserializeDocumentSslPoliciesUnwrapped(v *[]types.SslPolicy, d *v = sv return nil } -func awsAwsquery_deserializeDocumentSslPolicy(v **types.SslPolicy, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTargetGroupStickinessConfig(v **types.TargetGroupStickinessConfig, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.SslPolicy + var sv *types.TargetGroupStickinessConfig if *v == nil { - sv = &types.SslPolicy{} + sv = &types.TargetGroupStickinessConfig{} } else { sv = *v } @@ -10222,13 +13673,7 @@ func awsAwsquery_deserializeDocumentSslPolicy(v **types.SslPolicy, decoder smith originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Ciphers", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentCiphers(&sv.Ciphers, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("Name", t.Name.Local): + case strings.EqualFold("DurationSeconds", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -10238,58 +13683,14 @@ func awsAwsquery_deserializeDocumentSslPolicy(v **types.SslPolicy, decoder smith } { xtv := string(val) - sv.Name = ptr.String(xtv) - } - - case strings.EqualFold("SslProtocols", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentSslProtocols(&sv.SslProtocols, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("SupportedLoadBalancerTypes", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentListOfString(&sv.SupportedLoadBalancerTypes, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.DurationSeconds = ptr.Int32(int32(i64)) } - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeDocumentSSLPolicyNotFoundException(v **types.SSLPolicyNotFoundException, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SSLPolicyNotFoundException - if *v == nil { - sv = &types.SSLPolicyNotFoundException{} - } 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): + case strings.EqualFold("Enabled", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -10298,8 +13699,11 @@ func awsAwsquery_deserializeDocumentSSLPolicyNotFoundException(v **types.SSLPoli break } { - xtv := string(val) - sv.Message = ptr.String(xtv) + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected TargetGroupStickinessEnabled to be of type *bool, got %T instead", val) + } + sv.Enabled = ptr.Bool(xtv) } default: @@ -10316,18 +13720,17 @@ func awsAwsquery_deserializeDocumentSSLPolicyNotFoundException(v **types.SSLPoli return nil } -func awsAwsquery_deserializeDocumentSslProtocols(v *[]string, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTargetGroupTuple(v **types.TargetGroupTuple, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []string + var sv *types.TargetGroupTuple if *v == nil { - sv = make([]string, 0) + sv = &types.TargetGroupTuple{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -10336,11 +13739,10 @@ func awsAwsquery_deserializeDocumentSslProtocols(v *[]string, decoder smithyxml. if done { break } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("member", t.Name.Local): - var col string + case strings.EqualFold("TargetGroupArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -10350,75 +13752,10 @@ func awsAwsquery_deserializeDocumentSslProtocols(v *[]string, decoder smithyxml. } { xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err + sv.TargetGroupArn = ptr.String(xtv) } - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeDocumentSslProtocolsUnwrapped(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_deserializeDocumentSubnetNotFoundException(v **types.SubnetNotFoundException, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.SubnetNotFoundException - if *v == nil { - sv = &types.SubnetNotFoundException{} - } 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): + case strings.EqualFold("Weight", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -10428,7 +13765,11 @@ func awsAwsquery_deserializeDocumentSubnetNotFoundException(v **types.SubnetNotF } { xtv := string(val) - sv.Message = ptr.String(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Weight = ptr.Int32(int32(i64)) } default: @@ -10445,13 +13786,13 @@ func awsAwsquery_deserializeDocumentSubnetNotFoundException(v **types.SubnetNotF return nil } -func awsAwsquery_deserializeDocumentTag(v **types.Tag, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTargetHealth(v **types.TargetHealth, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.Tag + var sv *types.TargetHealth if *v == nil { - sv = &types.Tag{} + sv = &types.TargetHealth{} } else { sv = *v } @@ -10467,7 +13808,7 @@ func awsAwsquery_deserializeDocumentTag(v **types.Tag, decoder smithyxml.NodeDec originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Key", t.Name.Local): + case strings.EqualFold("Description", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -10477,10 +13818,10 @@ func awsAwsquery_deserializeDocumentTag(v **types.Tag, decoder smithyxml.NodeDec } { xtv := string(val) - sv.Key = ptr.String(xtv) + sv.Description = ptr.String(xtv) } - case strings.EqualFold("Value", t.Name.Local): + case strings.EqualFold("Reason", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -10490,7 +13831,20 @@ func awsAwsquery_deserializeDocumentTag(v **types.Tag, decoder smithyxml.NodeDec } { xtv := string(val) - sv.Value = ptr.String(xtv) + sv.Reason = types.TargetHealthReasonEnum(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.TargetHealthStateEnum(xtv) } default: @@ -10507,13 +13861,13 @@ func awsAwsquery_deserializeDocumentTag(v **types.Tag, decoder smithyxml.NodeDec return nil } -func awsAwsquery_deserializeDocumentTagDescription(v **types.TagDescription, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTargetHealthDescription(v **types.TargetHealthDescription, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TagDescription + var sv *types.TargetHealthDescription if *v == nil { - sv = &types.TagDescription{} + sv = &types.TargetHealthDescription{} } else { sv = *v } @@ -10529,7 +13883,13 @@ func awsAwsquery_deserializeDocumentTagDescription(v **types.TagDescription, dec originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ResourceArn", t.Name.Local): + case strings.EqualFold("AnomalyDetection", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAnomalyDetection(&sv.AnomalyDetection, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("HealthCheckPort", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -10539,12 +13899,18 @@ func awsAwsquery_deserializeDocumentTagDescription(v **types.TagDescription, dec } { xtv := string(val) - sv.ResourceArn = ptr.String(xtv) + sv.HealthCheckPort = ptr.String(xtv) } - case strings.EqualFold("Tags", t.Name.Local): + case strings.EqualFold("Target", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTargetDescription(&sv.Target, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TargetHealth", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTargetHealth(&sv.TargetHealth, nodeDecoder); err != nil { return err } @@ -10562,13 +13928,13 @@ func awsAwsquery_deserializeDocumentTagDescription(v **types.TagDescription, dec return nil } -func awsAwsquery_deserializeDocumentTagDescriptions(v *[]types.TagDescription, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTargetHealthDescriptions(v *[]types.TargetHealthDescription, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.TagDescription + var sv []types.TargetHealthDescription if *v == nil { - sv = make([]types.TagDescription, 0) + sv = make([]types.TargetHealthDescription, 0) } else { sv = *v } @@ -10584,10 +13950,10 @@ func awsAwsquery_deserializeDocumentTagDescriptions(v *[]types.TagDescription, d } switch { case strings.EqualFold("member", t.Name.Local): - var col types.TagDescription + var col types.TargetHealthDescription nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col - if err := awsAwsquery_deserializeDocumentTagDescription(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTargetHealthDescription(&destAddr, nodeDecoder); err != nil { return err } col = *destAddr @@ -10606,22 +13972,22 @@ func awsAwsquery_deserializeDocumentTagDescriptions(v *[]types.TagDescription, d return nil } -func awsAwsquery_deserializeDocumentTagDescriptionsUnwrapped(v *[]types.TagDescription, decoder smithyxml.NodeDecoder) error { - var sv []types.TagDescription +func awsAwsquery_deserializeDocumentTargetHealthDescriptionsUnwrapped(v *[]types.TargetHealthDescription, decoder smithyxml.NodeDecoder) error { + var sv []types.TargetHealthDescription if *v == nil { - sv = make([]types.TagDescription, 0) + sv = make([]types.TargetHealthDescription, 0) } else { sv = *v } switch { default: - var mv types.TagDescription + var mv types.TargetHealthDescription t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv - if err := awsAwsquery_deserializeDocumentTagDescription(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTargetHealthDescription(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr @@ -10630,18 +13996,17 @@ func awsAwsquery_deserializeDocumentTagDescriptionsUnwrapped(v *[]types.TagDescr *v = sv return nil } -func awsAwsquery_deserializeDocumentTagList(v *[]types.Tag, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTooManyActionsException(v **types.TooManyActionsException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.Tag + var sv *types.TooManyActionsException if *v == nil { - sv = make([]types.Tag, 0) + sv = &types.TooManyActionsException{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -10650,18 +14015,24 @@ func awsAwsquery_deserializeDocumentTagList(v *[]types.Tag, decoder smithyxml.No if done { break } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("member", t.Name.Local): - var col types.Tag - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsAwsquery_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - col = *destAddr - sv = append(sv, col) + 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 @@ -10674,37 +14045,13 @@ func awsAwsquery_deserializeDocumentTagList(v *[]types.Tag, decoder smithyxml.No return nil } -func awsAwsquery_deserializeDocumentTagListUnwrapped(v *[]types.Tag, decoder smithyxml.NodeDecoder) error { - var sv []types.Tag - if *v == nil { - sv = make([]types.Tag, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Tag - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsAwsquery_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsAwsquery_deserializeDocumentTargetDescription(v **types.TargetDescription, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTooManyCertificatesException(v **types.TooManyCertificatesException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TargetDescription + var sv *types.TooManyCertificatesException if *v == nil { - sv = &types.TargetDescription{} + sv = &types.TooManyCertificatesException{} } else { sv = *v } @@ -10720,33 +14067,7 @@ func awsAwsquery_deserializeDocumentTargetDescription(v **types.TargetDescriptio originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("AvailabilityZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AvailabilityZone = ptr.String(xtv) - } - - case strings.EqualFold("Id", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Id = ptr.String(xtv) - } - - case strings.EqualFold("Port", t.Name.Local): + case strings.EqualFold("Message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -10756,11 +14077,7 @@ func awsAwsquery_deserializeDocumentTargetDescription(v **types.TargetDescriptio } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Port = ptr.Int32(int32(i64)) + sv.Message = ptr.String(xtv) } default: @@ -10777,13 +14094,13 @@ func awsAwsquery_deserializeDocumentTargetDescription(v **types.TargetDescriptio return nil } -func awsAwsquery_deserializeDocumentTargetGroup(v **types.TargetGroup, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTooManyListenersException(v **types.TooManyListenersException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TargetGroup + var sv *types.TooManyListenersException if *v == nil { - sv = &types.TargetGroup{} + sv = &types.TooManyListenersException{} } else { sv = *v } @@ -10795,100 +14112,11 @@ func awsAwsquery_deserializeDocumentTargetGroup(v **types.TargetGroup, decoder s } if done { break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("HealthCheckEnabled", 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 HealthCheckEnabled to be of type *bool, got %T instead", val) - } - sv.HealthCheckEnabled = ptr.Bool(xtv) - } - - case strings.EqualFold("HealthCheckIntervalSeconds", 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.HealthCheckIntervalSeconds = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("HealthCheckPath", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HealthCheckPath = ptr.String(xtv) - } - - case strings.EqualFold("HealthCheckPort", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HealthCheckPort = ptr.String(xtv) - } - - case strings.EqualFold("HealthCheckProtocol", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HealthCheckProtocol = types.ProtocolEnum(xtv) - } - - case strings.EqualFold("HealthCheckTimeoutSeconds", 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.HealthCheckTimeoutSeconds = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("HealthyThresholdCount", t.Name.Local): + } + 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 @@ -10898,14 +14126,46 @@ func awsAwsquery_deserializeDocumentTargetGroup(v **types.TargetGroup, decoder s } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.HealthyThresholdCount = ptr.Int32(int32(i64)) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("IpAddressType", t.Name.Local): + 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_deserializeDocumentTooManyLoadBalancersException(v **types.TooManyLoadBalancersException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TooManyLoadBalancersException + if *v == nil { + sv = &types.TooManyLoadBalancersException{} + } 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 @@ -10915,22 +14175,46 @@ func awsAwsquery_deserializeDocumentTargetGroup(v **types.TargetGroup, decoder s } { xtv := string(val) - sv.IpAddressType = types.TargetGroupIpAddressTypeEnum(xtv) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("LoadBalancerArns", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentLoadBalancerArns(&sv.LoadBalancerArns, nodeDecoder); err != nil { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { return err } - case strings.EqualFold("Matcher", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentMatcher(&sv.Matcher, nodeDecoder); err != nil { - return err - } + } + decoder = originalDecoder + } + *v = sv + return nil +} - case strings.EqualFold("Port", t.Name.Local): +func awsAwsquery_deserializeDocumentTooManyRegistrationsForTargetIdException(v **types.TooManyRegistrationsForTargetIdException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TooManyRegistrationsForTargetIdException + if *v == nil { + sv = &types.TooManyRegistrationsForTargetIdException{} + } 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 @@ -10940,27 +14224,46 @@ func awsAwsquery_deserializeDocumentTargetGroup(v **types.TargetGroup, decoder s } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Port = ptr.Int32(int32(i64)) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("Protocol", 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.Protocol = types.ProtocolEnum(xtv) - } - case strings.EqualFold("ProtocolVersion", t.Name.Local): + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTooManyRulesException(v **types.TooManyRulesException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TooManyRulesException + if *v == nil { + sv = &types.TooManyRulesException{} + } 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 @@ -10970,23 +14273,46 @@ func awsAwsquery_deserializeDocumentTargetGroup(v **types.TargetGroup, decoder s } { xtv := string(val) - sv.ProtocolVersion = ptr.String(xtv) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("TargetGroupArn", 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.TargetGroupArn = ptr.String(xtv) - } - case strings.EqualFold("TargetGroupName", t.Name.Local): + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TooManyTagsException + if *v == nil { + sv = &types.TooManyTagsException{} + } 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 @@ -10996,23 +14322,46 @@ func awsAwsquery_deserializeDocumentTargetGroup(v **types.TargetGroup, decoder s } { xtv := string(val) - sv.TargetGroupName = ptr.String(xtv) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("TargetType", 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.TargetType = types.TargetTypeEnum(xtv) - } - case strings.EqualFold("UnhealthyThresholdCount", t.Name.Local): + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTooManyTargetGroupsException(v **types.TooManyTargetGroupsException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TooManyTargetGroupsException + if *v == nil { + sv = &types.TooManyTargetGroupsException{} + } 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 @@ -11022,14 +14371,46 @@ func awsAwsquery_deserializeDocumentTargetGroup(v **types.TargetGroup, decoder s } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.UnhealthyThresholdCount = ptr.Int32(int32(i64)) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err } - case strings.EqualFold("VpcId", t.Name.Local): + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTooManyTargetsException(v **types.TooManyTargetsException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TooManyTargetsException + if *v == nil { + sv = &types.TooManyTargetsException{} + } 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 @@ -11039,7 +14420,7 @@ func awsAwsquery_deserializeDocumentTargetGroup(v **types.TargetGroup, decoder s } { xtv := string(val) - sv.VpcId = ptr.String(xtv) + sv.Message = ptr.String(xtv) } default: @@ -11056,13 +14437,13 @@ func awsAwsquery_deserializeDocumentTargetGroup(v **types.TargetGroup, decoder s return nil } -func awsAwsquery_deserializeDocumentTargetGroupAssociationLimitException(v **types.TargetGroupAssociationLimitException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTooManyTrustStoreRevocationEntriesException(v **types.TooManyTrustStoreRevocationEntriesException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TargetGroupAssociationLimitException + var sv *types.TooManyTrustStoreRevocationEntriesException if *v == nil { - sv = &types.TargetGroupAssociationLimitException{} + sv = &types.TooManyTrustStoreRevocationEntriesException{} } else { sv = *v } @@ -11105,13 +14486,13 @@ func awsAwsquery_deserializeDocumentTargetGroupAssociationLimitException(v **typ return nil } -func awsAwsquery_deserializeDocumentTargetGroupAttribute(v **types.TargetGroupAttribute, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTooManyTrustStoresException(v **types.TooManyTrustStoresException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TargetGroupAttribute + var sv *types.TooManyTrustStoresException if *v == nil { - sv = &types.TargetGroupAttribute{} + sv = &types.TooManyTrustStoresException{} } else { sv = *v } @@ -11127,20 +14508,7 @@ func awsAwsquery_deserializeDocumentTargetGroupAttribute(v **types.TargetGroupAt 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): + case strings.EqualFold("Message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11150,7 +14518,7 @@ func awsAwsquery_deserializeDocumentTargetGroupAttribute(v **types.TargetGroupAt } { xtv := string(val) - sv.Value = ptr.String(xtv) + sv.Message = ptr.String(xtv) } default: @@ -11167,18 +14535,17 @@ func awsAwsquery_deserializeDocumentTargetGroupAttribute(v **types.TargetGroupAt return nil } -func awsAwsquery_deserializeDocumentTargetGroupAttributes(v *[]types.TargetGroupAttribute, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTooManyUniqueTargetGroupsPerLoadBalancerException(v **types.TooManyUniqueTargetGroupsPerLoadBalancerException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.TargetGroupAttribute + var sv *types.TooManyUniqueTargetGroupsPerLoadBalancerException if *v == nil { - sv = make([]types.TargetGroupAttribute, 0) + sv = &types.TooManyUniqueTargetGroupsPerLoadBalancerException{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -11187,18 +14554,24 @@ func awsAwsquery_deserializeDocumentTargetGroupAttributes(v *[]types.TargetGroup if done { break } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("member", t.Name.Local): - var col types.TargetGroupAttribute - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsAwsquery_deserializeDocumentTargetGroupAttribute(&destAddr, nodeDecoder); err != nil { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - col = *destAddr - sv = append(sv, col) + 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 @@ -11211,42 +14584,17 @@ func awsAwsquery_deserializeDocumentTargetGroupAttributes(v *[]types.TargetGroup return nil } -func awsAwsquery_deserializeDocumentTargetGroupAttributesUnwrapped(v *[]types.TargetGroupAttribute, decoder smithyxml.NodeDecoder) error { - var sv []types.TargetGroupAttribute - if *v == nil { - sv = make([]types.TargetGroupAttribute, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TargetGroupAttribute - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsAwsquery_deserializeDocumentTargetGroupAttribute(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsAwsquery_deserializeDocumentTargetGroupList(v *[]types.TargetGroupTuple, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTrustStore(v **types.TrustStore, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.TargetGroupTuple + var sv *types.TrustStore if *v == nil { - sv = make([]types.TargetGroupTuple, 0) + sv = &types.TrustStore{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -11255,18 +14603,84 @@ func awsAwsquery_deserializeDocumentTargetGroupList(v *[]types.TargetGroupTuple, if done { break } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("member", t.Name.Local): - var col types.TargetGroupTuple - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsAwsquery_deserializeDocumentTargetGroupTuple(&destAddr, nodeDecoder); err != nil { + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - col = *destAddr - sv = append(sv, col) + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("NumberOfCaCertificates", 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.NumberOfCaCertificates = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.TrustStoreStatus(xtv) + } + + case strings.EqualFold("TotalRevokedEntries", 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.TotalRevokedEntries = ptr.Int64(i64) + } + + case strings.EqualFold("TrustStoreArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TrustStoreArn = ptr.String(xtv) + } default: + // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -11279,37 +14693,13 @@ func awsAwsquery_deserializeDocumentTargetGroupList(v *[]types.TargetGroupTuple, return nil } -func awsAwsquery_deserializeDocumentTargetGroupListUnwrapped(v *[]types.TargetGroupTuple, decoder smithyxml.NodeDecoder) error { - var sv []types.TargetGroupTuple - if *v == nil { - sv = make([]types.TargetGroupTuple, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.TargetGroupTuple - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsAwsquery_deserializeDocumentTargetGroupTuple(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsAwsquery_deserializeDocumentTargetGroupNotFoundException(v **types.TargetGroupNotFoundException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTrustStoreAssociation(v **types.TrustStoreAssociation, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TargetGroupNotFoundException + var sv *types.TrustStoreAssociation if *v == nil { - sv = &types.TargetGroupNotFoundException{} + sv = &types.TrustStoreAssociation{} } else { sv = *v } @@ -11325,7 +14715,7 @@ func awsAwsquery_deserializeDocumentTargetGroupNotFoundException(v **types.Targe originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): + case strings.EqualFold("ResourceArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11335,7 +14725,7 @@ func awsAwsquery_deserializeDocumentTargetGroupNotFoundException(v **types.Targe } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.ResourceArn = ptr.String(xtv) } default: @@ -11352,13 +14742,13 @@ func awsAwsquery_deserializeDocumentTargetGroupNotFoundException(v **types.Targe return nil } -func awsAwsquery_deserializeDocumentTargetGroups(v *[]types.TargetGroup, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTrustStoreAssociations(v *[]types.TrustStoreAssociation, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.TargetGroup + var sv []types.TrustStoreAssociation if *v == nil { - sv = make([]types.TargetGroup, 0) + sv = make([]types.TrustStoreAssociation, 0) } else { sv = *v } @@ -11374,10 +14764,10 @@ func awsAwsquery_deserializeDocumentTargetGroups(v *[]types.TargetGroup, decoder } switch { case strings.EqualFold("member", t.Name.Local): - var col types.TargetGroup + var col types.TrustStoreAssociation nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col - if err := awsAwsquery_deserializeDocumentTargetGroup(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTrustStoreAssociation(&destAddr, nodeDecoder); err != nil { return err } col = *destAddr @@ -11396,22 +14786,22 @@ func awsAwsquery_deserializeDocumentTargetGroups(v *[]types.TargetGroup, decoder return nil } -func awsAwsquery_deserializeDocumentTargetGroupsUnwrapped(v *[]types.TargetGroup, decoder smithyxml.NodeDecoder) error { - var sv []types.TargetGroup +func awsAwsquery_deserializeDocumentTrustStoreAssociationsUnwrapped(v *[]types.TrustStoreAssociation, decoder smithyxml.NodeDecoder) error { + var sv []types.TrustStoreAssociation if *v == nil { - sv = make([]types.TargetGroup, 0) + sv = make([]types.TrustStoreAssociation, 0) } else { sv = *v } switch { default: - var mv types.TargetGroup + var mv types.TrustStoreAssociation t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv - if err := awsAwsquery_deserializeDocumentTargetGroup(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTrustStoreAssociation(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr @@ -11420,13 +14810,13 @@ func awsAwsquery_deserializeDocumentTargetGroupsUnwrapped(v *[]types.TargetGroup *v = sv return nil } -func awsAwsquery_deserializeDocumentTargetGroupStickinessConfig(v **types.TargetGroupStickinessConfig, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTrustStoreInUseException(v **types.TrustStoreInUseException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TargetGroupStickinessConfig + var sv *types.TrustStoreInUseException if *v == nil { - sv = &types.TargetGroupStickinessConfig{} + sv = &types.TrustStoreInUseException{} } else { sv = *v } @@ -11442,7 +14832,7 @@ func awsAwsquery_deserializeDocumentTargetGroupStickinessConfig(v **types.Target originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("DurationSeconds", t.Name.Local): + case strings.EqualFold("Message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11452,14 +14842,46 @@ func awsAwsquery_deserializeDocumentTargetGroupStickinessConfig(v **types.Target } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.DurationSeconds = ptr.Int32(int32(i64)) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("Enabled", t.Name.Local): + 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_deserializeDocumentTrustStoreNotFoundException(v **types.TrustStoreNotFoundException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TrustStoreNotFoundException + if *v == nil { + sv = &types.TrustStoreNotFoundException{} + } 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 @@ -11468,11 +14890,8 @@ func awsAwsquery_deserializeDocumentTargetGroupStickinessConfig(v **types.Target break } { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected TargetGroupStickinessEnabled to be of type *bool, got %T instead", val) - } - sv.Enabled = ptr.Bool(xtv) + xtv := string(val) + sv.Message = ptr.String(xtv) } default: @@ -11489,13 +14908,13 @@ func awsAwsquery_deserializeDocumentTargetGroupStickinessConfig(v **types.Target return nil } -func awsAwsquery_deserializeDocumentTargetGroupTuple(v **types.TargetGroupTuple, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTrustStoreNotReadyException(v **types.TrustStoreNotReadyException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TargetGroupTuple + var sv *types.TrustStoreNotReadyException if *v == nil { - sv = &types.TargetGroupTuple{} + sv = &types.TrustStoreNotReadyException{} } else { sv = *v } @@ -11511,20 +14930,7 @@ func awsAwsquery_deserializeDocumentTargetGroupTuple(v **types.TargetGroupTuple, originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("TargetGroupArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TargetGroupArn = ptr.String(xtv) - } - - case strings.EqualFold("Weight", t.Name.Local): + case strings.EqualFold("Message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11534,11 +14940,7 @@ func awsAwsquery_deserializeDocumentTargetGroupTuple(v **types.TargetGroupTuple, } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Weight = ptr.Int32(int32(i64)) + sv.Message = ptr.String(xtv) } default: @@ -11555,13 +14957,13 @@ func awsAwsquery_deserializeDocumentTargetGroupTuple(v **types.TargetGroupTuple, return nil } -func awsAwsquery_deserializeDocumentTargetHealth(v **types.TargetHealth, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTrustStoreRevocation(v **types.TrustStoreRevocation, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TargetHealth + var sv *types.TrustStoreRevocation if *v == nil { - sv = &types.TargetHealth{} + sv = &types.TrustStoreRevocation{} } else { sv = *v } @@ -11577,7 +14979,7 @@ func awsAwsquery_deserializeDocumentTargetHealth(v **types.TargetHealth, decoder originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Description", t.Name.Local): + case strings.EqualFold("NumberOfRevokedEntries", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11587,10 +14989,14 @@ func awsAwsquery_deserializeDocumentTargetHealth(v **types.TargetHealth, decoder } { xtv := string(val) - sv.Description = ptr.String(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.NumberOfRevokedEntries = ptr.Int64(i64) } - case strings.EqualFold("Reason", t.Name.Local): + case strings.EqualFold("RevocationId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11600,10 +15006,14 @@ func awsAwsquery_deserializeDocumentTargetHealth(v **types.TargetHealth, decoder } { xtv := string(val) - sv.Reason = types.TargetHealthReasonEnum(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.RevocationId = ptr.Int64(i64) } - case strings.EqualFold("State", t.Name.Local): + case strings.EqualFold("RevocationType", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11613,46 +15023,10 @@ func awsAwsquery_deserializeDocumentTargetHealth(v **types.TargetHealth, decoder } { xtv := string(val) - sv.State = types.TargetHealthStateEnum(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + sv.RevocationType = types.RevocationType(xtv) } - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsAwsquery_deserializeDocumentTargetHealthDescription(v **types.TargetHealthDescription, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TargetHealthDescription - if *v == nil { - sv = &types.TargetHealthDescription{} - } 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("HealthCheckPort", t.Name.Local): + case strings.EqualFold("TrustStoreArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11662,19 +15036,7 @@ func awsAwsquery_deserializeDocumentTargetHealthDescription(v **types.TargetHeal } { xtv := string(val) - sv.HealthCheckPort = ptr.String(xtv) - } - - case strings.EqualFold("Target", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentTargetDescription(&sv.Target, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("TargetHealth", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentTargetHealth(&sv.TargetHealth, nodeDecoder); err != nil { - return err + sv.TrustStoreArn = ptr.String(xtv) } default: @@ -11691,13 +15053,13 @@ func awsAwsquery_deserializeDocumentTargetHealthDescription(v **types.TargetHeal return nil } -func awsAwsquery_deserializeDocumentTargetHealthDescriptions(v *[]types.TargetHealthDescription, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTrustStoreRevocations(v *[]types.TrustStoreRevocation, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.TargetHealthDescription + var sv []types.TrustStoreRevocation if *v == nil { - sv = make([]types.TargetHealthDescription, 0) + sv = make([]types.TrustStoreRevocation, 0) } else { sv = *v } @@ -11713,10 +15075,10 @@ func awsAwsquery_deserializeDocumentTargetHealthDescriptions(v *[]types.TargetHe } switch { case strings.EqualFold("member", t.Name.Local): - var col types.TargetHealthDescription + var col types.TrustStoreRevocation nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col - if err := awsAwsquery_deserializeDocumentTargetHealthDescription(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTrustStoreRevocation(&destAddr, nodeDecoder); err != nil { return err } col = *destAddr @@ -11735,22 +15097,22 @@ func awsAwsquery_deserializeDocumentTargetHealthDescriptions(v *[]types.TargetHe return nil } -func awsAwsquery_deserializeDocumentTargetHealthDescriptionsUnwrapped(v *[]types.TargetHealthDescription, decoder smithyxml.NodeDecoder) error { - var sv []types.TargetHealthDescription +func awsAwsquery_deserializeDocumentTrustStoreRevocationsUnwrapped(v *[]types.TrustStoreRevocation, decoder smithyxml.NodeDecoder) error { + var sv []types.TrustStoreRevocation if *v == nil { - sv = make([]types.TargetHealthDescription, 0) + sv = make([]types.TrustStoreRevocation, 0) } else { sv = *v } switch { default: - var mv types.TargetHealthDescription + var mv types.TrustStoreRevocation t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv - if err := awsAwsquery_deserializeDocumentTargetHealthDescription(&destAddr, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTrustStoreRevocation(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr @@ -11759,17 +15121,18 @@ func awsAwsquery_deserializeDocumentTargetHealthDescriptionsUnwrapped(v *[]types *v = sv return nil } -func awsAwsquery_deserializeDocumentTooManyActionsException(v **types.TooManyActionsException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentTrustStores(v *[]types.TrustStore, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TooManyActionsException + var sv []types.TrustStore if *v == nil { - sv = &types.TooManyActionsException{} + sv = make([]types.TrustStore, 0) } else { sv = *v } + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -11778,24 +15141,18 @@ func awsAwsquery_deserializeDocumentTooManyActionsException(v **types.TooManyAct 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 { + case strings.EqualFold("member", t.Name.Local): + var col types.TrustStore + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentTrustStore(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } + col = *destAddr + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -11808,62 +15165,37 @@ func awsAwsquery_deserializeDocumentTooManyActionsException(v **types.TooManyAct return nil } -func awsAwsquery_deserializeDocumentTooManyCertificatesException(v **types.TooManyCertificatesException, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.TooManyCertificatesException +func awsAwsquery_deserializeDocumentTrustStoresUnwrapped(v *[]types.TrustStore, decoder smithyxml.NodeDecoder) error { + var sv []types.TrustStore if *v == nil { - sv = &types.TooManyCertificatesException{} + sv = make([]types.TrustStore, 0) } else { sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { + switch { + default: + var mv types.TrustStore + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentTrustStore(&destAddr, nodeDecoder); 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 + mv = *destAddr + sv = append(sv, mv) } *v = sv return nil } - -func awsAwsquery_deserializeDocumentTooManyListenersException(v **types.TooManyListenersException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentUnsupportedProtocolException(v **types.UnsupportedProtocolException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TooManyListenersException + var sv *types.UnsupportedProtocolException if *v == nil { - sv = &types.TooManyListenersException{} + sv = &types.UnsupportedProtocolException{} } else { sv = *v } @@ -11906,13 +15238,13 @@ func awsAwsquery_deserializeDocumentTooManyListenersException(v **types.TooManyL return nil } -func awsAwsquery_deserializeDocumentTooManyLoadBalancersException(v **types.TooManyLoadBalancersException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentAddListenerCertificatesOutput(v **AddListenerCertificatesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TooManyLoadBalancersException + var sv *AddListenerCertificatesOutput if *v == nil { - sv = &types.TooManyLoadBalancersException{} + sv = &AddListenerCertificatesOutput{} } else { sv = *v } @@ -11928,18 +15260,11 @@ func awsAwsquery_deserializeDocumentTooManyLoadBalancersException(v **types.TooM originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("Certificates", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCertificateList(&sv.Certificates, nodeDecoder); 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 @@ -11955,13 +15280,13 @@ func awsAwsquery_deserializeDocumentTooManyLoadBalancersException(v **types.TooM return nil } -func awsAwsquery_deserializeDocumentTooManyRegistrationsForTargetIdException(v **types.TooManyRegistrationsForTargetIdException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentAddTagsOutput(v **AddTagsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TooManyRegistrationsForTargetIdException + var sv *AddTagsOutput if *v == nil { - sv = &types.TooManyRegistrationsForTargetIdException{} + sv = &AddTagsOutput{} } else { sv = *v } @@ -11977,19 +15302,6 @@ func awsAwsquery_deserializeDocumentTooManyRegistrationsForTargetIdException(v * 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() @@ -12004,13 +15316,13 @@ func awsAwsquery_deserializeDocumentTooManyRegistrationsForTargetIdException(v * return nil } -func awsAwsquery_deserializeDocumentTooManyRulesException(v **types.TooManyRulesException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentAddTrustStoreRevocationsOutput(v **AddTrustStoreRevocationsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TooManyRulesException + var sv *AddTrustStoreRevocationsOutput if *v == nil { - sv = &types.TooManyRulesException{} + sv = &AddTrustStoreRevocationsOutput{} } else { sv = *v } @@ -12026,18 +15338,11 @@ func awsAwsquery_deserializeDocumentTooManyRulesException(v **types.TooManyRules originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("TrustStoreRevocations", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTrustStoreRevocations(&sv.TrustStoreRevocations, nodeDecoder); 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 @@ -12053,13 +15358,13 @@ func awsAwsquery_deserializeDocumentTooManyRulesException(v **types.TooManyRules return nil } -func awsAwsquery_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentCreateListenerOutput(v **CreateListenerOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TooManyTagsException + var sv *CreateListenerOutput if *v == nil { - sv = &types.TooManyTagsException{} + sv = &CreateListenerOutput{} } else { sv = *v } @@ -12075,18 +15380,11 @@ func awsAwsquery_deserializeDocumentTooManyTagsException(v **types.TooManyTagsEx originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("Listeners", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentListeners(&sv.Listeners, nodeDecoder); 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 @@ -12102,13 +15400,13 @@ func awsAwsquery_deserializeDocumentTooManyTagsException(v **types.TooManyTagsEx return nil } -func awsAwsquery_deserializeDocumentTooManyTargetGroupsException(v **types.TooManyTargetGroupsException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentCreateLoadBalancerOutput(v **CreateLoadBalancerOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TooManyTargetGroupsException + var sv *CreateLoadBalancerOutput if *v == nil { - sv = &types.TooManyTargetGroupsException{} + sv = &CreateLoadBalancerOutput{} } else { sv = *v } @@ -12124,18 +15422,11 @@ func awsAwsquery_deserializeDocumentTooManyTargetGroupsException(v **types.TooMa originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("LoadBalancers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLoadBalancers(&sv.LoadBalancers, nodeDecoder); 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 @@ -12151,13 +15442,13 @@ func awsAwsquery_deserializeDocumentTooManyTargetGroupsException(v **types.TooMa return nil } -func awsAwsquery_deserializeDocumentTooManyTargetsException(v **types.TooManyTargetsException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentCreateRuleOutput(v **CreateRuleOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TooManyTargetsException + var sv *CreateRuleOutput if *v == nil { - sv = &types.TooManyTargetsException{} + sv = &CreateRuleOutput{} } else { sv = *v } @@ -12173,18 +15464,11 @@ func awsAwsquery_deserializeDocumentTooManyTargetsException(v **types.TooManyTar originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("Rules", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRules(&sv.Rules, nodeDecoder); 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 @@ -12200,13 +15484,13 @@ func awsAwsquery_deserializeDocumentTooManyTargetsException(v **types.TooManyTar return nil } -func awsAwsquery_deserializeDocumentTooManyUniqueTargetGroupsPerLoadBalancerException(v **types.TooManyUniqueTargetGroupsPerLoadBalancerException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentCreateTargetGroupOutput(v **CreateTargetGroupOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.TooManyUniqueTargetGroupsPerLoadBalancerException + var sv *CreateTargetGroupOutput if *v == nil { - sv = &types.TooManyUniqueTargetGroupsPerLoadBalancerException{} + sv = &CreateTargetGroupOutput{} } else { sv = *v } @@ -12222,18 +15506,11 @@ func awsAwsquery_deserializeDocumentTooManyUniqueTargetGroupsPerLoadBalancerExce originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("TargetGroups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTargetGroups(&sv.TargetGroups, nodeDecoder); 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 @@ -12249,13 +15526,13 @@ func awsAwsquery_deserializeDocumentTooManyUniqueTargetGroupsPerLoadBalancerExce return nil } -func awsAwsquery_deserializeDocumentUnsupportedProtocolException(v **types.UnsupportedProtocolException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentCreateTrustStoreOutput(v **CreateTrustStoreOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.UnsupportedProtocolException + var sv *CreateTrustStoreOutput if *v == nil { - sv = &types.UnsupportedProtocolException{} + sv = &CreateTrustStoreOutput{} } else { sv = *v } @@ -12271,18 +15548,11 @@ func awsAwsquery_deserializeDocumentUnsupportedProtocolException(v **types.Unsup originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("TrustStores", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTrustStores(&sv.TrustStores, nodeDecoder); 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 @@ -12298,13 +15568,13 @@ func awsAwsquery_deserializeDocumentUnsupportedProtocolException(v **types.Unsup return nil } -func awsAwsquery_deserializeOpDocumentAddListenerCertificatesOutput(v **AddListenerCertificatesOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDeleteListenerOutput(v **DeleteListenerOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *AddListenerCertificatesOutput + var sv *DeleteListenerOutput if *v == nil { - sv = &AddListenerCertificatesOutput{} + sv = &DeleteListenerOutput{} } else { sv = *v } @@ -12320,12 +15590,6 @@ func awsAwsquery_deserializeOpDocumentAddListenerCertificatesOutput(v **AddListe originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Certificates", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentCertificateList(&sv.Certificates, nodeDecoder); err != nil { - return err - } - default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -12340,13 +15604,13 @@ func awsAwsquery_deserializeOpDocumentAddListenerCertificatesOutput(v **AddListe return nil } -func awsAwsquery_deserializeOpDocumentAddTagsOutput(v **AddTagsOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDeleteLoadBalancerOutput(v **DeleteLoadBalancerOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *AddTagsOutput + var sv *DeleteLoadBalancerOutput if *v == nil { - sv = &AddTagsOutput{} + sv = &DeleteLoadBalancerOutput{} } else { sv = *v } @@ -12376,13 +15640,13 @@ func awsAwsquery_deserializeOpDocumentAddTagsOutput(v **AddTagsOutput, decoder s return nil } -func awsAwsquery_deserializeOpDocumentCreateListenerOutput(v **CreateListenerOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDeleteRuleOutput(v **DeleteRuleOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *CreateListenerOutput + var sv *DeleteRuleOutput if *v == nil { - sv = &CreateListenerOutput{} + sv = &DeleteRuleOutput{} } else { sv = *v } @@ -12398,12 +15662,6 @@ func awsAwsquery_deserializeOpDocumentCreateListenerOutput(v **CreateListenerOut originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Listeners", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentListeners(&sv.Listeners, nodeDecoder); err != nil { - return err - } - default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -12418,13 +15676,13 @@ func awsAwsquery_deserializeOpDocumentCreateListenerOutput(v **CreateListenerOut return nil } -func awsAwsquery_deserializeOpDocumentCreateLoadBalancerOutput(v **CreateLoadBalancerOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDeleteTargetGroupOutput(v **DeleteTargetGroupOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *CreateLoadBalancerOutput + var sv *DeleteTargetGroupOutput if *v == nil { - sv = &CreateLoadBalancerOutput{} + sv = &DeleteTargetGroupOutput{} } else { sv = *v } @@ -12440,12 +15698,6 @@ func awsAwsquery_deserializeOpDocumentCreateLoadBalancerOutput(v **CreateLoadBal originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("LoadBalancers", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentLoadBalancers(&sv.LoadBalancers, nodeDecoder); err != nil { - return err - } - default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -12460,13 +15712,13 @@ func awsAwsquery_deserializeOpDocumentCreateLoadBalancerOutput(v **CreateLoadBal return nil } -func awsAwsquery_deserializeOpDocumentCreateRuleOutput(v **CreateRuleOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDeleteTrustStoreOutput(v **DeleteTrustStoreOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *CreateRuleOutput + var sv *DeleteTrustStoreOutput if *v == nil { - sv = &CreateRuleOutput{} + sv = &DeleteTrustStoreOutput{} } else { sv = *v } @@ -12482,12 +15734,6 @@ func awsAwsquery_deserializeOpDocumentCreateRuleOutput(v **CreateRuleOutput, dec originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Rules", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentRules(&sv.Rules, nodeDecoder); err != nil { - return err - } - default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -12502,13 +15748,13 @@ func awsAwsquery_deserializeOpDocumentCreateRuleOutput(v **CreateRuleOutput, dec return nil } -func awsAwsquery_deserializeOpDocumentCreateTargetGroupOutput(v **CreateTargetGroupOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDeregisterTargetsOutput(v **DeregisterTargetsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *CreateTargetGroupOutput + var sv *DeregisterTargetsOutput if *v == nil { - sv = &CreateTargetGroupOutput{} + sv = &DeregisterTargetsOutput{} } else { sv = *v } @@ -12524,12 +15770,6 @@ func awsAwsquery_deserializeOpDocumentCreateTargetGroupOutput(v **CreateTargetGr originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("TargetGroups", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentTargetGroups(&sv.TargetGroups, nodeDecoder); err != nil { - return err - } - default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -12544,13 +15784,13 @@ func awsAwsquery_deserializeOpDocumentCreateTargetGroupOutput(v **CreateTargetGr return nil } -func awsAwsquery_deserializeOpDocumentDeleteListenerOutput(v **DeleteListenerOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDescribeAccountLimitsOutput(v **DescribeAccountLimitsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DeleteListenerOutput + var sv *DescribeAccountLimitsOutput if *v == nil { - sv = &DeleteListenerOutput{} + sv = &DescribeAccountLimitsOutput{} } else { sv = *v } @@ -12566,6 +15806,25 @@ func awsAwsquery_deserializeOpDocumentDeleteListenerOutput(v **DeleteListenerOut originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("Limits", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLimits(&sv.Limits, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("NextMarker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextMarker = ptr.String(xtv) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -12580,13 +15839,13 @@ func awsAwsquery_deserializeOpDocumentDeleteListenerOutput(v **DeleteListenerOut return nil } -func awsAwsquery_deserializeOpDocumentDeleteLoadBalancerOutput(v **DeleteLoadBalancerOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDescribeListenerCertificatesOutput(v **DescribeListenerCertificatesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DeleteLoadBalancerOutput + var sv *DescribeListenerCertificatesOutput if *v == nil { - sv = &DeleteLoadBalancerOutput{} + sv = &DescribeListenerCertificatesOutput{} } else { sv = *v } @@ -12602,6 +15861,25 @@ func awsAwsquery_deserializeOpDocumentDeleteLoadBalancerOutput(v **DeleteLoadBal originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("Certificates", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCertificateList(&sv.Certificates, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("NextMarker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextMarker = ptr.String(xtv) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -12616,13 +15894,13 @@ func awsAwsquery_deserializeOpDocumentDeleteLoadBalancerOutput(v **DeleteLoadBal return nil } -func awsAwsquery_deserializeOpDocumentDeleteRuleOutput(v **DeleteRuleOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDescribeListenersOutput(v **DescribeListenersOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DeleteRuleOutput + var sv *DescribeListenersOutput if *v == nil { - sv = &DeleteRuleOutput{} + sv = &DescribeListenersOutput{} } else { sv = *v } @@ -12638,6 +15916,25 @@ func awsAwsquery_deserializeOpDocumentDeleteRuleOutput(v **DeleteRuleOutput, dec originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("Listeners", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentListeners(&sv.Listeners, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("NextMarker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextMarker = ptr.String(xtv) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -12652,13 +15949,13 @@ func awsAwsquery_deserializeOpDocumentDeleteRuleOutput(v **DeleteRuleOutput, dec return nil } -func awsAwsquery_deserializeOpDocumentDeleteTargetGroupOutput(v **DeleteTargetGroupOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDescribeLoadBalancerAttributesOutput(v **DescribeLoadBalancerAttributesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DeleteTargetGroupOutput + var sv *DescribeLoadBalancerAttributesOutput if *v == nil { - sv = &DeleteTargetGroupOutput{} + sv = &DescribeLoadBalancerAttributesOutput{} } else { sv = *v } @@ -12674,6 +15971,12 @@ func awsAwsquery_deserializeOpDocumentDeleteTargetGroupOutput(v **DeleteTargetGr originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("Attributes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLoadBalancerAttributes(&sv.Attributes, nodeDecoder); err != nil { + return err + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -12688,28 +15991,47 @@ func awsAwsquery_deserializeOpDocumentDeleteTargetGroupOutput(v **DeleteTargetGr return nil } -func awsAwsquery_deserializeOpDocumentDeregisterTargetsOutput(v **DeregisterTargetsOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDescribeLoadBalancersOutput(v **DescribeLoadBalancersOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DeregisterTargetsOutput + var sv *DescribeLoadBalancersOutput if *v == nil { - sv = &DeregisterTargetsOutput{} + sv = &DescribeLoadBalancersOutput{} } 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 { + 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("LoadBalancers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLoadBalancers(&sv.LoadBalancers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("NextMarker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextMarker = ptr.String(xtv) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -12724,13 +16046,13 @@ func awsAwsquery_deserializeOpDocumentDeregisterTargetsOutput(v **DeregisterTarg return nil } -func awsAwsquery_deserializeOpDocumentDescribeAccountLimitsOutput(v **DescribeAccountLimitsOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDescribeRulesOutput(v **DescribeRulesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeAccountLimitsOutput + var sv *DescribeRulesOutput if *v == nil { - sv = &DescribeAccountLimitsOutput{} + sv = &DescribeRulesOutput{} } else { sv = *v } @@ -12746,12 +16068,6 @@ func awsAwsquery_deserializeOpDocumentDescribeAccountLimitsOutput(v **DescribeAc originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Limits", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentLimits(&sv.Limits, nodeDecoder); err != nil { - return err - } - case strings.EqualFold("NextMarker", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -12765,6 +16081,12 @@ func awsAwsquery_deserializeOpDocumentDescribeAccountLimitsOutput(v **DescribeAc sv.NextMarker = ptr.String(xtv) } + case strings.EqualFold("Rules", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRules(&sv.Rules, nodeDecoder); err != nil { + return err + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -12779,13 +16101,13 @@ func awsAwsquery_deserializeOpDocumentDescribeAccountLimitsOutput(v **DescribeAc return nil } -func awsAwsquery_deserializeOpDocumentDescribeListenerCertificatesOutput(v **DescribeListenerCertificatesOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDescribeSSLPoliciesOutput(v **DescribeSSLPoliciesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeListenerCertificatesOutput + var sv *DescribeSSLPoliciesOutput if *v == nil { - sv = &DescribeListenerCertificatesOutput{} + sv = &DescribeSSLPoliciesOutput{} } else { sv = *v } @@ -12801,12 +16123,6 @@ func awsAwsquery_deserializeOpDocumentDescribeListenerCertificatesOutput(v **Des originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Certificates", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentCertificateList(&sv.Certificates, nodeDecoder); err != nil { - return err - } - case strings.EqualFold("NextMarker", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -12820,6 +16136,12 @@ func awsAwsquery_deserializeOpDocumentDescribeListenerCertificatesOutput(v **Des sv.NextMarker = ptr.String(xtv) } + case strings.EqualFold("SslPolicies", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSslPolicies(&sv.SslPolicies, nodeDecoder); err != nil { + return err + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -12834,13 +16156,13 @@ func awsAwsquery_deserializeOpDocumentDescribeListenerCertificatesOutput(v **Des return nil } -func awsAwsquery_deserializeOpDocumentDescribeListenersOutput(v **DescribeListenersOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDescribeTagsOutput(v **DescribeTagsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeListenersOutput + var sv *DescribeTagsOutput if *v == nil { - sv = &DescribeListenersOutput{} + sv = &DescribeTagsOutput{} } else { sv = *v } @@ -12856,24 +16178,11 @@ func awsAwsquery_deserializeOpDocumentDescribeListenersOutput(v **DescribeListen originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Listeners", t.Name.Local): + case strings.EqualFold("TagDescriptions", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentListeners(&sv.Listeners, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("NextMarker", t.Name.Local): - val, err := decoder.Value() - if err != nil { + if err := awsAwsquery_deserializeDocumentTagDescriptions(&sv.TagDescriptions, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.NextMarker = ptr.String(xtv) - } default: // Do nothing and ignore the unexpected tag element @@ -12889,13 +16198,13 @@ func awsAwsquery_deserializeOpDocumentDescribeListenersOutput(v **DescribeListen return nil } -func awsAwsquery_deserializeOpDocumentDescribeLoadBalancerAttributesOutput(v **DescribeLoadBalancerAttributesOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDescribeTargetGroupAttributesOutput(v **DescribeTargetGroupAttributesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeLoadBalancerAttributesOutput + var sv *DescribeTargetGroupAttributesOutput if *v == nil { - sv = &DescribeLoadBalancerAttributesOutput{} + sv = &DescribeTargetGroupAttributesOutput{} } else { sv = *v } @@ -12913,7 +16222,7 @@ func awsAwsquery_deserializeOpDocumentDescribeLoadBalancerAttributesOutput(v **D switch { case strings.EqualFold("Attributes", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentLoadBalancerAttributes(&sv.Attributes, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTargetGroupAttributes(&sv.Attributes, nodeDecoder); err != nil { return err } @@ -12931,13 +16240,13 @@ func awsAwsquery_deserializeOpDocumentDescribeLoadBalancerAttributesOutput(v **D return nil } -func awsAwsquery_deserializeOpDocumentDescribeLoadBalancersOutput(v **DescribeLoadBalancersOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDescribeTargetGroupsOutput(v **DescribeTargetGroupsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeLoadBalancersOutput + var sv *DescribeTargetGroupsOutput if *v == nil { - sv = &DescribeLoadBalancersOutput{} + sv = &DescribeTargetGroupsOutput{} } else { sv = *v } @@ -12953,12 +16262,6 @@ func awsAwsquery_deserializeOpDocumentDescribeLoadBalancersOutput(v **DescribeLo originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("LoadBalancers", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentLoadBalancers(&sv.LoadBalancers, nodeDecoder); err != nil { - return err - } - case strings.EqualFold("NextMarker", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -12972,6 +16275,12 @@ func awsAwsquery_deserializeOpDocumentDescribeLoadBalancersOutput(v **DescribeLo sv.NextMarker = ptr.String(xtv) } + case strings.EqualFold("TargetGroups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTargetGroups(&sv.TargetGroups, nodeDecoder); err != nil { + return err + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -12986,13 +16295,13 @@ func awsAwsquery_deserializeOpDocumentDescribeLoadBalancersOutput(v **DescribeLo return nil } -func awsAwsquery_deserializeOpDocumentDescribeRulesOutput(v **DescribeRulesOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDescribeTargetHealthOutput(v **DescribeTargetHealthOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeRulesOutput + var sv *DescribeTargetHealthOutput if *v == nil { - sv = &DescribeRulesOutput{} + sv = &DescribeTargetHealthOutput{} } else { sv = *v } @@ -13008,22 +16317,9 @@ func awsAwsquery_deserializeOpDocumentDescribeRulesOutput(v **DescribeRulesOutpu originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("NextMarker", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextMarker = ptr.String(xtv) - } - - case strings.EqualFold("Rules", t.Name.Local): + case strings.EqualFold("TargetHealthDescriptions", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentRules(&sv.Rules, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTargetHealthDescriptions(&sv.TargetHealthDescriptions, nodeDecoder); err != nil { return err } @@ -13041,13 +16337,13 @@ func awsAwsquery_deserializeOpDocumentDescribeRulesOutput(v **DescribeRulesOutpu return nil } -func awsAwsquery_deserializeOpDocumentDescribeSSLPoliciesOutput(v **DescribeSSLPoliciesOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDescribeTrustStoreAssociationsOutput(v **DescribeTrustStoreAssociationsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeSSLPoliciesOutput + var sv *DescribeTrustStoreAssociationsOutput if *v == nil { - sv = &DescribeSSLPoliciesOutput{} + sv = &DescribeTrustStoreAssociationsOutput{} } else { sv = *v } @@ -13076,9 +16372,9 @@ func awsAwsquery_deserializeOpDocumentDescribeSSLPoliciesOutput(v **DescribeSSLP sv.NextMarker = ptr.String(xtv) } - case strings.EqualFold("SslPolicies", t.Name.Local): + case strings.EqualFold("TrustStoreAssociations", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentSslPolicies(&sv.SslPolicies, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTrustStoreAssociations(&sv.TrustStoreAssociations, nodeDecoder); err != nil { return err } @@ -13096,13 +16392,13 @@ func awsAwsquery_deserializeOpDocumentDescribeSSLPoliciesOutput(v **DescribeSSLP return nil } -func awsAwsquery_deserializeOpDocumentDescribeTagsOutput(v **DescribeTagsOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDescribeTrustStoreRevocationsOutput(v **DescribeTrustStoreRevocationsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeTagsOutput + var sv *DescribeTrustStoreRevocationsOutput if *v == nil { - sv = &DescribeTagsOutput{} + sv = &DescribeTrustStoreRevocationsOutput{} } else { sv = *v } @@ -13118,9 +16414,22 @@ func awsAwsquery_deserializeOpDocumentDescribeTagsOutput(v **DescribeTagsOutput, originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("TagDescriptions", t.Name.Local): + case strings.EqualFold("NextMarker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextMarker = ptr.String(xtv) + } + + case strings.EqualFold("TrustStoreRevocations", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentTagDescriptions(&sv.TagDescriptions, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentDescribeTrustStoreRevocationResponse(&sv.TrustStoreRevocations, nodeDecoder); err != nil { return err } @@ -13138,13 +16447,13 @@ func awsAwsquery_deserializeOpDocumentDescribeTagsOutput(v **DescribeTagsOutput, return nil } -func awsAwsquery_deserializeOpDocumentDescribeTargetGroupAttributesOutput(v **DescribeTargetGroupAttributesOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentDescribeTrustStoresOutput(v **DescribeTrustStoresOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeTargetGroupAttributesOutput + var sv *DescribeTrustStoresOutput if *v == nil { - sv = &DescribeTargetGroupAttributesOutput{} + sv = &DescribeTrustStoresOutput{} } else { sv = *v } @@ -13160,9 +16469,22 @@ func awsAwsquery_deserializeOpDocumentDescribeTargetGroupAttributesOutput(v **De originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Attributes", t.Name.Local): + case strings.EqualFold("NextMarker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextMarker = ptr.String(xtv) + } + + case strings.EqualFold("TrustStores", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentTargetGroupAttributes(&sv.Attributes, nodeDecoder); err != nil { + if err := awsAwsquery_deserializeDocumentTrustStores(&sv.TrustStores, nodeDecoder); err != nil { return err } @@ -13180,13 +16502,13 @@ func awsAwsquery_deserializeOpDocumentDescribeTargetGroupAttributesOutput(v **De return nil } -func awsAwsquery_deserializeOpDocumentDescribeTargetGroupsOutput(v **DescribeTargetGroupsOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentGetTrustStoreCaCertificatesBundleOutput(v **GetTrustStoreCaCertificatesBundleOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeTargetGroupsOutput + var sv *GetTrustStoreCaCertificatesBundleOutput if *v == nil { - sv = &DescribeTargetGroupsOutput{} + sv = &GetTrustStoreCaCertificatesBundleOutput{} } else { sv = *v } @@ -13202,7 +16524,7 @@ func awsAwsquery_deserializeOpDocumentDescribeTargetGroupsOutput(v **DescribeTar originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("NextMarker", t.Name.Local): + case strings.EqualFold("Location", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -13212,13 +16534,7 @@ func awsAwsquery_deserializeOpDocumentDescribeTargetGroupsOutput(v **DescribeTar } { xtv := string(val) - sv.NextMarker = ptr.String(xtv) - } - - case strings.EqualFold("TargetGroups", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentTargetGroups(&sv.TargetGroups, nodeDecoder); err != nil { - return err + sv.Location = ptr.String(xtv) } default: @@ -13235,13 +16551,13 @@ func awsAwsquery_deserializeOpDocumentDescribeTargetGroupsOutput(v **DescribeTar return nil } -func awsAwsquery_deserializeOpDocumentDescribeTargetHealthOutput(v **DescribeTargetHealthOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeOpDocumentGetTrustStoreRevocationContentOutput(v **GetTrustStoreRevocationContentOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeTargetHealthOutput + var sv *GetTrustStoreRevocationContentOutput if *v == nil { - sv = &DescribeTargetHealthOutput{} + sv = &GetTrustStoreRevocationContentOutput{} } else { sv = *v } @@ -13257,11 +16573,18 @@ func awsAwsquery_deserializeOpDocumentDescribeTargetHealthOutput(v **DescribeTar originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("TargetHealthDescriptions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentTargetHealthDescriptions(&sv.TargetHealthDescriptions, nodeDecoder); err != nil { + case strings.EqualFold("Location", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.Location = ptr.String(xtv) + } default: // Do nothing and ignore the unexpected tag element @@ -13487,6 +16810,48 @@ func awsAwsquery_deserializeOpDocumentModifyTargetGroupOutput(v **ModifyTargetGr return nil } +func awsAwsquery_deserializeOpDocumentModifyTrustStoreOutput(v **ModifyTrustStoreOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyTrustStoreOutput + if *v == nil { + sv = &ModifyTrustStoreOutput{} + } 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("TrustStores", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTrustStores(&sv.TrustStores, 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_deserializeOpDocumentRegisterTargetsOutput(v **RegisterTargetsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13595,6 +16960,42 @@ func awsAwsquery_deserializeOpDocumentRemoveTagsOutput(v **RemoveTagsOutput, dec return nil } +func awsAwsquery_deserializeOpDocumentRemoveTrustStoreRevocationsOutput(v **RemoveTrustStoreRevocationsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *RemoveTrustStoreRevocationsOutput + if *v == nil { + sv = &RemoveTrustStoreRevocationsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsAwsquery_deserializeOpDocumentSetIpAddressTypeOutput(v **SetIpAddressTypeOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/elasticloadbalancingv2/generated.json b/service/elasticloadbalancingv2/generated.json index 65bc4c146ed..9c75c42008c 100644 --- a/service/elasticloadbalancingv2/generated.json +++ b/service/elasticloadbalancingv2/generated.json @@ -12,14 +12,17 @@ "api_client_test.go", "api_op_AddListenerCertificates.go", "api_op_AddTags.go", + "api_op_AddTrustStoreRevocations.go", "api_op_CreateListener.go", "api_op_CreateLoadBalancer.go", "api_op_CreateRule.go", "api_op_CreateTargetGroup.go", + "api_op_CreateTrustStore.go", "api_op_DeleteListener.go", "api_op_DeleteLoadBalancer.go", "api_op_DeleteRule.go", "api_op_DeleteTargetGroup.go", + "api_op_DeleteTrustStore.go", "api_op_DeregisterTargets.go", "api_op_DescribeAccountLimits.go", "api_op_DescribeListenerCertificates.go", @@ -32,14 +35,21 @@ "api_op_DescribeTargetGroupAttributes.go", "api_op_DescribeTargetGroups.go", "api_op_DescribeTargetHealth.go", + "api_op_DescribeTrustStoreAssociations.go", + "api_op_DescribeTrustStoreRevocations.go", + "api_op_DescribeTrustStores.go", + "api_op_GetTrustStoreCaCertificatesBundle.go", + "api_op_GetTrustStoreRevocationContent.go", "api_op_ModifyListener.go", "api_op_ModifyLoadBalancerAttributes.go", "api_op_ModifyRule.go", "api_op_ModifyTargetGroup.go", "api_op_ModifyTargetGroupAttributes.go", + "api_op_ModifyTrustStore.go", "api_op_RegisterTargets.go", "api_op_RemoveListenerCertificates.go", "api_op_RemoveTags.go", + "api_op_RemoveTrustStoreRevocations.go", "api_op_SetIpAddressType.go", "api_op_SetRulePriorities.go", "api_op_SetSecurityGroups.go", diff --git a/service/elasticloadbalancingv2/serializers.go b/service/elasticloadbalancingv2/serializers.go index 67381e6aa1e..53c7db843df 100644 --- a/service/elasticloadbalancingv2/serializers.go +++ b/service/elasticloadbalancingv2/serializers.go @@ -144,6 +144,70 @@ func (m *awsAwsquery_serializeOpAddTags) HandleSerialize(ctx context.Context, in return next.HandleSerialize(ctx, in) } +type awsAwsquery_serializeOpAddTrustStoreRevocations struct { +} + +func (*awsAwsquery_serializeOpAddTrustStoreRevocations) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpAddTrustStoreRevocations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AddTrustStoreRevocationsInput) + _ = 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("AddTrustStoreRevocations") + body.Key("Version").String("2015-12-01") + + if err := awsAwsquery_serializeOpDocumentAddTrustStoreRevocationsInput(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_serializeOpCreateListener struct { } @@ -400,6 +464,70 @@ func (m *awsAwsquery_serializeOpCreateTargetGroup) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsquery_serializeOpCreateTrustStore struct { +} + +func (*awsAwsquery_serializeOpCreateTrustStore) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateTrustStore) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateTrustStoreInput) + _ = 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("CreateTrustStore") + body.Key("Version").String("2015-12-01") + + if err := awsAwsquery_serializeOpDocumentCreateTrustStoreInput(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_serializeOpDeleteListener struct { } @@ -656,6 +784,70 @@ func (m *awsAwsquery_serializeOpDeleteTargetGroup) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsquery_serializeOpDeleteTrustStore struct { +} + +func (*awsAwsquery_serializeOpDeleteTrustStore) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteTrustStore) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteTrustStoreInput) + _ = 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("DeleteTrustStore") + body.Key("Version").String("2015-12-01") + + if err := awsAwsquery_serializeOpDocumentDeleteTrustStoreInput(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_serializeOpDeregisterTargets struct { } @@ -1424,14 +1616,14 @@ func (m *awsAwsquery_serializeOpDescribeTargetHealth) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpModifyListener struct { +type awsAwsquery_serializeOpDescribeTrustStoreAssociations struct { } -func (*awsAwsquery_serializeOpModifyListener) ID() string { +func (*awsAwsquery_serializeOpDescribeTrustStoreAssociations) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpModifyListener) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsquery_serializeOpDescribeTrustStoreAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1439,7 +1631,7 @@ func (m *awsAwsquery_serializeOpModifyListener) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ModifyListenerInput) + input, ok := in.Parameters.(*DescribeTrustStoreAssociationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1464,10 +1656,10 @@ func (m *awsAwsquery_serializeOpModifyListener) HandleSerialize(ctx context.Cont bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() - body.Key("Action").String("ModifyListener") + body.Key("Action").String("DescribeTrustStoreAssociations") body.Key("Version").String("2015-12-01") - if err := awsAwsquery_serializeOpDocumentModifyListenerInput(input, bodyEncoder.Value); err != nil { + if err := awsAwsquery_serializeOpDocumentDescribeTrustStoreAssociationsInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1488,14 +1680,14 @@ func (m *awsAwsquery_serializeOpModifyListener) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpModifyLoadBalancerAttributes struct { +type awsAwsquery_serializeOpDescribeTrustStoreRevocations struct { } -func (*awsAwsquery_serializeOpModifyLoadBalancerAttributes) ID() string { +func (*awsAwsquery_serializeOpDescribeTrustStoreRevocations) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpModifyLoadBalancerAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsquery_serializeOpDescribeTrustStoreRevocations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1503,7 +1695,7 @@ func (m *awsAwsquery_serializeOpModifyLoadBalancerAttributes) HandleSerialize(ct return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ModifyLoadBalancerAttributesInput) + input, ok := in.Parameters.(*DescribeTrustStoreRevocationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1528,10 +1720,10 @@ func (m *awsAwsquery_serializeOpModifyLoadBalancerAttributes) HandleSerialize(ct bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() - body.Key("Action").String("ModifyLoadBalancerAttributes") + body.Key("Action").String("DescribeTrustStoreRevocations") body.Key("Version").String("2015-12-01") - if err := awsAwsquery_serializeOpDocumentModifyLoadBalancerAttributesInput(input, bodyEncoder.Value); err != nil { + if err := awsAwsquery_serializeOpDocumentDescribeTrustStoreRevocationsInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1552,14 +1744,14 @@ func (m *awsAwsquery_serializeOpModifyLoadBalancerAttributes) HandleSerialize(ct return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpModifyRule struct { +type awsAwsquery_serializeOpDescribeTrustStores struct { } -func (*awsAwsquery_serializeOpModifyRule) ID() string { +func (*awsAwsquery_serializeOpDescribeTrustStores) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpModifyRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsquery_serializeOpDescribeTrustStores) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1567,7 +1759,7 @@ func (m *awsAwsquery_serializeOpModifyRule) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ModifyRuleInput) + input, ok := in.Parameters.(*DescribeTrustStoresInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1592,10 +1784,10 @@ func (m *awsAwsquery_serializeOpModifyRule) HandleSerialize(ctx context.Context, bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() - body.Key("Action").String("ModifyRule") + body.Key("Action").String("DescribeTrustStores") body.Key("Version").String("2015-12-01") - if err := awsAwsquery_serializeOpDocumentModifyRuleInput(input, bodyEncoder.Value); err != nil { + if err := awsAwsquery_serializeOpDocumentDescribeTrustStoresInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1616,14 +1808,14 @@ func (m *awsAwsquery_serializeOpModifyRule) HandleSerialize(ctx context.Context, return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpModifyTargetGroup struct { +type awsAwsquery_serializeOpGetTrustStoreCaCertificatesBundle struct { } -func (*awsAwsquery_serializeOpModifyTargetGroup) ID() string { +func (*awsAwsquery_serializeOpGetTrustStoreCaCertificatesBundle) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpModifyTargetGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsquery_serializeOpGetTrustStoreCaCertificatesBundle) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1631,7 +1823,7 @@ func (m *awsAwsquery_serializeOpModifyTargetGroup) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ModifyTargetGroupInput) + input, ok := in.Parameters.(*GetTrustStoreCaCertificatesBundleInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1656,10 +1848,10 @@ func (m *awsAwsquery_serializeOpModifyTargetGroup) HandleSerialize(ctx context.C bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() - body.Key("Action").String("ModifyTargetGroup") + body.Key("Action").String("GetTrustStoreCaCertificatesBundle") body.Key("Version").String("2015-12-01") - if err := awsAwsquery_serializeOpDocumentModifyTargetGroupInput(input, bodyEncoder.Value); err != nil { + if err := awsAwsquery_serializeOpDocumentGetTrustStoreCaCertificatesBundleInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1680,14 +1872,14 @@ func (m *awsAwsquery_serializeOpModifyTargetGroup) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpModifyTargetGroupAttributes struct { +type awsAwsquery_serializeOpGetTrustStoreRevocationContent struct { } -func (*awsAwsquery_serializeOpModifyTargetGroupAttributes) ID() string { +func (*awsAwsquery_serializeOpGetTrustStoreRevocationContent) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpModifyTargetGroupAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsquery_serializeOpGetTrustStoreRevocationContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1695,7 +1887,7 @@ func (m *awsAwsquery_serializeOpModifyTargetGroupAttributes) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ModifyTargetGroupAttributesInput) + input, ok := in.Parameters.(*GetTrustStoreRevocationContentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1720,10 +1912,10 @@ func (m *awsAwsquery_serializeOpModifyTargetGroupAttributes) HandleSerialize(ctx bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() - body.Key("Action").String("ModifyTargetGroupAttributes") + body.Key("Action").String("GetTrustStoreRevocationContent") body.Key("Version").String("2015-12-01") - if err := awsAwsquery_serializeOpDocumentModifyTargetGroupAttributesInput(input, bodyEncoder.Value); err != nil { + if err := awsAwsquery_serializeOpDocumentGetTrustStoreRevocationContentInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1744,14 +1936,14 @@ func (m *awsAwsquery_serializeOpModifyTargetGroupAttributes) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpRegisterTargets struct { +type awsAwsquery_serializeOpModifyListener struct { } -func (*awsAwsquery_serializeOpRegisterTargets) ID() string { +func (*awsAwsquery_serializeOpModifyListener) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpRegisterTargets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsquery_serializeOpModifyListener) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1759,7 +1951,7 @@ func (m *awsAwsquery_serializeOpRegisterTargets) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*RegisterTargetsInput) + input, ok := in.Parameters.(*ModifyListenerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1784,10 +1976,458 @@ func (m *awsAwsquery_serializeOpRegisterTargets) HandleSerialize(ctx context.Con bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() - body.Key("Action").String("RegisterTargets") + body.Key("Action").String("ModifyListener") + body.Key("Version").String("2015-12-01") + + if err := awsAwsquery_serializeOpDocumentModifyListenerInput(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_serializeOpModifyLoadBalancerAttributes struct { +} + +func (*awsAwsquery_serializeOpModifyLoadBalancerAttributes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyLoadBalancerAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyLoadBalancerAttributesInput) + _ = 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("ModifyLoadBalancerAttributes") + body.Key("Version").String("2015-12-01") + + if err := awsAwsquery_serializeOpDocumentModifyLoadBalancerAttributesInput(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_serializeOpModifyRule struct { +} + +func (*awsAwsquery_serializeOpModifyRule) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyRuleInput) + _ = 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("ModifyRule") + body.Key("Version").String("2015-12-01") + + if err := awsAwsquery_serializeOpDocumentModifyRuleInput(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_serializeOpModifyTargetGroup struct { +} + +func (*awsAwsquery_serializeOpModifyTargetGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyTargetGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyTargetGroupInput) + _ = 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("ModifyTargetGroup") + body.Key("Version").String("2015-12-01") + + if err := awsAwsquery_serializeOpDocumentModifyTargetGroupInput(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_serializeOpModifyTargetGroupAttributes struct { +} + +func (*awsAwsquery_serializeOpModifyTargetGroupAttributes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyTargetGroupAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyTargetGroupAttributesInput) + _ = 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("ModifyTargetGroupAttributes") + body.Key("Version").String("2015-12-01") + + if err := awsAwsquery_serializeOpDocumentModifyTargetGroupAttributesInput(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_serializeOpModifyTrustStore struct { +} + +func (*awsAwsquery_serializeOpModifyTrustStore) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyTrustStore) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyTrustStoreInput) + _ = 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("ModifyTrustStore") + body.Key("Version").String("2015-12-01") + + if err := awsAwsquery_serializeOpDocumentModifyTrustStoreInput(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_serializeOpRegisterTargets struct { +} + +func (*awsAwsquery_serializeOpRegisterTargets) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRegisterTargets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RegisterTargetsInput) + _ = 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("RegisterTargets") + body.Key("Version").String("2015-12-01") + + if err := awsAwsquery_serializeOpDocumentRegisterTargetsInput(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_serializeOpRemoveListenerCertificates struct { +} + +func (*awsAwsquery_serializeOpRemoveListenerCertificates) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRemoveListenerCertificates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RemoveListenerCertificatesInput) + _ = 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("RemoveListenerCertificates") body.Key("Version").String("2015-12-01") - if err := awsAwsquery_serializeOpDocumentRegisterTargetsInput(input, bodyEncoder.Value); err != nil { + if err := awsAwsquery_serializeOpDocumentRemoveListenerCertificatesInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1808,14 +2448,14 @@ func (m *awsAwsquery_serializeOpRegisterTargets) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpRemoveListenerCertificates struct { +type awsAwsquery_serializeOpRemoveTags struct { } -func (*awsAwsquery_serializeOpRemoveListenerCertificates) ID() string { +func (*awsAwsquery_serializeOpRemoveTags) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpRemoveListenerCertificates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsquery_serializeOpRemoveTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1823,7 +2463,7 @@ func (m *awsAwsquery_serializeOpRemoveListenerCertificates) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*RemoveListenerCertificatesInput) + input, ok := in.Parameters.(*RemoveTagsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1848,10 +2488,10 @@ func (m *awsAwsquery_serializeOpRemoveListenerCertificates) HandleSerialize(ctx bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() - body.Key("Action").String("RemoveListenerCertificates") + body.Key("Action").String("RemoveTags") body.Key("Version").String("2015-12-01") - if err := awsAwsquery_serializeOpDocumentRemoveListenerCertificatesInput(input, bodyEncoder.Value); err != nil { + if err := awsAwsquery_serializeOpDocumentRemoveTagsInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1872,14 +2512,14 @@ func (m *awsAwsquery_serializeOpRemoveListenerCertificates) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpRemoveTags struct { +type awsAwsquery_serializeOpRemoveTrustStoreRevocations struct { } -func (*awsAwsquery_serializeOpRemoveTags) ID() string { +func (*awsAwsquery_serializeOpRemoveTrustStoreRevocations) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpRemoveTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsquery_serializeOpRemoveTrustStoreRevocations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1887,7 +2527,7 @@ func (m *awsAwsquery_serializeOpRemoveTags) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*RemoveTagsInput) + input, ok := in.Parameters.(*RemoveTrustStoreRevocationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1912,10 +2552,10 @@ func (m *awsAwsquery_serializeOpRemoveTags) HandleSerialize(ctx context.Context, bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() - body.Key("Action").String("RemoveTags") + body.Key("Action").String("RemoveTrustStoreRevocations") body.Key("Version").String("2015-12-01") - if err := awsAwsquery_serializeOpDocumentRemoveTagsInput(input, bodyEncoder.Value); err != nil { + if err := awsAwsquery_serializeOpDocumentRemoveTrustStoreRevocationsInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2555,6 +3195,16 @@ func awsAwsquery_serializeDocumentListenerArns(v []string, value query.Value) er return nil } +func awsAwsquery_serializeDocumentListOfDescribeTargetHealthIncludeOptions(v []types.DescribeTargetHealthInputIncludeEnum, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsAwsquery_serializeDocumentListOfString(v []string, value query.Value) error { array := value.Array("member") @@ -2631,6 +3281,28 @@ func awsAwsquery_serializeDocumentMatcher(v *types.Matcher, value query.Value) e return nil } +func awsAwsquery_serializeDocumentMutualAuthenticationAttributes(v *types.MutualAuthenticationAttributes, value query.Value) error { + object := value.Object() + _ = object + + if v.IgnoreClientCertificateExpiry != nil { + objectKey := object.Key("IgnoreClientCertificateExpiry") + objectKey.Boolean(*v.IgnoreClientCertificateExpiry) + } + + if v.Mode != nil { + objectKey := object.Key("Mode") + objectKey.String(*v.Mode) + } + + if v.TrustStoreArn != nil { + objectKey := object.Key("TrustStoreArn") + objectKey.String(*v.TrustStoreArn) + } + + return nil +} + func awsAwsquery_serializeDocumentPathPatternConditionConfig(v *types.PathPatternConditionConfig, value query.Value) error { object := value.Object() _ = object @@ -2735,6 +3407,55 @@ func awsAwsquery_serializeDocumentResourceArns(v []string, value query.Value) er return nil } +func awsAwsquery_serializeDocumentRevocationContent(v *types.RevocationContent, value query.Value) error { + object := value.Object() + _ = object + + if len(v.RevocationType) > 0 { + objectKey := object.Key("RevocationType") + objectKey.String(string(v.RevocationType)) + } + + if v.S3Bucket != nil { + objectKey := object.Key("S3Bucket") + objectKey.String(*v.S3Bucket) + } + + if v.S3Key != nil { + objectKey := object.Key("S3Key") + objectKey.String(*v.S3Key) + } + + if v.S3ObjectVersion != nil { + objectKey := object.Key("S3ObjectVersion") + objectKey.String(*v.S3ObjectVersion) + } + + return nil +} + +func awsAwsquery_serializeDocumentRevocationContents(v []types.RevocationContent, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentRevocationContent(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentRevocationIds(v []int64, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.Long(v[i]) + } + return nil +} + func awsAwsquery_serializeDocumentRuleArns(v []string, value query.Value) error { array := value.Array("member") @@ -3098,6 +3819,26 @@ func awsAwsquery_serializeDocumentTargetGroupTuple(v *types.TargetGroupTuple, va return nil } +func awsAwsquery_serializeDocumentTrustStoreArns(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_serializeDocumentTrustStoreNames(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_serializeOpDocumentAddListenerCertificatesInput(v *AddListenerCertificatesInput, value query.Value) error { object := value.Object() _ = object @@ -3138,6 +3879,25 @@ func awsAwsquery_serializeOpDocumentAddTagsInput(v *AddTagsInput, value query.Va return nil } +func awsAwsquery_serializeOpDocumentAddTrustStoreRevocationsInput(v *AddTrustStoreRevocationsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.RevocationContents != nil { + objectKey := object.Key("RevocationContents") + if err := awsAwsquery_serializeDocumentRevocationContents(v.RevocationContents, objectKey); err != nil { + return err + } + } + + if v.TrustStoreArn != nil { + objectKey := object.Key("TrustStoreArn") + objectKey.String(*v.TrustStoreArn) + } + + return nil +} + func awsAwsquery_serializeOpDocumentCreateListenerInput(v *CreateListenerInput, value query.Value) error { object := value.Object() _ = object @@ -3168,6 +3928,13 @@ func awsAwsquery_serializeOpDocumentCreateListenerInput(v *CreateListenerInput, objectKey.String(*v.LoadBalancerArn) } + if v.MutualAuthentication != nil { + objectKey := object.Key("MutualAuthentication") + if err := awsAwsquery_serializeDocumentMutualAuthenticationAttributes(v.MutualAuthentication, objectKey); err != nil { + return err + } + } + if v.Port != nil { objectKey := object.Key("Port") objectKey.Integer(*v.Port) @@ -3387,6 +4154,40 @@ func awsAwsquery_serializeOpDocumentCreateTargetGroupInput(v *CreateTargetGroupI return nil } +func awsAwsquery_serializeOpDocumentCreateTrustStoreInput(v *CreateTrustStoreInput, value query.Value) error { + object := value.Object() + _ = object + + if v.CaCertificatesBundleS3Bucket != nil { + objectKey := object.Key("CaCertificatesBundleS3Bucket") + objectKey.String(*v.CaCertificatesBundleS3Bucket) + } + + if v.CaCertificatesBundleS3Key != nil { + objectKey := object.Key("CaCertificatesBundleS3Key") + objectKey.String(*v.CaCertificatesBundleS3Key) + } + + if v.CaCertificatesBundleS3ObjectVersion != nil { + objectKey := object.Key("CaCertificatesBundleS3ObjectVersion") + objectKey.String(*v.CaCertificatesBundleS3ObjectVersion) + } + + if v.Name != nil { + objectKey := object.Key("Name") + objectKey.String(*v.Name) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + func awsAwsquery_serializeOpDocumentDeleteListenerInput(v *DeleteListenerInput, value query.Value) error { object := value.Object() _ = object @@ -3435,6 +4236,18 @@ func awsAwsquery_serializeOpDocumentDeleteTargetGroupInput(v *DeleteTargetGroupI return nil } +func awsAwsquery_serializeOpDocumentDeleteTrustStoreInput(v *DeleteTrustStoreInput, value query.Value) error { + object := value.Object() + _ = object + + if v.TrustStoreArn != nil { + objectKey := object.Key("TrustStoreArn") + objectKey.String(*v.TrustStoreArn) + } + + return nil +} + func awsAwsquery_serializeOpDocumentDeregisterTargetsInput(v *DeregisterTargetsInput, value query.Value) error { object := value.Object() _ = object @@ -3689,6 +4502,13 @@ func awsAwsquery_serializeOpDocumentDescribeTargetHealthInput(v *DescribeTargetH object := value.Object() _ = object + if v.Include != nil { + objectKey := object.Key("Include") + if err := awsAwsquery_serializeDocumentListOfDescribeTargetHealthIncludeOptions(v.Include, objectKey); err != nil { + return err + } + } + if v.TargetGroupArn != nil { objectKey := object.Key("TargetGroupArn") objectKey.String(*v.TargetGroupArn) @@ -3704,6 +4524,117 @@ func awsAwsquery_serializeOpDocumentDescribeTargetHealthInput(v *DescribeTargetH return nil } +func awsAwsquery_serializeOpDocumentDescribeTrustStoreAssociationsInput(v *DescribeTrustStoreAssociationsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.PageSize != nil { + objectKey := object.Key("PageSize") + objectKey.Integer(*v.PageSize) + } + + if v.TrustStoreArn != nil { + objectKey := object.Key("TrustStoreArn") + objectKey.String(*v.TrustStoreArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeTrustStoreRevocationsInput(v *DescribeTrustStoreRevocationsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.PageSize != nil { + objectKey := object.Key("PageSize") + objectKey.Integer(*v.PageSize) + } + + if v.RevocationIds != nil { + objectKey := object.Key("RevocationIds") + if err := awsAwsquery_serializeDocumentRevocationIds(v.RevocationIds, objectKey); err != nil { + return err + } + } + + if v.TrustStoreArn != nil { + objectKey := object.Key("TrustStoreArn") + objectKey.String(*v.TrustStoreArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeTrustStoresInput(v *DescribeTrustStoresInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.Names != nil { + objectKey := object.Key("Names") + if err := awsAwsquery_serializeDocumentTrustStoreNames(v.Names, objectKey); err != nil { + return err + } + } + + if v.PageSize != nil { + objectKey := object.Key("PageSize") + objectKey.Integer(*v.PageSize) + } + + if v.TrustStoreArns != nil { + objectKey := object.Key("TrustStoreArns") + if err := awsAwsquery_serializeDocumentTrustStoreArns(v.TrustStoreArns, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentGetTrustStoreCaCertificatesBundleInput(v *GetTrustStoreCaCertificatesBundleInput, value query.Value) error { + object := value.Object() + _ = object + + if v.TrustStoreArn != nil { + objectKey := object.Key("TrustStoreArn") + objectKey.String(*v.TrustStoreArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentGetTrustStoreRevocationContentInput(v *GetTrustStoreRevocationContentInput, value query.Value) error { + object := value.Object() + _ = object + + if v.RevocationId != nil { + objectKey := object.Key("RevocationId") + objectKey.Long(*v.RevocationId) + } + + if v.TrustStoreArn != nil { + objectKey := object.Key("TrustStoreArn") + objectKey.String(*v.TrustStoreArn) + } + + return nil +} + func awsAwsquery_serializeOpDocumentModifyListenerInput(v *ModifyListenerInput, value query.Value) error { object := value.Object() _ = object @@ -3734,6 +4665,13 @@ func awsAwsquery_serializeOpDocumentModifyListenerInput(v *ModifyListenerInput, objectKey.String(*v.ListenerArn) } + if v.MutualAuthentication != nil { + objectKey := object.Key("MutualAuthentication") + if err := awsAwsquery_serializeDocumentMutualAuthenticationAttributes(v.MutualAuthentication, objectKey); err != nil { + return err + } + } + if v.Port != nil { objectKey := object.Key("Port") objectKey.Integer(*v.Port) @@ -3875,6 +4813,33 @@ func awsAwsquery_serializeOpDocumentModifyTargetGroupInput(v *ModifyTargetGroupI return nil } +func awsAwsquery_serializeOpDocumentModifyTrustStoreInput(v *ModifyTrustStoreInput, value query.Value) error { + object := value.Object() + _ = object + + if v.CaCertificatesBundleS3Bucket != nil { + objectKey := object.Key("CaCertificatesBundleS3Bucket") + objectKey.String(*v.CaCertificatesBundleS3Bucket) + } + + if v.CaCertificatesBundleS3Key != nil { + objectKey := object.Key("CaCertificatesBundleS3Key") + objectKey.String(*v.CaCertificatesBundleS3Key) + } + + if v.CaCertificatesBundleS3ObjectVersion != nil { + objectKey := object.Key("CaCertificatesBundleS3ObjectVersion") + objectKey.String(*v.CaCertificatesBundleS3ObjectVersion) + } + + if v.TrustStoreArn != nil { + objectKey := object.Key("TrustStoreArn") + objectKey.String(*v.TrustStoreArn) + } + + return nil +} + func awsAwsquery_serializeOpDocumentRegisterTargetsInput(v *RegisterTargetsInput, value query.Value) error { object := value.Object() _ = object @@ -3934,6 +4899,25 @@ func awsAwsquery_serializeOpDocumentRemoveTagsInput(v *RemoveTagsInput, value qu return nil } +func awsAwsquery_serializeOpDocumentRemoveTrustStoreRevocationsInput(v *RemoveTrustStoreRevocationsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.RevocationIds != nil { + objectKey := object.Key("RevocationIds") + if err := awsAwsquery_serializeDocumentRevocationIds(v.RevocationIds, objectKey); err != nil { + return err + } + } + + if v.TrustStoreArn != nil { + objectKey := object.Key("TrustStoreArn") + objectKey.String(*v.TrustStoreArn) + } + + return nil +} + func awsAwsquery_serializeOpDocumentSetIpAddressTypeInput(v *SetIpAddressTypeInput, value query.Value) error { object := value.Object() _ = object diff --git a/service/elasticloadbalancingv2/types/enums.go b/service/elasticloadbalancingv2/types/enums.go index ba73e0e3716..b88123d3e7f 100644 --- a/service/elasticloadbalancingv2/types/enums.go +++ b/service/elasticloadbalancingv2/types/enums.go @@ -26,6 +26,24 @@ func (ActionTypeEnum) Values() []ActionTypeEnum { } } +type AnomalyResultEnum string + +// Enum values for AnomalyResultEnum +const ( + AnomalyResultEnumAnomalous AnomalyResultEnum = "anomalous" + AnomalyResultEnumNormal AnomalyResultEnum = "normal" +) + +// Values returns all known values for AnomalyResultEnum. 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 (AnomalyResultEnum) Values() []AnomalyResultEnum { + return []AnomalyResultEnum{ + "anomalous", + "normal", + } +} + type AuthenticateCognitoActionConditionalBehaviorEnum string // Enum values for AuthenticateCognitoActionConditionalBehaviorEnum @@ -68,6 +86,25 @@ func (AuthenticateOidcActionConditionalBehaviorEnum) Values() []AuthenticateOidc } } +type DescribeTargetHealthInputIncludeEnum string + +// Enum values for DescribeTargetHealthInputIncludeEnum +const ( + DescribeTargetHealthInputIncludeEnumAnomaly DescribeTargetHealthInputIncludeEnum = "AnomalyDetection" + DescribeTargetHealthInputIncludeEnumAll DescribeTargetHealthInputIncludeEnum = "All" +) + +// Values returns all known values for DescribeTargetHealthInputIncludeEnum. 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 (DescribeTargetHealthInputIncludeEnum) Values() []DescribeTargetHealthInputIncludeEnum { + return []DescribeTargetHealthInputIncludeEnum{ + "AnomalyDetection", + "All", + } +} + type EnforceSecurityGroupInboundRulesOnPrivateLinkTrafficEnum string // Enum values for EnforceSecurityGroupInboundRulesOnPrivateLinkTrafficEnum @@ -165,6 +202,24 @@ func (LoadBalancerTypeEnum) Values() []LoadBalancerTypeEnum { } } +type MitigationInEffectEnum string + +// Enum values for MitigationInEffectEnum +const ( + MitigationInEffectEnumYes MitigationInEffectEnum = "yes" + MitigationInEffectEnumNo MitigationInEffectEnum = "no" +) + +// Values returns all known values for MitigationInEffectEnum. 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 (MitigationInEffectEnum) Values() []MitigationInEffectEnum { + return []MitigationInEffectEnum{ + "yes", + "no", + } +} + type ProtocolEnum string // Enum values for ProtocolEnum @@ -212,6 +267,22 @@ func (RedirectActionStatusCodeEnum) Values() []RedirectActionStatusCodeEnum { } } +type RevocationType string + +// Enum values for RevocationType +const ( + RevocationTypeCrl RevocationType = "CRL" +) + +// Values returns all known values for RevocationType. 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 (RevocationType) Values() []RevocationType { + return []RevocationType{ + "CRL", + } +} + type TargetGroupIpAddressTypeEnum string // Enum values for TargetGroupIpAddressTypeEnum @@ -316,3 +387,21 @@ func (TargetTypeEnum) Values() []TargetTypeEnum { "alb", } } + +type TrustStoreStatus string + +// Enum values for TrustStoreStatus +const ( + TrustStoreStatusActive TrustStoreStatus = "ACTIVE" + TrustStoreStatusCreating TrustStoreStatus = "CREATING" +) + +// Values returns all known values for TrustStoreStatus. 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 (TrustStoreStatus) Values() []TrustStoreStatus { + return []TrustStoreStatus{ + "ACTIVE", + "CREATING", + } +} diff --git a/service/elasticloadbalancingv2/types/errors.go b/service/elasticloadbalancingv2/types/errors.go index a44b7489162..8edc1b087a8 100644 --- a/service/elasticloadbalancingv2/types/errors.go +++ b/service/elasticloadbalancingv2/types/errors.go @@ -87,6 +87,34 @@ func (e *AvailabilityZoneNotSupportedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The specified ca certificate bundle does not exist. +type CaCertificatesBundleNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *CaCertificatesBundleNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *CaCertificatesBundleNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *CaCertificatesBundleNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "CaCertificatesBundleNotFound" + } + return *e.ErrorCodeOverride +} +func (e *CaCertificatesBundleNotFoundException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + // The specified certificate does not exist. type CertificateNotFoundException struct { Message *string @@ -219,6 +247,32 @@ func (e *DuplicateTargetGroupNameException) ErrorCode() string { } func (e *DuplicateTargetGroupNameException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// A trust store with the specified name already exists. +type DuplicateTrustStoreNameException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DuplicateTrustStoreNameException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DuplicateTrustStoreNameException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DuplicateTrustStoreNameException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DuplicateTrustStoreName" + } + return *e.ErrorCodeOverride +} +func (e *DuplicateTrustStoreNameException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The health of the specified targets could not be retrieved due to an internal // error. type HealthUnavailableException struct { @@ -272,6 +326,34 @@ func (e *IncompatibleProtocolsException) ErrorCode() string { } func (e *IncompatibleProtocolsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The specified ca certificate bundle is in an invalid format, or corrupt. +type InvalidCaCertificatesBundleException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidCaCertificatesBundleException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidCaCertificatesBundleException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidCaCertificatesBundleException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidCaCertificatesBundle" + } + return *e.ErrorCodeOverride +} +func (e *InvalidCaCertificatesBundleException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + // The requested configuration is not valid. type InvalidConfigurationRequestException struct { Message *string @@ -328,6 +410,33 @@ func (e *InvalidLoadBalancerActionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The provided revocation file is an invalid format, or uses an incorrect +// algorithm. +type InvalidRevocationContentException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidRevocationContentException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidRevocationContentException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidRevocationContentException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRevocationContent" + } + return *e.ErrorCodeOverride +} +func (e *InvalidRevocationContentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The requested scheme is not valid. type InvalidSchemeException struct { Message *string @@ -563,6 +672,60 @@ func (e *ResourceInUseException) ErrorCode() string { } func (e *ResourceInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The specified revocation file does not exist. +type RevocationContentNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *RevocationContentNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *RevocationContentNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *RevocationContentNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "RevocationContentNotFound" + } + return *e.ErrorCodeOverride +} +func (e *RevocationContentNotFoundException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The specified revocation ID does not exist. +type RevocationIdNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *RevocationIdNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *RevocationIdNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *RevocationIdNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "RevocationIdNotFound" + } + return *e.ErrorCodeOverride +} +func (e *RevocationIdNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The specified rule does not exist. type RuleNotFoundException struct { Message *string @@ -855,7 +1018,7 @@ func (e *TooManyRulesException) ErrorCode() string { } func (e *TooManyRulesException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// You've reached the limit on the number of tags per load balancer. +// You've reached the limit on the number of tags for this resource. type TooManyTagsException struct { Message *string @@ -934,6 +1097,61 @@ func (e *TooManyTargetsException) ErrorCode() string { } func (e *TooManyTargetsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The specified trust store has too many revocation entries. +type TooManyTrustStoreRevocationEntriesException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TooManyTrustStoreRevocationEntriesException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TooManyTrustStoreRevocationEntriesException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TooManyTrustStoreRevocationEntriesException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TooManyTrustStoreRevocationEntries" + } + return *e.ErrorCodeOverride +} +func (e *TooManyTrustStoreRevocationEntriesException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// You've reached the limit on the number of trust stores for your Amazon Web +// Services account. +type TooManyTrustStoresException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TooManyTrustStoresException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TooManyTrustStoresException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TooManyTrustStoresException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TooManyTrustStores" + } + return *e.ErrorCodeOverride +} +func (e *TooManyTrustStoresException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // You've reached the limit on the number of unique target groups per load // balancer across all listeners. If a target group is used by multiple actions for // a load balancer, it is counted as only one use. @@ -964,6 +1182,84 @@ func (e *TooManyUniqueTargetGroupsPerLoadBalancerException) ErrorFault() smithy. return smithy.FaultClient } +// The specified trust store is currently in use. +type TrustStoreInUseException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TrustStoreInUseException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TrustStoreInUseException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TrustStoreInUseException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TrustStoreInUse" + } + return *e.ErrorCodeOverride +} +func (e *TrustStoreInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified trust store does not exist. +type TrustStoreNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TrustStoreNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TrustStoreNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TrustStoreNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TrustStoreNotFound" + } + return *e.ErrorCodeOverride +} +func (e *TrustStoreNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified trust store is not active. +type TrustStoreNotReadyException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TrustStoreNotReadyException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TrustStoreNotReadyException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TrustStoreNotReadyException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TrustStoreNotReady" + } + return *e.ErrorCodeOverride +} +func (e *TrustStoreNotReadyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The specified protocol is not supported. type UnsupportedProtocolException struct { Message *string diff --git a/service/elasticloadbalancingv2/types/types.go b/service/elasticloadbalancingv2/types/types.go index 263c579b0a3..7a440ff07a3 100644 --- a/service/elasticloadbalancingv2/types/types.go +++ b/service/elasticloadbalancingv2/types/types.go @@ -52,6 +52,18 @@ type Action struct { noSmithyDocumentSerde } +// Information about anomaly detection and mitigation. +type AnomalyDetection struct { + + // Indicates whether anomaly mitigation is in progress. + MitigationInEffect MitigationInEffectEnum + + // The latest anomaly detection result. + Result AnomalyResultEnum + + noSmithyDocumentSerde +} + // Request parameters to use when integrating with Amazon Cognito to authenticate // users. type AuthenticateCognitoActionConfig struct { @@ -218,6 +230,24 @@ type Cipher struct { noSmithyDocumentSerde } +// Information about the revocations used by a trust store. +type DescribeTrustStoreRevocation struct { + + // The number of revoked certificates. + NumberOfRevokedEntries *int64 + + // The revocation ID of a revocation file in use. + RevocationId *int64 + + // The type of revocation file. + RevocationType RevocationType + + // The Amazon Resource Name (ARN) of the trust store. + TrustStoreArn *string + + noSmithyDocumentSerde +} + // Information about an action that returns a custom HTTP response. type FixedResponseActionConfig struct { @@ -357,6 +387,9 @@ type Listener struct { // The Amazon Resource Name (ARN) of the load balancer. LoadBalancerArn *string + // The mutual authentication configuration information. + MutualAuthentication *MutualAuthenticationAttributes + // The port on which the load balancer is listening. Port *int32 @@ -476,6 +509,14 @@ type LoadBalancerAttribute struct { // The following attributes are supported by only Application Load Balancers: // - idle_timeout.timeout_seconds - The idle timeout value, in seconds. The valid // range is 1-4000 seconds. The default is 60 seconds. + // - connection_logs.s3.enabled - Indicates whether connection logs are enabled. + // The value is true or false . The default is false . + // - connection_logs.s3.bucket - The name of the S3 bucket for the connection + // logs. This attribute is required if connection logs are enabled. The bucket must + // exist in the same region as the load balancer and have a bucket policy that + // grants Elastic Load Balancing permissions to write to the bucket. + // - connection_logs.s3.prefix - The prefix for the location in the S3 bucket for + // the connection logs. // - routing.http.desync_mitigation_mode - Determines how the load balancer // handles requests that might pose a security risk to your application. The // possible values are monitor , defensive , and strictest . The default is @@ -570,6 +611,22 @@ type Matcher struct { noSmithyDocumentSerde } +// Information about the mutual authentication attributes of a listener. +type MutualAuthenticationAttributes struct { + + // Indicates whether expired client certificates are ignored. + IgnoreClientCertificateExpiry *bool + + // The client certificate handling method. Options are off , passthrough or verify + // . The default value is off . + Mode *string + + // The Amazon Resource Name (ARN) of the trust store. + TrustStoreArn *string + + noSmithyDocumentSerde +} + // Information about a path pattern condition. type PathPatternConditionConfig struct { @@ -661,6 +718,24 @@ type RedirectActionConfig struct { noSmithyDocumentSerde } +// Information about a revocation file. +type RevocationContent struct { + + // The type of revocation file. + RevocationType RevocationType + + // The Amazon S3 bucket for the revocation file. + S3Bucket *string + + // The Amazon S3 path for the revocation file. + S3Key *string + + // The Amazon S3 object version of the revocation file. + S3ObjectVersion *string + + noSmithyDocumentSerde +} + // Information about a rule. type Rule struct { @@ -1001,7 +1076,11 @@ type TargetGroupAttribute struct { // Application Load Balancer and the target is an instance or an IP address: // - load_balancing.algorithm.type - The load balancing algorithm determines how // the load balancer selects targets when routing requests. The value is - // round_robin or least_outstanding_requests . The default is round_robin . + // round_robin , least_outstanding_requests , or weighted_random . The default is + // round_robin . + // - load_balancing.algorithm.anomaly_mitigation - Only available when + // load_balancing.algorithm.type is weighted_random . Indicates whether anomaly + // mitigation is enabled. The value is on or off . The default is off . // - slow_start.duration_seconds - The time period, in seconds, during which a // newly registered target receives an increasing share of the traffic to the // target group. After this time period ends, the target receives its full share of @@ -1141,6 +1220,10 @@ type TargetHealth struct { // Information about the health of a target. type TargetHealthDescription struct { + // The anomaly detection result for the target. If no anomalies were detected, the + // result is normal . If anomalies were detected, the result is anomalous . + AnomalyDetection *AnomalyDetection + // The port to use to connect with the target. HealthCheckPort *string @@ -1153,4 +1236,52 @@ type TargetHealthDescription struct { noSmithyDocumentSerde } +// Information about a trust store. +type TrustStore struct { + + // The name of the trust store. + Name *string + + // The number of ca certificates in the trust store. + NumberOfCaCertificates *int32 + + // The current status of the trust store. + Status TrustStoreStatus + + // The number of revoked certificates in the trust store. + TotalRevokedEntries *int64 + + // The Amazon Resource Name (ARN) of the trust store. + TrustStoreArn *string + + noSmithyDocumentSerde +} + +// Information about the resources a trust store is associated with. +type TrustStoreAssociation struct { + + // The Amazon Resource Name (ARN) of the resource. + ResourceArn *string + + noSmithyDocumentSerde +} + +// Information about a revocation file in use by a trust store. +type TrustStoreRevocation struct { + + // The number of revoked certificates. + NumberOfRevokedEntries *int64 + + // The revocation ID of the revocation file. + RevocationId *int64 + + // The type of revocation file. + RevocationType RevocationType + + // The Amazon Resource Name (ARN) of the trust store. + TrustStoreArn *string + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/elasticloadbalancingv2/validators.go b/service/elasticloadbalancingv2/validators.go index 0c4905bdb42..06057557ae8 100644 --- a/service/elasticloadbalancingv2/validators.go +++ b/service/elasticloadbalancingv2/validators.go @@ -50,6 +50,26 @@ func (m *validateOpAddTags) HandleInitialize(ctx context.Context, in middleware. return next.HandleInitialize(ctx, in) } +type validateOpAddTrustStoreRevocations struct { +} + +func (*validateOpAddTrustStoreRevocations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAddTrustStoreRevocations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AddTrustStoreRevocationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAddTrustStoreRevocationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateListener struct { } @@ -130,6 +150,26 @@ func (m *validateOpCreateTargetGroup) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpCreateTrustStore struct { +} + +func (*validateOpCreateTrustStore) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateTrustStore) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateTrustStoreInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateTrustStoreInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteListener struct { } @@ -210,6 +250,26 @@ func (m *validateOpDeleteTargetGroup) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpDeleteTrustStore struct { +} + +func (*validateOpDeleteTrustStore) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteTrustStore) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteTrustStoreInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteTrustStoreInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeregisterTargets struct { } @@ -330,6 +390,86 @@ func (m *validateOpDescribeTargetHealth) HandleInitialize(ctx context.Context, i return next.HandleInitialize(ctx, in) } +type validateOpDescribeTrustStoreAssociations struct { +} + +func (*validateOpDescribeTrustStoreAssociations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeTrustStoreAssociations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeTrustStoreAssociationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeTrustStoreAssociationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeTrustStoreRevocations struct { +} + +func (*validateOpDescribeTrustStoreRevocations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeTrustStoreRevocations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeTrustStoreRevocationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeTrustStoreRevocationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetTrustStoreCaCertificatesBundle struct { +} + +func (*validateOpGetTrustStoreCaCertificatesBundle) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetTrustStoreCaCertificatesBundle) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetTrustStoreCaCertificatesBundleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetTrustStoreCaCertificatesBundleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetTrustStoreRevocationContent struct { +} + +func (*validateOpGetTrustStoreRevocationContent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetTrustStoreRevocationContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetTrustStoreRevocationContentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetTrustStoreRevocationContentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpModifyListener struct { } @@ -430,6 +570,26 @@ func (m *validateOpModifyTargetGroup) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpModifyTrustStore struct { +} + +func (*validateOpModifyTrustStore) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyTrustStore) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyTrustStoreInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyTrustStoreInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpRegisterTargets struct { } @@ -490,6 +650,26 @@ func (m *validateOpRemoveTags) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpRemoveTrustStoreRevocations struct { +} + +func (*validateOpRemoveTrustStoreRevocations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRemoveTrustStoreRevocations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RemoveTrustStoreRevocationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRemoveTrustStoreRevocationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpSetIpAddressType struct { } @@ -578,6 +758,10 @@ func addOpAddTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAddTags{}, middleware.After) } +func addOpAddTrustStoreRevocationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAddTrustStoreRevocations{}, middleware.After) +} + func addOpCreateListenerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateListener{}, middleware.After) } @@ -594,6 +778,10 @@ func addOpCreateTargetGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateTargetGroup{}, middleware.After) } +func addOpCreateTrustStoreValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateTrustStore{}, middleware.After) +} + func addOpDeleteListenerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteListener{}, middleware.After) } @@ -610,6 +798,10 @@ func addOpDeleteTargetGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteTargetGroup{}, middleware.After) } +func addOpDeleteTrustStoreValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteTrustStore{}, middleware.After) +} + func addOpDeregisterTargetsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeregisterTargets{}, middleware.After) } @@ -634,6 +826,22 @@ func addOpDescribeTargetHealthValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpDescribeTargetHealth{}, middleware.After) } +func addOpDescribeTrustStoreAssociationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeTrustStoreAssociations{}, middleware.After) +} + +func addOpDescribeTrustStoreRevocationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeTrustStoreRevocations{}, middleware.After) +} + +func addOpGetTrustStoreCaCertificatesBundleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetTrustStoreCaCertificatesBundle{}, middleware.After) +} + +func addOpGetTrustStoreRevocationContentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetTrustStoreRevocationContent{}, middleware.After) +} + func addOpModifyListenerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpModifyListener{}, middleware.After) } @@ -654,6 +862,10 @@ func addOpModifyTargetGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpModifyTargetGroup{}, middleware.After) } +func addOpModifyTrustStoreValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyTrustStore{}, middleware.After) +} + func addOpRegisterTargetsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRegisterTargets{}, middleware.After) } @@ -666,6 +878,10 @@ func addOpRemoveTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRemoveTags{}, middleware.After) } +func addOpRemoveTrustStoreRevocationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRemoveTrustStoreRevocations{}, middleware.After) +} + func addOpSetIpAddressTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSetIpAddressType{}, middleware.After) } @@ -916,6 +1132,21 @@ func validateOpAddTagsInput(v *AddTagsInput) error { } } +func validateOpAddTrustStoreRevocationsInput(v *AddTrustStoreRevocationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AddTrustStoreRevocationsInput"} + if v.TrustStoreArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TrustStoreArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateListenerInput(v *CreateListenerInput) error { if v == nil { return nil @@ -1016,6 +1247,32 @@ func validateOpCreateTargetGroupInput(v *CreateTargetGroupInput) error { } } +func validateOpCreateTrustStoreInput(v *CreateTrustStoreInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateTrustStoreInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.CaCertificatesBundleS3Bucket == nil { + invalidParams.Add(smithy.NewErrParamRequired("CaCertificatesBundleS3Bucket")) + } + if v.CaCertificatesBundleS3Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("CaCertificatesBundleS3Key")) + } + 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 validateOpDeleteListenerInput(v *DeleteListenerInput) error { if v == nil { return nil @@ -1076,6 +1333,21 @@ func validateOpDeleteTargetGroupInput(v *DeleteTargetGroupInput) error { } } +func validateOpDeleteTrustStoreInput(v *DeleteTrustStoreInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteTrustStoreInput"} + if v.TrustStoreArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TrustStoreArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeregisterTargetsInput(v *DeregisterTargetsInput) error { if v == nil { return nil @@ -1178,6 +1450,69 @@ func validateOpDescribeTargetHealthInput(v *DescribeTargetHealthInput) error { } } +func validateOpDescribeTrustStoreAssociationsInput(v *DescribeTrustStoreAssociationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeTrustStoreAssociationsInput"} + if v.TrustStoreArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TrustStoreArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeTrustStoreRevocationsInput(v *DescribeTrustStoreRevocationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeTrustStoreRevocationsInput"} + if v.TrustStoreArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TrustStoreArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetTrustStoreCaCertificatesBundleInput(v *GetTrustStoreCaCertificatesBundleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetTrustStoreCaCertificatesBundleInput"} + if v.TrustStoreArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TrustStoreArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetTrustStoreRevocationContentInput(v *GetTrustStoreRevocationContentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetTrustStoreRevocationContentInput"} + if v.TrustStoreArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TrustStoreArn")) + } + if v.RevocationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RevocationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpModifyListenerInput(v *ModifyListenerInput) error { if v == nil { return nil @@ -1269,6 +1604,27 @@ func validateOpModifyTargetGroupInput(v *ModifyTargetGroupInput) error { } } +func validateOpModifyTrustStoreInput(v *ModifyTrustStoreInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyTrustStoreInput"} + if v.TrustStoreArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TrustStoreArn")) + } + if v.CaCertificatesBundleS3Bucket == nil { + invalidParams.Add(smithy.NewErrParamRequired("CaCertificatesBundleS3Bucket")) + } + if v.CaCertificatesBundleS3Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("CaCertificatesBundleS3Key")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpRegisterTargetsInput(v *RegisterTargetsInput) error { if v == nil { return nil @@ -1327,6 +1683,24 @@ func validateOpRemoveTagsInput(v *RemoveTagsInput) error { } } +func validateOpRemoveTrustStoreRevocationsInput(v *RemoveTrustStoreRevocationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RemoveTrustStoreRevocationsInput"} + if v.TrustStoreArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TrustStoreArn")) + } + if v.RevocationIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("RevocationIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpSetIpAddressTypeInput(v *SetIpAddressTypeInput) error { if v == nil { return nil diff --git a/service/freetier/LICENSE.txt b/service/freetier/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/freetier/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/freetier/api_client.go b/service/freetier/api_client.go new file mode 100644 index 00000000000..b47af2a90f8 --- /dev/null +++ b/service/freetier/api_client.go @@ -0,0 +1,454 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package freetier + +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 = "FreeTier" +const ServiceAPIVersion = "2023-09-07" + +// Client provides the API client to make operations call for AWS Free Tier. +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, "freetier", 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/freetier/api_client_test.go b/service/freetier/api_client_test.go new file mode 100644 index 00000000000..c2ca03724c7 --- /dev/null +++ b/service/freetier/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package freetier + +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/freetier/api_op_GetFreeTierUsage.go b/service/freetier/api_op_GetFreeTierUsage.go new file mode 100644 index 00000000000..e78a3781e4f --- /dev/null +++ b/service/freetier/api_op_GetFreeTierUsage.go @@ -0,0 +1,241 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package freetier + +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/freetier/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of all Free Tier usage objects that match your filters. +func (c *Client) GetFreeTierUsage(ctx context.Context, params *GetFreeTierUsageInput, optFns ...func(*Options)) (*GetFreeTierUsageOutput, error) { + if params == nil { + params = &GetFreeTierUsageInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetFreeTierUsage", params, optFns, c.addOperationGetFreeTierUsageMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetFreeTierUsageOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetFreeTierUsageInput struct { + + // An expression that specifies the conditions that you want each FreeTierUsage + // object to meet. + Filter *types.Expression + + // The maximum number of results to return in the response. MaxResults means that + // there can be up to the specified number of values, but there might be fewer + // results based on your filters. + MaxResults *int32 + + // The pagination token that indicates the next set of results to retrieve. + NextToken *string + + noSmithyDocumentSerde +} + +type GetFreeTierUsageOutput struct { + + // The list of Free Tier usage objects that meet your filter expression. + // + // This member is required. + FreeTierUsages []types.FreeTierUsage + + // The pagination token that indicates the next set of results to retrieve. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetFreeTierUsageMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetFreeTierUsage{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetFreeTierUsage{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetFreeTierUsage"); 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 = addOpGetFreeTierUsageValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFreeTierUsage(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 +} + +// GetFreeTierUsageAPIClient is a client that implements the GetFreeTierUsage +// operation. +type GetFreeTierUsageAPIClient interface { + GetFreeTierUsage(context.Context, *GetFreeTierUsageInput, ...func(*Options)) (*GetFreeTierUsageOutput, error) +} + +var _ GetFreeTierUsageAPIClient = (*Client)(nil) + +// GetFreeTierUsagePaginatorOptions is the paginator options for GetFreeTierUsage +type GetFreeTierUsagePaginatorOptions struct { + // The maximum number of results to return in the response. MaxResults means that + // there can be up to the specified number of values, but there might be fewer + // results based on your filters. + 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 +} + +// GetFreeTierUsagePaginator is a paginator for GetFreeTierUsage +type GetFreeTierUsagePaginator struct { + options GetFreeTierUsagePaginatorOptions + client GetFreeTierUsageAPIClient + params *GetFreeTierUsageInput + nextToken *string + firstPage bool +} + +// NewGetFreeTierUsagePaginator returns a new GetFreeTierUsagePaginator +func NewGetFreeTierUsagePaginator(client GetFreeTierUsageAPIClient, params *GetFreeTierUsageInput, optFns ...func(*GetFreeTierUsagePaginatorOptions)) *GetFreeTierUsagePaginator { + if params == nil { + params = &GetFreeTierUsageInput{} + } + + options := GetFreeTierUsagePaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &GetFreeTierUsagePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetFreeTierUsagePaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetFreeTierUsage page. +func (p *GetFreeTierUsagePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetFreeTierUsageOutput, 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.GetFreeTierUsage(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_opGetFreeTierUsage(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetFreeTierUsage", + } +} diff --git a/service/freetier/auth.go b/service/freetier/auth.go new file mode 100644 index 00000000000..12f163906a2 --- /dev/null +++ b/service/freetier/auth.go @@ -0,0 +1,256 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package freetier + +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, "freetier") + 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/freetier/deserializers.go b/service/freetier/deserializers.go new file mode 100644 index 00000000000..868143f0724 --- /dev/null +++ b/service/freetier/deserializers.go @@ -0,0 +1,637 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package freetier + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/freetier/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "math" + "strings" +) + +type awsAwsjson10_deserializeOpGetFreeTierUsage struct { +} + +func (*awsAwsjson10_deserializeOpGetFreeTierUsage) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpGetFreeTierUsage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetFreeTierUsage(response, &metadata) + } + output := &GetFreeTierUsageOutput{} + 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_deserializeOpDocumentGetFreeTierUsageOutput(&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_deserializeOpErrorGetFreeTierUsage(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +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_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ThrottlingException{} + err := awsAwsjson10_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ValidationException{} + err := awsAwsjson10_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeDocumentFreeTierUsage(v **types.FreeTierUsage, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FreeTierUsage + if *v == nil { + sv = &types.FreeTierUsage{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "actualUsageAmount": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ActualUsageAmount = 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.ActualUsageAmount = f64 + + default: + return fmt.Errorf("expected GenericDouble to be a JSON Number, got %T instead", value) + + } + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "forecastedUsageAmount": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ForecastedUsageAmount = 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.ForecastedUsageAmount = f64 + + default: + return fmt.Errorf("expected GenericDouble to be a JSON Number, got %T instead", value) + + } + } + + case "freeTierType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.FreeTierType = ptr.String(jtv) + } + + case "limit": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Limit = 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.Limit = f64 + + default: + return fmt.Errorf("expected GenericDouble to be a JSON Number, got %T instead", value) + + } + } + + case "operation": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Operation = ptr.String(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "service": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Service = ptr.String(jtv) + } + + case "unit": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Unit = ptr.String(jtv) + } + + case "usageType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.UsageType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentFreeTierUsages(v *[]types.FreeTierUsage, 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.FreeTierUsage + if *v == nil { + cv = []types.FreeTierUsage{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FreeTierUsage + destAddr := &col + if err := awsAwsjson10_deserializeDocumentFreeTierUsage(&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 GenericString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentGetFreeTierUsageOutput(v **GetFreeTierUsageOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetFreeTierUsageOutput + if *v == nil { + sv = &GetFreeTierUsageOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "freeTierUsages": + if err := awsAwsjson10_deserializeDocumentFreeTierUsages(&sv.FreeTierUsages, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/freetier/doc.go b/service/freetier/doc.go new file mode 100644 index 00000000000..dad1472ce78 --- /dev/null +++ b/service/freetier/doc.go @@ -0,0 +1,15 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package freetier provides the API client, operations, and parameter types for +// AWS Free Tier. +// +// You can use the Amazon Web Services Free Tier API to query programmatically +// your Free Tier usage data. Free Tier tracks your monthly usage data for all free +// tier offers that are associated with your Amazon Web Services account. You can +// use the Free Tier API to filter and show only the data that you want. Service +// endpoint The Free Tier API provides the following endpoint: +// - https://freetier.us-east-1.api.aws +// +// For more information, see Using the Amazon Web Services Free Tier (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-free-tier.html) +// in the Billing User Guide. +package freetier diff --git a/service/freetier/endpoints.go b/service/freetier/endpoints.go new file mode 100644 index 00000000000..8e9a6f1a66d --- /dev/null +++ b/service/freetier/endpoints.go @@ -0,0 +1,593 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package freetier + +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/freetier/internal/endpoints" + smithy "github.com/aws/smithy-go" + 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 = "awsfreetierservice" + } + 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_FREETIER") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "FreeTier", 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, 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.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.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) + } + _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") + } + 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 _PartitionResult.Name == "aws" { + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://freetier-fips.") + out.WriteString(_Region) + out.WriteString(".api.aws") + 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") + } + uriString := "https://freetier.us-east-1.api.aws" + + 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{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "freetier") + smithyhttp.SetSigV4ASigningName(&sp, "freetier") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if true == _PartitionResult.SupportsDualStack { + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://freetier-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 is enabled but this partition does not support FIPS") + } + if _Region == "aws-cn-global" { + uriString := "https://freetier.cn-northwest-1.api.amazonwebservices.com.cn" + + 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{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "freetier") + smithyhttp.SetSigV4ASigningName(&sp, "freetier") + + smithyhttp.SetSigV4SigningRegion(&sp, "cn-northwest-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://freetier.") + 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 + } + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://freetier-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 _Region == "aws-cn-global" { + uriString := "https://freetier.cn-northwest-1.api.amazonwebservices.com.cn" + + 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{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "freetier") + smithyhttp.SetSigV4ASigningName(&sp, "freetier") + + smithyhttp.SetSigV4SigningRegion(&sp, "cn-northwest-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://freetier.") + 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.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/freetier/endpoints_config_test.go b/service/freetier/endpoints_config_test.go new file mode 100644 index 00000000000..6fb75012c58 --- /dev/null +++ b/service/freetier/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package freetier + +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-freetier.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-freetier.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-freetier.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-freetier.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-freetier.dev", + expectURL: aws.String("https://env-freetier.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-freetier.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-freetier.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-freetier.dev", + expectURL: aws.String("http://config-freetier.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-freetier.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-freetier.dev", + clientEndpoint: aws.String("https://client-freetier.dev"), + expectURL: aws.String("https://client-freetier.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_FREETIER", 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/freetier/endpoints_test.go b/service/freetier/endpoints_test.go new file mode 100644 index 00000000000..d86c08afe3c --- /dev/null +++ b/service/freetier/endpoints_test.go @@ -0,0 +1,482 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package freetier + +import ( + "context" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/google/go-cmp/cmp" + "net/http" + "net/url" + "strings" + "testing" +) + +// For region aws-global with FIPS disabled and DualStack enabled +func TestEndpointCase0(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("aws-global"), + UseFIPS: 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://freetier.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "freetier") + smithyhttp.SetSigV4ASigningName(&sp, "freetier") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + } + + 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 enabled +func TestEndpointCase1(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: 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://freetier-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 disabled and DualStack enabled +func TestEndpointCase2(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: 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://freetier.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "freetier") + smithyhttp.SetSigV4ASigningName(&sp, "freetier") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + } + + 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 aws-cn-global with FIPS disabled and DualStack enabled +func TestEndpointCase3(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("aws-cn-global"), + UseFIPS: 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://freetier.cn-northwest-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "freetier") + smithyhttp.SetSigV4ASigningName(&sp, "freetier") + + smithyhttp.SetSigV4SigningRegion(&sp, "cn-northwest-1") + return sp + }(), + }, + }) + return out + }(), + } + + 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), + } + + 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://freetier-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 disabled and DualStack enabled +func TestEndpointCase5(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: 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://freetier.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 us-gov-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase6(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: 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://freetier-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 disabled and DualStack enabled +func TestEndpointCase7(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: 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://freetier.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 custom endpoint with region set and fips disabled and dualstack disabled +func TestEndpointCase8(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: 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 TestEndpointCase9(t *testing.T) { + var params = EndpointParameters{ + UseFIPS: 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 TestEndpointCase10(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: 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: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// Missing region +func TestEndpointCase11(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/freetier/generated.json b/service/freetier/generated.json new file mode 100644 index 00000000000..a783239d16f --- /dev/null +++ b/service/freetier/generated.json @@ -0,0 +1,33 @@ +{ + "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_GetFreeTierUsage.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/freetier", + "unstable": false +} diff --git a/service/freetier/go.mod b/service/freetier/go.mod new file mode 100644 index 00000000000..64bffcf7b66 --- /dev/null +++ b/service/freetier/go.mod @@ -0,0 +1,17 @@ +module github.com/aws/aws-sdk-go-v2/service/freetier + +go 1.19 + +require ( + github.com/aws/aws-sdk-go-v2 v1.23.1 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4 + 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/freetier/go.sum b/service/freetier/go.sum new file mode 100644 index 00000000000..42e4fc806b4 --- /dev/null +++ b/service/freetier/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/freetier/go_module_metadata.go b/service/freetier/go_module_metadata.go new file mode 100644 index 00000000000..551619d9b31 --- /dev/null +++ b/service/freetier/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package freetier + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/freetier/internal/endpoints/endpoints.go b/service/freetier/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..2b78cde5af2 --- /dev/null +++ b/service/freetier/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 FreeTier 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: "freetier.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "freetier-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "freetier-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "freetier.{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: "freetier.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "freetier-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "freetier-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "freetier.{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: "freetier-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "freetier.{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: "freetier-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "freetier.{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: "freetier-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "freetier.{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: "freetier-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "freetier.{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: "freetier.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "freetier-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "freetier-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "freetier.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/freetier/internal/endpoints/endpoints_test.go b/service/freetier/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/freetier/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/freetier/options.go b/service/freetier/options.go new file mode 100644 index 00000000000..66cceb79bd0 --- /dev/null +++ b/service/freetier/options.go @@ -0,0 +1,219 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package freetier + +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/freetier/protocol_test.go b/service/freetier/protocol_test.go new file mode 100644 index 00000000000..087abdfe267 --- /dev/null +++ b/service/freetier/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package freetier diff --git a/service/freetier/serializers.go b/service/freetier/serializers.go new file mode 100644 index 00000000000..2edb8180136 --- /dev/null +++ b/service/freetier/serializers.go @@ -0,0 +1,190 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package freetier + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/freetier/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "path" +) + +type awsAwsjson10_serializeOpGetFreeTierUsage struct { +} + +func (*awsAwsjson10_serializeOpGetFreeTierUsage) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetFreeTierUsage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetFreeTierUsageInput) + _ = 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("AWSFreeTierService.GetFreeTierUsage") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetFreeTierUsageInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsAwsjson10_serializeDocumentDimensionValues(v *types.DimensionValues, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Key) > 0 { + ok := object.Key("Key") + ok.String(string(v.Key)) + } + + if v.MatchOptions != nil { + ok := object.Key("MatchOptions") + if err := awsAwsjson10_serializeDocumentMatchOptions(v.MatchOptions, ok); err != nil { + return err + } + } + + if v.Values != nil { + ok := object.Key("Values") + if err := awsAwsjson10_serializeDocumentValues(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeDocumentExpression(v *types.Expression, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.And != nil { + ok := object.Key("And") + if err := awsAwsjson10_serializeDocumentExpressions(v.And, ok); err != nil { + return err + } + } + + if v.Dimensions != nil { + ok := object.Key("Dimensions") + if err := awsAwsjson10_serializeDocumentDimensionValues(v.Dimensions, ok); err != nil { + return err + } + } + + if v.Not != nil { + ok := object.Key("Not") + if err := awsAwsjson10_serializeDocumentExpression(v.Not, ok); err != nil { + return err + } + } + + if v.Or != nil { + ok := object.Key("Or") + if err := awsAwsjson10_serializeDocumentExpressions(v.Or, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeDocumentExpressions(v []types.Expression, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentExpression(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeDocumentMatchOptions(v []types.MatchOption, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsAwsjson10_serializeDocumentValues(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson10_serializeOpDocumentGetFreeTierUsageInput(v *GetFreeTierUsageInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filter != nil { + ok := object.Key("filter") + if err := awsAwsjson10_serializeDocumentExpression(v.Filter, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} diff --git a/service/freetier/types/enums.go b/service/freetier/types/enums.go new file mode 100644 index 00000000000..d4045bf38b6 --- /dev/null +++ b/service/freetier/types/enums.go @@ -0,0 +1,55 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type Dimension string + +// Enum values for Dimension +const ( + DimensionService Dimension = "SERVICE" + DimensionOperation Dimension = "OPERATION" + DimensionUsageType Dimension = "USAGE_TYPE" + DimensionRegion Dimension = "REGION" + DimensionFreeTierType Dimension = "FREE_TIER_TYPE" + DimensionDescription Dimension = "DESCRIPTION" + DimensionUsagePercentage Dimension = "USAGE_PERCENTAGE" +) + +// Values returns all known values for Dimension. 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 (Dimension) Values() []Dimension { + return []Dimension{ + "SERVICE", + "OPERATION", + "USAGE_TYPE", + "REGION", + "FREE_TIER_TYPE", + "DESCRIPTION", + "USAGE_PERCENTAGE", + } +} + +type MatchOption string + +// Enum values for MatchOption +const ( + MatchOptionEquals MatchOption = "EQUALS" + MatchOptionStartsWith MatchOption = "STARTS_WITH" + MatchOptionEndsWith MatchOption = "ENDS_WITH" + MatchOptionContains MatchOption = "CONTAINS" + MatchOptionGreaterThanOrEqual MatchOption = "GREATER_THAN_OR_EQUAL" +) + +// Values returns all known values for MatchOption. 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 (MatchOption) Values() []MatchOption { + return []MatchOption{ + "EQUALS", + "STARTS_WITH", + "ENDS_WITH", + "CONTAINS", + "GREATER_THAN_OR_EQUAL", + } +} diff --git a/service/freetier/types/errors.go b/service/freetier/types/errors.go new file mode 100644 index 00000000000..08b2a21d127 --- /dev/null +++ b/service/freetier/types/errors.go @@ -0,0 +1,86 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// An unexpected error occurred during the processing of your 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 } + +// 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 input fails to satisfy the constraints specified by an Amazon Web Service. +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/freetier/types/types.go b/service/freetier/types/types.go new file mode 100644 index 00000000000..160707593f3 --- /dev/null +++ b/service/freetier/types/types.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +// Contains the specifications for the filters to use for your request. +type DimensionValues struct { + + // The name of the dimension that you want to filter on. + // + // This member is required. + Key Dimension + + // The match options that you can use to filter your results. You can specify only + // one of these values in the array. + // + // This member is required. + MatchOptions []MatchOption + + // The metadata values you can specify to filter upon, so that the results all + // match at least one of the specified values. + // + // This member is required. + Values []string + + noSmithyDocumentSerde +} + +// Use Expression to filter in the GetFreeTierUsage API operation. You can use the +// following patterns: +// - Simple dimension values ( Dimensions root operator) +// - Complex expressions with logical operators ( AND , NOT , and OR root +// operators). +// +// For simple dimension values, you can set the dimension name, values, and match +// type for the filters that you plan to use. Example for simple dimension values +// You can filter to match exactly for REGION==us-east-1 OR REGION==us-west-1 . The +// corresponding Expression appears like the following: { "Dimensions": { "Key": +// "REGION", "Values": [ "us-east-1", "us-west-1" ], "MatchOptions": ["EQUALS"] } } +// As shown in the previous example, lists of dimension values are combined with OR +// when you apply the filter. For complex expressions with logical operators, you +// can have nested expressions to use the logical operators and specify advanced +// filtering. Example for complex expressions with logical operators You can filter +// by ((REGION == us-east-1 OR REGION == us-west-1) OR (SERVICE CONTAINS +// AWSLambda)) AND (USAGE_TYPE !CONTAINS DataTransfer) . The corresponding +// Expression appears like the following: { "And": [ {"Or": [ {"Dimensions": { +// "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ], "MatchOptions": +// ["EQUALS"] }}, {"Dimensions": { "Key": "SERVICE", "Values": ["AWSLambda"], +// "MatchOptions": ["CONTAINS"] } } ]}, {"Not": {"Dimensions": { "Key": +// "USAGE_TYPE", "Values": ["DataTransfer"], "MatchOptions": ["CONTAINS"] }}} ] } +// In the following Contents, you must specify exactly one of the following root +// operators. +type Expression struct { + + // Return results that match all Expressions that you specified in the array. + And []Expression + + // The specific dimension, values, and match type to filter objects with. + Dimensions *DimensionValues + + // Return results that don’t match the Expression that you specified. + Not *Expression + + // Return results that match any of the Expressions that you specified. in the + // array. + Or []Expression + + noSmithyDocumentSerde +} + +// Consists of a Amazon Web Services Free Tier offer’s metadata and your data +// usage for the offer. +type FreeTierUsage struct { + + // Describes the actual usage accrued month-to-day (MTD) that you've used so far. + ActualUsageAmount float64 + + // The description of the Free Tier offer. + Description *string + + // Describes the forecasted usage by the month that you're expected to use. + ForecastedUsageAmount float64 + + // Describes the type of the Free Tier offer. For example, the offer can be "12 + // Months Free" , "Always Free" , and "Free Trial" . + FreeTierType *string + + // Describes the maximum usage allowed in Free Tier. + Limit float64 + + // Describes usageType more granularly with the specific Amazon Web Service API + // operation. For example, this can be the RunInstances API operation for Amazon + // Elastic Compute Cloud. + Operation *string + + // Describes the Amazon Web Services Region for which this offer is applicable + Region *string + + // The name of the Amazon Web Service providing the Free Tier offer. For example, + // this can be Amazon Elastic Compute Cloud. + Service *string + + // Describes the unit of the usageType , such as Hrs . + Unit *string + + // Describes the usage details of the offer. For example, this might be + // Global-BoxUsage:freetrial . + UsageType *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/freetier/validators.go b/service/freetier/validators.go new file mode 100644 index 00000000000..1de8870ae5a --- /dev/null +++ b/service/freetier/validators.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package freetier + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/freetier/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpGetFreeTierUsage struct { +} + +func (*validateOpGetFreeTierUsage) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetFreeTierUsage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetFreeTierUsageInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetFreeTierUsageInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpGetFreeTierUsageValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetFreeTierUsage{}, middleware.After) +} + +func validateDimensionValues(v *types.DimensionValues) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DimensionValues"} + if len(v.Key) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Values == nil { + invalidParams.Add(smithy.NewErrParamRequired("Values")) + } + if v.MatchOptions == nil { + invalidParams.Add(smithy.NewErrParamRequired("MatchOptions")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateExpression(v *types.Expression) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Expression"} + if v.Or != nil { + if err := validateExpressions(v.Or); err != nil { + invalidParams.AddNested("Or", err.(smithy.InvalidParamsError)) + } + } + if v.And != nil { + if err := validateExpressions(v.And); err != nil { + invalidParams.AddNested("And", err.(smithy.InvalidParamsError)) + } + } + if v.Not != nil { + if err := validateExpression(v.Not); err != nil { + invalidParams.AddNested("Not", err.(smithy.InvalidParamsError)) + } + } + if v.Dimensions != nil { + if err := validateDimensionValues(v.Dimensions); err != nil { + invalidParams.AddNested("Dimensions", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateExpressions(v []types.Expression) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Expressions"} + for i := range v { + if err := validateExpression(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetFreeTierUsageInput(v *GetFreeTierUsageInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetFreeTierUsageInput"} + if v.Filter != nil { + if err := validateExpression(v.Filter); err != nil { + invalidParams.AddNested("Filter", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/fsx/api_op_CopySnapshotAndUpdateVolume.go b/service/fsx/api_op_CopySnapshotAndUpdateVolume.go new file mode 100644 index 00000000000..323dc77a509 --- /dev/null +++ b/service/fsx/api_op_CopySnapshotAndUpdateVolume.go @@ -0,0 +1,219 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package fsx + +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/fsx/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates an existing volume by using a snapshot from another Amazon FSx for +// OpenZFS file system. For more information, see on-demand data replication (https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/on-demand-replication.html) +// in the Amazon FSx for OpenZFS User Guide. +func (c *Client) CopySnapshotAndUpdateVolume(ctx context.Context, params *CopySnapshotAndUpdateVolumeInput, optFns ...func(*Options)) (*CopySnapshotAndUpdateVolumeOutput, error) { + if params == nil { + params = &CopySnapshotAndUpdateVolumeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CopySnapshotAndUpdateVolume", params, optFns, c.addOperationCopySnapshotAndUpdateVolumeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CopySnapshotAndUpdateVolumeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CopySnapshotAndUpdateVolumeInput struct { + + // The Amazon Resource Name (ARN) for a given resource. ARNs uniquely identify + // Amazon Web Services resources. We require an ARN when you need to specify a + // resource unambiguously across all of Amazon Web Services. For more information, + // see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the Amazon Web Services General Reference. + // + // This member is required. + SourceSnapshotARN *string + + // Specifies the ID of the volume that you are copying the snapshot to. + // + // This member is required. + VolumeId *string + + // (Optional) An idempotency token for resource creation, in a string of up to 63 + // ASCII characters. This token is automatically filled on your behalf when you use + // the Command Line Interface (CLI) or an Amazon Web Services SDK. + ClientRequestToken *string + + // Specifies the strategy to use when copying data from a snapshot to the volume. + // - FULL_COPY - Copies all data from the snapshot to the volume. + // - INCREMENTAL_COPY - Copies only the snapshot data that's changed since the + // previous replication. + // CLONE isn't a valid copy strategy option for the CopySnapshotAndUpdateVolume + // operation. + CopyStrategy types.OpenZFSCopyStrategy + + // Confirms that you want to delete data on the destination volume that wasn’t + // there during the previous snapshot replication. Your replication will fail if + // you don’t include an option for a specific type of data and that data is on your + // destination. For example, if you don’t include DELETE_INTERMEDIATE_SNAPSHOTS + // and there are intermediate snapshots on the destination, you can’t copy the + // snapshot. + // - DELETE_INTERMEDIATE_SNAPSHOTS - Deletes snapshots on the destination volume + // that aren’t on the source volume. + // - DELETE_CLONED_VOLUMES - Deletes snapshot clones on the destination volume + // that aren't on the source volume. + // - DELETE_INTERMEDIATE_DATA - Overwrites snapshots on the destination volume + // that don’t match the source snapshot that you’re copying. + Options []types.UpdateOpenZFSVolumeOption + + noSmithyDocumentSerde +} + +type CopySnapshotAndUpdateVolumeOutput struct { + + // A list of administrative actions for the file system that are in process or + // waiting to be processed. Administrative actions describe changes to the Amazon + // FSx system. + AdministrativeActions []types.AdministrativeAction + + // The lifecycle state of the destination volume. + Lifecycle types.VolumeLifecycle + + // The ID of the volume that you copied the snapshot to. + VolumeId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCopySnapshotAndUpdateVolumeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCopySnapshotAndUpdateVolume{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCopySnapshotAndUpdateVolume{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CopySnapshotAndUpdateVolume"); 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_opCopySnapshotAndUpdateVolumeMiddleware(stack, options); err != nil { + return err + } + if err = addOpCopySnapshotAndUpdateVolumeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCopySnapshotAndUpdateVolume(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_initializeOpCopySnapshotAndUpdateVolume struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCopySnapshotAndUpdateVolume) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCopySnapshotAndUpdateVolume) 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.(*CopySnapshotAndUpdateVolumeInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CopySnapshotAndUpdateVolumeInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCopySnapshotAndUpdateVolumeMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCopySnapshotAndUpdateVolume{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCopySnapshotAndUpdateVolume(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CopySnapshotAndUpdateVolume", + } +} diff --git a/service/fsx/api_op_CreateFileSystem.go b/service/fsx/api_op_CreateFileSystem.go index 40296cefafb..55d2b274310 100644 --- a/service/fsx/api_op_CreateFileSystem.go +++ b/service/fsx/api_op_CreateFileSystem.go @@ -79,11 +79,12 @@ type CreateFileSystemInput struct { // - For SCRATCH_1 deployment type, valid values are 1200 GiB, 2400 GiB, and // increments of 3600 GiB. // FSx for ONTAP file systems - The amount of storage capacity that you can - // configure is from 1024 GiB up to 196,608 GiB (192 TiB). FSx for OpenZFS file - // systems - The amount of storage capacity that you can configure is from 64 GiB - // up to 524,288 GiB (512 TiB). FSx for Windows File Server file systems - The - // amount of storage capacity that you can configure depends on the value that you - // set for StorageType as follows: + // configure depends on the value of the HAPairs property. The minimum value is + // calculated as 1,024 * HAPairs and the maxium is calculated as 524,288 * HAPairs + // .. FSx for OpenZFS file systems - The amount of storage capacity that you can + // configure is from 64 GiB up to 524,288 GiB (512 TiB). FSx for Windows File + // Server file systems - The amount of storage capacity that you can configure + // depends on the value that you set for StorageType as follows: // - For SSD storage, valid values are 32 GiB-65,536 GiB (64 TiB). // - For HDD storage, valid values are 2000 GiB-65,536 GiB (64 TiB). // diff --git a/service/fsx/api_op_CreateFileSystemFromBackup.go b/service/fsx/api_op_CreateFileSystemFromBackup.go index 9984492b4b9..55af0580952 100644 --- a/service/fsx/api_op_CreateFileSystemFromBackup.go +++ b/service/fsx/api_op_CreateFileSystemFromBackup.go @@ -122,7 +122,7 @@ type CreateFileSystemFromBackupInput struct { // parameter, the default is the backup's StorageCapacity value. If used to create // a file system other than OpenZFS, you must provide a value that matches the // backup's StorageCapacity value. If you provide any other value, Amazon FSx - // responds with a 400 Bad Request. + // responds with with an HTTP status code 400 Bad Request. StorageCapacity *int32 // Sets the storage type for the Windows or OpenZFS file system that you're diff --git a/service/fsx/api_op_DescribeSharedVpcConfiguration.go b/service/fsx/api_op_DescribeSharedVpcConfiguration.go new file mode 100644 index 00000000000..5984a52f472 --- /dev/null +++ b/service/fsx/api_op_DescribeSharedVpcConfiguration.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package fsx + +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" +) + +// Indicates whether participant accounts in your organization can create Amazon +// FSx for NetApp ONTAP Multi-AZ file systems in subnets that are shared by a +// virtual private cloud (VPC) owner. For more information, see the Amazon FSx for +// NetApp ONTAP User Guide (https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/maz-shared-vpc.html) +// . +func (c *Client) DescribeSharedVpcConfiguration(ctx context.Context, params *DescribeSharedVpcConfigurationInput, optFns ...func(*Options)) (*DescribeSharedVpcConfigurationOutput, error) { + if params == nil { + params = &DescribeSharedVpcConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeSharedVpcConfiguration", params, optFns, c.addOperationDescribeSharedVpcConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeSharedVpcConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeSharedVpcConfigurationInput struct { + noSmithyDocumentSerde +} + +type DescribeSharedVpcConfigurationOutput struct { + + // Indicates whether participant accounts can create FSx for ONTAP Multi-AZ file + // systems in shared subnets. + EnableFsxRouteTableUpdatesFromParticipantAccounts *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeSharedVpcConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeSharedVpcConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeSharedVpcConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSharedVpcConfiguration"); 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_opDescribeSharedVpcConfiguration(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_opDescribeSharedVpcConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeSharedVpcConfiguration", + } +} diff --git a/service/fsx/api_op_DisassociateFileSystemAliases.go b/service/fsx/api_op_DisassociateFileSystemAliases.go index 6e89c8e6653..6ffa49924a9 100644 --- a/service/fsx/api_op_DisassociateFileSystemAliases.go +++ b/service/fsx/api_op_DisassociateFileSystemAliases.go @@ -15,8 +15,8 @@ import ( // Use this action to disassociate, or remove, one or more Domain Name Service // (DNS) aliases from an Amazon FSx for Windows File Server file system. If you // attempt to disassociate a DNS alias that is not associated with the file system, -// Amazon FSx responds with a 400 Bad Request. For more information, see Working -// with DNS Aliases (https://docs.aws.amazon.com/fsx/latest/WindowsGuide/managing-dns-aliases.html) +// Amazon FSx responds with an HTTP status code 400 (Bad Request). For more +// information, see Working with DNS Aliases (https://docs.aws.amazon.com/fsx/latest/WindowsGuide/managing-dns-aliases.html) // . The system generated response showing the DNS aliases that Amazon FSx is // attempting to disassociate from the file system. Use the API operation to // monitor the status of the aliases Amazon FSx is disassociating with the file diff --git a/service/fsx/api_op_UpdateFileSystem.go b/service/fsx/api_op_UpdateFileSystem.go index 92daf1a0265..88473d75ca8 100644 --- a/service/fsx/api_op_UpdateFileSystem.go +++ b/service/fsx/api_op_UpdateFileSystem.go @@ -42,9 +42,11 @@ import ( // - DailyAutomaticBackupStartTime // - DiskIopsConfiguration // - FsxAdminPassword +// - HAPairs // - RemoveRouteTableIds // - StorageCapacity // - ThroughputCapacity +// - ThroughputCapacityPerHAPair // - WeeklyMaintenanceStartTime // // For FSx for OpenZFS file systems, you can update the following properties: diff --git a/service/fsx/api_op_UpdateSharedVpcConfiguration.go b/service/fsx/api_op_UpdateSharedVpcConfiguration.go new file mode 100644 index 00000000000..dcb9f4315ce --- /dev/null +++ b/service/fsx/api_op_UpdateSharedVpcConfiguration.go @@ -0,0 +1,183 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package fsx + +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" +) + +// Configures whether participant accounts in your organization can create Amazon +// FSx for NetApp ONTAP Multi-AZ file systems in subnets that are shared by a +// virtual private cloud (VPC) owner. For more information, see the Amazon FSx for +// NetApp ONTAP User Guide (https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/maz-shared-vpc.html) +// . We strongly recommend that participant-created Multi-AZ file systems in the +// shared VPC are deleted before you disable this feature. Once the feature is +// disabled, these file systems will enter a MISCONFIGURED state and behave like +// Single-AZ file systems. For more information, see Important considerations +// before disabling shared VPC support for Multi-AZ file systems (https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/maz-shared-vpc.html#disabling-maz-vpc-sharing) +// . +func (c *Client) UpdateSharedVpcConfiguration(ctx context.Context, params *UpdateSharedVpcConfigurationInput, optFns ...func(*Options)) (*UpdateSharedVpcConfigurationOutput, error) { + if params == nil { + params = &UpdateSharedVpcConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSharedVpcConfiguration", params, optFns, c.addOperationUpdateSharedVpcConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSharedVpcConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSharedVpcConfigurationInput struct { + + // (Optional) An idempotency token for resource creation, in a string of up to 63 + // ASCII characters. This token is automatically filled on your behalf when you use + // the Command Line Interface (CLI) or an Amazon Web Services SDK. + ClientRequestToken *string + + // Specifies whether participant accounts can create FSx for ONTAP Multi-AZ file + // systems in shared subnets. Set to true to enable or false to disable. + EnableFsxRouteTableUpdatesFromParticipantAccounts *string + + noSmithyDocumentSerde +} + +type UpdateSharedVpcConfigurationOutput struct { + + // Indicates whether participant accounts can create FSx for ONTAP Multi-AZ file + // systems in shared subnets. + EnableFsxRouteTableUpdatesFromParticipantAccounts *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSharedVpcConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSharedVpcConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateSharedVpcConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateSharedVpcConfiguration"); 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_opUpdateSharedVpcConfigurationMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSharedVpcConfiguration(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_initializeOpUpdateSharedVpcConfiguration struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpUpdateSharedVpcConfiguration) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpUpdateSharedVpcConfiguration) 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.(*UpdateSharedVpcConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateSharedVpcConfigurationInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opUpdateSharedVpcConfigurationMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateSharedVpcConfiguration{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opUpdateSharedVpcConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateSharedVpcConfiguration", + } +} diff --git a/service/fsx/deserializers.go b/service/fsx/deserializers.go index 6806006a89f..05b289f06c5 100644 --- a/service/fsx/deserializers.go +++ b/service/fsx/deserializers.go @@ -400,6 +400,126 @@ func awsAwsjson11_deserializeOpErrorCopyBackup(response *smithyhttp.Response, me } } +type awsAwsjson11_deserializeOpCopySnapshotAndUpdateVolume struct { +} + +func (*awsAwsjson11_deserializeOpCopySnapshotAndUpdateVolume) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCopySnapshotAndUpdateVolume) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCopySnapshotAndUpdateVolume(response, &metadata) + } + output := &CopySnapshotAndUpdateVolumeOutput{} + 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_deserializeOpDocumentCopySnapshotAndUpdateVolumeOutput(&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_deserializeOpErrorCopySnapshotAndUpdateVolume(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("BadRequest", errorCode): + return awsAwsjson11_deserializeErrorBadRequest(response, errorBody) + + case strings.EqualFold("IncompatibleParameterError", errorCode): + return awsAwsjson11_deserializeErrorIncompatibleParameterError(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("ServiceLimitExceeded", errorCode): + return awsAwsjson11_deserializeErrorServiceLimitExceeded(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCreateBackup struct { } @@ -3277,6 +3397,120 @@ func awsAwsjson11_deserializeOpErrorDescribeFileSystems(response *smithyhttp.Res } } +type awsAwsjson11_deserializeOpDescribeSharedVpcConfiguration struct { +} + +func (*awsAwsjson11_deserializeOpDescribeSharedVpcConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDescribeSharedVpcConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDescribeSharedVpcConfiguration(response, &metadata) + } + output := &DescribeSharedVpcConfigurationOutput{} + 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_deserializeOpDocumentDescribeSharedVpcConfigurationOutput(&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_deserializeOpErrorDescribeSharedVpcConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("BadRequest", errorCode): + return awsAwsjson11_deserializeErrorBadRequest(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDescribeSnapshots struct { } @@ -4855,6 +5089,123 @@ func awsAwsjson11_deserializeOpErrorUpdateFileSystem(response *smithyhttp.Respon } } +type awsAwsjson11_deserializeOpUpdateSharedVpcConfiguration struct { +} + +func (*awsAwsjson11_deserializeOpUpdateSharedVpcConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateSharedVpcConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateSharedVpcConfiguration(response, &metadata) + } + output := &UpdateSharedVpcConfigurationOutput{} + 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_deserializeOpDocumentUpdateSharedVpcConfigurationOutput(&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_deserializeOpErrorUpdateSharedVpcConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("BadRequest", errorCode): + return awsAwsjson11_deserializeErrorBadRequest(response, errorBody) + + case strings.EqualFold("IncompatibleParameterError", errorCode): + return awsAwsjson11_deserializeErrorIncompatibleParameterError(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpUpdateSnapshot struct { } @@ -6608,6 +6959,19 @@ func awsAwsjson11_deserializeDocumentAdministrativeAction(v **types.Administrati sv.ProgressPercent = ptr.Int32(int32(i64)) } + case "RemainingTransferBytes": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RemainingTransferBytes to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RemainingTransferBytes = ptr.Int64(i64) + } + case "RequestTime": if value != nil { switch jtv := value.(type) { @@ -6648,6 +7012,19 @@ func awsAwsjson11_deserializeDocumentAdministrativeAction(v **types.Administrati return err } + case "TotalTransferBytes": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected TotalTransferBytes to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalTransferBytes = ptr.Int64(i64) + } + default: _, _ = key, value @@ -6731,6 +7108,91 @@ func awsAwsjson11_deserializeDocumentAdministrativeActions(v *[]types.Administra return nil } +func awsAwsjson11_deserializeDocumentAggregateConfiguration(v **types.AggregateConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AggregateConfiguration + if *v == nil { + sv = &types.AggregateConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Aggregates": + if err := awsAwsjson11_deserializeDocumentAggregates(&sv.Aggregates, value); err != nil { + return err + } + + case "TotalConstituents": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected TotalConstituents to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalConstituents = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAggregates(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 Aggregate to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentAlias(v **types.Alias, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10897,6 +11359,19 @@ func awsAwsjson11_deserializeDocumentOntapFileSystemConfiguration(v **types.Onta sv.FsxAdminPassword = ptr.String(jtv) } + case "HAPairs": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected HAPairs to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.HAPairs = ptr.Int32(int32(i64)) + } + case "PreferredSubnetId": if value != nil { jtv, ok := value.(string) @@ -10924,6 +11399,19 @@ func awsAwsjson11_deserializeDocumentOntapFileSystemConfiguration(v **types.Onta sv.ThroughputCapacity = ptr.Int32(int32(i64)) } + case "ThroughputCapacityPerHAPair": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ThroughputCapacityPerHAPair to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ThroughputCapacityPerHAPair = ptr.Int32(int32(i64)) + } + case "WeeklyMaintenanceStartTime": if value != nil { jtv, ok := value.(string) @@ -10964,6 +11452,11 @@ func awsAwsjson11_deserializeDocumentOntapVolumeConfiguration(v **types.OntapVol for key, value := range shape { switch key { + case "AggregateConfiguration": + if err := awsAwsjson11_deserializeDocumentAggregateConfiguration(&sv.AggregateConfiguration, value); err != nil { + return err + } + case "CopyTagsToBackups": if value != nil { jtv, ok := value.(bool) @@ -11009,6 +11502,19 @@ func awsAwsjson11_deserializeDocumentOntapVolumeConfiguration(v **types.OntapVol sv.SecurityStyle = types.SecurityStyle(jtv) } + case "SizeInBytes": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected VolumeCapacityBytes to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.SizeInBytes = ptr.Int64(i64) + } + case "SizeInMegabytes": if value != nil { jtv, ok := value.(json.Number) @@ -11077,6 +11583,15 @@ func awsAwsjson11_deserializeDocumentOntapVolumeConfiguration(v **types.OntapVol sv.UUID = ptr.String(jtv) } + case "VolumeStyle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VolumeStyle to be of type string, got %T instead", value) + } + sv.VolumeStyle = types.VolumeStyle(jtv) + } + default: _, _ = key, value @@ -11617,6 +12132,15 @@ func awsAwsjson11_deserializeDocumentOpenZFSVolumeConfiguration(v **types.OpenZF sv.DeleteClonedVolumes = ptr.Bool(jtv) } + case "DeleteIntermediateData": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Flag to be of type *bool, got %T instead", value) + } + sv.DeleteIntermediateData = ptr.Bool(jtv) + } + case "DeleteIntermediateSnaphots": if value != nil { jtv, ok := value.(bool) @@ -11626,6 +12150,15 @@ func awsAwsjson11_deserializeDocumentOpenZFSVolumeConfiguration(v **types.OpenZF sv.DeleteIntermediateSnaphots = ptr.Bool(jtv) } + case "DestinationSnapshot": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SnapshotId to be of type string, got %T instead", value) + } + sv.DestinationSnapshot = ptr.String(jtv) + } + case "NfsExports": if err := awsAwsjson11_deserializeDocumentOpenZFSNfsExports(&sv.NfsExports, value); err != nil { return err @@ -11676,6 +12209,15 @@ func awsAwsjson11_deserializeDocumentOpenZFSVolumeConfiguration(v **types.OpenZF sv.RestoreToSnapshot = ptr.String(jtv) } + case "SourceSnapshotARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceARN to be of type string, got %T instead", value) + } + sv.SourceSnapshotARN = ptr.String(jtv) + } + case "StorageCapacityQuotaGiB": if value != nil { jtv, ok := value.(json.Number) @@ -13634,6 +14176,60 @@ func awsAwsjson11_deserializeOpDocumentCopyBackupOutput(v **CopyBackupOutput, va return nil } +func awsAwsjson11_deserializeOpDocumentCopySnapshotAndUpdateVolumeOutput(v **CopySnapshotAndUpdateVolumeOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CopySnapshotAndUpdateVolumeOutput + if *v == nil { + sv = &CopySnapshotAndUpdateVolumeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AdministrativeActions": + if err := awsAwsjson11_deserializeDocumentAdministrativeActions(&sv.AdministrativeActions, value); err != nil { + return err + } + + case "Lifecycle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VolumeLifecycle to be of type string, got %T instead", value) + } + sv.Lifecycle = types.VolumeLifecycle(jtv) + } + + case "VolumeId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VolumeId to be of type string, got %T instead", value) + } + sv.VolumeId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCreateBackupOutput(v **CreateBackupOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14636,6 +15232,46 @@ func awsAwsjson11_deserializeOpDocumentDescribeFileSystemsOutput(v **DescribeFil return nil } +func awsAwsjson11_deserializeOpDocumentDescribeSharedVpcConfigurationOutput(v **DescribeSharedVpcConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeSharedVpcConfigurationOutput + if *v == nil { + sv = &DescribeSharedVpcConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EnableFsxRouteTableUpdatesFromParticipantAccounts": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VerboseFlag to be of type string, got %T instead", value) + } + sv.EnableFsxRouteTableUpdatesFromParticipantAccounts = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDescribeSnapshotsOutput(v **DescribeSnapshotsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15148,6 +15784,46 @@ func awsAwsjson11_deserializeOpDocumentUpdateFileSystemOutput(v **UpdateFileSyst return nil } +func awsAwsjson11_deserializeOpDocumentUpdateSharedVpcConfigurationOutput(v **UpdateSharedVpcConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateSharedVpcConfigurationOutput + if *v == nil { + sv = &UpdateSharedVpcConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EnableFsxRouteTableUpdatesFromParticipantAccounts": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VerboseFlag to be of type string, got %T instead", value) + } + sv.EnableFsxRouteTableUpdatesFromParticipantAccounts = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUpdateSnapshotOutput(v **UpdateSnapshotOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/fsx/generated.json b/service/fsx/generated.json index a1f1b2e14ad..5f133ab5bed 100644 --- a/service/fsx/generated.json +++ b/service/fsx/generated.json @@ -12,6 +12,7 @@ "api_op_AssociateFileSystemAliases.go", "api_op_CancelDataRepositoryTask.go", "api_op_CopyBackup.go", + "api_op_CopySnapshotAndUpdateVolume.go", "api_op_CreateBackup.go", "api_op_CreateDataRepositoryAssociation.go", "api_op_CreateDataRepositoryTask.go", @@ -35,6 +36,7 @@ "api_op_DescribeFileCaches.go", "api_op_DescribeFileSystemAliases.go", "api_op_DescribeFileSystems.go", + "api_op_DescribeSharedVpcConfiguration.go", "api_op_DescribeSnapshots.go", "api_op_DescribeStorageVirtualMachines.go", "api_op_DescribeVolumes.go", @@ -48,6 +50,7 @@ "api_op_UpdateDataRepositoryAssociation.go", "api_op_UpdateFileCache.go", "api_op_UpdateFileSystem.go", + "api_op_UpdateSharedVpcConfiguration.go", "api_op_UpdateSnapshot.go", "api_op_UpdateStorageVirtualMachine.go", "api_op_UpdateVolume.go", diff --git a/service/fsx/serializers.go b/service/fsx/serializers.go index a2a6418413c..85779d8e569 100644 --- a/service/fsx/serializers.go +++ b/service/fsx/serializers.go @@ -180,6 +180,61 @@ func (m *awsAwsjson11_serializeOpCopyBackup) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpCopySnapshotAndUpdateVolume struct { +} + +func (*awsAwsjson11_serializeOpCopySnapshotAndUpdateVolume) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCopySnapshotAndUpdateVolume) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CopySnapshotAndUpdateVolumeInput) + _ = 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("AWSSimbaAPIService_v20180301.CopySnapshotAndUpdateVolume") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCopySnapshotAndUpdateVolumeInput(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_serializeOpCreateBackup struct { } @@ -1445,6 +1500,61 @@ func (m *awsAwsjson11_serializeOpDescribeFileSystems) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDescribeSharedVpcConfiguration struct { +} + +func (*awsAwsjson11_serializeOpDescribeSharedVpcConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeSharedVpcConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeSharedVpcConfigurationInput) + _ = 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("AWSSimbaAPIService_v20180301.DescribeSharedVpcConfiguration") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeSharedVpcConfigurationInput(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_serializeOpDescribeSnapshots struct { } @@ -2160,6 +2270,61 @@ func (m *awsAwsjson11_serializeOpUpdateFileSystem) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpUpdateSharedVpcConfiguration struct { +} + +func (*awsAwsjson11_serializeOpUpdateSharedVpcConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateSharedVpcConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateSharedVpcConfigurationInput) + _ = 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("AWSSimbaAPIService_v20180301.UpdateSharedVpcConfiguration") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateSharedVpcConfigurationInput(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_serializeOpUpdateSnapshot struct { } @@ -2324,6 +2489,17 @@ func (m *awsAwsjson11_serializeOpUpdateVolume) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } +func awsAwsjson11_serializeDocumentAggregates(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentAlternateDNSNames(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -2418,6 +2594,25 @@ func awsAwsjson11_serializeDocumentCompletionReport(v *types.CompletionReport, v return nil } +func awsAwsjson11_serializeDocumentCreateAggregateConfiguration(v *types.CreateAggregateConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Aggregates != nil { + ok := object.Key("Aggregates") + if err := awsAwsjson11_serializeDocumentAggregates(v.Aggregates, ok); err != nil { + return err + } + } + + if v.ConstituentsPerAggregate != nil { + ok := object.Key("ConstituentsPerAggregate") + ok.Integer(*v.ConstituentsPerAggregate) + } + + return nil +} + func awsAwsjson11_serializeDocumentCreateFileCacheDataRepositoryAssociations(v []types.FileCacheDataRepositoryAssociation, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -2577,6 +2772,11 @@ func awsAwsjson11_serializeDocumentCreateFileSystemOntapConfiguration(v *types.C ok.String(*v.FsxAdminPassword) } + if v.HAPairs != nil { + ok := object.Key("HAPairs") + ok.Integer(*v.HAPairs) + } + if v.PreferredSubnetId != nil { ok := object.Key("PreferredSubnetId") ok.String(*v.PreferredSubnetId) @@ -2594,6 +2794,11 @@ func awsAwsjson11_serializeDocumentCreateFileSystemOntapConfiguration(v *types.C ok.Integer(*v.ThroughputCapacity) } + if v.ThroughputCapacityPerHAPair != nil { + ok := object.Key("ThroughputCapacityPerHAPair") + ok.Integer(*v.ThroughputCapacityPerHAPair) + } + if v.WeeklyMaintenanceStartTime != nil { ok := object.Key("WeeklyMaintenanceStartTime") ok.String(*v.WeeklyMaintenanceStartTime) @@ -2754,6 +2959,13 @@ func awsAwsjson11_serializeDocumentCreateOntapVolumeConfiguration(v *types.Creat object := value.Object() defer object.Close() + if v.AggregateConfiguration != nil { + ok := object.Key("AggregateConfiguration") + if err := awsAwsjson11_serializeDocumentCreateAggregateConfiguration(v.AggregateConfiguration, ok); err != nil { + return err + } + } + if v.CopyTagsToBackups != nil { ok := object.Key("CopyTagsToBackups") ok.Boolean(*v.CopyTagsToBackups) @@ -2774,6 +2986,11 @@ func awsAwsjson11_serializeDocumentCreateOntapVolumeConfiguration(v *types.Creat ok.String(string(v.SecurityStyle)) } + if v.SizeInBytes != nil { + ok := object.Key("SizeInBytes") + ok.Long(*v.SizeInBytes) + } + if v.SizeInMegabytes != nil { ok := object.Key("SizeInMegabytes") ok.Integer(*v.SizeInMegabytes) @@ -2808,6 +3025,11 @@ func awsAwsjson11_serializeDocumentCreateOntapVolumeConfiguration(v *types.Creat } } + if len(v.VolumeStyle) > 0 { + ok := object.Key("VolumeStyle") + ok.String(string(v.VolumeStyle)) + } + return nil } @@ -4025,6 +4247,11 @@ func awsAwsjson11_serializeDocumentUpdateFileSystemOntapConfiguration(v *types.U ok.Integer(*v.ThroughputCapacity) } + if v.ThroughputCapacityPerHAPair != nil { + ok := object.Key("ThroughputCapacityPerHAPair") + ok.Integer(*v.ThroughputCapacityPerHAPair) + } + if v.WeeklyMaintenanceStartTime != nil { ok := object.Key("WeeklyMaintenanceStartTime") ok.String(*v.WeeklyMaintenanceStartTime) @@ -4158,6 +4385,11 @@ func awsAwsjson11_serializeDocumentUpdateOntapVolumeConfiguration(v *types.Updat ok.String(string(v.SecurityStyle)) } + if v.SizeInBytes != nil { + ok := object.Key("SizeInBytes") + ok.Long(*v.SizeInBytes) + } + if v.SizeInMegabytes != nil { ok := object.Key("SizeInMegabytes") ok.Integer(*v.SizeInMegabytes) @@ -4236,6 +4468,17 @@ func awsAwsjson11_serializeDocumentUpdateOpenZFSVolumeConfiguration(v *types.Upd return nil } +func awsAwsjson11_serializeDocumentUpdateOpenZFSVolumeOptions(v []types.UpdateOpenZFSVolumeOption, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsAwsjson11_serializeDocumentUpdateSnaplockConfiguration(v *types.UpdateSnaplockConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4442,6 +4685,40 @@ func awsAwsjson11_serializeOpDocumentCopyBackupInput(v *CopyBackupInput, value s return nil } +func awsAwsjson11_serializeOpDocumentCopySnapshotAndUpdateVolumeInput(v *CopySnapshotAndUpdateVolumeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if len(v.CopyStrategy) > 0 { + ok := object.Key("CopyStrategy") + ok.String(string(v.CopyStrategy)) + } + + if v.Options != nil { + ok := object.Key("Options") + if err := awsAwsjson11_serializeDocumentUpdateOpenZFSVolumeOptions(v.Options, ok); err != nil { + return err + } + } + + if v.SourceSnapshotARN != nil { + ok := object.Key("SourceSnapshotARN") + ok.String(*v.SourceSnapshotARN) + } + + if v.VolumeId != nil { + ok := object.Key("VolumeId") + ok.String(*v.VolumeId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCreateBackupInput(v *CreateBackupInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5295,6 +5572,13 @@ func awsAwsjson11_serializeOpDocumentDescribeFileSystemsInput(v *DescribeFileSys return nil } +func awsAwsjson11_serializeOpDocumentDescribeSharedVpcConfigurationInput(v *DescribeSharedVpcConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + return nil +} + func awsAwsjson11_serializeOpDocumentDescribeSnapshotsInput(v *DescribeSnapshotsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5643,6 +5927,23 @@ func awsAwsjson11_serializeOpDocumentUpdateFileSystemInput(v *UpdateFileSystemIn return nil } +func awsAwsjson11_serializeOpDocumentUpdateSharedVpcConfigurationInput(v *UpdateSharedVpcConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.EnableFsxRouteTableUpdatesFromParticipantAccounts != nil { + ok := object.Key("EnableFsxRouteTableUpdatesFromParticipantAccounts") + ok.String(*v.EnableFsxRouteTableUpdatesFromParticipantAccounts) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUpdateSnapshotInput(v *UpdateSnapshotInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/fsx/types/enums.go b/service/fsx/types/enums.go index f599aeadbbf..bd389888233 100644 --- a/service/fsx/types/enums.go +++ b/service/fsx/types/enums.go @@ -40,6 +40,8 @@ const ( AdministrativeActionTypeIopsOptimization AdministrativeActionType = "IOPS_OPTIMIZATION" AdministrativeActionTypeStorageTypeOptimization AdministrativeActionType = "STORAGE_TYPE_OPTIMIZATION" AdministrativeActionTypeMisconfiguredStateRecovery AdministrativeActionType = "MISCONFIGURED_STATE_RECOVERY" + AdministrativeActionTypeVolumeUpdateWithSnapshot AdministrativeActionType = "VOLUME_UPDATE_WITH_SNAPSHOT" + AdministrativeActionTypeVolumeInitializeWithSnapshot AdministrativeActionType = "VOLUME_INITIALIZE_WITH_SNAPSHOT" ) // Values returns all known values for AdministrativeActionType. Note that this @@ -59,6 +61,8 @@ func (AdministrativeActionType) Values() []AdministrativeActionType { "IOPS_OPTIMIZATION", "STORAGE_TYPE_OPTIMIZATION", "MISCONFIGURED_STATE_RECOVERY", + "VOLUME_UPDATE_WITH_SNAPSHOT", + "VOLUME_INITIALIZE_WITH_SNAPSHOT", } } @@ -644,6 +648,7 @@ type OntapDeploymentType string const ( OntapDeploymentTypeMultiAz1 OntapDeploymentType = "MULTI_AZ_1" OntapDeploymentTypeSingleAz1 OntapDeploymentType = "SINGLE_AZ_1" + OntapDeploymentTypeSingleAz2 OntapDeploymentType = "SINGLE_AZ_2" ) // Values returns all known values for OntapDeploymentType. Note that this can be @@ -653,6 +658,7 @@ func (OntapDeploymentType) Values() []OntapDeploymentType { return []OntapDeploymentType{ "MULTI_AZ_1", "SINGLE_AZ_1", + "SINGLE_AZ_2", } } @@ -680,8 +686,9 @@ type OpenZFSCopyStrategy string // Enum values for OpenZFSCopyStrategy const ( - OpenZFSCopyStrategyClone OpenZFSCopyStrategy = "CLONE" - OpenZFSCopyStrategyFullCopy OpenZFSCopyStrategy = "FULL_COPY" + OpenZFSCopyStrategyClone OpenZFSCopyStrategy = "CLONE" + OpenZFSCopyStrategyFullCopy OpenZFSCopyStrategy = "FULL_COPY" + OpenZFSCopyStrategyIncrementalCopy OpenZFSCopyStrategy = "INCREMENTAL_COPY" ) // Values returns all known values for OpenZFSCopyStrategy. Note that this can be @@ -691,6 +698,7 @@ func (OpenZFSCopyStrategy) Values() []OpenZFSCopyStrategy { return []OpenZFSCopyStrategy{ "CLONE", "FULL_COPY", + "INCREMENTAL_COPY", } } @@ -1150,6 +1158,26 @@ func (Unit) Values() []Unit { } } +type UpdateOpenZFSVolumeOption string + +// Enum values for UpdateOpenZFSVolumeOption +const ( + UpdateOpenZFSVolumeOptionDeleteIntermediateSnapshots UpdateOpenZFSVolumeOption = "DELETE_INTERMEDIATE_SNAPSHOTS" + UpdateOpenZFSVolumeOptionDeleteClonedVolumes UpdateOpenZFSVolumeOption = "DELETE_CLONED_VOLUMES" + UpdateOpenZFSVolumeOptionDeleteIntermediateData UpdateOpenZFSVolumeOption = "DELETE_INTERMEDIATE_DATA" +) + +// Values returns all known values for UpdateOpenZFSVolumeOption. 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 (UpdateOpenZFSVolumeOption) Values() []UpdateOpenZFSVolumeOption { + return []UpdateOpenZFSVolumeOption{ + "DELETE_INTERMEDIATE_SNAPSHOTS", + "DELETE_CLONED_VOLUMES", + "DELETE_INTERMEDIATE_DATA", + } +} + type VolumeFilterName string // Enum values for VolumeFilterName @@ -1196,6 +1224,24 @@ func (VolumeLifecycle) Values() []VolumeLifecycle { } } +type VolumeStyle string + +// Enum values for VolumeStyle +const ( + VolumeStyleFlexvol VolumeStyle = "FLEXVOL" + VolumeStyleFlexgroup VolumeStyle = "FLEXGROUP" +) + +// Values returns all known values for VolumeStyle. 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 (VolumeStyle) Values() []VolumeStyle { + return []VolumeStyle{ + "FLEXVOL", + "FLEXGROUP", + } +} + type VolumeType string // Enum values for VolumeType diff --git a/service/fsx/types/types.go b/service/fsx/types/types.go index ecb7f547fb3..01bba28ac52 100644 --- a/service/fsx/types/types.go +++ b/service/fsx/types/types.go @@ -29,7 +29,7 @@ type ActiveDirectoryBackupAttributes struct { } // Describes a specific Amazon FSx administrative action for the current Windows, -// Lustre, or OpenZFS file system. +// Lustre, OpenZFS, or ONTAP file system or volume. type AdministrativeAction struct { // Describes the type of administrative action, as follows: @@ -80,9 +80,9 @@ type AdministrativeAction struct { // progress using the ProgressPercent property. When STORAGE_TYPE_OPTIMIZATION // has been completed successfully, the parent FILE_SYSTEM_UPDATE action status // changes to COMPLETED . - // - VOLUME_UPDATE - A volume update to an Amazon FSx for NetApp ONTAP or Amazon - // FSx for OpenZFS volume initiated from the Amazon FSx console, API ( - // UpdateVolume ), or CLI ( update-volume ). + // - VOLUME_UPDATE - A volume update to an Amazon FSx for OpenZFS volume + // initiated from the Amazon FSx console, API ( UpdateVolume ), or CLI ( + // update-volume ). // - VOLUME_RESTORE - An Amazon FSx for OpenZFS volume is returned to the state // saved by the specified snapshot, initiated from an API ( // RestoreVolumeFromSnapshot ) or CLI ( restore-volume-from-snapshot ). @@ -91,6 +91,14 @@ type AdministrativeAction struct { // update-snapshot ). // - RELEASE_NFS_V3_LOCKS - Tracks the release of Network File System (NFS) V3 // locks on an Amazon FSx for OpenZFS file system. + // - VOLUME_INITIALIZE_WITH_SNAPSHOT - A volume is being created from a snapshot + // on a different FSx for OpenZFS file system. You can initiate this from the + // Amazon FSx console, API ( CreateVolume ), or CLI ( create-volume ) when using + // the using the FULL_COPY strategy. + // - VOLUME_UPDATE_WITH_SNAPSHOT - A volume is being updated from a snapshot on a + // different FSx for OpenZFS file system. You can initiate this from the Amazon FSx + // console, API ( CopySnapshotAndUpdateVolume ), or CLI ( + // copy-snapshot-and-update-volume ). AdministrativeActionType AdministrativeActionType // Provides information about a failed administrative action. @@ -100,10 +108,14 @@ type AdministrativeAction struct { // Does not apply to any other administrative action type. ProgressPercent *int32 + // The remaining bytes to transfer for the FSx for OpenZFS snapshot that you're + // copying. + RemainingTransferBytes *int64 + // The time that the administrative action request was received. RequestTime *time.Time - // Describes the status of the administrative action, as follows: + // The status of the administrative action, as follows: // - FAILED - Amazon FSx failed to process the administrative action // successfully. // - IN_PROGRESS - Amazon FSx is processing the administrative action. @@ -114,17 +126,20 @@ type AdministrativeAction struct { // storage-optimization process. Status Status - // Describes the target value for the administration action, provided in the - // UpdateFileSystem operation. Returned for FILE_SYSTEM_UPDATE administrative - // actions. + // The target value for the administration action, provided in the UpdateFileSystem + // operation. Returned for FILE_SYSTEM_UPDATE administrative actions. TargetFileSystemValues *FileSystem // A snapshot of an Amazon FSx for OpenZFS volume. TargetSnapshotValues *Snapshot - // Describes an Amazon FSx for NetApp ONTAP or Amazon FSx for OpenZFS volume. + // Describes an Amazon FSx volume. TargetVolumeValues *Volume + // The number of bytes that have transferred for the FSx for OpenZFS snapshot that + // you're copying. + TotalTransferBytes *int64 + noSmithyDocumentSerde } @@ -137,6 +152,30 @@ type AdministrativeActionFailureDetails struct { noSmithyDocumentSerde } +// Used to specify configuration options for a volume’s storage aggregate or +// aggregates. +type AggregateConfiguration struct { + + // The list of aggregates that this volume resides on. Aggregates are storage + // pools which make up your primary storage tier. Each high-availability (HA) pair + // has one aggregate. The names of the aggregates map to the names of the + // aggregates in the ONTAP CLI and REST API. For FlexVols, there will always be a + // single entry. Amazon FSx responds with an HTTP status code 400 (Bad Request) for + // the following conditions: + // - The strings in the value of Aggregates are not are not formatted as aggrX , + // where X is a number between 1 and 6. + // - The value of Aggregates contains aggregates that are not present. + // - One or more of the aggregates supplied are too close to the volume limit to + // support adding more volumes. + Aggregates []string + + // The total number of constituents this FlexGroup volume has. Not applicable for + // FlexVols. + TotalConstituents *int32 + + noSmithyDocumentSerde +} + // A DNS alias that is associated with the file system. You can use a DNS alias to // access a file system using user-defined DNS names, in addition to the default // DNS name that Amazon FSx assigns to the file system. For more information, see @@ -316,7 +355,7 @@ type Backup struct { // The tags associated with a particular file system. Tags []Tag - // Describes an Amazon FSx for NetApp ONTAP or Amazon FSx for OpenZFS volume. + // Describes an Amazon FSx volume. Volume *Volume noSmithyDocumentSerde @@ -370,6 +409,22 @@ type CompletionReport struct { noSmithyDocumentSerde } +// Used to specify the configuration options for a volume's storage aggregate or +// aggregates. +type CreateAggregateConfiguration struct { + + // Used to specify the names of aggregates on which the volume will be created. + Aggregates []string + + // Used to explicitly set the number of constituents within the FlexGroup per + // storage aggregate. This field is optional when creating a FlexGroup volume. If + // unspecified, the default value will be 8. This field cannot be provided when + // creating a FlexVol volume. + ConstituentsPerAggregate *int32 + + noSmithyDocumentSerde +} + // The Amazon File Cache configuration for the cache that you are creating. type CreateFileCacheLustreConfiguration struct { @@ -569,6 +624,8 @@ type CreateFileSystemOntapConfiguration struct { // Multi-AZ redundancy to tolerate temporary Availability Zone (AZ) unavailability. // // - SINGLE_AZ_1 - A file system configured for Single-AZ redundancy. + // - SINGLE_AZ_2 - A file system configured with multiple high-availability (HA) + // pairs for Single-AZ redundancy. // For information about the use cases for Multi-AZ and Single-AZ deployments, // refer to Choosing a file system deployment type (https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/high-availability-AZ.html) // . @@ -576,12 +633,6 @@ type CreateFileSystemOntapConfiguration struct { // This member is required. DeploymentType OntapDeploymentType - // Sets the throughput capacity for the file system that you're creating. Valid - // values are 128, 256, 512, 1024, 2048, and 4096 MBps. - // - // This member is required. - ThroughputCapacity *int32 - // The number of days to retain automatic backups. Setting this property to 0 // disables automatic backups. You can retain automatic backups for a maximum of 90 // days. The default is 30 . @@ -608,6 +659,17 @@ type CreateFileSystemOntapConfiguration struct { // administer your file system using the NetApp ONTAP CLI and REST API. FsxAdminPassword *string + // Specifies how many high-availability (HA) pairs the file system will have. The + // default value is 1. The value of this property affects the values of + // StorageCapacity , Iops , and ThroughputCapacity . For more information, see + // High-availability (HA) pairs (https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/HA-pairs.html) + // in the FSx for ONTAP user guide. Amazon FSx responds with an HTTP status code + // 400 (Bad Request) for the following conditions: + // - The value of HAPairs is less than 1 or greater than 6. + // - The value of HAPairs is greater than 1 and the value of DeploymentType is + // SINGLE_AZ_1 or MULTI_AZ_1 . + HAPairs *int32 + // Required when DeploymentType is set to MULTI_AZ_1 . This specifies the subnet in // which you want the preferred file server to be located. PreferredSubnetId *string @@ -619,6 +681,31 @@ type CreateFileSystemOntapConfiguration struct { // route table. RouteTableIds []string + // Sets the throughput capacity for the file system that you're creating in + // megabytes per second (MBps). For more information, see Managing throughput + // capacity (https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/managing-throughput-capacity.html) + // in the FSx for ONTAP User Guide. Amazon FSx responds with an HTTP status code + // 400 (Bad Request) for the following conditions: + // - The value of ThroughputCapacity and ThroughputCapacityPerHAPair are not the + // same value. + // - The value of ThroughputCapacity when divided by the value of HAPairs is + // outside of the valid range for ThroughputCapacity . + ThroughputCapacity *int32 + + // Use to choose the throughput capacity per HA pair, rather than the total + // throughput for the file system. This field and ThroughputCapacity cannot be + // defined in the same API call, but one is required. This field and + // ThroughputCapacity are the same for file systems with one HA pair. + // - For SINGLE_AZ_1 and MULTI_AZ_1 , valid values are 128, 256, 512, 1024, 2048, + // or 4096 MBps. + // - For SINGLE_AZ_2 , valid values are 3072 or 6144 MBps. + // Amazon FSx responds with an HTTP status code 400 (Bad Request) for the + // following conditions: + // - The value of ThroughputCapacity and ThroughputCapacityPerHAPair are not the + // same value + // - The value of ThroughputCapacityPerHAPair is not a valid value. + ThroughputCapacityPerHAPair *int32 + // A recurring weekly time, in the format D:HH:MM . D is the day of the week, for // which 1 represents Monday and 7 represents Sunday. For further details, see the // ISO-8601 spec as described on Wikipedia (https://en.wikipedia.org/wiki/ISO_week_date) @@ -843,16 +930,15 @@ type CreateFileSystemWindowsConfiguration struct { // Specifies the configuration of the ONTAP volume that you are creating. type CreateOntapVolumeConfiguration struct { - // Specifies the size of the volume, in megabytes (MB), that you are creating. - // - // This member is required. - SizeInMegabytes *int32 - // Specifies the ONTAP SVM in which to create the volume. // // This member is required. StorageVirtualMachineId *string + // Use to specify configuration options for a volume’s storage aggregate or + // aggregates. + AggregateConfiguration *CreateAggregateConfiguration + // A boolean flag indicating whether tags for the volume should be copied to // backups. This value defaults to false. If it's set to true, all tags for the // volume are copied to all automatic and user-initiated backups where the user @@ -891,6 +977,14 @@ type CreateOntapVolumeConfiguration struct { // and users consist of both NFS and SMB clients. SecurityStyle SecurityStyle + // The configured size of the volume, in bytes. + SizeInBytes *int64 + + // Specifies the size of the volume, in megabytes (MB), that you are creating. + // + // Deprecated: This property is deprecated, use SizeInBytes instead + SizeInMegabytes *int32 + // Specifies the SnapLock configuration for an FSx for ONTAP volume. SnaplockConfiguration *CreateSnaplockConfiguration @@ -931,19 +1025,31 @@ type CreateOntapVolumeConfiguration struct { // being moved to the capacity pool tier. TieringPolicy *TieringPolicy + // Use to specify the style of an ONTAP volume. For more information about + // FlexVols and FlexGroups, see Volume types (https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/volume-types.html) + // in Amazon FSx for NetApp ONTAP User Guide. + VolumeStyle VolumeStyle + noSmithyDocumentSerde } -// The snapshot configuration to use when creating an OpenZFS volume from a -// snapshot. +// The snapshot configuration to use when creating an Amazon FSx for OpenZFS +// volume from a snapshot. type CreateOpenZFSOriginSnapshotConfiguration struct { - // The strategy used when copying data from the snapshot to the new volume. + // Specifies the strategy used when copying data from the snapshot to the new + // volume. // - CLONE - The new volume references the data in the origin snapshot. Cloning a // snapshot is faster than copying data from the snapshot to a new volume and // doesn't consume disk throughput. However, the origin snapshot can't be deleted // if there is a volume using its copied data. - // - FULL_COPY - Copies all data from the snapshot to the new volume. + // - FULL_COPY - Copies all data from the snapshot to the new volume. Specify + // this option to create the volume from a snapshot on another FSx for OpenZFS file + // system. + // The INCREMENTAL_COPY option is only for updating an existing volume by using a + // snapshot from another FSx for OpenZFS file system. For more information, see + // CopySnapshotAndUpdateVolume (https://docs.aws.amazon.com/fsx/latest/APIReference/API_CopySnapshotAndUpdateVolume.html) + // . // // This member is required. CopyStrategy OpenZFSCopyStrategy @@ -1651,7 +1757,12 @@ type DeleteVolumeOpenZFSConfiguration struct { // was provisioned, or the mode (by the customer or by Amazon FSx). type DiskIopsConfiguration struct { - // The total number of SSD IOPS provisioned for the file system. + // The total number of SSD IOPS provisioned for the file system. The minimum and + // maximum values for this property depend on the value of HAPairs and + // StorageCapacity . The minimum value is calculated as StorageCapacity * 3 * + // HAPairs (3 IOPS per GB of StorageCapacity ). The maximum value is calculated as + // 200,000 * HAPairs . Amazon FSx responds with an HTTP status code 400 (Bad + // Request) if the value of Iops is outside of the minimum or maximum values. Iops *int64 // Specifies whether the file system is using the AUTOMATIC setting of SSD IOPS of @@ -2057,7 +2168,9 @@ type FileSystem struct { // The Amazon Resource Name (ARN) of the file system resource. ResourceARN *string - // The storage capacity of the file system in gibibytes (GiB). + // The storage capacity of the file system in gibibytes (GiB). Amazon FSx responds + // with an HTTP status code 400 (Bad Request) if the value of StorageCapacity is + // outside of the minimum or maximum values. StorageCapacity *int32 // The type of storage the file system is using. If set to SSD , the file system @@ -2379,6 +2492,8 @@ type OntapFileSystemConfiguration struct { // Multi-AZ redundancy to tolerate temporary Availability Zone (AZ) unavailability. // // - SINGLE_AZ_1 - A file system configured for Single-AZ redundancy. + // - SINGLE_AZ_2 - A file system configured with multiple high-availability (HA) + // pairs for Single-AZ redundancy. // For information about the use cases for Multi-AZ and Single-AZ deployments, // refer to Choosing Multi-AZ or Single-AZ file system deployment (https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/high-availability-multiAZ.html) // . @@ -2406,6 +2521,17 @@ type OntapFileSystemConfiguration struct { // API. The password value is always redacted in the response. FsxAdminPassword *string + // Specifies how many high-availability (HA) file server pairs the file system + // will have. The default value is 1. The value of this property affects the values + // of StorageCapacity , Iops , and ThroughputCapacity . For more information, see + // High-availability (HA) pairs (https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/HA-pairs.html) + // in the FSx for ONTAP user guide. Amazon FSx responds with an HTTP status code + // 400 (Bad Request) for the following conditions: + // - The value of HAPairs is less than 1 or greater than 6. + // - The value of HAPairs is greater than 1 and the value of DeploymentType is + // SINGLE_AZ_1 or MULTI_AZ_1 . + HAPairs *int32 + // The ID for a subnet. A subnet is a range of IP addresses in your virtual // private cloud (VPC). For more information, see VPC and subnets (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html) // in the Amazon VPC User Guide. @@ -2419,6 +2545,23 @@ type OntapFileSystemConfiguration struct { // (MBps). ThroughputCapacity *int32 + // Use to choose the throughput capacity per HA pair. When the value of HAPairs is + // equal to 1, the value of ThroughputCapacityPerHAPair is the total throughput + // for the file system. This field and ThroughputCapacity cannot be defined in the + // same API call, but one is required. This field and ThroughputCapacity are the + // same for file systems with one HA pair. + // - For SINGLE_AZ_1 and MULTI_AZ_1 , valid values are 128, 256, 512, 1024, 2048, + // or 4096 MBps. + // - For SINGLE_AZ_2 , valid values are 3072 or 6144 MBps. + // Amazon FSx responds with an HTTP status code 400 (Bad Request) for the + // following conditions: + // - The value of ThroughputCapacity and ThroughputCapacityPerHAPair are not the + // same value. + // - The value of deployment type is SINGLE_AZ_2 and ThroughputCapacity / + // ThroughputCapacityPerHAPair is a valid HA pair (a value between 2 and 6). + // - The value of ThroughputCapacityPerHAPair is not a valid value. + ThroughputCapacityPerHAPair *int32 + // A recurring weekly time, in the format D:HH:MM . D is the day of the week, for // which 1 represents Monday and 7 represents Sunday. For further details, see the // ISO-8601 spec as described on Wikipedia (https://en.wikipedia.org/wiki/ISO_week_date) @@ -2432,6 +2575,10 @@ type OntapFileSystemConfiguration struct { // The configuration of an Amazon FSx for NetApp ONTAP volume. type OntapVolumeConfiguration struct { + // This structure specifies configuration options for a volume’s storage aggregate + // or aggregates. + AggregateConfiguration *AggregateConfiguration + // A boolean flag indicating whether tags for the volume should be copied to // backups. This value defaults to false. If it's set to true, all tags for the // volume are copied to all automatic and user-initiated backups where the user @@ -2471,6 +2618,9 @@ type OntapVolumeConfiguration struct { // The security style for the volume, which can be UNIX , NTFS , or MIXED . SecurityStyle SecurityStyle + // The configured size of the volume, in bytes. + SizeInBytes *int64 + // The configured size of the volume, in megabytes (MBs). SizeInMegabytes *int32 @@ -2512,6 +2662,11 @@ type OntapVolumeConfiguration struct { // The volume's universally unique identifier (UUID). UUID *string + // Use to specify the style of an ONTAP volume. For more information about + // FlexVols and FlexGroups, see Volume types (https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/volume-types.html) + // in Amazon FSx for NetApp ONTAP User Guide. + VolumeStyle VolumeStyle + noSmithyDocumentSerde } @@ -2680,8 +2835,8 @@ type OpenZFSNfsExport struct { noSmithyDocumentSerde } -// The snapshot configuration to use when creating an OpenZFS volume from a -// snapshot. +// The snapshot configuration used when creating an Amazon FSx for OpenZFS volume +// from a snapshot. type OpenZFSOriginSnapshotConfiguration struct { // The strategy used when copying data from the snapshot to the new volume. @@ -2690,6 +2845,10 @@ type OpenZFSOriginSnapshotConfiguration struct { // doesn't consume disk throughput. However, the origin snapshot can't be deleted // if there is a volume using its copied data. // - FULL_COPY - Copies all data from the snapshot to the new volume. + // The INCREMENTAL_COPY option is only for updating an existing volume by using a + // snapshot from another FSx for OpenZFS file system. For more information, see + // CopySnapshotAndUpdateVolume (https://docs.aws.amazon.com/fsx/latest/APIReference/API_CopySnapshotAndUpdateVolume.html) + // . CopyStrategy OpenZFSCopyStrategy // The Amazon Resource Name (ARN) for a given resource. ARNs uniquely identify @@ -2750,10 +2909,19 @@ type OpenZFSVolumeConfiguration struct { // snapshot. DeleteClonedVolumes *bool + // A Boolean value indicating whether snapshot data that differs between the + // current state and the specified snapshot should be overwritten when a volume is + // restored from a snapshot. + DeleteIntermediateData *bool + // A Boolean value indicating whether snapshots between the current state and the // specified snapshot should be deleted when a volume is restored from snapshot. DeleteIntermediateSnaphots *bool + // The ID of the snapshot that's being copied or was most recently copied to the + // destination volume. + DestinationSnapshot *string + // The configuration object for mounting a Network File System (NFS) file system. NfsExports []OpenZFSNfsExport @@ -2776,6 +2944,13 @@ type OpenZFSVolumeConfiguration struct { // Specifies the ID of the snapshot to which the volume was restored. RestoreToSnapshot *string + // The Amazon Resource Name (ARN) for a given resource. ARNs uniquely identify + // Amazon Web Services resources. We require an ARN when you need to specify a + // resource unambiguously across all of Amazon Web Services. For more information, + // see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the Amazon Web Services General Reference. + SourceSnapshotARN *string + // The maximum amount of storage in gibibtyes (GiB) that the volume can use from // its parent. You can specify a quota larger than the storage on the parent // volume. @@ -3443,12 +3618,29 @@ type UpdateFileSystemOntapConfiguration struct { RemoveRouteTableIds []string // Enter a new value to change the amount of throughput capacity for the file - // system. Throughput capacity is measured in megabytes per second (MBps). Valid - // values are 128, 256, 512, 1024, 2048, and 4096 MBps. For more information, see - // Managing throughput capacity (https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/managing-throughput-capacity.html) - // in the FSx for ONTAP User Guide. + // system in megabytes per second (MBps). For more information, see Managing + // throughput capacity (https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/managing-throughput-capacity.html) + // in the FSx for ONTAP User Guide. Amazon FSx responds with an HTTP status code + // 400 (Bad Request) for the following conditions: + // - The value of ThroughputCapacity and ThroughputCapacityPerHAPair are not the + // same value. + // - The value of ThroughputCapacity when divided by the value of HAPairs is + // outside of the valid range for ThroughputCapacity . ThroughputCapacity *int32 + // Use to choose the throughput capacity per HA pair, rather than the total + // throughput for the file system. This field and ThroughputCapacity cannot be + // defined in the same API call, but one is required. This field and + // ThroughputCapacity are the same for file systems with one HA pair. + // - For SINGLE_AZ_1 and MULTI_AZ_1 , valid values are 128, 256, 512, 1024, 2048, + // or 4096 MBps. + // - For SINGLE_AZ_2 , valid values are 3072 or 6144 MBps. + // Amazon FSx responds with an HTTP status code 400 (Bad Request) for the + // following conditions: The value of ThroughputCapacity and + // ThroughputCapacityPerHAPair are not the same value. The value of + // ThroughputCapacityPerHAPair is not a valid value. + ThroughputCapacityPerHAPair *int32 + // A recurring weekly time, in the format D:HH:MM . D is the day of the week, for // which 1 represents Monday and 7 represents Sunday. For further details, see the // ISO-8601 spec as described on Wikipedia (https://en.wikipedia.org/wiki/ISO_week_date) @@ -3596,6 +3788,9 @@ type UpdateOntapVolumeConfiguration struct { // The security style for the volume, which can be UNIX , NTFS , or MIXED . SecurityStyle SecurityStyle + // The configured size of the volume, in bytes. + SizeInBytes *int64 + // Specifies the size of the volume in megabytes. SizeInMegabytes *int32 @@ -3730,7 +3925,7 @@ type UpdateSvmActiveDirectoryConfiguration struct { noSmithyDocumentSerde } -// Describes an Amazon FSx for NetApp ONTAP or Amazon FSx for OpenZFS volume. +// Describes an Amazon FSx volume. type Volume struct { // A list of administrative actions for the volume that are in process or waiting diff --git a/service/fsx/validators.go b/service/fsx/validators.go index d3bf5806741..f7ce498b2b5 100644 --- a/service/fsx/validators.go +++ b/service/fsx/validators.go @@ -70,6 +70,26 @@ func (m *validateOpCopyBackup) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpCopySnapshotAndUpdateVolume struct { +} + +func (*validateOpCopySnapshotAndUpdateVolume) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCopySnapshotAndUpdateVolume) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CopySnapshotAndUpdateVolumeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCopySnapshotAndUpdateVolumeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateBackup struct { } @@ -702,6 +722,10 @@ func addOpCopyBackupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCopyBackup{}, middleware.After) } +func addOpCopySnapshotAndUpdateVolumeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCopySnapshotAndUpdateVolume{}, middleware.After) +} + func addOpCreateBackupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateBackup{}, middleware.After) } @@ -923,9 +947,6 @@ func validateCreateFileSystemOntapConfiguration(v *types.CreateFileSystemOntapCo if len(v.DeploymentType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("DeploymentType")) } - if v.ThroughputCapacity == nil { - invalidParams.Add(smithy.NewErrParamRequired("ThroughputCapacity")) - } if invalidParams.Len() > 0 { return invalidParams } else { @@ -986,9 +1007,6 @@ func validateCreateOntapVolumeConfiguration(v *types.CreateOntapVolumeConfigurat return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateOntapVolumeConfiguration"} - if v.SizeInMegabytes == nil { - invalidParams.Add(smithy.NewErrParamRequired("SizeInMegabytes")) - } if v.StorageVirtualMachineId == nil { invalidParams.Add(smithy.NewErrParamRequired("StorageVirtualMachineId")) } @@ -1637,6 +1655,24 @@ func validateOpCopyBackupInput(v *CopyBackupInput) error { } } +func validateOpCopySnapshotAndUpdateVolumeInput(v *CopySnapshotAndUpdateVolumeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CopySnapshotAndUpdateVolumeInput"} + if v.VolumeId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VolumeId")) + } + if v.SourceSnapshotARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceSnapshotARN")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateBackupInput(v *CreateBackupInput) error { if v == nil { return nil diff --git a/service/guardduty/deserializers.go b/service/guardduty/deserializers.go index 9a90a7ae75a..e7fc97c2829 100644 --- a/service/guardduty/deserializers.go +++ b/service/guardduty/deserializers.go @@ -9935,6 +9935,46 @@ func awsRestjson1_deserializeDocumentAffectedResources(v *map[string]string, val return nil } +func awsRestjson1_deserializeDocumentAgentDetails(v **types.AgentDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AgentDetails + if *v == nil { + sv = &types.AgentDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentAnomaly(v **types.Anomaly, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10914,6 +10954,63 @@ func awsRestjson1_deserializeDocumentContainer(v **types.Container, value interf return nil } +func awsRestjson1_deserializeDocumentContainerInstanceDetails(v **types.ContainerInstanceDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ContainerInstanceDetails + if *v == nil { + sv = &types.ContainerInstanceDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "compatibleContainerInstances": + 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.CompatibleContainerInstances = ptr.Int64(i64) + } + + case "coveredContainerInstances": + 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.CoveredContainerInstances = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentContainers(v *[]types.Container, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11117,6 +11214,128 @@ func awsRestjson1_deserializeDocumentCountry(v **types.Country, value interface{ return nil } +func awsRestjson1_deserializeDocumentCoverageEc2InstanceDetails(v **types.CoverageEc2InstanceDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CoverageEc2InstanceDetails + if *v == nil { + sv = &types.CoverageEc2InstanceDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "agentDetails": + if err := awsRestjson1_deserializeDocumentAgentDetails(&sv.AgentDetails, value); err != nil { + return err + } + + case "clusterArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ClusterArn = ptr.String(jtv) + } + + case "instanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceId = ptr.String(jtv) + } + + case "instanceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceType = ptr.String(jtv) + } + + case "managementType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ManagementType to be of type string, got %T instead", value) + } + sv.ManagementType = types.ManagementType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCoverageEcsClusterDetails(v **types.CoverageEcsClusterDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CoverageEcsClusterDetails + if *v == nil { + sv = &types.CoverageEcsClusterDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "clusterName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ClusterName = ptr.String(jtv) + } + + case "containerInstanceDetails": + if err := awsRestjson1_deserializeDocumentContainerInstanceDetails(&sv.ContainerInstanceDetails, value); err != nil { + return err + } + + case "fargateDetails": + if err := awsRestjson1_deserializeDocumentFargateDetails(&sv.FargateDetails, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentCoverageEksClusterDetails(v **types.CoverageEksClusterDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11316,6 +11535,16 @@ func awsRestjson1_deserializeDocumentCoverageResourceDetails(v **types.CoverageR for key, value := range shape { switch key { + case "ec2InstanceDetails": + if err := awsRestjson1_deserializeDocumentCoverageEc2InstanceDetails(&sv.Ec2InstanceDetails, value); err != nil { + return err + } + + case "ecsClusterDetails": + if err := awsRestjson1_deserializeDocumentCoverageEcsClusterDetails(&sv.EcsClusterDetails, value); err != nil { + return err + } + case "eksClusterDetails": if err := awsRestjson1_deserializeDocumentCoverageEksClusterDetails(&sv.EksClusterDetails, value); err != nil { return err @@ -12843,6 +13072,51 @@ func awsRestjson1_deserializeDocumentEvidence(v **types.Evidence, value interfac return nil } +func awsRestjson1_deserializeDocumentFargateDetails(v **types.FargateDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FargateDetails + if *v == nil { + sv = &types.FargateDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "issues": + if err := awsRestjson1_deserializeDocumentIssues(&sv.Issues, value); err != nil { + return err + } + + case "managementType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ManagementType to be of type string, got %T instead", value) + } + sv.ManagementType = types.ManagementType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentFilePaths(v *[]types.ScanFilePath, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14111,6 +14385,42 @@ func awsRestjson1_deserializeDocumentIpv6Addresses(v *[]string, value interface{ return nil } +func awsRestjson1_deserializeDocumentIssues(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_deserializeDocumentKubernetesApiCallAction(v **types.KubernetesApiCallAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/guardduty/doc.go b/service/guardduty/doc.go index bbc8b15acc5..6394a64c887 100644 --- a/service/guardduty/doc.go +++ b/service/guardduty/doc.go @@ -4,21 +4,24 @@ // Amazon GuardDuty. // // Amazon GuardDuty is a continuous security monitoring service that analyzes and -// processes the following data sources: VPC flow logs, Amazon Web Services -// CloudTrail management event logs, CloudTrail S3 data event logs, EKS audit logs, -// DNS logs, and Amazon EBS volume data. It uses threat intelligence feeds, such as -// lists of malicious IPs and domains, and machine learning to identify unexpected, -// potentially unauthorized, and malicious activity within your Amazon Web Services -// environment. This can include issues like escalations of privileges, uses of -// exposed credentials, or communication with malicious IPs, domains, or presence -// of malware on your Amazon EC2 instances and container workloads. For example, -// GuardDuty can detect compromised EC2 instances and container workloads serving -// malware, or mining bitcoin. GuardDuty also monitors Amazon Web Services account -// access behavior for signs of compromise, such as unauthorized infrastructure -// deployments like EC2 instances deployed in a Region that has never been used, or -// unusual API calls like a password policy change to reduce password strength. -// GuardDuty informs you about the status of your Amazon Web Services environment -// by producing security findings that you can view in the GuardDuty console or -// through Amazon EventBridge. For more information, see the Amazon GuardDuty User -// Guide (https://docs.aws.amazon.com/guardduty/latest/ug/what-is-guardduty.html) . +// processes the following foundational data sources - VPC flow logs, Amazon Web +// Services CloudTrail management event logs, CloudTrail S3 data event logs, EKS +// audit logs, DNS logs, Amazon EBS volume data, runtime activity belonging to +// container workloads, such as Amazon EKS, Amazon ECS (including Amazon Web +// Services Fargate), and Amazon EC2 instances. It uses threat intelligence feeds, +// such as lists of malicious IPs and domains, and machine learning to identify +// unexpected, potentially unauthorized, and malicious activity within your Amazon +// Web Services environment. This can include issues like escalations of +// privileges, uses of exposed credentials, or communication with malicious IPs, +// domains, or presence of malware on your Amazon EC2 instances and container +// workloads. For example, GuardDuty can detect compromised EC2 instances and +// container workloads serving malware, or mining bitcoin. GuardDuty also monitors +// Amazon Web Services account access behavior for signs of compromise, such as +// unauthorized infrastructure deployments like EC2 instances deployed in a Region +// that has never been used, or unusual API calls like a password policy change to +// reduce password strength. GuardDuty informs you about the status of your Amazon +// Web Services environment by producing security findings that you can view in the +// GuardDuty console or through Amazon EventBridge. For more information, see the +// Amazon GuardDuty User Guide (https://docs.aws.amazon.com/guardduty/latest/ug/what-is-guardduty.html) +// . package guardduty diff --git a/service/guardduty/types/enums.go b/service/guardduty/types/enums.go index f2697464eb1..7c6dc65b155 100644 --- a/service/guardduty/types/enums.go +++ b/service/guardduty/types/enums.go @@ -51,6 +51,10 @@ const ( CoverageFilterCriterionKeyAddonVersion CoverageFilterCriterionKey = "ADDON_VERSION" CoverageFilterCriterionKeyManagementType CoverageFilterCriterionKey = "MANAGEMENT_TYPE" CoverageFilterCriterionKeyEksClusterName CoverageFilterCriterionKey = "EKS_CLUSTER_NAME" + CoverageFilterCriterionKeyEcsClusterName CoverageFilterCriterionKey = "ECS_CLUSTER_NAME" + CoverageFilterCriterionKeyAgentVersion CoverageFilterCriterionKey = "AGENT_VERSION" + CoverageFilterCriterionKeyInstanceId CoverageFilterCriterionKey = "INSTANCE_ID" + CoverageFilterCriterionKeyClusterArn CoverageFilterCriterionKey = "CLUSTER_ARN" ) // Values returns all known values for CoverageFilterCriterionKey. Note that this @@ -65,6 +69,10 @@ func (CoverageFilterCriterionKey) Values() []CoverageFilterCriterionKey { "ADDON_VERSION", "MANAGEMENT_TYPE", "EKS_CLUSTER_NAME", + "ECS_CLUSTER_NAME", + "AGENT_VERSION", + "INSTANCE_ID", + "CLUSTER_ARN", } } @@ -79,6 +87,8 @@ const ( CoverageSortKeyAddonVersion CoverageSortKey = "ADDON_VERSION" CoverageSortKeyUpdatedAt CoverageSortKey = "UPDATED_AT" CoverageSortKeyEksClusterName CoverageSortKey = "EKS_CLUSTER_NAME" + CoverageSortKeyEcsClusterName CoverageSortKey = "ECS_CLUSTER_NAME" + CoverageSortKeyInstanceId CoverageSortKey = "INSTANCE_ID" ) // Values returns all known values for CoverageSortKey. Note that this can be @@ -93,6 +103,8 @@ func (CoverageSortKey) Values() []CoverageSortKey { "ADDON_VERSION", "UPDATED_AT", "EKS_CLUSTER_NAME", + "ECS_CLUSTER_NAME", + "INSTANCE_ID", } } @@ -230,6 +242,7 @@ const ( DetectorFeatureRdsLoginEvents DetectorFeature = "RDS_LOGIN_EVENTS" DetectorFeatureEksRuntimeMonitoring DetectorFeature = "EKS_RUNTIME_MONITORING" DetectorFeatureLambdaNetworkLogs DetectorFeature = "LAMBDA_NETWORK_LOGS" + DetectorFeatureRuntimeMonitoring DetectorFeature = "RUNTIME_MONITORING" ) // Values returns all known values for DetectorFeature. Note that this can be @@ -243,6 +256,7 @@ func (DetectorFeature) Values() []DetectorFeature { "RDS_LOGIN_EVENTS", "EKS_RUNTIME_MONITORING", "LAMBDA_NETWORK_LOGS", + "RUNTIME_MONITORING", } } @@ -259,6 +273,7 @@ const ( DetectorFeatureResultRdsLoginEvents DetectorFeatureResult = "RDS_LOGIN_EVENTS" DetectorFeatureResultEksRuntimeMonitoring DetectorFeatureResult = "EKS_RUNTIME_MONITORING" DetectorFeatureResultLambdaNetworkLogs DetectorFeatureResult = "LAMBDA_NETWORK_LOGS" + DetectorFeatureResultRuntimeMonitoring DetectorFeatureResult = "RUNTIME_MONITORING" ) // Values returns all known values for DetectorFeatureResult. Note that this can @@ -275,6 +290,7 @@ func (DetectorFeatureResult) Values() []DetectorFeatureResult { "RDS_LOGIN_EVENTS", "EKS_RUNTIME_MONITORING", "LAMBDA_NETWORK_LOGS", + "RUNTIME_MONITORING", } } @@ -318,7 +334,8 @@ type FeatureAdditionalConfiguration string // Enum values for FeatureAdditionalConfiguration const ( - FeatureAdditionalConfigurationEksAddonManagement FeatureAdditionalConfiguration = "EKS_ADDON_MANAGEMENT" + FeatureAdditionalConfigurationEksAddonManagement FeatureAdditionalConfiguration = "EKS_ADDON_MANAGEMENT" + FeatureAdditionalConfigurationEcsFargateAgentManagement FeatureAdditionalConfiguration = "ECS_FARGATE_AGENT_MANAGEMENT" ) // Values returns all known values for FeatureAdditionalConfiguration. Note that @@ -328,6 +345,7 @@ const ( func (FeatureAdditionalConfiguration) Values() []FeatureAdditionalConfiguration { return []FeatureAdditionalConfiguration{ "EKS_ADDON_MANAGEMENT", + "ECS_FARGATE_AGENT_MANAGEMENT", } } @@ -425,15 +443,17 @@ type FreeTrialFeatureResult string // Enum values for FreeTrialFeatureResult const ( - FreeTrialFeatureResultFlowLogs FreeTrialFeatureResult = "FLOW_LOGS" - FreeTrialFeatureResultCloudTrail FreeTrialFeatureResult = "CLOUD_TRAIL" - FreeTrialFeatureResultDnsLogs FreeTrialFeatureResult = "DNS_LOGS" - FreeTrialFeatureResultS3DataEvents FreeTrialFeatureResult = "S3_DATA_EVENTS" - FreeTrialFeatureResultEksAuditLogs FreeTrialFeatureResult = "EKS_AUDIT_LOGS" - FreeTrialFeatureResultEbsMalwareProtection FreeTrialFeatureResult = "EBS_MALWARE_PROTECTION" - FreeTrialFeatureResultRdsLoginEvents FreeTrialFeatureResult = "RDS_LOGIN_EVENTS" - FreeTrialFeatureResultEksRuntimeMonitoring FreeTrialFeatureResult = "EKS_RUNTIME_MONITORING" - FreeTrialFeatureResultLambdaNetworkLogs FreeTrialFeatureResult = "LAMBDA_NETWORK_LOGS" + FreeTrialFeatureResultFlowLogs FreeTrialFeatureResult = "FLOW_LOGS" + FreeTrialFeatureResultCloudTrail FreeTrialFeatureResult = "CLOUD_TRAIL" + FreeTrialFeatureResultDnsLogs FreeTrialFeatureResult = "DNS_LOGS" + FreeTrialFeatureResultS3DataEvents FreeTrialFeatureResult = "S3_DATA_EVENTS" + FreeTrialFeatureResultEksAuditLogs FreeTrialFeatureResult = "EKS_AUDIT_LOGS" + FreeTrialFeatureResultEbsMalwareProtection FreeTrialFeatureResult = "EBS_MALWARE_PROTECTION" + FreeTrialFeatureResultRdsLoginEvents FreeTrialFeatureResult = "RDS_LOGIN_EVENTS" + FreeTrialFeatureResultEksRuntimeMonitoring FreeTrialFeatureResult = "EKS_RUNTIME_MONITORING" + FreeTrialFeatureResultLambdaNetworkLogs FreeTrialFeatureResult = "LAMBDA_NETWORK_LOGS" + FreeTrialFeatureResultFargateRuntimeMonitoring FreeTrialFeatureResult = "FARGATE_RUNTIME_MONITORING" + FreeTrialFeatureResultEc2RuntimeMonitoring FreeTrialFeatureResult = "EC2_RUNTIME_MONITORING" ) // Values returns all known values for FreeTrialFeatureResult. Note that this can @@ -450,6 +470,8 @@ func (FreeTrialFeatureResult) Values() []FreeTrialFeatureResult { "RDS_LOGIN_EVENTS", "EKS_RUNTIME_MONITORING", "LAMBDA_NETWORK_LOGS", + "FARGATE_RUNTIME_MONITORING", + "EC2_RUNTIME_MONITORING", } } @@ -513,6 +535,7 @@ type ManagementType string const ( ManagementTypeAutoManaged ManagementType = "AUTO_MANAGED" ManagementTypeManual ManagementType = "MANUAL" + ManagementTypeDisabled ManagementType = "DISABLED" ) // Values returns all known values for ManagementType. Note that this can be @@ -522,6 +545,7 @@ func (ManagementType) Values() []ManagementType { return []ManagementType{ "AUTO_MANAGED", "MANUAL", + "DISABLED", } } @@ -553,6 +577,7 @@ const ( OrgFeatureRdsLoginEvents OrgFeature = "RDS_LOGIN_EVENTS" OrgFeatureEksRuntimeMonitoring OrgFeature = "EKS_RUNTIME_MONITORING" OrgFeatureLambdaNetworkLogs OrgFeature = "LAMBDA_NETWORK_LOGS" + OrgFeatureRuntimeMonitoring OrgFeature = "RUNTIME_MONITORING" ) // Values returns all known values for OrgFeature. Note that this can be expanded @@ -566,6 +591,7 @@ func (OrgFeature) Values() []OrgFeature { "RDS_LOGIN_EVENTS", "EKS_RUNTIME_MONITORING", "LAMBDA_NETWORK_LOGS", + "RUNTIME_MONITORING", } } @@ -573,7 +599,8 @@ type OrgFeatureAdditionalConfiguration string // Enum values for OrgFeatureAdditionalConfiguration const ( - OrgFeatureAdditionalConfigurationEksAddonManagement OrgFeatureAdditionalConfiguration = "EKS_ADDON_MANAGEMENT" + OrgFeatureAdditionalConfigurationEksAddonManagement OrgFeatureAdditionalConfiguration = "EKS_ADDON_MANAGEMENT" + OrgFeatureAdditionalConfigurationEcsFargateAgentManagement OrgFeatureAdditionalConfiguration = "ECS_FARGATE_AGENT_MANAGEMENT" ) // Values returns all known values for OrgFeatureAdditionalConfiguration. Note @@ -583,6 +610,7 @@ const ( func (OrgFeatureAdditionalConfiguration) Values() []OrgFeatureAdditionalConfiguration { return []OrgFeatureAdditionalConfiguration{ "EKS_ADDON_MANAGEMENT", + "ECS_FARGATE_AGENT_MANAGEMENT", } } @@ -671,6 +699,8 @@ type ResourceType string // Enum values for ResourceType const ( ResourceTypeEks ResourceType = "EKS" + ResourceTypeEcs ResourceType = "ECS" + ResourceTypeEc2 ResourceType = "EC2" ) // Values returns all known values for ResourceType. Note that this can be @@ -679,6 +709,8 @@ const ( func (ResourceType) Values() []ResourceType { return []ResourceType{ "EKS", + "ECS", + "EC2", } } @@ -814,15 +846,17 @@ type UsageFeature string // Enum values for UsageFeature const ( - UsageFeatureFlowLogs UsageFeature = "FLOW_LOGS" - UsageFeatureCloudTrail UsageFeature = "CLOUD_TRAIL" - UsageFeatureDnsLogs UsageFeature = "DNS_LOGS" - UsageFeatureS3DataEvents UsageFeature = "S3_DATA_EVENTS" - UsageFeatureEksAuditLogs UsageFeature = "EKS_AUDIT_LOGS" - UsageFeatureEbsMalwareProtection UsageFeature = "EBS_MALWARE_PROTECTION" - UsageFeatureRdsLoginEvents UsageFeature = "RDS_LOGIN_EVENTS" - UsageFeatureLambdaNetworkLogs UsageFeature = "LAMBDA_NETWORK_LOGS" - UsageFeatureEksRuntimeMonitoring UsageFeature = "EKS_RUNTIME_MONITORING" + UsageFeatureFlowLogs UsageFeature = "FLOW_LOGS" + UsageFeatureCloudTrail UsageFeature = "CLOUD_TRAIL" + UsageFeatureDnsLogs UsageFeature = "DNS_LOGS" + UsageFeatureS3DataEvents UsageFeature = "S3_DATA_EVENTS" + UsageFeatureEksAuditLogs UsageFeature = "EKS_AUDIT_LOGS" + UsageFeatureEbsMalwareProtection UsageFeature = "EBS_MALWARE_PROTECTION" + UsageFeatureRdsLoginEvents UsageFeature = "RDS_LOGIN_EVENTS" + UsageFeatureLambdaNetworkLogs UsageFeature = "LAMBDA_NETWORK_LOGS" + UsageFeatureEksRuntimeMonitoring UsageFeature = "EKS_RUNTIME_MONITORING" + UsageFeatureFargateRuntimeMonitoring UsageFeature = "FARGATE_RUNTIME_MONITORING" + UsageFeatureEc2RuntimeMonitoring UsageFeature = "EC2_RUNTIME_MONITORING" ) // Values returns all known values for UsageFeature. Note that this can be @@ -839,6 +873,8 @@ func (UsageFeature) Values() []UsageFeature { "RDS_LOGIN_EVENTS", "LAMBDA_NETWORK_LOGS", "EKS_RUNTIME_MONITORING", + "FARGATE_RUNTIME_MONITORING", + "EC2_RUNTIME_MONITORING", } } diff --git a/service/guardduty/types/types.go b/service/guardduty/types/types.go index a90068cd138..2d123df73b3 100644 --- a/service/guardduty/types/types.go +++ b/service/guardduty/types/types.go @@ -163,6 +163,15 @@ type Administrator struct { noSmithyDocumentSerde } +// Information about the installed GuardDuty security agent. +type AgentDetails struct { + + // Version of the installed GuardDuty security agent. + Version *string + + noSmithyDocumentSerde +} + // Contains information about the anomalies. type Anomaly struct { @@ -403,6 +412,20 @@ type Container struct { noSmithyDocumentSerde } +// Contains information about the Amazon EC2 instance that is running the Amazon +// ECS container. +type ContainerInstanceDetails struct { + + // Represents total number of nodes in the Amazon ECS cluster. + CompatibleContainerInstances *int64 + + // Represents the nodes in the Amazon ECS cluster that has a HEALTHY coverage + // status. + CoveredContainerInstances *int64 + + noSmithyDocumentSerde +} + // Contains information about the country where the remote IP address is located. type Country struct { @@ -415,6 +438,50 @@ type Country struct { noSmithyDocumentSerde } +// This API is also used when you use GuardDuty Runtime Monitoring for your Amazon +// EC2 instances (currently in preview release) and is subject to change. Contains +// information about the Amazon EC2 instance runtime coverage details. +type CoverageEc2InstanceDetails struct { + + // Information about the installed security agent. + AgentDetails *AgentDetails + + // The cluster ARN of the Amazon ECS cluster running on the Amazon EC2 instance. + ClusterArn *string + + // The Amazon EC2 instance ID. + InstanceId *string + + // The instance type of the Amazon EC2 instance. + InstanceType *string + + // Indicates how the GuardDuty security agent is managed for this resource. + // - AUTO_MANAGED indicates that GuardDuty deploys and manages updates for this + // resource. + // - MANUAL indicates that you are responsible to deploy, update, and manage the + // GuardDuty security agent updates for this resource. + // The DISABLED status doesn't apply to Amazon EC2 instances and Amazon EKS + // clusters that run on Amazon EC2 instances. + ManagementType ManagementType + + noSmithyDocumentSerde +} + +// Contains information about Amazon ECS cluster runtime coverage details. +type CoverageEcsClusterDetails struct { + + // The name of the Amazon ECS cluster. + ClusterName *string + + // Information about the Amazon ECS container running on Amazon EC2 instance. + ContainerInstanceDetails *ContainerInstanceDetails + + // Information about the Fargate details associated with the Amazon ECS cluster. + FargateDetails *FargateDetails + + noSmithyDocumentSerde +} + // Information about the EKS cluster that has a coverage status. type CoverageEksClusterDetails struct { @@ -509,6 +576,14 @@ type CoverageResource struct { // Information about the resource for each individual EKS cluster. type CoverageResourceDetails struct { + // This API is also used when you use GuardDuty Runtime Monitoring for your Amazon + // EC2 instances (currently in preview release) and is subject to change. + // Information about the Amazon EC2 instance assessed for runtime coverage. + Ec2InstanceDetails *CoverageEc2InstanceDetails + + // Information about the Amazon ECS cluster that is assessed for runtime coverage. + EcsClusterDetails *CoverageEcsClusterDetails + // EKS cluster details involved in the coverage statistics. EksClusterDetails *CoverageEksClusterDetails @@ -945,6 +1020,25 @@ type Evidence struct { noSmithyDocumentSerde } +// Contains information about AWS Fargate details associated with an Amazon ECS +// cluster. +type FargateDetails struct { + + // Runtime coverage issues identified for the resource running on AWS Fargate. + Issues []string + + // Indicates how the GuardDuty security agent is managed for this resource. + // - AUTO_MANAGED indicates that GuardDuty deploys and manages updates for this + // resource. + // - MANUAL indicates that you are responsible to deploy, update, and manage the + // GuardDuty security agent updates for this resource. + // - DISABLED indicates that the deployment of the GuardDuty security agent is + // disabled for this resource. + ManagementType ManagementType + + noSmithyDocumentSerde +} + // Contains information about the condition. type FilterCondition struct { diff --git a/service/iotfleetwise/api_op_GetDecoderManifest.go b/service/iotfleetwise/api_op_GetDecoderManifest.go index 659edbd044f..837cfe20eb1 100644 --- a/service/iotfleetwise/api_op_GetDecoderManifest.go +++ b/service/iotfleetwise/api_op_GetDecoderManifest.go @@ -66,6 +66,10 @@ type GetDecoderManifestOutput struct { // A brief description of the decoder manifest. Description *string + // The detailed message for the decoder manifest. When a decoder manifest is in an + // INVALID status, the message contains detailed reason and help information. + Message *string + // The ARN of a vehicle model (model manifest) associated with the decoder // manifest. ModelManifestArn *string diff --git a/service/iotfleetwise/api_op_GetEncryptionConfiguration.go b/service/iotfleetwise/api_op_GetEncryptionConfiguration.go index 9facc7fac5d..1687c06ef1c 100644 --- a/service/iotfleetwise/api_op_GetEncryptionConfiguration.go +++ b/service/iotfleetwise/api_op_GetEncryptionConfiguration.go @@ -41,7 +41,7 @@ type GetEncryptionConfigurationOutput struct { // This member is required. EncryptionStatus types.EncryptionStatus - // The type of encryption. Set to KMS_BASED_ENCRYPTION to use an KMS key that you + // The type of encryption. Set to KMS_BASED_ENCRYPTION to use a KMS key that you // own and manage. Set to FLEETWISE_DEFAULT_ENCRYPTION to use an Amazon Web // Services managed key that is owned by the Amazon Web Services IoT FleetWise // service account. diff --git a/service/iotfleetwise/deserializers.go b/service/iotfleetwise/deserializers.go index 2a53de0e08b..5d7c71cdc46 100644 --- a/service/iotfleetwise/deserializers.go +++ b/service/iotfleetwise/deserializers.go @@ -124,6 +124,9 @@ func awsAwsjson10_deserializeOpErrorAssociateVehicleFleet(response *smithyhttp.R case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) @@ -7039,6 +7042,15 @@ func awsAwsjson10_deserializeDocumentActuator(v **types.Actuator, value interfac } } + case "structFullyQualifiedName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NodePath to be of type string, got %T instead", value) + } + sv.StructFullyQualifiedName = ptr.String(jtv) + } + case "unit": if value != nil { jtv, ok := value.(string) @@ -7605,7 +7617,7 @@ func awsAwsjson10_deserializeDocumentCanSignal(v **types.CanSignal, value interf if value != nil { jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected PrimitiveBoolean to be of type *bool, got %T instead", value) } sv.IsBigEndian = jtv } @@ -7614,7 +7626,7 @@ func awsAwsjson10_deserializeDocumentCanSignal(v **types.CanSignal, value interf if value != nil { jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected PrimitiveBoolean to be of type *bool, got %T instead", value) } sv.IsSigned = jtv } @@ -8126,6 +8138,167 @@ func awsAwsjson10_deserializeDocumentCreateVehicleResponses(v *[]types.CreateVeh return nil } +func awsAwsjson10_deserializeDocumentCustomProperty(v **types.CustomProperty, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CustomProperty + if *v == nil { + sv = &types.CustomProperty{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "comment": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected message to be of type string, got %T instead", value) + } + sv.Comment = ptr.String(jtv) + } + + case "dataEncoding": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NodeDataEncoding to be of type string, got %T instead", value) + } + sv.DataEncoding = types.NodeDataEncoding(jtv) + } + + case "dataType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NodeDataType to be of type string, got %T instead", value) + } + sv.DataType = types.NodeDataType(jtv) + } + + case "deprecationMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected message to be of type string, got %T instead", value) + } + sv.DeprecationMessage = 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 "fullyQualifiedName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string to be of type string, got %T instead", value) + } + sv.FullyQualifiedName = ptr.String(jtv) + } + + case "structFullyQualifiedName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NodePath to be of type string, got %T instead", value) + } + sv.StructFullyQualifiedName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentCustomStruct(v **types.CustomStruct, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CustomStruct + if *v == nil { + sv = &types.CustomStruct{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "comment": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected message to be of type string, got %T instead", value) + } + sv.Comment = ptr.String(jtv) + } + + case "deprecationMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected message to be of type string, got %T instead", value) + } + sv.DeprecationMessage = 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 "fullyQualifiedName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string to be of type string, got %T instead", value) + } + sv.FullyQualifiedName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentDataDestinationConfig(v *types.DataDestinationConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8350,6 +8523,15 @@ func awsAwsjson10_deserializeDocumentDecoderManifestSummary(v **types.DecoderMan } } + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + case "modelManifestArn": if value != nil { jtv, ok := value.(string) @@ -8964,6 +9146,15 @@ func awsAwsjson10_deserializeDocumentInvalidSignalDecoder(v **types.InvalidSigna for key, value := range shape { switch key { + case "hint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected message to be of type string, got %T instead", value) + } + sv.Hint = ptr.String(jtv) + } + case "name": if value != nil { jtv, ok := value.(string) @@ -9198,6 +9389,51 @@ func awsAwsjson10_deserializeDocumentListOfStrings(v *[]string, value interface{ return nil } +func awsAwsjson10_deserializeDocumentMessageSignal(v **types.MessageSignal, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.MessageSignal + if *v == nil { + sv = &types.MessageSignal{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "structuredMessage": + if err := awsAwsjson10_deserializeDocumentStructuredMessage(&sv.StructuredMessage, value); err != nil { + return err + } + + case "topicName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TopicName to be of type string, got %T instead", value) + } + sv.TopicName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentModelManifestSummaries(v *[]types.ModelManifestSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9390,6 +9626,11 @@ func awsAwsjson10_deserializeDocumentNetworkInterface(v **types.NetworkInterface sv.Type = types.NetworkInterfaceType(jtv) } + case "vehicleMiddleware": + if err := awsAwsjson10_deserializeDocumentVehicleMiddleware(&sv.VehicleMiddleware, value); err != nil { + return err + } + default: _, _ = key, value @@ -9483,6 +9724,16 @@ loop: uv = &types.NodeMemberBranch{Value: mv} break loop + case "property": + var mv types.CustomProperty + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentCustomProperty(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.NodeMemberProperty{Value: mv} + break loop + case "sensor": var mv types.Sensor destAddr := &mv @@ -9493,6 +9744,16 @@ loop: uv = &types.NodeMemberSensor{Value: mv} break loop + case "struct": + var mv types.CustomStruct + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentCustomStruct(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.NodeMemberStruct{Value: mv} + break loop + default: uv = &types.UnknownUnionMember{Tag: key} break loop @@ -9577,6 +9838,19 @@ func awsAwsjson10_deserializeDocumentNodeCounts(v **types.NodeCounts, value inte sv.TotalNodes = int32(i64) } + case "totalProperties": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected number to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalProperties = int32(i64) + } + case "totalSensors": if value != nil { jtv, ok := value.(json.Number) @@ -9590,6 +9864,19 @@ func awsAwsjson10_deserializeDocumentNodeCounts(v **types.NodeCounts, value inte sv.TotalSensors = int32(i64) } + case "totalStructs": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected number to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalStructs = int32(i64) + } + default: _, _ = key, value @@ -9670,7 +9957,7 @@ func awsAwsjson10_deserializeDocumentObdInterface(v **types.ObdInterface, value if value != nil { jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected PrimitiveBoolean to be of type *bool, got %T instead", value) } sv.HasTransmissionEcu = jtv } @@ -9723,7 +10010,7 @@ func awsAwsjson10_deserializeDocumentObdInterface(v **types.ObdInterface, value if value != nil { jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected PrimitiveBoolean to be of type *bool, got %T instead", value) } sv.UseExtendedIds = jtv } @@ -9855,7 +10142,7 @@ func awsAwsjson10_deserializeDocumentObdSignal(v **types.ObdSignal, value interf if err != nil { return err } - sv.PidResponseLength = int32(i64) + sv.PidResponseLength = ptr.Int32(int32(i64)) } case "scaling": @@ -9927,7 +10214,7 @@ func awsAwsjson10_deserializeDocumentObdSignal(v **types.ObdSignal, value interf return nil } -func awsAwsjson10_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { +func awsAwsjson10_deserializeDocumentPrimitiveMessageDefinition(v *types.PrimitiveMessageDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9940,13 +10227,53 @@ func awsAwsjson10_deserializeDocumentResourceNotFoundException(v **types.Resourc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ResourceNotFoundException - if *v == nil { - sv = &types.ResourceNotFoundException{} - } else { - sv = *v - } - + var uv types.PrimitiveMessageDefinition +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "ros2PrimitiveMessageDefinition": + var mv types.ROS2PrimitiveMessageDefinition + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentROS2PrimitiveMessageDefinition(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.PrimitiveMessageDefinitionMemberRos2PrimitiveMessageDefinition{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + 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": @@ -9985,6 +10312,127 @@ func awsAwsjson10_deserializeDocumentResourceNotFoundException(v **types.Resourc return nil } +func awsAwsjson10_deserializeDocumentROS2PrimitiveMessageDefinition(v **types.ROS2PrimitiveMessageDefinition, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ROS2PrimitiveMessageDefinition + if *v == nil { + sv = &types.ROS2PrimitiveMessageDefinition{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "offset": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Offset = 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.Offset = ptr.Float64(f64) + + default: + return fmt.Errorf("expected double to be a JSON Number, got %T instead", value) + + } + } + + case "primitiveType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ROS2PrimitiveType to be of type string, got %T instead", value) + } + sv.PrimitiveType = types.ROS2PrimitiveType(jtv) + } + + case "scaling": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Scaling = 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.Scaling = ptr.Float64(f64) + + default: + return fmt.Errorf("expected double to be a JSON Number, got %T instead", value) + + } + } + + case "upperBound": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected maxStringSize to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.UpperBound = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentS3Config(v **types.S3Config, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10192,6 +10640,15 @@ func awsAwsjson10_deserializeDocumentSensor(v **types.Sensor, value interface{}) } } + case "structFullyQualifiedName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NodePath to be of type string, got %T instead", value) + } + sv.StructFullyQualifiedName = ptr.String(jtv) + } + case "unit": if value != nil { jtv, ok := value.(string) @@ -10370,6 +10827,11 @@ func awsAwsjson10_deserializeDocumentSignalDecoder(v **types.SignalDecoder, valu sv.InterfaceId = ptr.String(jtv) } + case "messageSignal": + if err := awsAwsjson10_deserializeDocumentMessageSignal(&sv.MessageSignal, value); err != nil { + return err + } + case "obdSignal": if err := awsAwsjson10_deserializeDocumentObdSignal(&sv.ObdSignal, value); err != nil { return err @@ -10527,6 +10989,208 @@ func awsAwsjson10_deserializeDocumentSignalInformationList(v *[]types.SignalInfo return nil } +func awsAwsjson10_deserializeDocumentStructuredMessage(v *types.StructuredMessage, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.StructuredMessage +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "primitiveMessageDefinition": + var mv types.PrimitiveMessageDefinition + if err := awsAwsjson10_deserializeDocumentPrimitiveMessageDefinition(&mv, value); err != nil { + return err + } + uv = &types.StructuredMessageMemberPrimitiveMessageDefinition{Value: mv} + break loop + + case "structuredMessageDefinition": + var mv []types.StructuredMessageFieldNameAndDataTypePair + if err := awsAwsjson10_deserializeDocumentStructuredMessageDefinition(&mv, value); err != nil { + return err + } + uv = &types.StructuredMessageMemberStructuredMessageDefinition{Value: mv} + break loop + + case "structuredMessageListDefinition": + var mv types.StructuredMessageListDefinition + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentStructuredMessageListDefinition(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.StructuredMessageMemberStructuredMessageListDefinition{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsAwsjson10_deserializeDocumentStructuredMessageDefinition(v *[]types.StructuredMessageFieldNameAndDataTypePair, 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.StructuredMessageFieldNameAndDataTypePair + if *v == nil { + cv = []types.StructuredMessageFieldNameAndDataTypePair{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.StructuredMessageFieldNameAndDataTypePair + destAddr := &col + if err := awsAwsjson10_deserializeDocumentStructuredMessageFieldNameAndDataTypePair(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentStructuredMessageFieldNameAndDataTypePair(v **types.StructuredMessageFieldNameAndDataTypePair, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.StructuredMessageFieldNameAndDataTypePair + if *v == nil { + sv = &types.StructuredMessageFieldNameAndDataTypePair{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "dataType": + if err := awsAwsjson10_deserializeDocumentStructuredMessage(&sv.DataType, value); err != nil { + return err + } + + case "fieldName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StructureMessageName to be of type string, got %T instead", value) + } + sv.FieldName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentStructuredMessageListDefinition(v **types.StructuredMessageListDefinition, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.StructuredMessageListDefinition + if *v == nil { + sv = &types.StructuredMessageListDefinition{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "capacity": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected nonNegativeInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Capacity = int32(i64) + } + + case "listType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StructuredMessageListType to be of type string, got %T instead", value) + } + sv.ListType = types.StructuredMessageListType(jtv) + } + + case "memberType": + if err := awsAwsjson10_deserializeDocumentStructuredMessage(&sv.MemberType, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StructureMessageName to be of type string, got %T instead", value) + } + sv.Name = 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) @@ -11224,6 +11888,55 @@ func awsAwsjson10_deserializeDocumentValidationExceptionFieldList(v *[]types.Val return nil } +func awsAwsjson10_deserializeDocumentVehicleMiddleware(v **types.VehicleMiddleware, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.VehicleMiddleware + if *v == nil { + sv = &types.VehicleMiddleware{} + } 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 VehicleMiddlewareName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "protocolName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VehicleMiddlewareProtocol to be of type string, got %T instead", value) + } + sv.ProtocolName = types.VehicleMiddlewareProtocol(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentVehicles(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12520,6 +13233,15 @@ func awsAwsjson10_deserializeOpDocumentGetDecoderManifestOutput(v **GetDecoderMa } } + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + case "modelManifestArn": if value != nil { jtv, ok := value.(string) diff --git a/service/iotfleetwise/endpoints.go b/service/iotfleetwise/endpoints.go index 51b82ebc5c5..a1250878f0f 100644 --- a/service/iotfleetwise/endpoints.go +++ b/service/iotfleetwise/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://iotfleetwise-fips.") diff --git a/service/iotfleetwise/serializers.go b/service/iotfleetwise/serializers.go index 78e01b719fa..64a4e797ffe 100644 --- a/service/iotfleetwise/serializers.go +++ b/service/iotfleetwise/serializers.go @@ -2953,6 +2953,11 @@ func awsAwsjson10_serializeDocumentActuator(v *types.Actuator, value smithyjson. } } + if v.StructFullyQualifiedName != nil { + ok := object.Key("structFullyQualifiedName") + ok.String(*v.StructFullyQualifiedName) + } + if v.Unit != nil { ok := object.Key("unit") ok.String(*v.Unit) @@ -3332,6 +3337,75 @@ func awsAwsjson10_serializeDocumentCreateVehicleRequestItems(v []types.CreateVeh return nil } +func awsAwsjson10_serializeDocumentCustomProperty(v *types.CustomProperty, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Comment != nil { + ok := object.Key("comment") + ok.String(*v.Comment) + } + + if len(v.DataEncoding) > 0 { + ok := object.Key("dataEncoding") + ok.String(string(v.DataEncoding)) + } + + if len(v.DataType) > 0 { + ok := object.Key("dataType") + ok.String(string(v.DataType)) + } + + if v.DeprecationMessage != nil { + ok := object.Key("deprecationMessage") + ok.String(*v.DeprecationMessage) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.FullyQualifiedName != nil { + ok := object.Key("fullyQualifiedName") + ok.String(*v.FullyQualifiedName) + } + + if v.StructFullyQualifiedName != nil { + ok := object.Key("structFullyQualifiedName") + ok.String(*v.StructFullyQualifiedName) + } + + return nil +} + +func awsAwsjson10_serializeDocumentCustomStruct(v *types.CustomStruct, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Comment != nil { + ok := object.Key("comment") + ok.String(*v.Comment) + } + + if v.DeprecationMessage != nil { + ok := object.Key("deprecationMessage") + ok.String(*v.DeprecationMessage) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.FullyQualifiedName != nil { + ok := object.Key("fullyQualifiedName") + ok.String(*v.FullyQualifiedName) + } + + return nil +} + func awsAwsjson10_serializeDocumentDataDestinationConfig(v types.DataDestinationConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3444,6 +3518,25 @@ func awsAwsjson10_serializeDocumentListOfStrings(v []string, value smithyjson.Va return nil } +func awsAwsjson10_serializeDocumentMessageSignal(v *types.MessageSignal, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.StructuredMessage != nil { + ok := object.Key("structuredMessage") + if err := awsAwsjson10_serializeDocumentStructuredMessage(v.StructuredMessage, ok); err != nil { + return err + } + } + + if v.TopicName != nil { + ok := object.Key("topicName") + ok.String(*v.TopicName) + } + + return nil +} + func awsAwsjson10_serializeDocumentModelSignalsMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3531,6 +3624,13 @@ func awsAwsjson10_serializeDocumentNetworkInterface(v *types.NetworkInterface, v ok.String(string(v.Type)) } + if v.VehicleMiddleware != nil { + ok := object.Key("vehicleMiddleware") + if err := awsAwsjson10_serializeDocumentVehicleMiddleware(v.VehicleMiddleware, ok); err != nil { + return err + } + } + return nil } @@ -3570,12 +3670,24 @@ func awsAwsjson10_serializeDocumentNode(v types.Node, value smithyjson.Value) er return err } + case *types.NodeMemberProperty: + av := object.Key("property") + if err := awsAwsjson10_serializeDocumentCustomProperty(&uv.Value, av); err != nil { + return err + } + case *types.NodeMemberSensor: av := object.Key("sensor") if err := awsAwsjson10_serializeDocumentSensor(&uv.Value, av); err != nil { return err } + case *types.NodeMemberStruct: + av := object.Key("struct") + if err := awsAwsjson10_serializeDocumentCustomStruct(&uv.Value, av); err != nil { + return err + } + default: return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) @@ -3694,9 +3806,9 @@ func awsAwsjson10_serializeDocumentObdSignal(v *types.ObdSignal, value smithyjso ok.Integer(v.Pid) } - { + if v.PidResponseLength != nil { ok := object.Key("pidResponseLength") - ok.Integer(v.PidResponseLength) + ok.Integer(*v.PidResponseLength) } if v.Scaling != nil { @@ -3730,6 +3842,77 @@ func awsAwsjson10_serializeDocumentObdSignal(v *types.ObdSignal, value smithyjso return nil } +func awsAwsjson10_serializeDocumentPrimitiveMessageDefinition(v types.PrimitiveMessageDefinition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.PrimitiveMessageDefinitionMemberRos2PrimitiveMessageDefinition: + av := object.Key("ros2PrimitiveMessageDefinition") + if err := awsAwsjson10_serializeDocumentROS2PrimitiveMessageDefinition(&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 awsAwsjson10_serializeDocumentROS2PrimitiveMessageDefinition(v *types.ROS2PrimitiveMessageDefinition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Offset != nil { + ok := object.Key("offset") + switch { + case math.IsNaN(*v.Offset): + ok.String("NaN") + + case math.IsInf(*v.Offset, 1): + ok.String("Infinity") + + case math.IsInf(*v.Offset, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.Offset) + + } + } + + if len(v.PrimitiveType) > 0 { + ok := object.Key("primitiveType") + ok.String(string(v.PrimitiveType)) + } + + if v.Scaling != nil { + ok := object.Key("scaling") + switch { + case math.IsNaN(*v.Scaling): + ok.String("NaN") + + case math.IsInf(*v.Scaling, 1): + ok.String("Infinity") + + case math.IsInf(*v.Scaling, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.Scaling) + + } + } + + if v.UpperBound != nil { + ok := object.Key("upperBound") + ok.Long(*v.UpperBound) + } + + return nil +} + func awsAwsjson10_serializeDocumentS3Config(v *types.S3Config, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3829,6 +4012,11 @@ func awsAwsjson10_serializeDocumentSensor(v *types.Sensor, value smithyjson.Valu } } + if v.StructFullyQualifiedName != nil { + ok := object.Key("structFullyQualifiedName") + ok.String(*v.StructFullyQualifiedName) + } + if v.Unit != nil { ok := object.Key("unit") ok.String(*v.Unit) @@ -3858,6 +4046,13 @@ func awsAwsjson10_serializeDocumentSignalDecoder(v *types.SignalDecoder, value s ok.String(*v.InterfaceId) } + if v.MessageSignal != nil { + ok := object.Key("messageSignal") + if err := awsAwsjson10_serializeDocumentMessageSignal(v.MessageSignal, ok); err != nil { + return err + } + } + if v.ObdSignal != nil { ok := object.Key("obdSignal") if err := awsAwsjson10_serializeDocumentObdSignal(v.ObdSignal, ok); err != nil { @@ -3921,6 +4116,97 @@ func awsAwsjson10_serializeDocumentSignalInformationList(v []types.SignalInforma return nil } +func awsAwsjson10_serializeDocumentStructuredMessage(v types.StructuredMessage, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.StructuredMessageMemberPrimitiveMessageDefinition: + av := object.Key("primitiveMessageDefinition") + if err := awsAwsjson10_serializeDocumentPrimitiveMessageDefinition(uv.Value, av); err != nil { + return err + } + + case *types.StructuredMessageMemberStructuredMessageDefinition: + av := object.Key("structuredMessageDefinition") + if err := awsAwsjson10_serializeDocumentStructuredMessageDefinition(uv.Value, av); err != nil { + return err + } + + case *types.StructuredMessageMemberStructuredMessageListDefinition: + av := object.Key("structuredMessageListDefinition") + if err := awsAwsjson10_serializeDocumentStructuredMessageListDefinition(&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 awsAwsjson10_serializeDocumentStructuredMessageDefinition(v []types.StructuredMessageFieldNameAndDataTypePair, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentStructuredMessageFieldNameAndDataTypePair(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeDocumentStructuredMessageFieldNameAndDataTypePair(v *types.StructuredMessageFieldNameAndDataTypePair, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DataType != nil { + ok := object.Key("dataType") + if err := awsAwsjson10_serializeDocumentStructuredMessage(v.DataType, ok); err != nil { + return err + } + } + + if v.FieldName != nil { + ok := object.Key("fieldName") + ok.String(*v.FieldName) + } + + return nil +} + +func awsAwsjson10_serializeDocumentStructuredMessageListDefinition(v *types.StructuredMessageListDefinition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Capacity != 0 { + ok := object.Key("capacity") + ok.Integer(v.Capacity) + } + + if len(v.ListType) > 0 { + ok := object.Key("listType") + ok.String(string(v.ListType)) + } + + if v.MemberType != nil { + ok := object.Key("memberType") + if err := awsAwsjson10_serializeDocumentStructuredMessage(v.MemberType, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + func awsAwsjson10_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4055,6 +4341,23 @@ func awsAwsjson10_serializeDocumentUpdateVehicleRequestItems(v []types.UpdateVeh return nil } +func awsAwsjson10_serializeDocumentVehicleMiddleware(v *types.VehicleMiddleware, 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.ProtocolName) > 0 { + ok := object.Key("protocolName") + ok.String(string(v.ProtocolName)) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentAssociateVehicleFleetInput(v *AssociateVehicleFleetInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/iotfleetwise/types/enums.go b/service/iotfleetwise/types/enums.go index aef11ba771a..18b8341c87f 100644 --- a/service/iotfleetwise/types/enums.go +++ b/service/iotfleetwise/types/enums.go @@ -138,8 +138,10 @@ type ManifestStatus string // Enum values for ManifestStatus const ( - ManifestStatusActive ManifestStatus = "ACTIVE" - ManifestStatusDraft ManifestStatus = "DRAFT" + ManifestStatusActive ManifestStatus = "ACTIVE" + ManifestStatusDraft ManifestStatus = "DRAFT" + ManifestStatusInvalid ManifestStatus = "INVALID" + ManifestStatusValidating ManifestStatus = "VALIDATING" ) // Values returns all known values for ManifestStatus. Note that this can be @@ -149,6 +151,8 @@ func (ManifestStatus) Values() []ManifestStatus { return []ManifestStatus{ "ACTIVE", "DRAFT", + "INVALID", + "VALIDATING", } } @@ -156,12 +160,14 @@ type NetworkInterfaceFailureReason string // Enum values for NetworkInterfaceFailureReason const ( - NetworkInterfaceFailureReasonDuplicateInterface NetworkInterfaceFailureReason = "DUPLICATE_NETWORK_INTERFACE" - NetworkInterfaceFailureReasonConflictingNetworkInterface NetworkInterfaceFailureReason = "CONFLICTING_NETWORK_INTERFACE" - NetworkInterfaceFailureReasonNetworkInterfaceToAddAlreadyExists NetworkInterfaceFailureReason = "NETWORK_INTERFACE_TO_ADD_ALREADY_EXISTS" - NetworkInterfaceFailureReasonCanNetworkInterfaceInfoIsNull NetworkInterfaceFailureReason = "CAN_NETWORK_INTERFACE_INFO_IS_NULL" - NetworkInterfaceFailureReasonObdNetworkInterfaceInfoIsNull NetworkInterfaceFailureReason = "OBD_NETWORK_INTERFACE_INFO_IS_NULL" - NetworkInterfaceFailureReasonNetworkInterfaceToRemoveAssociatedWithSignals NetworkInterfaceFailureReason = "NETWORK_INTERFACE_TO_REMOVE_ASSOCIATED_WITH_SIGNALS" + NetworkInterfaceFailureReasonDuplicateInterface NetworkInterfaceFailureReason = "DUPLICATE_NETWORK_INTERFACE" + NetworkInterfaceFailureReasonConflictingNetworkInterface NetworkInterfaceFailureReason = "CONFLICTING_NETWORK_INTERFACE" + NetworkInterfaceFailureReasonNetworkInterfaceToAddAlreadyExists NetworkInterfaceFailureReason = "NETWORK_INTERFACE_TO_ADD_ALREADY_EXISTS" + NetworkInterfaceFailureReasonCanNetworkInterfaceInfoIsNull NetworkInterfaceFailureReason = "CAN_NETWORK_INTERFACE_INFO_IS_NULL" + NetworkInterfaceFailureReasonObdNetworkInterfaceInfoIsNull NetworkInterfaceFailureReason = "OBD_NETWORK_INTERFACE_INFO_IS_NULL" + NetworkInterfaceFailureReasonNetworkInterfaceToRemoveAssociatedWithSignals NetworkInterfaceFailureReason = "NETWORK_INTERFACE_TO_REMOVE_ASSOCIATED_WITH_SIGNALS" + NetworkInterfaceFailureReasonVehicleMiddlewareNetworkInterfaceInfoIsNull NetworkInterfaceFailureReason = "VEHICLE_MIDDLEWARE_NETWORK_INTERFACE_INFO_IS_NULL" + NetworkInterfaceFailureReasonCustomerDecodedSignalNetworkInterfaceInfoIsNull NetworkInterfaceFailureReason = "CUSTOMER_DECODED_SIGNAL_NETWORK_INTERFACE_INFO_IS_NULL" ) // Values returns all known values for NetworkInterfaceFailureReason. Note that @@ -176,6 +182,8 @@ func (NetworkInterfaceFailureReason) Values() []NetworkInterfaceFailureReason { "CAN_NETWORK_INTERFACE_INFO_IS_NULL", "OBD_NETWORK_INTERFACE_INFO_IS_NULL", "NETWORK_INTERFACE_TO_REMOVE_ASSOCIATED_WITH_SIGNALS", + "VEHICLE_MIDDLEWARE_NETWORK_INTERFACE_INFO_IS_NULL", + "CUSTOMER_DECODED_SIGNAL_NETWORK_INTERFACE_INFO_IS_NULL", } } @@ -183,8 +191,10 @@ type NetworkInterfaceType string // Enum values for NetworkInterfaceType const ( - NetworkInterfaceTypeCanInterface NetworkInterfaceType = "CAN_INTERFACE" - NetworkInterfaceTypeObdInterface NetworkInterfaceType = "OBD_INTERFACE" + NetworkInterfaceTypeCanInterface NetworkInterfaceType = "CAN_INTERFACE" + NetworkInterfaceTypeObdInterface NetworkInterfaceType = "OBD_INTERFACE" + NetworkInterfaceTypeVehicleMiddleware NetworkInterfaceType = "VEHICLE_MIDDLEWARE" + NetworkInterfaceTypeCustomerDecodedInterface NetworkInterfaceType = "CUSTOMER_DECODED_INTERFACE" ) // Values returns all known values for NetworkInterfaceType. Note that this can be @@ -194,6 +204,26 @@ func (NetworkInterfaceType) Values() []NetworkInterfaceType { return []NetworkInterfaceType{ "CAN_INTERFACE", "OBD_INTERFACE", + "VEHICLE_MIDDLEWARE", + "CUSTOMER_DECODED_INTERFACE", + } +} + +type NodeDataEncoding string + +// Enum values for NodeDataEncoding +const ( + NodeDataEncodingBinary NodeDataEncoding = "BINARY" + NodeDataEncodingTyped NodeDataEncoding = "TYPED" +) + +// Values returns all known values for NodeDataEncoding. 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 (NodeDataEncoding) Values() []NodeDataEncoding { + return []NodeDataEncoding{ + "BINARY", + "TYPED", } } @@ -228,6 +258,8 @@ const ( NodeDataTypeStringArray NodeDataType = "STRING_ARRAY" NodeDataTypeUnixTimestampArray NodeDataType = "UNIX_TIMESTAMP_ARRAY" NodeDataTypeUnknown NodeDataType = "UNKNOWN" + NodeDataTypeStruct NodeDataType = "STRUCT" + NodeDataTypeStructArray NodeDataType = "STRUCT_ARRAY" ) // Values returns all known values for NodeDataType. Note that this can be @@ -262,6 +294,8 @@ func (NodeDataType) Values() []NodeDataType { "STRING_ARRAY", "UNIX_TIMESTAMP_ARRAY", "UNKNOWN", + "STRUCT", + "STRUCT_ARRAY", } } @@ -285,6 +319,50 @@ func (RegistrationStatus) Values() []RegistrationStatus { } } +type ROS2PrimitiveType string + +// Enum values for ROS2PrimitiveType +const ( + ROS2PrimitiveTypeBool ROS2PrimitiveType = "BOOL" + ROS2PrimitiveTypeByte ROS2PrimitiveType = "BYTE" + ROS2PrimitiveTypeChar ROS2PrimitiveType = "CHAR" + ROS2PrimitiveTypeFloat32 ROS2PrimitiveType = "FLOAT32" + ROS2PrimitiveTypeFloat64 ROS2PrimitiveType = "FLOAT64" + ROS2PrimitiveTypeInt8 ROS2PrimitiveType = "INT8" + ROS2PrimitiveTypeUint8 ROS2PrimitiveType = "UINT8" + ROS2PrimitiveTypeInt16 ROS2PrimitiveType = "INT16" + ROS2PrimitiveTypeUint16 ROS2PrimitiveType = "UINT16" + ROS2PrimitiveTypeInt32 ROS2PrimitiveType = "INT32" + ROS2PrimitiveTypeUint32 ROS2PrimitiveType = "UINT32" + ROS2PrimitiveTypeInt64 ROS2PrimitiveType = "INT64" + ROS2PrimitiveTypeUint64 ROS2PrimitiveType = "UINT64" + ROS2PrimitiveTypeString ROS2PrimitiveType = "STRING" + ROS2PrimitiveTypeWstring ROS2PrimitiveType = "WSTRING" +) + +// Values returns all known values for ROS2PrimitiveType. 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 (ROS2PrimitiveType) Values() []ROS2PrimitiveType { + return []ROS2PrimitiveType{ + "BOOL", + "BYTE", + "CHAR", + "FLOAT32", + "FLOAT64", + "INT8", + "UINT8", + "INT16", + "UINT16", + "INT32", + "UINT32", + "INT64", + "UINT64", + "STRING", + "WSTRING", + } +} + type SignalDecoderFailureReason string // Enum values for SignalDecoderFailureReason @@ -298,6 +376,13 @@ const ( SignalDecoderFailureReasonCanSignalInfoIsNull SignalDecoderFailureReason = "CAN_SIGNAL_INFO_IS_NULL" SignalDecoderFailureReasonObdSignalInfoIsNull SignalDecoderFailureReason = "OBD_SIGNAL_INFO_IS_NULL" SignalDecoderFailureReasonNoDecoderInfoForSignalInModel SignalDecoderFailureReason = "NO_DECODER_INFO_FOR_SIGNAL_IN_MODEL" + SignalDecoderFailureReasonMessageSignalInfoIsNull SignalDecoderFailureReason = "MESSAGE_SIGNAL_INFO_IS_NULL" + SignalDecoderFailureReasonSignalDecoderTypeIncompatibleWithMessageSignalType SignalDecoderFailureReason = "SIGNAL_DECODER_TYPE_INCOMPATIBLE_WITH_MESSAGE_SIGNAL_TYPE" + SignalDecoderFailureReasonStructSizeMismatch SignalDecoderFailureReason = "STRUCT_SIZE_MISMATCH" + SignalDecoderFailureReasonNoSignalInCatalogForDecoderSignal SignalDecoderFailureReason = "NO_SIGNAL_IN_CATALOG_FOR_DECODER_SIGNAL" + SignalDecoderFailureReasonSignalDecoderIncompatibleWithSignalCatalog SignalDecoderFailureReason = "SIGNAL_DECODER_INCOMPATIBLE_WITH_SIGNAL_CATALOG" + SignalDecoderFailureReasonEmptyMessageSignal SignalDecoderFailureReason = "EMPTY_MESSAGE_SIGNAL" + SignalDecoderFailureReasonCustomerDecodedSignalInfoIsNull SignalDecoderFailureReason = "CUSTOMER_DECODED_SIGNAL_INFO_IS_NULL" ) // Values returns all known values for SignalDecoderFailureReason. Note that this @@ -314,6 +399,13 @@ func (SignalDecoderFailureReason) Values() []SignalDecoderFailureReason { "CAN_SIGNAL_INFO_IS_NULL", "OBD_SIGNAL_INFO_IS_NULL", "NO_DECODER_INFO_FOR_SIGNAL_IN_MODEL", + "MESSAGE_SIGNAL_INFO_IS_NULL", + "SIGNAL_DECODER_TYPE_INCOMPATIBLE_WITH_MESSAGE_SIGNAL_TYPE", + "STRUCT_SIZE_MISMATCH", + "NO_SIGNAL_IN_CATALOG_FOR_DECODER_SIGNAL", + "SIGNAL_DECODER_INCOMPATIBLE_WITH_SIGNAL_CATALOG", + "EMPTY_MESSAGE_SIGNAL", + "CUSTOMER_DECODED_SIGNAL_INFO_IS_NULL", } } @@ -321,8 +413,10 @@ type SignalDecoderType string // Enum values for SignalDecoderType const ( - SignalDecoderTypeCanSignal SignalDecoderType = "CAN_SIGNAL" - SignalDecoderTypeObdSignal SignalDecoderType = "OBD_SIGNAL" + SignalDecoderTypeCanSignal SignalDecoderType = "CAN_SIGNAL" + SignalDecoderTypeObdSignal SignalDecoderType = "OBD_SIGNAL" + SignalDecoderTypeMessageSignal SignalDecoderType = "MESSAGE_SIGNAL" + SignalDecoderTypeCustomerDecodedSignal SignalDecoderType = "CUSTOMER_DECODED_SIGNAL" ) // Values returns all known values for SignalDecoderType. Note that this can be @@ -332,6 +426,8 @@ func (SignalDecoderType) Values() []SignalDecoderType { return []SignalDecoderType{ "CAN_SIGNAL", "OBD_SIGNAL", + "MESSAGE_SIGNAL", + "CUSTOMER_DECODED_SIGNAL", } } @@ -371,6 +467,26 @@ func (StorageCompressionFormat) Values() []StorageCompressionFormat { } } +type StructuredMessageListType string + +// Enum values for StructuredMessageListType +const ( + StructuredMessageListTypeFixedCapacity StructuredMessageListType = "FIXED_CAPACITY" + StructuredMessageListTypeDynamicUnboundedCapacity StructuredMessageListType = "DYNAMIC_UNBOUNDED_CAPACITY" + StructuredMessageListTypeDynamicBoundedCapacity StructuredMessageListType = "DYNAMIC_BOUNDED_CAPACITY" +) + +// Values returns all known values for StructuredMessageListType. 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 (StructuredMessageListType) Values() []StructuredMessageListType { + return []StructuredMessageListType{ + "FIXED_CAPACITY", + "DYNAMIC_UNBOUNDED_CAPACITY", + "DYNAMIC_BOUNDED_CAPACITY", + } +} + type TriggerMode string // Enum values for TriggerMode @@ -469,6 +585,22 @@ func (VehicleAssociationBehavior) Values() []VehicleAssociationBehavior { } } +type VehicleMiddlewareProtocol string + +// Enum values for VehicleMiddlewareProtocol +const ( + VehicleMiddlewareProtocolRos2 VehicleMiddlewareProtocol = "ROS_2" +) + +// Values returns all known values for VehicleMiddlewareProtocol. 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 (VehicleMiddlewareProtocol) Values() []VehicleMiddlewareProtocol { + return []VehicleMiddlewareProtocol{ + "ROS_2", + } +} + type VehicleState string // Enum values for VehicleState diff --git a/service/iotfleetwise/types/types.go b/service/iotfleetwise/types/types.go index ea69c86c315..40367835807 100644 --- a/service/iotfleetwise/types/types.go +++ b/service/iotfleetwise/types/types.go @@ -47,6 +47,11 @@ type Actuator struct { // The specified possible minimum value of an actuator. Min *float64 + // The fully qualified name of the struct node for the actuator if the data type + // of the actuator is Struct or StructArray . For example, the struct fully + // qualified name of an actuator might be Vehicle.Door.LockStruct . + StructFullyQualifiedName *string + // The scientific unit for the actuator. Unit *string @@ -169,7 +174,8 @@ type CampaignSummary struct { type CanDbcDefinition struct { // A list of DBC files. You can upload only one DBC file for each network - // interface and specify up to five (inclusive) files in the list. + // interface and specify up to five (inclusive) files in the list. The DBC file can + // be a maximum size of 200 MB. // // This member is required. CanDbcFiles [][]byte @@ -387,6 +393,63 @@ type CreateVehicleResponseItem struct { noSmithyDocumentSerde } +// Represents a member of the complex data structure. The data type of the +// property can be either primitive or another struct . +type CustomProperty struct { + + // The data type for the custom property. + // + // This member is required. + DataType NodeDataType + + // The fully qualified name of the custom property. For example, the fully + // qualified name of a custom property might be + // ComplexDataTypes.VehicleDataTypes.SVMCamera.FPS . + // + // This member is required. + FullyQualifiedName *string + + // A comment in addition to the description. + Comment *string + + // Indicates whether the property is binary data. + DataEncoding NodeDataEncoding + + // The deprecation message for the node or the branch that was moved or deleted. + DeprecationMessage *string + + // A brief description of the custom property. + Description *string + + // The fully qualified name of the struct node for the custom property if the data + // type of the custom property is Struct or StructArray . + StructFullyQualifiedName *string + + noSmithyDocumentSerde +} + +// The custom structure represents a complex or higher-order data structure. +type CustomStruct struct { + + // The fully qualified name of the custom structure. For example, the fully + // qualified name of a custom structure might be + // ComplexDataTypes.VehicleDataTypes.SVMCamera . + // + // This member is required. + FullyQualifiedName *string + + // A comment in addition to the description. + Comment *string + + // The deprecation message for the node or the branch that was moved or deleted. + DeprecationMessage *string + + // A brief description of the custom structure. + Description *string + + noSmithyDocumentSerde +} + // The destination where the Amazon Web Services IoT FleetWise campaign sends // data. You can send data to be stored in Amazon S3 or Amazon Timestream. // @@ -440,6 +503,10 @@ type DecoderManifestSummary struct { // A brief description of the decoder manifest. Description *string + // The detailed message for the decoder manifest. When a decoder manifest is in an + // INVALID status, the message contains detailed reason and help information. + Message *string + // The ARN of a vehicle model (model manifest) associated with the decoder // manifest. ModelManifestArn *string @@ -574,6 +641,9 @@ type InvalidSignal struct { // A reason that a signal decoder isn't valid. type InvalidSignalDecoder struct { + // The possible cause for the invalid signal decoder. + Hint *string + // The name of a signal decoder that isn't valid. Name *string @@ -583,6 +653,25 @@ type InvalidSignalDecoder struct { noSmithyDocumentSerde } +// The decoding information for a specific message which support higher order data +// types. +type MessageSignal struct { + + // The structured message for the message signal. It can be defined with either a + // primitiveMessageDefinition , structuredMessageListDefinition , or + // structuredMessageDefinition recursively. + // + // This member is required. + StructuredMessage StructuredMessage + + // The topic name for the message signal. It corresponds to topics in ROS 2. + // + // This member is required. + TopicName *string + + noSmithyDocumentSerde +} + // Information about a vehicle model (model manifest). You can use the API // operation to return this information about multiple vehicle models. type ModelManifestSummary struct { @@ -664,6 +753,10 @@ type NetworkInterface struct { // (OBD) II protocol. ObdInterface *ObdInterface + // The vehicle middleware defined as a type of network interface. Examples of + // vehicle middleware include ROS2 and SOME/IP . + VehicleMiddleware *VehicleMiddleware + noSmithyDocumentSerde } @@ -675,7 +768,9 @@ type NetworkInterface struct { // NodeMemberActuator // NodeMemberAttribute // NodeMemberBranch +// NodeMemberProperty // NodeMemberSensor +// NodeMemberStruct type Node interface { isNode() } @@ -710,6 +805,16 @@ type NodeMemberBranch struct { func (*NodeMemberBranch) isNode() {} +// Represents a member of the complex data structure. The datatype of the property +// can be either primitive or another struct . +type NodeMemberProperty struct { + Value CustomProperty + + noSmithyDocumentSerde +} + +func (*NodeMemberProperty) isNode() {} + // An input component that reports the environmental condition of a vehicle. You // can collect data about fluid levels, temperatures, vibrations, or battery // voltage from sensors. @@ -721,6 +826,15 @@ type NodeMemberSensor struct { func (*NodeMemberSensor) isNode() {} +// Represents a complex or higher-order data structure. +type NodeMemberStruct struct { + Value CustomStruct + + noSmithyDocumentSerde +} + +func (*NodeMemberStruct) isNode() {} + // Information about the number of nodes and node types in a vehicle network. type NodeCounts struct { @@ -736,9 +850,15 @@ type NodeCounts struct { // The total number of nodes in a vehicle network. TotalNodes int32 + // The total properties for the node. + TotalProperties int32 + // The total number of nodes in a vehicle network that represent sensors. TotalSensors int32 + // The total structure for the node. + TotalStructs int32 + noSmithyDocumentSerde } @@ -797,7 +917,7 @@ type ObdSignal struct { // The length of the requested data. // // This member is required. - PidResponseLength int32 + PidResponseLength *int32 // A multiplier used to decode the message. // @@ -823,6 +943,49 @@ type ObdSignal struct { noSmithyDocumentSerde } +// Represents a primitive type node of the complex data structure. +// +// The following types satisfy this interface: +// +// PrimitiveMessageDefinitionMemberRos2PrimitiveMessageDefinition +type PrimitiveMessageDefinition interface { + isPrimitiveMessageDefinition() +} + +// Information about a PrimitiveMessage using a ROS 2 compliant primitive type +// message of the complex data structure. +type PrimitiveMessageDefinitionMemberRos2PrimitiveMessageDefinition struct { + Value ROS2PrimitiveMessageDefinition + + noSmithyDocumentSerde +} + +func (*PrimitiveMessageDefinitionMemberRos2PrimitiveMessageDefinition) isPrimitiveMessageDefinition() { +} + +// Represents a ROS 2 compliant primitive type message of the complex data +// structure. +type ROS2PrimitiveMessageDefinition struct { + + // The primitive type (integer, floating point, boolean, etc.) for the ROS 2 + // primitive message definition. + // + // This member is required. + PrimitiveType ROS2PrimitiveType + + // The offset used to calculate the signal value. Combined with scaling, the + // calculation is value = raw_value * scaling + offset . + Offset *float64 + + // A multiplier used to decode the message. + Scaling *float64 + + // An optional attribute specifying the upper bound for STRING and WSTRING . + UpperBound *int64 + + noSmithyDocumentSerde +} + // The Amazon S3 bucket where the Amazon Web Services IoT FleetWise campaign sends // data. Amazon S3 is an object storage service that stores data as objects within // buckets. For more information, see Creating, configuring, and working with @@ -895,6 +1058,11 @@ type Sensor struct { // The specified possible minimum value of the sensor. Min *float64 + // The fully qualified name of the struct node for a sensor if the data type of + // the actuator is Struct or StructArray . For example, the struct fully qualified + // name of a sensor might be Vehicle.ADAS.CameraStruct . + StructFullyQualifiedName *string + // The scientific unit of measurement for data collected by the sensor. Unit *string @@ -948,6 +1116,10 @@ type SignalDecoder struct { // protocol. CanSignal *CanSignal + // The decoding information for a specific message which supports higher order + // data types. + MessageSignal *MessageSignal + // Information about signal decoder using the On-board diagnostic (OBD) II // protocol. ObdSignal *ObdSignal @@ -974,6 +1146,88 @@ type SignalInformation struct { noSmithyDocumentSerde } +// The structured message for the message signal. It can be defined with either a +// primitiveMessageDefinition , structuredMessageListDefinition , or +// structuredMessageDefinition recursively. +// +// The following types satisfy this interface: +// +// StructuredMessageMemberPrimitiveMessageDefinition +// StructuredMessageMemberStructuredMessageDefinition +// StructuredMessageMemberStructuredMessageListDefinition +type StructuredMessage interface { + isStructuredMessage() +} + +// Represents a primitive type node of the complex data structure. +type StructuredMessageMemberPrimitiveMessageDefinition struct { + Value PrimitiveMessageDefinition + + noSmithyDocumentSerde +} + +func (*StructuredMessageMemberPrimitiveMessageDefinition) isStructuredMessage() {} + +// Represents a struct type node of the complex data structure. +type StructuredMessageMemberStructuredMessageDefinition struct { + Value []StructuredMessageFieldNameAndDataTypePair + + noSmithyDocumentSerde +} + +func (*StructuredMessageMemberStructuredMessageDefinition) isStructuredMessage() {} + +// Represents a list type node of the complex data structure. +type StructuredMessageMemberStructuredMessageListDefinition struct { + Value StructuredMessageListDefinition + + noSmithyDocumentSerde +} + +func (*StructuredMessageMemberStructuredMessageListDefinition) isStructuredMessage() {} + +// Represents a StructureMessageName to DataType map element. +type StructuredMessageFieldNameAndDataTypePair struct { + + // The data type. + // + // This member is required. + DataType StructuredMessage + + // The field name of the structured message. It determines how a data value is + // referenced in the target language. + // + // This member is required. + FieldName *string + + noSmithyDocumentSerde +} + +// Represents a list type node of the complex data structure. +type StructuredMessageListDefinition struct { + + // The type of list of the structured message list definition. + // + // This member is required. + ListType StructuredMessageListType + + // The member type of the structured message list definition. + // + // This member is required. + MemberType StructuredMessage + + // The name of the structured message list definition. + // + // This member is required. + Name *string + + // The capacity of the structured message list definition when the list type is + // FIXED_CAPACITY or DYNAMIC_BOUNDED_CAPACITY . + Capacity int32 + + noSmithyDocumentSerde +} + // A set of key/value pairs that are used to manage the resource. type Tag struct { @@ -1146,6 +1400,23 @@ type ValidationExceptionField struct { noSmithyDocumentSerde } +// The vehicle middleware defined as a type of network interface. Examples of +// vehicle middleware include ROS2 and SOME/IP . +type VehicleMiddleware struct { + + // The name of the vehicle middleware. + // + // This member is required. + Name *string + + // The protocol name of the vehicle middleware. + // + // This member is required. + ProtocolName VehicleMiddlewareProtocol + + noSmithyDocumentSerde +} + // Information about the state of a vehicle and how it relates to the status of a // campaign. type VehicleStatus struct { @@ -1219,8 +1490,10 @@ type UnknownUnionMember struct { noSmithyDocumentSerde } -func (*UnknownUnionMember) isCollectionScheme() {} -func (*UnknownUnionMember) isDataDestinationConfig() {} -func (*UnknownUnionMember) isFormattedVss() {} -func (*UnknownUnionMember) isNetworkFileDefinition() {} -func (*UnknownUnionMember) isNode() {} +func (*UnknownUnionMember) isCollectionScheme() {} +func (*UnknownUnionMember) isDataDestinationConfig() {} +func (*UnknownUnionMember) isFormattedVss() {} +func (*UnknownUnionMember) isNetworkFileDefinition() {} +func (*UnknownUnionMember) isNode() {} +func (*UnknownUnionMember) isPrimitiveMessageDefinition() {} +func (*UnknownUnionMember) isStructuredMessage() {} diff --git a/service/iotfleetwise/types/types_exported_test.go b/service/iotfleetwise/types/types_exported_test.go index 41492da1c57..ae787b78f53 100644 --- a/service/iotfleetwise/types/types_exported_test.go +++ b/service/iotfleetwise/types/types_exported_test.go @@ -100,9 +100,15 @@ func ExampleNode_outputUsage() { case *types.NodeMemberBranch: _ = v.Value // Value is types.Branch + case *types.NodeMemberProperty: + _ = v.Value // Value is types.CustomProperty + case *types.NodeMemberSensor: _ = v.Value // Value is types.Sensor + case *types.NodeMemberStruct: + _ = v.Value // Value is types.CustomStruct + case *types.UnknownUnionMember: fmt.Println("unknown tag:", v.Tag) @@ -113,6 +119,52 @@ func ExampleNode_outputUsage() { } var _ *types.Branch +var _ *types.CustomStruct var _ *types.Actuator var _ *types.Sensor var _ *types.Attribute +var _ *types.CustomProperty + +func ExamplePrimitiveMessageDefinition_outputUsage() { + var union types.PrimitiveMessageDefinition + // type switches can be used to check the union value + switch v := union.(type) { + case *types.PrimitiveMessageDefinitionMemberRos2PrimitiveMessageDefinition: + _ = v.Value // Value is types.ROS2PrimitiveMessageDefinition + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.ROS2PrimitiveMessageDefinition + +func ExampleStructuredMessage_outputUsage() { + var union types.StructuredMessage + // type switches can be used to check the union value + switch v := union.(type) { + case *types.StructuredMessageMemberPrimitiveMessageDefinition: + _ = v.Value // Value is types.PrimitiveMessageDefinition + + case *types.StructuredMessageMemberStructuredMessageDefinition: + _ = v.Value // Value is []types.StructuredMessageFieldNameAndDataTypePair + + case *types.StructuredMessageMemberStructuredMessageListDefinition: + _ = v.Value // Value is types.StructuredMessageListDefinition + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ types.PrimitiveMessageDefinition +var _ []types.StructuredMessageFieldNameAndDataTypePair +var _ *types.StructuredMessageListDefinition diff --git a/service/iotfleetwise/validators.go b/service/iotfleetwise/validators.go index 8a79088957a..71ad6a8db10 100644 --- a/service/iotfleetwise/validators.go +++ b/service/iotfleetwise/validators.go @@ -1241,6 +1241,39 @@ func validateCreateVehicleRequestItems(v []types.CreateVehicleRequestItem) error } } +func validateCustomProperty(v *types.CustomProperty) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CustomProperty"} + if v.FullyQualifiedName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FullyQualifiedName")) + } + if len(v.DataType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("DataType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCustomStruct(v *types.CustomStruct) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CustomStruct"} + if v.FullyQualifiedName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FullyQualifiedName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateDataDestinationConfig(v types.DataDestinationConfig) error { if v == nil { return nil @@ -1297,6 +1330,28 @@ func validateIamResources(v *types.IamResources) error { } } +func validateMessageSignal(v *types.MessageSignal) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MessageSignal"} + if v.TopicName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TopicName")) + } + if v.StructuredMessage == nil { + invalidParams.Add(smithy.NewErrParamRequired("StructuredMessage")) + } else if v.StructuredMessage != nil { + if err := validateStructuredMessage(v.StructuredMessage); err != nil { + invalidParams.AddNested("StructuredMessage", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateNetworkFileDefinition(v types.NetworkFileDefinition) error { if v == nil { return nil @@ -1354,6 +1409,11 @@ func validateNetworkInterface(v *types.NetworkInterface) error { invalidParams.AddNested("ObdInterface", err.(smithy.InvalidParamsError)) } } + if v.VehicleMiddleware != nil { + if err := validateVehicleMiddleware(v.VehicleMiddleware); err != nil { + invalidParams.AddNested("VehicleMiddleware", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1399,11 +1459,21 @@ func validateNode(v types.Node) error { invalidParams.AddNested("[branch]", err.(smithy.InvalidParamsError)) } + case *types.NodeMemberProperty: + if err := validateCustomProperty(&uv.Value); err != nil { + invalidParams.AddNested("[property]", err.(smithy.InvalidParamsError)) + } + case *types.NodeMemberSensor: if err := validateSensor(&uv.Value); err != nil { invalidParams.AddNested("[sensor]", err.(smithy.InvalidParamsError)) } + case *types.NodeMemberStruct: + if err := validateCustomStruct(&uv.Value); err != nil { + invalidParams.AddNested("[struct]", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -1449,6 +1519,9 @@ func validateObdSignal(v *types.ObdSignal) error { return nil } invalidParams := smithy.InvalidParamsError{Context: "ObdSignal"} + if v.PidResponseLength == nil { + invalidParams.Add(smithy.NewErrParamRequired("PidResponseLength")) + } if v.Scaling == nil { invalidParams.Add(smithy.NewErrParamRequired("Scaling")) } @@ -1465,6 +1538,40 @@ func validateObdSignal(v *types.ObdSignal) error { } } +func validatePrimitiveMessageDefinition(v types.PrimitiveMessageDefinition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PrimitiveMessageDefinition"} + switch uv := v.(type) { + case *types.PrimitiveMessageDefinitionMemberRos2PrimitiveMessageDefinition: + if err := validateROS2PrimitiveMessageDefinition(&uv.Value); err != nil { + invalidParams.AddNested("[ros2PrimitiveMessageDefinition]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateROS2PrimitiveMessageDefinition(v *types.ROS2PrimitiveMessageDefinition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ROS2PrimitiveMessageDefinition"} + if len(v.PrimitiveType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("PrimitiveType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateS3Config(v *types.S3Config) error { if v == nil { return nil @@ -1522,6 +1629,11 @@ func validateSignalDecoder(v *types.SignalDecoder) error { invalidParams.AddNested("ObdSignal", err.(smithy.InvalidParamsError)) } } + if v.MessageSignal != nil { + if err := validateMessageSignal(v.MessageSignal); err != nil { + invalidParams.AddNested("MessageSignal", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1578,6 +1690,99 @@ func validateSignalInformationList(v []types.SignalInformation) error { } } +func validateStructuredMessage(v types.StructuredMessage) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StructuredMessage"} + switch uv := v.(type) { + case *types.StructuredMessageMemberPrimitiveMessageDefinition: + if err := validatePrimitiveMessageDefinition(uv.Value); err != nil { + invalidParams.AddNested("[primitiveMessageDefinition]", err.(smithy.InvalidParamsError)) + } + + case *types.StructuredMessageMemberStructuredMessageDefinition: + if err := validateStructuredMessageDefinition(uv.Value); err != nil { + invalidParams.AddNested("[structuredMessageDefinition]", err.(smithy.InvalidParamsError)) + } + + case *types.StructuredMessageMemberStructuredMessageListDefinition: + if err := validateStructuredMessageListDefinition(&uv.Value); err != nil { + invalidParams.AddNested("[structuredMessageListDefinition]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStructuredMessageDefinition(v []types.StructuredMessageFieldNameAndDataTypePair) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StructuredMessageDefinition"} + for i := range v { + if err := validateStructuredMessageFieldNameAndDataTypePair(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStructuredMessageFieldNameAndDataTypePair(v *types.StructuredMessageFieldNameAndDataTypePair) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StructuredMessageFieldNameAndDataTypePair"} + if v.FieldName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FieldName")) + } + if v.DataType == nil { + invalidParams.Add(smithy.NewErrParamRequired("DataType")) + } else if v.DataType != nil { + if err := validateStructuredMessage(v.DataType); err != nil { + invalidParams.AddNested("DataType", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStructuredMessageListDefinition(v *types.StructuredMessageListDefinition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StructuredMessageListDefinition"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.MemberType == nil { + invalidParams.Add(smithy.NewErrParamRequired("MemberType")) + } else if v.MemberType != nil { + if err := validateStructuredMessage(v.MemberType); err != nil { + invalidParams.AddNested("MemberType", err.(smithy.InvalidParamsError)) + } + } + if len(v.ListType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ListType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTag(v *types.Tag) error { if v == nil { return nil @@ -1696,6 +1901,24 @@ func validateUpdateVehicleRequestItems(v []types.UpdateVehicleRequestItem) error } } +func validateVehicleMiddleware(v *types.VehicleMiddleware) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VehicleMiddleware"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.ProtocolName) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ProtocolName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpAssociateVehicleFleetInput(v *AssociateVehicleFleetInput) error { if v == nil { return nil diff --git a/service/lakeformation/api_op_CreateLakeFormationIdentityCenterConfiguration.go b/service/lakeformation/api_op_CreateLakeFormationIdentityCenterConfiguration.go new file mode 100644 index 00000000000..02923f2ce73 --- /dev/null +++ b/service/lakeformation/api_op_CreateLakeFormationIdentityCenterConfiguration.go @@ -0,0 +1,149 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lakeformation + +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/lakeformation/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an IAM Identity Center connection with Lake Formation to allow IAM +// Identity Center users and groups to access Data Catalog resources. +func (c *Client) CreateLakeFormationIdentityCenterConfiguration(ctx context.Context, params *CreateLakeFormationIdentityCenterConfigurationInput, optFns ...func(*Options)) (*CreateLakeFormationIdentityCenterConfigurationOutput, error) { + if params == nil { + params = &CreateLakeFormationIdentityCenterConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateLakeFormationIdentityCenterConfiguration", params, optFns, c.addOperationCreateLakeFormationIdentityCenterConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateLakeFormationIdentityCenterConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateLakeFormationIdentityCenterConfigurationInput struct { + + // The identifier for the Data Catalog. By default, the account ID. The Data + // Catalog is the persistent metadata store. It contains database definitions, + // table definitions, view definitions, and other control information to manage + // your Lake Formation environment. + CatalogId *string + + // A list of the account IDs of Amazon Web Services accounts of third-party + // applications that are allowed to to access data managed by Lake Formation. + ExternalFiltering *types.ExternalFilteringConfiguration + + // The ARN of the IAM Identity Center instance for which the operation will be + // executed. For more information about ARNs, see Amazon Resource Names (ARNs) and + // Amazon Web Services Service Namespaces in the Amazon Web Services General + // Reference. + InstanceArn *string + + noSmithyDocumentSerde +} + +type CreateLakeFormationIdentityCenterConfigurationOutput struct { + + // The Amazon Resource Name (ARN) of the integrated application. + ApplicationArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateLakeFormationIdentityCenterConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateLakeFormationIdentityCenterConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateLakeFormationIdentityCenterConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateLakeFormationIdentityCenterConfiguration"); 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 = addOpCreateLakeFormationIdentityCenterConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLakeFormationIdentityCenterConfiguration(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_opCreateLakeFormationIdentityCenterConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateLakeFormationIdentityCenterConfiguration", + } +} diff --git a/service/lakeformation/api_op_DeleteLakeFormationIdentityCenterConfiguration.go b/service/lakeformation/api_op_DeleteLakeFormationIdentityCenterConfiguration.go new file mode 100644 index 00000000000..614f748b894 --- /dev/null +++ b/service/lakeformation/api_op_DeleteLakeFormationIdentityCenterConfiguration.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lakeformation + +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 IAM Identity Center connection with Lake Formation. +func (c *Client) DeleteLakeFormationIdentityCenterConfiguration(ctx context.Context, params *DeleteLakeFormationIdentityCenterConfigurationInput, optFns ...func(*Options)) (*DeleteLakeFormationIdentityCenterConfigurationOutput, error) { + if params == nil { + params = &DeleteLakeFormationIdentityCenterConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteLakeFormationIdentityCenterConfiguration", params, optFns, c.addOperationDeleteLakeFormationIdentityCenterConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteLakeFormationIdentityCenterConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteLakeFormationIdentityCenterConfigurationInput struct { + + // The identifier for the Data Catalog. By default, the account ID. The Data + // Catalog is the persistent metadata store. It contains database definitions, + // table definitions, view definition, and other control information to manage your + // Lake Formation environment. + CatalogId *string + + noSmithyDocumentSerde +} + +type DeleteLakeFormationIdentityCenterConfigurationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteLakeFormationIdentityCenterConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteLakeFormationIdentityCenterConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteLakeFormationIdentityCenterConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteLakeFormationIdentityCenterConfiguration"); 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_opDeleteLakeFormationIdentityCenterConfiguration(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_opDeleteLakeFormationIdentityCenterConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteLakeFormationIdentityCenterConfiguration", + } +} diff --git a/service/lakeformation/api_op_DescribeLakeFormationIdentityCenterConfiguration.go b/service/lakeformation/api_op_DescribeLakeFormationIdentityCenterConfiguration.go new file mode 100644 index 00000000000..ca457d8aaa5 --- /dev/null +++ b/service/lakeformation/api_op_DescribeLakeFormationIdentityCenterConfiguration.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lakeformation + +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/lakeformation/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the instance ARN and application ARN for the connection. +func (c *Client) DescribeLakeFormationIdentityCenterConfiguration(ctx context.Context, params *DescribeLakeFormationIdentityCenterConfigurationInput, optFns ...func(*Options)) (*DescribeLakeFormationIdentityCenterConfigurationOutput, error) { + if params == nil { + params = &DescribeLakeFormationIdentityCenterConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeLakeFormationIdentityCenterConfiguration", params, optFns, c.addOperationDescribeLakeFormationIdentityCenterConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeLakeFormationIdentityCenterConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeLakeFormationIdentityCenterConfigurationInput struct { + + // The identifier for the Data Catalog. By default, the account ID. The Data + // Catalog is the persistent metadata store. It contains database definitions, + // table definitions, and other control information to manage your Lake Formation + // environment. + CatalogId *string + + noSmithyDocumentSerde +} + +type DescribeLakeFormationIdentityCenterConfigurationOutput struct { + + // The Amazon Resource Name (ARN) of the integrated application. + ApplicationArn *string + + // The identifier for the Data Catalog. By default, the account ID. The Data + // Catalog is the persistent metadata store. It contains database definitions, + // table definitions, and other control information to manage your Lake Formation + // environment. + CatalogId *string + + // Indicates if external filtering is enabled. + ExternalFiltering *types.ExternalFilteringConfiguration + + // The Amazon Resource Name (ARN) of the connection. + InstanceArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeLakeFormationIdentityCenterConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeLakeFormationIdentityCenterConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeLakeFormationIdentityCenterConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeLakeFormationIdentityCenterConfiguration"); 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_opDescribeLakeFormationIdentityCenterConfiguration(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_opDescribeLakeFormationIdentityCenterConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeLakeFormationIdentityCenterConfiguration", + } +} diff --git a/service/lakeformation/api_op_SearchTablesByLFTags.go b/service/lakeformation/api_op_SearchTablesByLFTags.go index 9dd5fb2ebba..4978e96bfed 100644 --- a/service/lakeformation/api_op_SearchTablesByLFTags.go +++ b/service/lakeformation/api_op_SearchTablesByLFTags.go @@ -55,7 +55,9 @@ type SearchTablesByLFTagsInput struct { type SearchTablesByLFTagsOutput struct { - // A continuation token, present if the current list segment is not the last. + // A continuation token, present if the current list segment is not the last. On + // the first run, if you include a not null (a value) token you can get empty + // pages. NextToken *string // A list of tables that meet the LF-tag conditions. diff --git a/service/lakeformation/api_op_UpdateLakeFormationIdentityCenterConfiguration.go b/service/lakeformation/api_op_UpdateLakeFormationIdentityCenterConfiguration.go new file mode 100644 index 00000000000..11305d7ca69 --- /dev/null +++ b/service/lakeformation/api_op_UpdateLakeFormationIdentityCenterConfiguration.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lakeformation + +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/lakeformation/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the IAM Identity Center connection parameters. +func (c *Client) UpdateLakeFormationIdentityCenterConfiguration(ctx context.Context, params *UpdateLakeFormationIdentityCenterConfigurationInput, optFns ...func(*Options)) (*UpdateLakeFormationIdentityCenterConfigurationOutput, error) { + if params == nil { + params = &UpdateLakeFormationIdentityCenterConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateLakeFormationIdentityCenterConfiguration", params, optFns, c.addOperationUpdateLakeFormationIdentityCenterConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateLakeFormationIdentityCenterConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateLakeFormationIdentityCenterConfigurationInput struct { + + // Allows to enable or disable the IAM Identity Center connection. + ApplicationStatus types.ApplicationStatus + + // The identifier for the Data Catalog. By default, the account ID. The Data + // Catalog is the persistent metadata store. It contains database definitions, + // table definitions, view definitions, and other control information to manage + // your Lake Formation environment. + CatalogId *string + + // A list of the account IDs of Amazon Web Services accounts of third-party + // applications that are allowed to access data managed by Lake Formation. + ExternalFiltering *types.ExternalFilteringConfiguration + + noSmithyDocumentSerde +} + +type UpdateLakeFormationIdentityCenterConfigurationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateLakeFormationIdentityCenterConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateLakeFormationIdentityCenterConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateLakeFormationIdentityCenterConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateLakeFormationIdentityCenterConfiguration"); 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 = addOpUpdateLakeFormationIdentityCenterConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateLakeFormationIdentityCenterConfiguration(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_opUpdateLakeFormationIdentityCenterConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateLakeFormationIdentityCenterConfiguration", + } +} diff --git a/service/lakeformation/deserializers.go b/service/lakeformation/deserializers.go index eaa3888bd0b..ea0c4e61571 100644 --- a/service/lakeformation/deserializers.go +++ b/service/lakeformation/deserializers.go @@ -1046,6 +1046,172 @@ func awsRestjson1_deserializeOpErrorCreateDataCellsFilter(response *smithyhttp.R } } +type awsRestjson1_deserializeOpCreateLakeFormationIdentityCenterConfiguration struct { +} + +func (*awsRestjson1_deserializeOpCreateLakeFormationIdentityCenterConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateLakeFormationIdentityCenterConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreateLakeFormationIdentityCenterConfiguration(response, &metadata) + } + output := &CreateLakeFormationIdentityCenterConfigurationOutput{} + 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_deserializeOpDocumentCreateLakeFormationIdentityCenterConfigurationOutput(&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_deserializeOpErrorCreateLakeFormationIdentityCenterConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("AlreadyExistsException", errorCode): + return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody) + + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("OperationTimeoutException", errorCode): + return awsRestjson1_deserializeErrorOperationTimeoutException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateLakeFormationIdentityCenterConfigurationOutput(v **CreateLakeFormationIdentityCenterConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateLakeFormationIdentityCenterConfigurationOutput + if *v == nil { + sv = &CreateLakeFormationIdentityCenterConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ApplicationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationArn to be of type string, got %T instead", value) + } + sv.ApplicationArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpCreateLakeFormationOptIn struct { } @@ -1337,6 +1503,104 @@ func awsRestjson1_deserializeOpErrorDeleteDataCellsFilter(response *smithyhttp.R } } +type awsRestjson1_deserializeOpDeleteLakeFormationIdentityCenterConfiguration struct { +} + +func (*awsRestjson1_deserializeOpDeleteLakeFormationIdentityCenterConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteLakeFormationIdentityCenterConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteLakeFormationIdentityCenterConfiguration(response, &metadata) + } + output := &DeleteLakeFormationIdentityCenterConfigurationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteLakeFormationIdentityCenterConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsRestjson1_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("OperationTimeoutException", errorCode): + return awsRestjson1_deserializeErrorOperationTimeoutException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpDeleteLakeFormationOptIn struct { } @@ -1621,8 +1885,100 @@ func awsRestjson1_deserializeOpErrorDeleteObjectsOnCancel(response *smithyhttp.R case strings.EqualFold("TransactionCanceledException", errorCode): return awsRestjson1_deserializeErrorTransactionCanceledException(response, errorBody) - case strings.EqualFold("TransactionCommittedException", errorCode): - return awsRestjson1_deserializeErrorTransactionCommittedException(response, errorBody) + case strings.EqualFold("TransactionCommittedException", errorCode): + return awsRestjson1_deserializeErrorTransactionCommittedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeregisterResource struct { +} + +func (*awsRestjson1_deserializeOpDeregisterResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeregisterResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeregisterResource(response, &metadata) + } + output := &DeregisterResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeregisterResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("EntityNotFoundException", errorCode): + return awsRestjson1_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("OperationTimeoutException", errorCode): + return awsRestjson1_deserializeErrorOperationTimeoutException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -1634,14 +1990,14 @@ func awsRestjson1_deserializeOpErrorDeleteObjectsOnCancel(response *smithyhttp.R } } -type awsRestjson1_deserializeOpDeregisterResource struct { +type awsRestjson1_deserializeOpDescribeLakeFormationIdentityCenterConfiguration struct { } -func (*awsRestjson1_deserializeOpDeregisterResource) ID() string { +func (*awsRestjson1_deserializeOpDescribeLakeFormationIdentityCenterConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeregisterResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeLakeFormationIdentityCenterConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1655,15 +2011,43 @@ func (m *awsRestjson1_deserializeOpDeregisterResource) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeregisterResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeLakeFormationIdentityCenterConfiguration(response, &metadata) } - output := &DeregisterResourceOutput{} + output := &DescribeLakeFormationIdentityCenterConfigurationOutput{} 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_deserializeOpDocumentDescribeLakeFormationIdentityCenterConfigurationOutput(&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_deserializeOpErrorDeregisterResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeLakeFormationIdentityCenterConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1704,6 +2088,9 @@ func awsRestjson1_deserializeOpErrorDeregisterResource(response *smithyhttp.Resp } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("EntityNotFoundException", errorCode): return awsRestjson1_deserializeErrorEntityNotFoundException(response, errorBody) @@ -1726,6 +2113,69 @@ func awsRestjson1_deserializeOpErrorDeregisterResource(response *smithyhttp.Resp } } +func awsRestjson1_deserializeOpDocumentDescribeLakeFormationIdentityCenterConfigurationOutput(v **DescribeLakeFormationIdentityCenterConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeLakeFormationIdentityCenterConfigurationOutput + if *v == nil { + sv = &DescribeLakeFormationIdentityCenterConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ApplicationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationArn to be of type string, got %T instead", value) + } + sv.ApplicationArn = ptr.String(jtv) + } + + case "CatalogId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CatalogIdString to be of type string, got %T instead", value) + } + sv.CatalogId = ptr.String(jtv) + } + + case "ExternalFiltering": + if err := awsRestjson1_deserializeDocumentExternalFilteringConfiguration(&sv.ExternalFiltering, value); err != nil { + return err + } + + case "InstanceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdentityCenterInstanceArn to be of type string, got %T instead", value) + } + sv.InstanceArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpDescribeResource struct { } @@ -6604,6 +7054,104 @@ func awsRestjson1_deserializeOpErrorUpdateDataCellsFilter(response *smithyhttp.R } } +type awsRestjson1_deserializeOpUpdateLakeFormationIdentityCenterConfiguration struct { +} + +func (*awsRestjson1_deserializeOpUpdateLakeFormationIdentityCenterConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateLakeFormationIdentityCenterConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateLakeFormationIdentityCenterConfiguration(response, &metadata) + } + output := &UpdateLakeFormationIdentityCenterConfigurationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateLakeFormationIdentityCenterConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsRestjson1_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("OperationTimeoutException", errorCode): + return awsRestjson1_deserializeErrorOperationTimeoutException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpUpdateLFTag struct { } @@ -8969,6 +9517,51 @@ func awsRestjson1_deserializeDocumentExpression(v *[]types.LFTag, value interfac return nil } +func awsRestjson1_deserializeDocumentExternalFilteringConfiguration(v **types.ExternalFilteringConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ExternalFilteringConfiguration + if *v == nil { + sv = &types.ExternalFilteringConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AuthorizedTargets": + if err := awsRestjson1_deserializeDocumentScopeTargets(&sv.AuthorizedTargets, value); err != nil { + return err + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EnableStatus to be of type string, got %T instead", value) + } + sv.Status = types.EnableStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentGlueEncryptionException(v **types.GlueEncryptionException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10390,6 +10983,42 @@ func awsRestjson1_deserializeDocumentRowFilter(v **types.RowFilter, value interf return nil } +func awsRestjson1_deserializeDocumentScopeTargets(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 ScopeTarget to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentStatisticsNotReadyYetException(v **types.StatisticsNotReadyYetException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/lakeformation/endpoints.go b/service/lakeformation/endpoints.go index b0cad83f574..a4fdec742d0 100644 --- a/service/lakeformation/endpoints.go +++ b/service/lakeformation/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://lakeformation-fips.") diff --git a/service/lakeformation/generated.json b/service/lakeformation/generated.json index 5f835fac513..3c9df999d0c 100644 --- a/service/lakeformation/generated.json +++ b/service/lakeformation/generated.json @@ -17,12 +17,15 @@ "api_op_CommitTransaction.go", "api_op_CreateDataCellsFilter.go", "api_op_CreateLFTag.go", + "api_op_CreateLakeFormationIdentityCenterConfiguration.go", "api_op_CreateLakeFormationOptIn.go", "api_op_DeleteDataCellsFilter.go", "api_op_DeleteLFTag.go", + "api_op_DeleteLakeFormationIdentityCenterConfiguration.go", "api_op_DeleteLakeFormationOptIn.go", "api_op_DeleteObjectsOnCancel.go", "api_op_DeregisterResource.go", + "api_op_DescribeLakeFormationIdentityCenterConfiguration.go", "api_op_DescribeResource.go", "api_op_DescribeTransaction.go", "api_op_ExtendTransaction.go", @@ -56,6 +59,7 @@ "api_op_StartTransaction.go", "api_op_UpdateDataCellsFilter.go", "api_op_UpdateLFTag.go", + "api_op_UpdateLakeFormationIdentityCenterConfiguration.go", "api_op_UpdateResource.go", "api_op_UpdateTableObjects.go", "api_op_UpdateTableStorageOptimizer.go", diff --git a/service/lakeformation/serializers.go b/service/lakeformation/serializers.go index c7c45738591..df6ed22ed80 100644 --- a/service/lakeformation/serializers.go +++ b/service/lakeformation/serializers.go @@ -585,6 +585,93 @@ func awsRestjson1_serializeOpDocumentCreateDataCellsFilterInput(v *CreateDataCel return nil } +type awsRestjson1_serializeOpCreateLakeFormationIdentityCenterConfiguration struct { +} + +func (*awsRestjson1_serializeOpCreateLakeFormationIdentityCenterConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateLakeFormationIdentityCenterConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateLakeFormationIdentityCenterConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/CreateLakeFormationIdentityCenterConfiguration") + 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_serializeOpDocumentCreateLakeFormationIdentityCenterConfigurationInput(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_serializeOpHttpBindingsCreateLakeFormationIdentityCenterConfigurationInput(v *CreateLakeFormationIdentityCenterConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateLakeFormationIdentityCenterConfigurationInput(v *CreateLakeFormationIdentityCenterConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CatalogId != nil { + ok := object.Key("CatalogId") + ok.String(*v.CatalogId) + } + + if v.ExternalFiltering != nil { + ok := object.Key("ExternalFiltering") + if err := awsRestjson1_serializeDocumentExternalFilteringConfiguration(v.ExternalFiltering, ok); err != nil { + return err + } + } + + if v.InstanceArn != nil { + ok := object.Key("InstanceArn") + ok.String(*v.InstanceArn) + } + + return nil +} + type awsRestjson1_serializeOpCreateLakeFormationOptIn struct { } @@ -846,6 +933,81 @@ func awsRestjson1_serializeOpDocumentDeleteDataCellsFilterInput(v *DeleteDataCel return nil } +type awsRestjson1_serializeOpDeleteLakeFormationIdentityCenterConfiguration struct { +} + +func (*awsRestjson1_serializeOpDeleteLakeFormationIdentityCenterConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteLakeFormationIdentityCenterConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteLakeFormationIdentityCenterConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/DeleteLakeFormationIdentityCenterConfiguration") + 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_serializeOpDocumentDeleteLakeFormationIdentityCenterConfigurationInput(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_serializeOpHttpBindingsDeleteLakeFormationIdentityCenterConfigurationInput(v *DeleteLakeFormationIdentityCenterConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteLakeFormationIdentityCenterConfigurationInput(v *DeleteLakeFormationIdentityCenterConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CatalogId != nil { + ok := object.Key("CatalogId") + ok.String(*v.CatalogId) + } + + return nil +} + type awsRestjson1_serializeOpDeleteLakeFormationOptIn struct { } @@ -1182,6 +1344,81 @@ func awsRestjson1_serializeOpDocumentDeregisterResourceInput(v *DeregisterResour return nil } +type awsRestjson1_serializeOpDescribeLakeFormationIdentityCenterConfiguration struct { +} + +func (*awsRestjson1_serializeOpDescribeLakeFormationIdentityCenterConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeLakeFormationIdentityCenterConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeLakeFormationIdentityCenterConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/DescribeLakeFormationIdentityCenterConfiguration") + 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_serializeOpDocumentDescribeLakeFormationIdentityCenterConfigurationInput(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_serializeOpHttpBindingsDescribeLakeFormationIdentityCenterConfigurationInput(v *DescribeLakeFormationIdentityCenterConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDescribeLakeFormationIdentityCenterConfigurationInput(v *DescribeLakeFormationIdentityCenterConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CatalogId != nil { + ok := object.Key("CatalogId") + ok.String(*v.CatalogId) + } + + return nil +} + type awsRestjson1_serializeOpDescribeResource struct { } @@ -4015,6 +4252,93 @@ func awsRestjson1_serializeOpDocumentUpdateDataCellsFilterInput(v *UpdateDataCel return nil } +type awsRestjson1_serializeOpUpdateLakeFormationIdentityCenterConfiguration struct { +} + +func (*awsRestjson1_serializeOpUpdateLakeFormationIdentityCenterConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateLakeFormationIdentityCenterConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateLakeFormationIdentityCenterConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/UpdateLakeFormationIdentityCenterConfiguration") + 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_serializeOpDocumentUpdateLakeFormationIdentityCenterConfigurationInput(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_serializeOpHttpBindingsUpdateLakeFormationIdentityCenterConfigurationInput(v *UpdateLakeFormationIdentityCenterConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateLakeFormationIdentityCenterConfigurationInput(v *UpdateLakeFormationIdentityCenterConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.ApplicationStatus) > 0 { + ok := object.Key("ApplicationStatus") + ok.String(string(v.ApplicationStatus)) + } + + if v.CatalogId != nil { + ok := object.Key("CatalogId") + ok.String(*v.CatalogId) + } + + if v.ExternalFiltering != nil { + ok := object.Key("ExternalFiltering") + if err := awsRestjson1_serializeDocumentExternalFilteringConfiguration(v.ExternalFiltering, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpUpdateLFTag struct { } @@ -4781,6 +5105,25 @@ func awsRestjson1_serializeDocumentExpression(v []types.LFTag, value smithyjson. return nil } +func awsRestjson1_serializeDocumentExternalFilteringConfiguration(v *types.ExternalFilteringConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AuthorizedTargets != nil { + ok := object.Key("AuthorizedTargets") + if err := awsRestjson1_serializeDocumentScopeTargets(v.AuthorizedTargets, ok); err != nil { + return err + } + } + + if len(v.Status) > 0 { + ok := object.Key("Status") + ok.String(string(v.Status)) + } + + return nil +} + func awsRestjson1_serializeDocumentFilterCondition(v *types.FilterCondition, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5141,6 +5484,17 @@ func awsRestjson1_serializeDocumentRowFilter(v *types.RowFilter, value smithyjso return nil } +func awsRestjson1_serializeDocumentScopeTargets(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_serializeDocumentStorageOptimizerConfig(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/lakeformation/types/enums.go b/service/lakeformation/types/enums.go index 6d52ce843bb..9cf2d53c1fa 100644 --- a/service/lakeformation/types/enums.go +++ b/service/lakeformation/types/enums.go @@ -2,6 +2,24 @@ package types +type ApplicationStatus string + +// Enum values for ApplicationStatus +const ( + ApplicationStatusEnabled ApplicationStatus = "ENABLED" + ApplicationStatusDisabled ApplicationStatus = "DISABLED" +) + +// Values returns all known values for ApplicationStatus. 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 (ApplicationStatus) Values() []ApplicationStatus { + return []ApplicationStatus{ + "ENABLED", + "DISABLED", + } +} + type ComparisonOperator string // Enum values for ComparisonOperator @@ -68,6 +86,24 @@ func (DataLakeResourceType) Values() []DataLakeResourceType { } } +type EnableStatus string + +// Enum values for EnableStatus +const ( + EnableStatusEnabled EnableStatus = "ENABLED" + EnableStatusDisabled EnableStatus = "DISABLED" +) + +// Values returns all known values for EnableStatus. 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 (EnableStatus) Values() []EnableStatus { + return []EnableStatus{ + "ENABLED", + "DISABLED", + } +} + type FieldNameString string // Enum values for FieldNameString diff --git a/service/lakeformation/types/types.go b/service/lakeformation/types/types.go index acea213c8bc..496078600f6 100644 --- a/service/lakeformation/types/types.go +++ b/service/lakeformation/types/types.go @@ -256,8 +256,8 @@ type DataLakeSettings struct { ExternalDataFilteringAllowList []DataLakePrincipal // A key-value map that provides an additional configuration on your data lake. - // CrossAccountVersion is the key you can configure in the Parameters field. - // Accepted values for the CrossAccountVersion key are 1, 2, and 3. + // CROSS_ACCOUNT_VERSION is the key you can configure in the Parameters field. + // Accepted values for the CrossAccountVersion key are 1, 2, 3, and 4. Parameters map[string]string // A list of Lake Formation principals with only view access to the resources, @@ -348,6 +348,24 @@ type ExecutionStatistics struct { noSmithyDocumentSerde } +// Configuration for enabling external data filtering for third-party applications +// to access data managed by Lake Formation . +type ExternalFilteringConfiguration struct { + + // List of third-party application ARNs integrated with Lake Formation. + // + // This member is required. + AuthorizedTargets []string + + // Allows to enable or disable the third-party applications that are allowed to + // access data managed by Lake Formation. + // + // This member is required. + Status EnableStatus + + noSmithyDocumentSerde +} + // This structure describes the filtering of columns in a table based on a filter // condition. type FilterCondition struct { diff --git a/service/lakeformation/validators.go b/service/lakeformation/validators.go index 84a0c619496..f7f4ec1aef3 100644 --- a/service/lakeformation/validators.go +++ b/service/lakeformation/validators.go @@ -150,6 +150,26 @@ func (m *validateOpCreateDataCellsFilter) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpCreateLakeFormationIdentityCenterConfiguration struct { +} + +func (*validateOpCreateLakeFormationIdentityCenterConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateLakeFormationIdentityCenterConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateLakeFormationIdentityCenterConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateLakeFormationIdentityCenterConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateLakeFormationOptIn struct { } @@ -790,6 +810,26 @@ func (m *validateOpUpdateDataCellsFilter) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpUpdateLakeFormationIdentityCenterConfiguration struct { +} + +func (*validateOpUpdateLakeFormationIdentityCenterConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateLakeFormationIdentityCenterConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateLakeFormationIdentityCenterConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateLakeFormationIdentityCenterConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateLFTag struct { } @@ -898,6 +938,10 @@ func addOpCreateDataCellsFilterValidationMiddleware(stack *middleware.Stack) err return stack.Initialize.Add(&validateOpCreateDataCellsFilter{}, middleware.After) } +func addOpCreateLakeFormationIdentityCenterConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateLakeFormationIdentityCenterConfiguration{}, middleware.After) +} + func addOpCreateLakeFormationOptInValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateLakeFormationOptIn{}, middleware.After) } @@ -1026,6 +1070,10 @@ func addOpUpdateDataCellsFilterValidationMiddleware(stack *middleware.Stack) err return stack.Initialize.Add(&validateOpUpdateDataCellsFilter{}, middleware.After) } +func addOpUpdateLakeFormationIdentityCenterConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateLakeFormationIdentityCenterConfiguration{}, middleware.After) +} + func addOpUpdateLFTagValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateLFTag{}, middleware.After) } @@ -1183,6 +1231,24 @@ func validateExpression(v []types.LFTag) error { } } +func validateExternalFilteringConfiguration(v *types.ExternalFilteringConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ExternalFilteringConfiguration"} + if len(v.Status) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Status")) + } + if v.AuthorizedTargets == nil { + invalidParams.Add(smithy.NewErrParamRequired("AuthorizedTargets")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateLFTag(v *types.LFTag) error { if v == nil { return nil @@ -1586,6 +1652,23 @@ func validateOpCreateDataCellsFilterInput(v *CreateDataCellsFilterInput) error { } } +func validateOpCreateLakeFormationIdentityCenterConfigurationInput(v *CreateLakeFormationIdentityCenterConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateLakeFormationIdentityCenterConfigurationInput"} + if v.ExternalFiltering != nil { + if err := validateExternalFilteringConfiguration(v.ExternalFiltering); err != nil { + invalidParams.AddNested("ExternalFiltering", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateLakeFormationOptInInput(v *CreateLakeFormationOptInInput) error { if v == nil { return nil @@ -2181,6 +2264,23 @@ func validateOpUpdateDataCellsFilterInput(v *UpdateDataCellsFilterInput) error { } } +func validateOpUpdateLakeFormationIdentityCenterConfigurationInput(v *UpdateLakeFormationIdentityCenterConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateLakeFormationIdentityCenterConfigurationInput"} + if v.ExternalFiltering != nil { + if err := validateExternalFilteringConfiguration(v.ExternalFiltering); err != nil { + invalidParams.AddNested("ExternalFiltering", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateLFTagInput(v *UpdateLFTagInput) error { if v == nil { return nil diff --git a/service/lexmodelsv2/api_op_CreateBotLocale.go b/service/lexmodelsv2/api_op_CreateBotLocale.go index 18d7714c143..47665a1786a 100644 --- a/service/lexmodelsv2/api_op_CreateBotLocale.go +++ b/service/lexmodelsv2/api_op_CreateBotLocale.go @@ -74,6 +74,10 @@ type CreateBotLocaleInput struct { // lists. Description *string + // Contains specifications about the generative AI capabilities from Amazon + // Bedrock that you can turn on for your bot. + GenerativeAISettings *types.GenerativeAISettings + // The Amazon Polly voice ID that Amazon Lex uses for voice interaction with the // user. VoiceSettings *types.VoiceSettings @@ -104,6 +108,10 @@ type CreateBotLocaleOutput struct { // The specified description of the bot locale. Description *string + // Contains specifications about the generative AI capabilities from Amazon + // Bedrock that you can turn on for your bot. + GenerativeAISettings *types.GenerativeAISettings + // The specified locale identifier. LocaleId *string diff --git a/service/lexmodelsv2/api_op_CreateBotVersion.go b/service/lexmodelsv2/api_op_CreateBotVersion.go index f0982b3ada4..2e3670fc6d1 100644 --- a/service/lexmodelsv2/api_op_CreateBotVersion.go +++ b/service/lexmodelsv2/api_op_CreateBotVersion.go @@ -13,11 +13,11 @@ import ( "time" ) -// Creates a new version of the bot based on the DRAFT version. If the DRAFT -// version of this resource hasn't changed since you created the last version, -// Amazon Lex doesn't create a new version, it returns the last created version. -// When you create the first version of a bot, Amazon Lex sets the version to 1. -// Subsequent versions increment by 1. +// Creates an immutable version of the bot. When you create the first version of a +// bot, Amazon Lex sets the version number to 1. Subsequent bot versions increase +// in an increment of 1. The version number will always represent the total number +// of versions created of the bot, not the current number of versions. If a bot +// version is deleted, that bot version number will not be reused. func (c *Client) CreateBotVersion(ctx context.Context, params *CreateBotVersionInput, optFns ...func(*Options)) (*CreateBotVersionOutput, error) { if params == nil { params = &CreateBotVersionInput{} diff --git a/service/lexmodelsv2/api_op_DescribeBotLocale.go b/service/lexmodelsv2/api_op_DescribeBotLocale.go index ed63cd96e9e..7ca3e33f6f0 100644 --- a/service/lexmodelsv2/api_op_DescribeBotLocale.go +++ b/service/lexmodelsv2/api_op_DescribeBotLocale.go @@ -80,6 +80,10 @@ type DescribeBotLocaleOutput struct { // bot. FailureReasons []string + // Contains settings for Amazon Bedrock's generative AI features for your bot + // locale. + GenerativeAISettings *types.GenerativeAISettings + // The number of intents defined for the locale. IntentsCount *int32 diff --git a/service/lexmodelsv2/api_op_DescribeBotResourceGeneration.go b/service/lexmodelsv2/api_op_DescribeBotResourceGeneration.go new file mode 100644 index 00000000000..e10dd3429c5 --- /dev/null +++ b/service/lexmodelsv2/api_op_DescribeBotResourceGeneration.go @@ -0,0 +1,188 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lexmodelsv2 + +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/lexmodelsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns information about a request to generate a bot through natural language +// description, made through the StartBotResource API. Use the +// generatedBotLocaleUrl to retrieve the Amazon S3 object containing the bot locale +// configuration. You can then modify and import this configuration. +func (c *Client) DescribeBotResourceGeneration(ctx context.Context, params *DescribeBotResourceGenerationInput, optFns ...func(*Options)) (*DescribeBotResourceGenerationOutput, error) { + if params == nil { + params = &DescribeBotResourceGenerationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeBotResourceGeneration", params, optFns, c.addOperationDescribeBotResourceGenerationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeBotResourceGenerationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeBotResourceGenerationInput struct { + + // The unique identifier of the bot for which to return the generation details. + // + // This member is required. + BotId *string + + // The version of the bot for which to return the generation details. + // + // This member is required. + BotVersion *string + + // The unique identifier of the generation request for which to return the + // generation details. + // + // This member is required. + GenerationId *string + + // The locale of the bot for which to return the generation details. + // + // This member is required. + LocaleId *string + + noSmithyDocumentSerde +} + +type DescribeBotResourceGenerationOutput struct { + + // The unique identifier of the bot for which the generation request was made. + BotId *string + + // The version of the bot for which the generation request was made. + BotVersion *string + + // The date and time at which the item was generated. + CreationDateTime *time.Time + + // A list of reasons why the generation of bot resources through natural language + // description failed. + FailureReasons []string + + // The Amazon S3 location of the generated bot locale configuration. + GeneratedBotLocaleUrl *string + + // The generation ID for which to return the generation details. + GenerationId *string + + // The prompt used in the generation request. + GenerationInputPrompt *string + + // The status of the generation request. + GenerationStatus types.GenerationStatus + + // The date and time at which the generated item was updated. + LastUpdatedDateTime *time.Time + + // The locale of the bot for which the generation request was made. + LocaleId *string + + // The ARN of the model used to generate the bot resources. + ModelArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeBotResourceGenerationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeBotResourceGeneration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeBotResourceGeneration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeBotResourceGeneration"); 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 = addOpDescribeBotResourceGenerationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeBotResourceGeneration(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_opDescribeBotResourceGeneration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeBotResourceGeneration", + } +} diff --git a/service/lexmodelsv2/api_op_GenerateBotElement.go b/service/lexmodelsv2/api_op_GenerateBotElement.go new file mode 100644 index 00000000000..1d717a3b38e --- /dev/null +++ b/service/lexmodelsv2/api_op_GenerateBotElement.go @@ -0,0 +1,164 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lexmodelsv2 + +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/lexmodelsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Generates sample utterances for an intent. +func (c *Client) GenerateBotElement(ctx context.Context, params *GenerateBotElementInput, optFns ...func(*Options)) (*GenerateBotElementOutput, error) { + if params == nil { + params = &GenerateBotElementInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GenerateBotElement", params, optFns, c.addOperationGenerateBotElementMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GenerateBotElementOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GenerateBotElementInput struct { + + // The bot unique Id for the bot request to generate utterances. + // + // This member is required. + BotId *string + + // The bot version for the bot request to generate utterances. + // + // This member is required. + BotVersion *string + + // The intent unique Id for the bot request to generate utterances. + // + // This member is required. + IntentId *string + + // The unique locale Id for the bot request to generate utterances. + // + // This member is required. + LocaleId *string + + noSmithyDocumentSerde +} + +type GenerateBotElementOutput struct { + + // The unique bot Id for the bot which received the response. + BotId *string + + // The unique bot version for the bot which received the response. + BotVersion *string + + // The unique intent Id for the bot which received the response. + IntentId *string + + // The unique locale Id for the bot which received the response. + LocaleId *string + + // The sample utterances for the bot which received the response. + SampleUtterances []types.SampleUtterance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGenerateBotElementMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGenerateBotElement{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGenerateBotElement{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GenerateBotElement"); 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 = addOpGenerateBotElementValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGenerateBotElement(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_opGenerateBotElement(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GenerateBotElement", + } +} diff --git a/service/lexmodelsv2/api_op_ListBotResourceGenerations.go b/service/lexmodelsv2/api_op_ListBotResourceGenerations.go new file mode 100644 index 00000000000..b0ca64f1924 --- /dev/null +++ b/service/lexmodelsv2/api_op_ListBotResourceGenerations.go @@ -0,0 +1,267 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lexmodelsv2 + +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/lexmodelsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the generation requests made for a bot locale. +func (c *Client) ListBotResourceGenerations(ctx context.Context, params *ListBotResourceGenerationsInput, optFns ...func(*Options)) (*ListBotResourceGenerationsOutput, error) { + if params == nil { + params = &ListBotResourceGenerationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListBotResourceGenerations", params, optFns, c.addOperationListBotResourceGenerationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListBotResourceGenerationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListBotResourceGenerationsInput struct { + + // The unique identifier of the bot whose generation requests you want to view. + // + // This member is required. + BotId *string + + // The version of the bot whose generation requests you want to view. + // + // This member is required. + BotVersion *string + + // The locale of the bot whose generation requests you want to view. + // + // This member is required. + LocaleId *string + + // The maximum number of results to return in the response. + MaxResults *int32 + + // If the total number of results is greater than the number specified in the + // maxResults , the response returns a token in the nextToken field. Use this + // token when making a request to return the next batch of results. + NextToken *string + + // An object containing information about the attribute and the method by which to + // sort the results + SortBy *types.GenerationSortBy + + noSmithyDocumentSerde +} + +type ListBotResourceGenerationsOutput struct { + + // The unique identifier of the bot for which the generation requests were made. + BotId *string + + // The version of the bot for which the generation requests were made. + BotVersion *string + + // A list of objects, each containing information about a generation request for + // the bot locale. + GenerationSummaries []types.GenerationSummary + + // The locale of the bot for which the generation requests were made. + LocaleId *string + + // If the total number of results is greater than the number specified in the + // maxResults , the response returns a token in the nextToken field. Use this + // token when making a request to return the next batch of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListBotResourceGenerationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListBotResourceGenerations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListBotResourceGenerations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListBotResourceGenerations"); 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 = addOpListBotResourceGenerationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListBotResourceGenerations(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 +} + +// ListBotResourceGenerationsAPIClient is a client that implements the +// ListBotResourceGenerations operation. +type ListBotResourceGenerationsAPIClient interface { + ListBotResourceGenerations(context.Context, *ListBotResourceGenerationsInput, ...func(*Options)) (*ListBotResourceGenerationsOutput, error) +} + +var _ ListBotResourceGenerationsAPIClient = (*Client)(nil) + +// ListBotResourceGenerationsPaginatorOptions is the paginator options for +// ListBotResourceGenerations +type ListBotResourceGenerationsPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListBotResourceGenerationsPaginator is a paginator for +// ListBotResourceGenerations +type ListBotResourceGenerationsPaginator struct { + options ListBotResourceGenerationsPaginatorOptions + client ListBotResourceGenerationsAPIClient + params *ListBotResourceGenerationsInput + nextToken *string + firstPage bool +} + +// NewListBotResourceGenerationsPaginator returns a new +// ListBotResourceGenerationsPaginator +func NewListBotResourceGenerationsPaginator(client ListBotResourceGenerationsAPIClient, params *ListBotResourceGenerationsInput, optFns ...func(*ListBotResourceGenerationsPaginatorOptions)) *ListBotResourceGenerationsPaginator { + if params == nil { + params = &ListBotResourceGenerationsInput{} + } + + options := ListBotResourceGenerationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListBotResourceGenerationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBotResourceGenerationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListBotResourceGenerations page. +func (p *ListBotResourceGenerationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBotResourceGenerationsOutput, 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.ListBotResourceGenerations(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_opListBotResourceGenerations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListBotResourceGenerations", + } +} diff --git a/service/lexmodelsv2/api_op_StartBotResourceGeneration.go b/service/lexmodelsv2/api_op_StartBotResourceGeneration.go new file mode 100644 index 00000000000..2e6b0246543 --- /dev/null +++ b/service/lexmodelsv2/api_op_StartBotResourceGeneration.go @@ -0,0 +1,179 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lexmodelsv2 + +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/lexmodelsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Starts a request for the descriptive bot builder to generate a bot locale +// configuration based on the prompt you provide it. After you make this call, use +// the DescribeBotResourceGeneration operation to check on the status of the +// generation and for the generatedBotLocaleUrl when the generation is complete. +// Use that value to retrieve the Amazon S3 object containing the bot locale +// configuration. You can then modify and import this configuration. +func (c *Client) StartBotResourceGeneration(ctx context.Context, params *StartBotResourceGenerationInput, optFns ...func(*Options)) (*StartBotResourceGenerationOutput, error) { + if params == nil { + params = &StartBotResourceGenerationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartBotResourceGeneration", params, optFns, c.addOperationStartBotResourceGenerationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartBotResourceGenerationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartBotResourceGenerationInput struct { + + // The unique identifier of the bot for which to generate intents and slot types. + // + // This member is required. + BotId *string + + // The version of the bot for which to generate intents and slot types. + // + // This member is required. + BotVersion *string + + // The prompt to generate intents and slot types for the bot locale. Your + // description should be both detailed and precise to help generate appropriate and + // sufficient intents for your bot. Include a list of actions to improve the intent + // creation process. + // + // This member is required. + GenerationInputPrompt *string + + // The locale of the bot for which to generate intents and slot types. + // + // This member is required. + LocaleId *string + + noSmithyDocumentSerde +} + +type StartBotResourceGenerationOutput struct { + + // The unique identifier of the bot for which the generation request was made. + BotId *string + + // The version of the bot for which the generation request was made. + BotVersion *string + + // The date and time at which the generation request was made. + CreationDateTime *time.Time + + // The unique identifier of the generation request. + GenerationId *string + + // The prompt that was used generate intents and slot types for the bot locale. + GenerationInputPrompt *string + + // The status of the generation request. + GenerationStatus types.GenerationStatus + + // The locale of the bot for which the generation request was made. + LocaleId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartBotResourceGenerationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartBotResourceGeneration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartBotResourceGeneration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartBotResourceGeneration"); 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 = addOpStartBotResourceGenerationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartBotResourceGeneration(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_opStartBotResourceGeneration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartBotResourceGeneration", + } +} diff --git a/service/lexmodelsv2/api_op_UpdateBotLocale.go b/service/lexmodelsv2/api_op_UpdateBotLocale.go index b465161cc5e..adb3d722155 100644 --- a/service/lexmodelsv2/api_op_UpdateBotLocale.go +++ b/service/lexmodelsv2/api_op_UpdateBotLocale.go @@ -59,6 +59,11 @@ type UpdateBotLocaleInput struct { // The new description of the locale. Description *string + // Contains settings for generative AI features powered by Amazon Bedrock for your + // bot locale. Use this object to turn generative AI features on and off. Pricing + // may differ if you turn a feature on. For more information, see LINK. + GenerativeAISettings *types.GenerativeAISettings + // The new Amazon Polly voice Amazon Lex should use for voice interaction with the // user. VoiceSettings *types.VoiceSettings @@ -88,6 +93,10 @@ type UpdateBotLocaleOutput struct { // that occurred while building the bot. FailureReasons []string + // Contains settings for generative AI features powered by Amazon Bedrock for your + // bot locale. + GenerativeAISettings *types.GenerativeAISettings + // A timestamp of the date and time that the locale was last updated. LastUpdatedDateTime *time.Time diff --git a/service/lexmodelsv2/deserializers.go b/service/lexmodelsv2/deserializers.go index 9d4e65ef1f2..8849b764937 100644 --- a/service/lexmodelsv2/deserializers.go +++ b/service/lexmodelsv2/deserializers.go @@ -1511,6 +1511,11 @@ func awsRestjson1_deserializeOpDocumentCreateBotLocaleOutput(v **CreateBotLocale sv.Description = ptr.String(jtv) } + case "generativeAISettings": + if err := awsRestjson1_deserializeDocumentGenerativeAISettings(&sv.GenerativeAISettings, value); err != nil { + return err + } + case "localeId": if value != nil { jtv, ok := value.(string) @@ -6375,6 +6380,11 @@ func awsRestjson1_deserializeOpDocumentDescribeBotLocaleOutput(v **DescribeBotLo return err } + case "generativeAISettings": + if err := awsRestjson1_deserializeDocumentGenerativeAISettings(&sv.GenerativeAISettings, value); err != nil { + return err + } + case "intentsCount": if value != nil { jtv, ok := value.(json.Number) @@ -6752,6 +6762,266 @@ func awsRestjson1_deserializeOpDocumentDescribeBotRecommendationOutput(v **Descr return nil } +type awsRestjson1_deserializeOpDescribeBotResourceGeneration struct { +} + +func (*awsRestjson1_deserializeOpDescribeBotResourceGeneration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribeBotResourceGeneration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDescribeBotResourceGeneration(response, &metadata) + } + output := &DescribeBotResourceGenerationOutput{} + 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_deserializeOpDocumentDescribeBotResourceGenerationOutput(&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_deserializeOpErrorDescribeBotResourceGeneration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return 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_deserializeOpDocumentDescribeBotResourceGenerationOutput(v **DescribeBotResourceGenerationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeBotResourceGenerationOutput + if *v == nil { + sv = &DescribeBotResourceGenerationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "botId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.BotId = ptr.String(jtv) + } + + case "botVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BotVersion to be of type string, got %T instead", value) + } + sv.BotVersion = ptr.String(jtv) + } + + case "creationDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "failureReasons": + if err := awsRestjson1_deserializeDocumentFailureReasons(&sv.FailureReasons, value); err != nil { + return err + } + + case "generatedBotLocaleUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PresignedS3Url to be of type string, got %T instead", value) + } + sv.GeneratedBotLocaleUrl = ptr.String(jtv) + } + + case "generationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.GenerationId = ptr.String(jtv) + } + + case "generationInputPrompt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenerationInput to be of type string, got %T instead", value) + } + sv.GenerationInputPrompt = ptr.String(jtv) + } + + case "generationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenerationStatus to be of type string, got %T instead", value) + } + sv.GenerationStatus = types.GenerationStatus(jtv) + } + + case "lastUpdatedDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "localeId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LocaleId to be of type string, got %T instead", value) + } + sv.LocaleId = ptr.String(jtv) + } + + case "modelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BedrockModelArn to be of type string, got %T instead", value) + } + sv.ModelArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpDescribeBotVersion struct { } @@ -9728,14 +9998,14 @@ func awsRestjson1_deserializeOpDocumentDescribeTestSetGenerationOutput(v **Descr return nil } -type awsRestjson1_deserializeOpGetTestExecutionArtifactsUrl struct { +type awsRestjson1_deserializeOpGenerateBotElement struct { } -func (*awsRestjson1_deserializeOpGetTestExecutionArtifactsUrl) ID() string { +func (*awsRestjson1_deserializeOpGenerateBotElement) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetTestExecutionArtifactsUrl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGenerateBotElement) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9749,9 +10019,9 @@ func (m *awsRestjson1_deserializeOpGetTestExecutionArtifactsUrl) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetTestExecutionArtifactsUrl(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGenerateBotElement(response, &metadata) } - output := &GetTestExecutionArtifactsUrlOutput{} + output := &GenerateBotElementOutput{} out.Result = output var buff [1024]byte @@ -9772,7 +10042,7 @@ func (m *awsRestjson1_deserializeOpGetTestExecutionArtifactsUrl) HandleDeseriali return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetTestExecutionArtifactsUrlOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGenerateBotElementOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9785,7 +10055,208 @@ func (m *awsRestjson1_deserializeOpGetTestExecutionArtifactsUrl) HandleDeseriali return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetTestExecutionArtifactsUrl(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGenerateBotElement(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(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("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGenerateBotElementOutput(v **GenerateBotElementOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GenerateBotElementOutput + if *v == nil { + sv = &GenerateBotElementOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "botId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.BotId = ptr.String(jtv) + } + + case "botVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DraftBotVersion to be of type string, got %T instead", value) + } + sv.BotVersion = ptr.String(jtv) + } + + case "intentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.IntentId = ptr.String(jtv) + } + + case "localeId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LocaleId to be of type string, got %T instead", value) + } + sv.LocaleId = ptr.String(jtv) + } + + case "sampleUtterances": + if err := awsRestjson1_deserializeDocumentSampleUtterancesList(&sv.SampleUtterances, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetTestExecutionArtifactsUrl struct { +} + +func (*awsRestjson1_deserializeOpGetTestExecutionArtifactsUrl) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetTestExecutionArtifactsUrl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetTestExecutionArtifactsUrl(response, &metadata) + } + output := &GetTestExecutionArtifactsUrlOutput{} + 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_deserializeOpDocumentGetTestExecutionArtifactsUrlOutput(&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_deserializeOpErrorGetTestExecutionArtifactsUrl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10351,7 +10822,190 @@ func (m *awsRestjson1_deserializeOpListBotLocales) HandleDeserialize(ctx context if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListBotLocales(response, &metadata) } - output := &ListBotLocalesOutput{} + output := &ListBotLocalesOutput{} + 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_deserializeOpDocumentListBotLocalesOutput(&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_deserializeOpErrorListBotLocales(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListBotLocalesOutput(v **ListBotLocalesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListBotLocalesOutput + if *v == nil { + sv = &ListBotLocalesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "botId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.BotId = ptr.String(jtv) + } + + case "botLocaleSummaries": + if err := awsRestjson1_deserializeDocumentBotLocaleSummaryList(&sv.BotLocaleSummaries, value); err != nil { + return err + } + + case "botVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BotVersion to be of type string, got %T instead", value) + } + sv.BotVersion = ptr.String(jtv) + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListBotRecommendations struct { +} + +func (*awsRestjson1_deserializeOpListBotRecommendations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListBotRecommendations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListBotRecommendations(response, &metadata) + } + output := &ListBotRecommendationsOutput{} out.Result = output var buff [1024]byte @@ -10372,7 +11026,7 @@ func (m *awsRestjson1_deserializeOpListBotLocales) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListBotLocalesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListBotRecommendationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10385,7 +11039,7 @@ func (m *awsRestjson1_deserializeOpListBotLocales) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListBotLocales(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListBotRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10429,8 +11083,8 @@ func awsRestjson1_deserializeOpErrorListBotLocales(response *smithyhttp.Response case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -10448,7 +11102,7 @@ func awsRestjson1_deserializeOpErrorListBotLocales(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListBotLocalesOutput(v **ListBotLocalesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListBotRecommendationsOutput(v **ListBotRecommendationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10461,9 +11115,9 @@ func awsRestjson1_deserializeOpDocumentListBotLocalesOutput(v **ListBotLocalesOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListBotLocalesOutput + var sv *ListBotRecommendationsOutput if *v == nil { - sv = &ListBotLocalesOutput{} + sv = &ListBotRecommendationsOutput{} } else { sv = *v } @@ -10479,8 +11133,8 @@ func awsRestjson1_deserializeOpDocumentListBotLocalesOutput(v **ListBotLocalesOu sv.BotId = ptr.String(jtv) } - case "botLocaleSummaries": - if err := awsRestjson1_deserializeDocumentBotLocaleSummaryList(&sv.BotLocaleSummaries, value); err != nil { + case "botRecommendationSummaries": + if err := awsRestjson1_deserializeDocumentBotRecommendationSummaryList(&sv.BotRecommendationSummaries, value); err != nil { return err } @@ -10488,11 +11142,20 @@ func awsRestjson1_deserializeOpDocumentListBotLocalesOutput(v **ListBotLocalesOu if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected BotVersion to be of type string, got %T instead", value) + return fmt.Errorf("expected DraftBotVersion to be of type string, got %T instead", value) } sv.BotVersion = ptr.String(jtv) } + case "localeId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LocaleId to be of type string, got %T instead", value) + } + sv.LocaleId = ptr.String(jtv) + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -10511,14 +11174,14 @@ func awsRestjson1_deserializeOpDocumentListBotLocalesOutput(v **ListBotLocalesOu return nil } -type awsRestjson1_deserializeOpListBotRecommendations struct { +type awsRestjson1_deserializeOpListBotResourceGenerations struct { } -func (*awsRestjson1_deserializeOpListBotRecommendations) ID() string { +func (*awsRestjson1_deserializeOpListBotResourceGenerations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListBotRecommendations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListBotResourceGenerations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10532,9 +11195,9 @@ func (m *awsRestjson1_deserializeOpListBotRecommendations) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListBotRecommendations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListBotResourceGenerations(response, &metadata) } - output := &ListBotRecommendationsOutput{} + output := &ListBotResourceGenerationsOutput{} out.Result = output var buff [1024]byte @@ -10555,7 +11218,7 @@ func (m *awsRestjson1_deserializeOpListBotRecommendations) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListBotRecommendationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListBotResourceGenerationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10568,7 +11231,7 @@ func (m *awsRestjson1_deserializeOpListBotRecommendations) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListBotRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListBotResourceGenerations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10631,7 +11294,7 @@ func awsRestjson1_deserializeOpErrorListBotRecommendations(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentListBotRecommendationsOutput(v **ListBotRecommendationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListBotResourceGenerationsOutput(v **ListBotResourceGenerationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10644,9 +11307,9 @@ func awsRestjson1_deserializeOpDocumentListBotRecommendationsOutput(v **ListBotR return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListBotRecommendationsOutput + var sv *ListBotResourceGenerationsOutput if *v == nil { - sv = &ListBotRecommendationsOutput{} + sv = &ListBotResourceGenerationsOutput{} } else { sv = *v } @@ -10662,20 +11325,20 @@ func awsRestjson1_deserializeOpDocumentListBotRecommendationsOutput(v **ListBotR sv.BotId = ptr.String(jtv) } - case "botRecommendationSummaries": - if err := awsRestjson1_deserializeDocumentBotRecommendationSummaryList(&sv.BotRecommendationSummaries, value); err != nil { - return err - } - case "botVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DraftBotVersion to be of type string, got %T instead", value) + return fmt.Errorf("expected BotVersion to be of type string, got %T instead", value) } sv.BotVersion = ptr.String(jtv) } + case "generationSummaries": + if err := awsRestjson1_deserializeDocumentGenerationSummaryList(&sv.GenerationSummaries, value); err != nil { + return err + } + case "localeId": if value != nil { jtv, ok := value.(string) @@ -15213,15 +15876,247 @@ func awsRestjson1_deserializeOpDocumentStartBotRecommendationOutput(v **StartBot } sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "encryptionSetting": + if err := awsRestjson1_deserializeDocumentEncryptionSetting(&sv.EncryptionSetting, value); err != nil { + return err + } + + case "localeId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LocaleId to be of type string, got %T instead", value) + } + sv.LocaleId = ptr.String(jtv) + } + + case "transcriptSourceSetting": + if err := awsRestjson1_deserializeDocumentTranscriptSourceSetting(&sv.TranscriptSourceSetting, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpStartBotResourceGeneration struct { +} + +func (*awsRestjson1_deserializeOpStartBotResourceGeneration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartBotResourceGeneration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorStartBotResourceGeneration(response, &metadata) + } + output := &StartBotResourceGenerationOutput{} + 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_deserializeOpDocumentStartBotResourceGenerationOutput(&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_deserializeOpErrorStartBotResourceGeneration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("PreconditionFailedException", errorCode): + return awsRestjson1_deserializeErrorPreconditionFailedException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentStartBotResourceGenerationOutput(v **StartBotResourceGenerationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartBotResourceGenerationOutput + if *v == nil { + sv = &StartBotResourceGenerationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "botId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.BotId = ptr.String(jtv) + } + + case "botVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BotVersion to be of type string, got %T instead", value) + } + sv.BotVersion = ptr.String(jtv) + } + + case "creationDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "generationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.GenerationId = ptr.String(jtv) + } + case "generationInputPrompt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenerationInput to be of type string, got %T instead", value) } + sv.GenerationInputPrompt = ptr.String(jtv) } - case "encryptionSetting": - if err := awsRestjson1_deserializeDocumentEncryptionSetting(&sv.EncryptionSetting, value); err != nil { - return err + case "generationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenerationStatus to be of type string, got %T instead", value) + } + sv.GenerationStatus = types.GenerationStatus(jtv) } case "localeId": @@ -15233,11 +16128,6 @@ func awsRestjson1_deserializeOpDocumentStartBotRecommendationOutput(v **StartBot sv.LocaleId = ptr.String(jtv) } - case "transcriptSourceSetting": - if err := awsRestjson1_deserializeDocumentTranscriptSourceSetting(&sv.TranscriptSourceSetting, value); err != nil { - return err - } - default: _, _ = key, value @@ -17017,6 +17907,11 @@ func awsRestjson1_deserializeOpDocumentUpdateBotLocaleOutput(v **UpdateBotLocale return err } + case "generativeAISettings": + if err := awsRestjson1_deserializeDocumentGenerativeAISettings(&sv.GenerativeAISettings, value); err != nil { + return err + } + case "lastUpdatedDateTime": if value != nil { switch jtv := value.(type) { @@ -21264,6 +22159,46 @@ func awsRestjson1_deserializeDocumentAudioSpecification(v **types.AudioSpecifica return nil } +func awsRestjson1_deserializeDocumentBedrockModelSpecification(v **types.BedrockModelSpecification, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BedrockModelSpecification + if *v == nil { + sv = &types.BedrockModelSpecification{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "modelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BedrockModelArn to be of type string, got %T instead", value) + } + sv.ModelArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentBotAliasHistoryEvent(v **types.BotAliasHistoryEvent, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -22801,6 +23736,47 @@ func awsRestjson1_deserializeDocumentBotVersionSummaryList(v *[]types.BotVersion return nil } +func awsRestjson1_deserializeDocumentBuildtimeSettings(v **types.BuildtimeSettings, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BuildtimeSettings + if *v == nil { + sv = &types.BuildtimeSettings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "descriptiveBotBuilder": + if err := awsRestjson1_deserializeDocumentDescriptiveBotBuilderSpecification(&sv.DescriptiveBotBuilder, value); err != nil { + return err + } + + case "sampleUtteranceGeneration": + if err := awsRestjson1_deserializeDocumentSampleUtteranceGenerationSpecification(&sv.SampleUtteranceGeneration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentBuiltInIntentSummary(v **types.BuiltInIntentSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -24333,6 +25309,51 @@ func awsRestjson1_deserializeDocumentDefaultConditionalBranch(v **types.DefaultC return nil } +func awsRestjson1_deserializeDocumentDescriptiveBotBuilderSpecification(v **types.DescriptiveBotBuilderSpecification, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DescriptiveBotBuilderSpecification + if *v == nil { + sv = &types.DescriptiveBotBuilderSpecification{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "bedrockModelSpecification": + if err := awsRestjson1_deserializeDocumentBedrockModelSpecification(&sv.BedrockModelSpecification, value); err != nil { + return err + } + + case "enabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Enabled = jtv + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentDialogAction(v **types.DialogAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -25232,7 +26253,128 @@ func awsRestjson1_deserializeDocumentFulfillmentStartResponseSpecification(v **t return nil } -func awsRestjson1_deserializeDocumentFulfillmentUpdateResponseSpecification(v **types.FulfillmentUpdateResponseSpecification, value interface{}) error { +func awsRestjson1_deserializeDocumentFulfillmentUpdateResponseSpecification(v **types.FulfillmentUpdateResponseSpecification, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FulfillmentUpdateResponseSpecification + if *v == nil { + sv = &types.FulfillmentUpdateResponseSpecification{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "allowInterrupt": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) + } + sv.AllowInterrupt = ptr.Bool(jtv) + } + + case "frequencyInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected FulfillmentUpdateResponseFrequency to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FrequencyInSeconds = ptr.Int32(int32(i64)) + } + + case "messageGroups": + if err := awsRestjson1_deserializeDocumentMessageGroupsList(&sv.MessageGroups, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFulfillmentUpdatesSpecification(v **types.FulfillmentUpdatesSpecification, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FulfillmentUpdatesSpecification + if *v == nil { + sv = &types.FulfillmentUpdatesSpecification{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "active": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) + } + sv.Active = ptr.Bool(jtv) + } + + case "startResponse": + if err := awsRestjson1_deserializeDocumentFulfillmentStartResponseSpecification(&sv.StartResponse, value); err != nil { + return err + } + + case "timeoutInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected FulfillmentTimeout to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TimeoutInSeconds = ptr.Int32(int32(i64)) + } + + case "updateResponse": + if err := awsRestjson1_deserializeDocumentFulfillmentUpdateResponseSpecification(&sv.UpdateResponse, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGenerationSummary(v **types.GenerationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -25245,40 +26387,63 @@ func awsRestjson1_deserializeDocumentFulfillmentUpdateResponseSpecification(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.FulfillmentUpdateResponseSpecification + var sv *types.GenerationSummary if *v == nil { - sv = &types.FulfillmentUpdateResponseSpecification{} + sv = &types.GenerationSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "allowInterrupt": + case "creationDateTime": if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.AllowInterrupt = ptr.Bool(jtv) } - case "frequencyInSeconds": + case "generationId": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected FulfillmentUpdateResponseFrequency to be json.Number, got %T instead", value) + return fmt.Errorf("expected Id to be of type string, got %T instead", value) } - i64, err := jtv.Int64() - if err != nil { - return err + sv.GenerationId = ptr.String(jtv) + } + + case "generationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenerationStatus to be of type string, got %T instead", value) } - sv.FrequencyInSeconds = ptr.Int32(int32(i64)) + sv.GenerationStatus = types.GenerationStatus(jtv) } - case "messageGroups": - if err := awsRestjson1_deserializeDocumentMessageGroupsList(&sv.MessageGroups, value); err != nil { - return err + case "lastUpdatedDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } } default: @@ -25290,7 +26455,41 @@ func awsRestjson1_deserializeDocumentFulfillmentUpdateResponseSpecification(v ** return nil } -func awsRestjson1_deserializeDocumentFulfillmentUpdatesSpecification(v **types.FulfillmentUpdatesSpecification, value interface{}) error { +func awsRestjson1_deserializeDocumentGenerationSummaryList(v *[]types.GenerationSummary, 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.GenerationSummary + if *v == nil { + cv = []types.GenerationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.GenerationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentGenerationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentGenerativeAISettings(v **types.GenerativeAISettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -25303,44 +26502,22 @@ func awsRestjson1_deserializeDocumentFulfillmentUpdatesSpecification(v **types.F return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.FulfillmentUpdatesSpecification + var sv *types.GenerativeAISettings if *v == nil { - sv = &types.FulfillmentUpdatesSpecification{} + sv = &types.GenerativeAISettings{} } else { sv = *v } for key, value := range shape { switch key { - case "active": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) - } - sv.Active = ptr.Bool(jtv) - } - - case "startResponse": - if err := awsRestjson1_deserializeDocumentFulfillmentStartResponseSpecification(&sv.StartResponse, value); err != nil { + case "buildtimeSettings": + if err := awsRestjson1_deserializeDocumentBuildtimeSettings(&sv.BuildtimeSettings, value); err != nil { return err } - case "timeoutInSeconds": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected FulfillmentTimeout to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.TimeoutInSeconds = ptr.Int32(int32(i64)) - } - - case "updateResponse": - if err := awsRestjson1_deserializeDocumentFulfillmentUpdateResponseSpecification(&sv.UpdateResponse, value); err != nil { + case "runtimeSettings": + if err := awsRestjson1_deserializeDocumentRuntimeSettings(&sv.RuntimeSettings, value); err != nil { return err } @@ -28256,6 +29433,42 @@ func awsRestjson1_deserializeDocumentRuntimeHintValuesList(v *[]types.RuntimeHin return nil } +func awsRestjson1_deserializeDocumentRuntimeSettings(v **types.RuntimeSettings, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RuntimeSettings + if *v == nil { + sv = &types.RuntimeSettings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "slotResolutionImprovement": + if err := awsRestjson1_deserializeDocumentSlotResolutionImprovementSpecification(&sv.SlotResolutionImprovement, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentS3BucketLogDestination(v **types.S3BucketLogDestination, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -28422,6 +29635,51 @@ func awsRestjson1_deserializeDocumentSampleUtterance(v **types.SampleUtterance, return nil } +func awsRestjson1_deserializeDocumentSampleUtteranceGenerationSpecification(v **types.SampleUtteranceGenerationSpecification, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SampleUtteranceGenerationSpecification + if *v == nil { + sv = &types.SampleUtteranceGenerationSpecification{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "bedrockModelSpecification": + if err := awsRestjson1_deserializeDocumentBedrockModelSpecification(&sv.BedrockModelSpecification, value); err != nil { + return err + } + + case "enabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Enabled = jtv + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentSampleUtterancesList(v *[]types.SampleUtterance, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -29113,6 +30371,91 @@ func awsRestjson1_deserializeDocumentSlotPriority(v **types.SlotPriority, value return nil } +func awsRestjson1_deserializeDocumentSlotResolutionImprovementSpecification(v **types.SlotResolutionImprovementSpecification, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SlotResolutionImprovementSpecification + if *v == nil { + sv = &types.SlotResolutionImprovementSpecification{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "bedrockModelSpecification": + if err := awsRestjson1_deserializeDocumentBedrockModelSpecification(&sv.BedrockModelSpecification, value); err != nil { + return err + } + + case "enabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) + } + sv.Enabled = jtv + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSlotResolutionSetting(v **types.SlotResolutionSetting, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SlotResolutionSetting + if *v == nil { + sv = &types.SlotResolutionSetting{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "slotResolutionStrategy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SlotResolutionStrategy to be of type string, got %T instead", value) + } + sv.SlotResolutionStrategy = types.SlotResolutionStrategy(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentSlotResolutionTestResultItem(v **types.SlotResolutionTestResultItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -29713,6 +31056,11 @@ func awsRestjson1_deserializeDocumentSlotValueElicitationSetting(v **types.SlotV sv.SlotConstraint = types.SlotConstraint(jtv) } + case "slotResolutionSetting": + if err := awsRestjson1_deserializeDocumentSlotResolutionSetting(&sv.SlotResolutionSetting, value); err != nil { + return err + } + case "waitAndContinueSpecification": if err := awsRestjson1_deserializeDocumentWaitAndContinueSpecification(&sv.WaitAndContinueSpecification, value); err != nil { return err diff --git a/service/lexmodelsv2/generated.json b/service/lexmodelsv2/generated.json index 1ab05348f06..34c14ba7f20 100644 --- a/service/lexmodelsv2/generated.json +++ b/service/lexmodelsv2/generated.json @@ -44,6 +44,7 @@ "api_op_DescribeBotAlias.go", "api_op_DescribeBotLocale.go", "api_op_DescribeBotRecommendation.go", + "api_op_DescribeBotResourceGeneration.go", "api_op_DescribeBotVersion.go", "api_op_DescribeCustomVocabularyMetadata.go", "api_op_DescribeExport.go", @@ -56,11 +57,13 @@ "api_op_DescribeTestSet.go", "api_op_DescribeTestSetDiscrepancyReport.go", "api_op_DescribeTestSetGeneration.go", + "api_op_GenerateBotElement.go", "api_op_GetTestExecutionArtifactsUrl.go", "api_op_ListAggregatedUtterances.go", "api_op_ListBotAliases.go", "api_op_ListBotLocales.go", "api_op_ListBotRecommendations.go", + "api_op_ListBotResourceGenerations.go", "api_op_ListBotVersions.go", "api_op_ListBots.go", "api_op_ListBuiltInIntents.go", @@ -86,6 +89,7 @@ "api_op_ListUtteranceMetrics.go", "api_op_SearchAssociatedTranscripts.go", "api_op_StartBotRecommendation.go", + "api_op_StartBotResourceGeneration.go", "api_op_StartImport.go", "api_op_StartTestExecution.go", "api_op_StartTestSetGeneration.go", diff --git a/service/lexmodelsv2/serializers.go b/service/lexmodelsv2/serializers.go index 8c316a50be6..e9a5e65d333 100644 --- a/service/lexmodelsv2/serializers.go +++ b/service/lexmodelsv2/serializers.go @@ -766,6 +766,13 @@ func awsRestjson1_serializeOpDocumentCreateBotLocaleInput(v *CreateBotLocaleInpu ok.String(*v.Description) } + if v.GenerativeAISettings != nil { + ok := object.Key("generativeAISettings") + if err := awsRestjson1_serializeDocumentGenerativeAISettings(v.GenerativeAISettings, ok); err != nil { + return err + } + } + if v.LocaleId != nil { ok := object.Key("localeId") ok.String(*v.LocaleId) @@ -3214,6 +3221,98 @@ func awsRestjson1_serializeOpHttpBindingsDescribeBotRecommendationInput(v *Descr return nil } +type awsRestjson1_serializeOpDescribeBotResourceGeneration struct { +} + +func (*awsRestjson1_serializeOpDescribeBotResourceGeneration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeBotResourceGeneration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeBotResourceGenerationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/generations/{generationId}") + 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_serializeOpHttpBindingsDescribeBotResourceGenerationInput(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_serializeOpHttpBindingsDescribeBotResourceGenerationInput(v *DescribeBotResourceGenerationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.BotId == nil || len(*v.BotId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")} + } + if v.BotId != nil { + if err := encoder.SetURI("botId").String(*v.BotId); err != nil { + return err + } + } + + if v.BotVersion == nil || len(*v.BotVersion) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")} + } + if v.BotVersion != nil { + if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil { + return err + } + } + + if v.GenerationId == nil || len(*v.GenerationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member generationId must not be empty")} + } + if v.GenerationId != nil { + if err := encoder.SetURI("generationId").String(*v.GenerationId); err != nil { + return err + } + } + + if v.LocaleId == nil || len(*v.LocaleId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")} + } + if v.LocaleId != nil { + if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDescribeBotVersion struct { } @@ -4111,6 +4210,112 @@ func awsRestjson1_serializeOpHttpBindingsDescribeTestSetGenerationInput(v *Descr return nil } +type awsRestjson1_serializeOpGenerateBotElement struct { +} + +func (*awsRestjson1_serializeOpGenerateBotElement) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGenerateBotElement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GenerateBotElementInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/generate") + 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_serializeOpHttpBindingsGenerateBotElementInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGenerateBotElementInput(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_serializeOpHttpBindingsGenerateBotElementInput(v *GenerateBotElementInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.BotId == nil || len(*v.BotId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")} + } + if v.BotId != nil { + if err := encoder.SetURI("botId").String(*v.BotId); err != nil { + return err + } + } + + if v.BotVersion == nil || len(*v.BotVersion) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")} + } + if v.BotVersion != nil { + if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil { + return err + } + } + + if v.LocaleId == nil || len(*v.LocaleId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")} + } + if v.LocaleId != nil { + if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGenerateBotElementInput(v *GenerateBotElementInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IntentId != nil { + ok := object.Key("intentId") + ok.String(*v.IntentId) + } + + return nil +} + type awsRestjson1_serializeOpGetTestExecutionArtifactsUrl struct { } @@ -4625,6 +4830,124 @@ func awsRestjson1_serializeOpDocumentListBotRecommendationsInput(v *ListBotRecom return nil } +type awsRestjson1_serializeOpListBotResourceGenerations struct { +} + +func (*awsRestjson1_serializeOpListBotResourceGenerations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListBotResourceGenerations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListBotResourceGenerationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/generations") + 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_serializeOpHttpBindingsListBotResourceGenerationsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListBotResourceGenerationsInput(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_serializeOpHttpBindingsListBotResourceGenerationsInput(v *ListBotResourceGenerationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.BotId == nil || len(*v.BotId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")} + } + if v.BotId != nil { + if err := encoder.SetURI("botId").String(*v.BotId); err != nil { + return err + } + } + + if v.BotVersion == nil || len(*v.BotVersion) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")} + } + if v.BotVersion != nil { + if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil { + return err + } + } + + if v.LocaleId == nil || len(*v.LocaleId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")} + } + if v.LocaleId != nil { + if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListBotResourceGenerationsInput(v *ListBotResourceGenerationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.SortBy != nil { + ok := object.Key("sortBy") + if err := awsRestjson1_serializeDocumentGenerationSortBy(v.SortBy, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpListBots struct { } @@ -7401,6 +7724,112 @@ func awsRestjson1_serializeOpDocumentStartBotRecommendationInput(v *StartBotReco return nil } +type awsRestjson1_serializeOpStartBotResourceGeneration struct { +} + +func (*awsRestjson1_serializeOpStartBotResourceGeneration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartBotResourceGeneration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartBotResourceGenerationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botversions/{botVersion}/botlocales/{localeId}/startgeneration") + 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_serializeOpHttpBindingsStartBotResourceGenerationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartBotResourceGenerationInput(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_serializeOpHttpBindingsStartBotResourceGenerationInput(v *StartBotResourceGenerationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.BotId == nil || len(*v.BotId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")} + } + if v.BotId != nil { + if err := encoder.SetURI("botId").String(*v.BotId); err != nil { + return err + } + } + + if v.BotVersion == nil || len(*v.BotVersion) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member botVersion must not be empty")} + } + if v.BotVersion != nil { + if err := encoder.SetURI("botVersion").String(*v.BotVersion); err != nil { + return err + } + } + + if v.LocaleId == nil || len(*v.LocaleId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")} + } + if v.LocaleId != nil { + if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartBotResourceGenerationInput(v *StartBotResourceGenerationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.GenerationInputPrompt != nil { + ok := object.Key("generationInputPrompt") + ok.String(*v.GenerationInputPrompt) + } + + return nil +} + type awsRestjson1_serializeOpStartImport struct { } @@ -8305,6 +8734,13 @@ func awsRestjson1_serializeOpDocumentUpdateBotLocaleInput(v *UpdateBotLocaleInpu ok.String(*v.Description) } + if v.GenerativeAISettings != nil { + ok := object.Key("generativeAISettings") + if err := awsRestjson1_serializeDocumentGenerativeAISettings(v.GenerativeAISettings, ok); err != nil { + return err + } + } + if v.NluIntentConfidenceThreshold != nil { ok := object.Key("nluIntentConfidenceThreshold") switch { @@ -9938,6 +10374,18 @@ func awsRestjson1_serializeDocumentAudioSpecification(v *types.AudioSpecificatio return nil } +func awsRestjson1_serializeDocumentBedrockModelSpecification(v *types.BedrockModelSpecification, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ModelArn != nil { + ok := object.Key("modelArn") + ok.String(*v.ModelArn) + } + + return nil +} + func awsRestjson1_serializeDocumentBotAliasLocaleSettings(v *types.BotAliasLocaleSettings, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -10318,6 +10766,27 @@ func awsRestjson1_serializeDocumentBotVersionSortBy(v *types.BotVersionSortBy, v return nil } +func awsRestjson1_serializeDocumentBuildtimeSettings(v *types.BuildtimeSettings, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DescriptiveBotBuilder != nil { + ok := object.Key("descriptiveBotBuilder") + if err := awsRestjson1_serializeDocumentDescriptiveBotBuilderSpecification(v.DescriptiveBotBuilder, ok); err != nil { + return err + } + } + + if v.SampleUtteranceGeneration != nil { + ok := object.Key("sampleUtteranceGeneration") + if err := awsRestjson1_serializeDocumentSampleUtteranceGenerationSpecification(v.SampleUtteranceGeneration, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentBuiltInIntentSortBy(v *types.BuiltInIntentSortBy, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -10793,6 +11262,25 @@ func awsRestjson1_serializeDocumentDeleteCustomVocabularyItemsList(v []types.Cus return nil } +func awsRestjson1_serializeDocumentDescriptiveBotBuilderSpecification(v *types.DescriptiveBotBuilderSpecification, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BedrockModelSpecification != nil { + ok := object.Key("bedrockModelSpecification") + if err := awsRestjson1_serializeDocumentBedrockModelSpecification(v.BedrockModelSpecification, ok); err != nil { + return err + } + } + + { + ok := object.Key("enabled") + ok.Boolean(v.Enabled) + } + + return nil +} + func awsRestjson1_serializeDocumentDialogAction(v *types.DialogAction, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -11174,6 +11662,44 @@ func awsRestjson1_serializeDocumentFulfillmentUpdatesSpecification(v *types.Fulf return nil } +func awsRestjson1_serializeDocumentGenerationSortBy(v *types.GenerationSortBy, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Attribute) > 0 { + ok := object.Key("attribute") + ok.String(string(v.Attribute)) + } + + if len(v.Order) > 0 { + ok := object.Key("order") + ok.String(string(v.Order)) + } + + return nil +} + +func awsRestjson1_serializeDocumentGenerativeAISettings(v *types.GenerativeAISettings, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BuildtimeSettings != nil { + ok := object.Key("buildtimeSettings") + if err := awsRestjson1_serializeDocumentBuildtimeSettings(v.BuildtimeSettings, ok); err != nil { + return err + } + } + + if v.RuntimeSettings != nil { + ok := object.Key("runtimeSettings") + if err := awsRestjson1_serializeDocumentRuntimeSettings(v.RuntimeSettings, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentGrammarSlotTypeSetting(v *types.GrammarSlotTypeSetting, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -12143,6 +12669,20 @@ func awsRestjson1_serializeDocumentResponseSpecification(v *types.ResponseSpecif return nil } +func awsRestjson1_serializeDocumentRuntimeSettings(v *types.RuntimeSettings, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SlotResolutionImprovement != nil { + ok := object.Key("slotResolutionImprovement") + if err := awsRestjson1_serializeDocumentSlotResolutionImprovementSpecification(v.SlotResolutionImprovement, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentS3BucketLogDestination(v *types.S3BucketLogDestination, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -12213,6 +12753,25 @@ func awsRestjson1_serializeDocumentSampleUtterance(v *types.SampleUtterance, val return nil } +func awsRestjson1_serializeDocumentSampleUtteranceGenerationSpecification(v *types.SampleUtteranceGenerationSpecification, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BedrockModelSpecification != nil { + ok := object.Key("bedrockModelSpecification") + if err := awsRestjson1_serializeDocumentBedrockModelSpecification(v.BedrockModelSpecification, ok); err != nil { + return err + } + } + + { + ok := object.Key("enabled") + ok.Boolean(v.Enabled) + } + + return nil +} + func awsRestjson1_serializeDocumentSampleUtterancesList(v []types.SampleUtterance, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -12436,6 +12995,37 @@ func awsRestjson1_serializeDocumentSlotPriority(v *types.SlotPriority, value smi return nil } +func awsRestjson1_serializeDocumentSlotResolutionImprovementSpecification(v *types.SlotResolutionImprovementSpecification, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BedrockModelSpecification != nil { + ok := object.Key("bedrockModelSpecification") + if err := awsRestjson1_serializeDocumentBedrockModelSpecification(v.BedrockModelSpecification, ok); err != nil { + return err + } + } + + { + ok := object.Key("enabled") + ok.Boolean(v.Enabled) + } + + return nil +} + +func awsRestjson1_serializeDocumentSlotResolutionSetting(v *types.SlotResolutionSetting, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.SlotResolutionStrategy) > 0 { + ok := object.Key("slotResolutionStrategy") + ok.String(string(v.SlotResolutionStrategy)) + } + + return nil +} + func awsRestjson1_serializeDocumentSlotSortBy(v *types.SlotSortBy, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -12590,6 +13180,13 @@ func awsRestjson1_serializeDocumentSlotValueElicitationSetting(v *types.SlotValu ok.String(string(v.SlotConstraint)) } + if v.SlotResolutionSetting != nil { + ok := object.Key("slotResolutionSetting") + if err := awsRestjson1_serializeDocumentSlotResolutionSetting(v.SlotResolutionSetting, ok); err != nil { + return err + } + } + if v.WaitAndContinueSpecification != nil { ok := object.Key("waitAndContinueSpecification") if err := awsRestjson1_serializeDocumentWaitAndContinueSpecification(v.WaitAndContinueSpecification, ok); err != nil { diff --git a/service/lexmodelsv2/types/enums.go b/service/lexmodelsv2/types/enums.go index e3f378f8ee2..e03261a099c 100644 --- a/service/lexmodelsv2/types/enums.go +++ b/service/lexmodelsv2/types/enums.go @@ -1104,6 +1104,44 @@ func (ExportStatus) Values() []ExportStatus { } } +type GenerationSortByAttribute string + +// Enum values for GenerationSortByAttribute +const ( + GenerationSortByAttributeCreationStartTime GenerationSortByAttribute = "creationStartTime" + GenerationSortByAttributeLastUpdatedTime GenerationSortByAttribute = "lastUpdatedTime" +) + +// Values returns all known values for GenerationSortByAttribute. 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 (GenerationSortByAttribute) Values() []GenerationSortByAttribute { + return []GenerationSortByAttribute{ + "creationStartTime", + "lastUpdatedTime", + } +} + +type GenerationStatus string + +// Enum values for GenerationStatus +const ( + GenerationStatusFailed GenerationStatus = "Failed" + GenerationStatusComplete GenerationStatus = "Complete" + GenerationStatusInProgress GenerationStatus = "InProgress" +) + +// Values returns all known values for GenerationStatus. 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 (GenerationStatus) Values() []GenerationStatus { + return []GenerationStatus{ + "Failed", + "Complete", + "InProgress", + } +} + type ImportExportFileFormat string // Enum values for ImportExportFileFormat @@ -1448,6 +1486,24 @@ func (SlotFilterOperator) Values() []SlotFilterOperator { } } +type SlotResolutionStrategy string + +// Enum values for SlotResolutionStrategy +const ( + SlotResolutionStrategyEnhancedFallback SlotResolutionStrategy = "EnhancedFallback" + SlotResolutionStrategyDefault SlotResolutionStrategy = "Default" +) + +// Values returns all known values for SlotResolutionStrategy. 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 (SlotResolutionStrategy) Values() []SlotResolutionStrategy { + return []SlotResolutionStrategy{ + "EnhancedFallback", + "Default", + } +} + type SlotShape string // Enum values for SlotShape diff --git a/service/lexmodelsv2/types/types.go b/service/lexmodelsv2/types/types.go index a12756ca437..502edbe7738 100644 --- a/service/lexmodelsv2/types/types.go +++ b/service/lexmodelsv2/types/types.go @@ -1073,6 +1073,18 @@ type AudioSpecification struct { noSmithyDocumentSerde } +// Contains information about the Amazon Bedrock model used to interpret the +// prompt used in descriptive bot building. +type BedrockModelSpecification struct { + + // The ARN of the foundation model used in descriptive bot building. + // + // This member is required. + ModelArn *string + + noSmithyDocumentSerde +} + // Provides a record of an event that affects a bot alias. For example, when the // version of a bot that the alias points to changes. type BotAliasHistoryEvent struct { @@ -1567,6 +1579,19 @@ type BotVersionSummary struct { noSmithyDocumentSerde } +// Contains specifications about the Amazon Lex build time generative AI +// capabilities from Amazon Bedrock that you can turn on for your bot. +type BuildtimeSettings struct { + + // An object containing specifications for the descriptive bot building feature. + DescriptiveBotBuilder *DescriptiveBotBuilderSpecification + + // Contains specifications for the sample utterance generation feature. + SampleUtteranceGeneration *SampleUtteranceGenerationSpecification + + noSmithyDocumentSerde +} + // Specifies attributes for sorting a list of built-in intents. type BuiltInIntentSortBy struct { @@ -2075,6 +2100,21 @@ type DefaultConditionalBranch struct { noSmithyDocumentSerde } +// Contains specifications for the descriptive bot building feature. +type DescriptiveBotBuilderSpecification struct { + + // Specifies whether the descriptive bot building feature is activated or not. + // + // This member is required. + Enabled bool + + // An object containing information about the Amazon Bedrock model used to + // interpret the prompt used in descriptive bot building. + BedrockModelSpecification *BedrockModelSpecification + + noSmithyDocumentSerde +} + // Defines the action that the bot executes at runtime when the conversation // reaches this step. type DialogAction struct { @@ -2442,6 +2482,59 @@ type FulfillmentUpdatesSpecification struct { noSmithyDocumentSerde } +// Specifies the attribute and method by which to sort the generation request +// information. +type GenerationSortBy struct { + + // The attribute by which to sort the generation request information. You can sort + // by the following attributes. + // - creationStartTime – The time at which the generation request was created. + // - lastUpdatedTime – The time at which the generation request was last updated. + // + // This member is required. + Attribute GenerationSortByAttribute + + // The order by which to sort the generation request information. + // + // This member is required. + Order SortOrder + + noSmithyDocumentSerde +} + +// Contains information about a generation request made for the bot locale. +type GenerationSummary struct { + + // The date and time at which the generation request was made. + CreationDateTime *time.Time + + // The unique identifier of the generation request. + GenerationId *string + + // The status of the generation request. + GenerationStatus GenerationStatus + + // The date and time at which the generation request was last updated. + LastUpdatedDateTime *time.Time + + noSmithyDocumentSerde +} + +// Contains specifications about the generative AI capabilities from Amazon +// Bedrock that you can turn on for your bot. +type GenerativeAISettings struct { + + // Contains specifications about the Amazon Lex build time generative AI + // capabilities from Amazon Bedrock that you can turn on for your bot. + BuildtimeSettings *BuildtimeSettings + + // Contains specifications about the Amazon Lex runtime generative AI capabilities + // from Amazon Bedrock that you can turn on for your bot. + RuntimeSettings *RuntimeSettings + + noSmithyDocumentSerde +} + // Settings requried for a slot type based on a grammar that you provide. type GrammarSlotTypeSetting struct { @@ -3423,6 +3516,16 @@ type RuntimeHintValue struct { noSmithyDocumentSerde } +// Contains specifications about the Amazon Lex runtime generative AI capabilities +// from Amazon Bedrock that you can turn on for your bot. +type RuntimeSettings struct { + + // An object containing specifications for the assisted slot resolution feature. + SlotResolutionImprovement *SlotResolutionImprovementSpecification + + noSmithyDocumentSerde +} + // Specifies an Amazon S3 bucket for logging audio conversations type S3BucketLogDestination struct { @@ -3490,6 +3593,21 @@ type SampleUtterance struct { noSmithyDocumentSerde } +// Contains specifications for the sample utterance generation feature. +type SampleUtteranceGenerationSpecification struct { + + // Specifies whether to enable sample utterance generation or not. + // + // This member is required. + Enabled bool + + // Contains information about the Amazon Bedrock model used to interpret the + // prompt used in descriptive bot building. + BedrockModelSpecification *BedrockModelSpecification + + noSmithyDocumentSerde +} + // Defines one of the values for a slot type. type SampleValue struct { @@ -3688,6 +3806,36 @@ type SlotPriority struct { noSmithyDocumentSerde } +// Contains specifications for the assisted slot resolution feature. +type SlotResolutionImprovementSpecification struct { + + // Specifies whether assisted slot resolution is turned on or off. + // + // This member is required. + Enabled bool + + // An object containing information about the Amazon Bedrock model used to assist + // slot resolution. + BedrockModelSpecification *BedrockModelSpecification + + noSmithyDocumentSerde +} + +// Contains information about whether assisted slot resolution is turned on for +// the slot or not. +type SlotResolutionSetting struct { + + // Specifies whether assisted slot resolution is turned on for the slot or not. If + // the value is EnhancedFallback , assisted slot resolution is activated when + // Amazon Lex defaults to the AMAZON.FallbackIntent . If the value is Default , + // assisted slot resolution is turned off. + // + // This member is required. + SlotResolutionStrategy SlotResolutionStrategy + + noSmithyDocumentSerde +} + // Information about the success and failure rate of slot resolution in the // results of a test execution. type SlotResolutionTestResultItem struct { @@ -3904,6 +4052,10 @@ type SlotValueElicitationSetting struct { // entered by a user. SlotCaptureSetting *SlotCaptureSetting + // An object containing information about whether assisted slot resolution is + // turned on for the slot or not. + SlotResolutionSetting *SlotResolutionSetting + // Specifies the prompts that Amazon Lex uses while a bot is waiting for customer // input. WaitAndContinueSpecification *WaitAndContinueSpecification diff --git a/service/lexmodelsv2/validators.go b/service/lexmodelsv2/validators.go index 7c5287b8f79..51703ba1426 100644 --- a/service/lexmodelsv2/validators.go +++ b/service/lexmodelsv2/validators.go @@ -670,6 +670,26 @@ func (m *validateOpDescribeBotRecommendation) HandleInitialize(ctx context.Conte return next.HandleInitialize(ctx, in) } +type validateOpDescribeBotResourceGeneration struct { +} + +func (*validateOpDescribeBotResourceGeneration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeBotResourceGeneration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeBotResourceGenerationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeBotResourceGenerationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeBotVersion struct { } @@ -910,6 +930,26 @@ func (m *validateOpDescribeTestSet) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpGenerateBotElement struct { +} + +func (*validateOpGenerateBotElement) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGenerateBotElement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GenerateBotElementInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGenerateBotElementInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetTestExecutionArtifactsUrl struct { } @@ -1010,6 +1050,26 @@ func (m *validateOpListBotRecommendations) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpListBotResourceGenerations struct { +} + +func (*validateOpListBotResourceGenerations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListBotResourceGenerations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListBotResourceGenerationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListBotResourceGenerationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListBots struct { } @@ -1510,6 +1570,26 @@ func (m *validateOpStartBotRecommendation) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpStartBotResourceGeneration struct { +} + +func (*validateOpStartBotResourceGeneration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartBotResourceGeneration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartBotResourceGenerationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartBotResourceGenerationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartImport struct { } @@ -1962,6 +2042,10 @@ func addOpDescribeBotRecommendationValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpDescribeBotRecommendation{}, middleware.After) } +func addOpDescribeBotResourceGenerationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeBotResourceGeneration{}, middleware.After) +} + func addOpDescribeBotVersionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeBotVersion{}, middleware.After) } @@ -2010,6 +2094,10 @@ func addOpDescribeTestSetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeTestSet{}, middleware.After) } +func addOpGenerateBotElementValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGenerateBotElement{}, middleware.After) +} + func addOpGetTestExecutionArtifactsUrlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetTestExecutionArtifactsUrl{}, middleware.After) } @@ -2030,6 +2118,10 @@ func addOpListBotRecommendationsValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpListBotRecommendations{}, middleware.After) } +func addOpListBotResourceGenerationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListBotResourceGenerations{}, middleware.After) +} + func addOpListBotsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListBots{}, middleware.After) } @@ -2130,6 +2222,10 @@ func addOpStartBotRecommendationValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpStartBotRecommendation{}, middleware.After) } +func addOpStartBotResourceGenerationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartBotResourceGeneration{}, middleware.After) +} + func addOpStartImportValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartImport{}, middleware.After) } @@ -2926,6 +3022,21 @@ func validateAudioSpecification(v *types.AudioSpecification) error { } } +func validateBedrockModelSpecification(v *types.BedrockModelSpecification) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BedrockModelSpecification"} + if v.ModelArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ModelArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateBotAliasLocaleSettings(v *types.BotAliasLocaleSettings) error { if v == nil { return nil @@ -3279,6 +3390,28 @@ func validateBotVersionSortBy(v *types.BotVersionSortBy) error { } } +func validateBuildtimeSettings(v *types.BuildtimeSettings) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BuildtimeSettings"} + if v.DescriptiveBotBuilder != nil { + if err := validateDescriptiveBotBuilderSpecification(v.DescriptiveBotBuilder); err != nil { + invalidParams.AddNested("DescriptiveBotBuilder", err.(smithy.InvalidParamsError)) + } + } + if v.SampleUtteranceGeneration != nil { + if err := validateSampleUtteranceGenerationSpecification(v.SampleUtteranceGeneration); err != nil { + invalidParams.AddNested("SampleUtteranceGeneration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateBuiltInIntentSortBy(v *types.BuiltInIntentSortBy) error { if v == nil { return nil @@ -3746,6 +3879,23 @@ func validateDeleteCustomVocabularyItemsList(v []types.CustomVocabularyEntryId) } } +func validateDescriptiveBotBuilderSpecification(v *types.DescriptiveBotBuilderSpecification) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescriptiveBotBuilderSpecification"} + if v.BedrockModelSpecification != nil { + if err := validateBedrockModelSpecification(v.BedrockModelSpecification); err != nil { + invalidParams.AddNested("BedrockModelSpecification", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateDialogAction(v *types.DialogAction) error { if v == nil { return nil @@ -4050,6 +4200,46 @@ func validateFulfillmentUpdatesSpecification(v *types.FulfillmentUpdatesSpecific } } +func validateGenerationSortBy(v *types.GenerationSortBy) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GenerationSortBy"} + if len(v.Attribute) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Attribute")) + } + if len(v.Order) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Order")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateGenerativeAISettings(v *types.GenerativeAISettings) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GenerativeAISettings"} + if v.RuntimeSettings != nil { + if err := validateRuntimeSettings(v.RuntimeSettings); err != nil { + invalidParams.AddNested("RuntimeSettings", err.(smithy.InvalidParamsError)) + } + } + if v.BuildtimeSettings != nil { + if err := validateBuildtimeSettings(v.BuildtimeSettings); err != nil { + invalidParams.AddNested("BuildtimeSettings", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateGrammarSlotTypeSetting(v *types.GrammarSlotTypeSetting) error { if v == nil { return nil @@ -4862,6 +5052,23 @@ func validateResponseSpecification(v *types.ResponseSpecification) error { } } +func validateRuntimeSettings(v *types.RuntimeSettings) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RuntimeSettings"} + if v.SlotResolutionImprovement != nil { + if err := validateSlotResolutionImprovementSpecification(v.SlotResolutionImprovement); err != nil { + invalidParams.AddNested("SlotResolutionImprovement", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateS3BucketLogDestination(v *types.S3BucketLogDestination) error { if v == nil { return nil @@ -4918,6 +5125,23 @@ func validateSampleUtterance(v *types.SampleUtterance) error { } } +func validateSampleUtteranceGenerationSpecification(v *types.SampleUtteranceGenerationSpecification) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SampleUtteranceGenerationSpecification"} + if v.BedrockModelSpecification != nil { + if err := validateBedrockModelSpecification(v.BedrockModelSpecification); err != nil { + invalidParams.AddNested("BedrockModelSpecification", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateSampleUtterancesList(v []types.SampleUtterance) error { if v == nil { return nil @@ -5156,6 +5380,38 @@ func validateSlotPriority(v *types.SlotPriority) error { } } +func validateSlotResolutionImprovementSpecification(v *types.SlotResolutionImprovementSpecification) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SlotResolutionImprovementSpecification"} + if v.BedrockModelSpecification != nil { + if err := validateBedrockModelSpecification(v.BedrockModelSpecification); err != nil { + invalidParams.AddNested("BedrockModelSpecification", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSlotResolutionSetting(v *types.SlotResolutionSetting) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SlotResolutionSetting"} + if len(v.SlotResolutionStrategy) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SlotResolutionStrategy")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateSlotSortBy(v *types.SlotSortBy) error { if v == nil { return nil @@ -5302,6 +5558,11 @@ func validateSlotValueElicitationSetting(v *types.SlotValueElicitationSetting) e invalidParams.AddNested("SlotCaptureSetting", err.(smithy.InvalidParamsError)) } } + if v.SlotResolutionSetting != nil { + if err := validateSlotResolutionSetting(v.SlotResolutionSetting); err != nil { + invalidParams.AddNested("SlotResolutionSetting", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -6133,6 +6394,11 @@ func validateOpCreateBotLocaleInput(v *CreateBotLocaleInput) error { invalidParams.AddNested("VoiceSettings", err.(smithy.InvalidParamsError)) } } + if v.GenerativeAISettings != nil { + if err := validateGenerativeAISettings(v.GenerativeAISettings); err != nil { + invalidParams.AddNested("GenerativeAISettings", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -6747,6 +7013,30 @@ func validateOpDescribeBotRecommendationInput(v *DescribeBotRecommendationInput) } } +func validateOpDescribeBotResourceGenerationInput(v *DescribeBotResourceGenerationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeBotResourceGenerationInput"} + if v.BotId == nil { + invalidParams.Add(smithy.NewErrParamRequired("BotId")) + } + if v.BotVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("BotVersion")) + } + if v.LocaleId == nil { + invalidParams.Add(smithy.NewErrParamRequired("LocaleId")) + } + if v.GenerationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("GenerationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeBotVersionInput(v *DescribeBotVersionInput) error { if v == nil { return nil @@ -6966,6 +7256,30 @@ func validateOpDescribeTestSetInput(v *DescribeTestSetInput) error { } } +func validateOpGenerateBotElementInput(v *GenerateBotElementInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GenerateBotElementInput"} + if v.IntentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("IntentId")) + } + if v.BotId == nil { + invalidParams.Add(smithy.NewErrParamRequired("BotId")) + } + if v.BotVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("BotVersion")) + } + if v.LocaleId == nil { + invalidParams.Add(smithy.NewErrParamRequired("LocaleId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetTestExecutionArtifactsUrlInput(v *GetTestExecutionArtifactsUrlInput) error { if v == nil { return nil @@ -7080,6 +7394,32 @@ func validateOpListBotRecommendationsInput(v *ListBotRecommendationsInput) error } } +func validateOpListBotResourceGenerationsInput(v *ListBotResourceGenerationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListBotResourceGenerationsInput"} + if v.BotId == nil { + invalidParams.Add(smithy.NewErrParamRequired("BotId")) + } + if v.BotVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("BotVersion")) + } + if v.LocaleId == nil { + invalidParams.Add(smithy.NewErrParamRequired("LocaleId")) + } + if v.SortBy != nil { + if err := validateGenerationSortBy(v.SortBy); err != nil { + invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListBotsInput(v *ListBotsInput) error { if v == nil { return nil @@ -7760,6 +8100,30 @@ func validateOpStartBotRecommendationInput(v *StartBotRecommendationInput) error } } +func validateOpStartBotResourceGenerationInput(v *StartBotResourceGenerationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartBotResourceGenerationInput"} + if v.GenerationInputPrompt == nil { + invalidParams.Add(smithy.NewErrParamRequired("GenerationInputPrompt")) + } + if v.BotId == nil { + invalidParams.Add(smithy.NewErrParamRequired("BotId")) + } + if v.BotVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("BotVersion")) + } + if v.LocaleId == nil { + invalidParams.Add(smithy.NewErrParamRequired("LocaleId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartImportInput(v *StartImportInput) error { if v == nil { return nil @@ -7996,6 +8360,11 @@ func validateOpUpdateBotLocaleInput(v *UpdateBotLocaleInput) error { invalidParams.AddNested("VoiceSettings", err.(smithy.InvalidParamsError)) } } + if v.GenerativeAISettings != nil { + if err := validateGenerativeAISettings(v.GenerativeAISettings); err != nil { + invalidParams.AddNested("GenerativeAISettings", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/lexruntimev2/api_op_PutSession.go b/service/lexruntimev2/api_op_PutSession.go index 335c6fb0abc..bfad6ac65da 100644 --- a/service/lexruntimev2/api_op_PutSession.go +++ b/service/lexruntimev2/api_op_PutSession.go @@ -93,17 +93,17 @@ type PutSessionOutput struct { // the messages are defined in the bot. Messages *string - // Request-specific information passed between the client application and Amazon - // Lex V2. These are the same as the requestAttribute parameter in the call to the - // PutSession operation. + // A base-64-encoded gzipped field that provides request-specific information + // passed between the client application and Amazon Lex V2. These are the same as + // the requestAttribute parameter in the call to the PutSession operation. RequestAttributes *string // The identifier of the session that received the data. SessionId *string - // Represents the current state of the dialog between the user and the bot. Use - // this to determine the progress of the conversation and what the next action may - // be. + // A base-64-encoded gzipped field that represents the current state of the dialog + // between the user and the bot. Use this to determine the progress of the + // conversation and what the next action may be. SessionState *string // Metadata pertaining to the operation's result. diff --git a/service/lexruntimev2/api_op_RecognizeUtterance.go b/service/lexruntimev2/api_op_RecognizeUtterance.go index dfb3d9a3fc9..ccf994887e5 100644 --- a/service/lexruntimev2/api_op_RecognizeUtterance.go +++ b/service/lexruntimev2/api_op_RecognizeUtterance.go @@ -156,7 +156,8 @@ type RecognizeUtteranceOutput struct { // Content type as specified in the responseContentType in the request. ContentType *string - // Indicates whether the input mode to the operation was text or speech. + // Indicates whether the input mode to the operation was text, speech, or from a + // touch-tone keypad. InputMode *string // The text used to process the request. If the input was an audio stream, the diff --git a/service/lexruntimev2/deserializers.go b/service/lexruntimev2/deserializers.go index 522959fc901..3b21de23193 100644 --- a/service/lexruntimev2/deserializers.go +++ b/service/lexruntimev2/deserializers.go @@ -2618,6 +2618,15 @@ func awsRestjson1_deserializeDocumentInterpretation(v **types.Interpretation, va return err } + case "interpretationSource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InterpretationSource to be of type string, got %T instead", value) + } + sv.InterpretationSource = types.InterpretationSource(jtv) + } + case "nluConfidence": if err := awsRestjson1_deserializeDocumentConfidenceScore(&sv.NluConfidence, value); err != nil { return err diff --git a/service/lexruntimev2/endpoints.go b/service/lexruntimev2/endpoints.go index 1be7156adf4..c2cc0c059e1 100644 --- a/service/lexruntimev2/endpoints.go +++ b/service/lexruntimev2/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://runtime-v2-lex-fips.") diff --git a/service/lexruntimev2/types/enums.go b/service/lexruntimev2/types/enums.go index aebabee8e85..85b716638eb 100644 --- a/service/lexruntimev2/types/enums.go +++ b/service/lexruntimev2/types/enums.go @@ -112,6 +112,24 @@ func (IntentState) Values() []IntentState { } } +type InterpretationSource string + +// Enum values for InterpretationSource +const ( + InterpretationSourceBedrock InterpretationSource = "Bedrock" + InterpretationSourceLex InterpretationSource = "Lex" +) + +// Values returns all known values for InterpretationSource. 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 (InterpretationSource) Values() []InterpretationSource { + return []InterpretationSource{ + "Bedrock", + "Lex", + } +} + type MessageContentType string // Enum values for MessageContentType diff --git a/service/lexruntimev2/types/types.go b/service/lexruntimev2/types/types.go index ed7f6f48830..3481b3b18f6 100644 --- a/service/lexruntimev2/types/types.go +++ b/service/lexruntimev2/types/types.go @@ -193,15 +193,15 @@ type ConfigurationEvent struct { type DialogAction struct { // The next action that the bot should take in its interaction with the user. The - // possible values are: - // - Close - Indicates that there will not be a response from the user. For + // following values are possible: + // - Close – Indicates that there will not be a response from the user. For // example, the statement "Your order has been placed" does not require a response. // - // - ConfirmIntent - The next action is asking the user if the intent is complete + // - ConfirmIntent – The next action is asking the user if the intent is complete // and ready to be fulfilled. This is a yes/no question such as "Place the order?" - // - Delegate - The next action is determined by Amazon Lex V2. - // - ElicitIntent - The next action is to elicit an intent from the user. - // - ElicitSlot - The next action is to elicit a slot value from the user. + // - Delegate – The next action is determined by Amazon Lex V2. + // - ElicitIntent – The next action is to elicit an intent from the user. + // - ElicitSlot – The next action is to elicit a slot value from the user. // // This member is required. Type DialogActionType @@ -211,7 +211,7 @@ type DialogAction struct { // // - Spell by letter - "b" "o" "b" // - Spell by word - "b as in boy" "o as in oscar" "b as in boy" - // For more information, see Using spelling to enter slot values (https://docs.aws.amazon.com/lexv2/latest/dg/using-spelling.html) + // For more information, see Using spelling to enter slot values (https://docs.aws.amazon.com/lexv2/latest/dg/spelling-styles.html) // . SlotElicitationStyle StyleType @@ -327,14 +327,25 @@ type Intent struct { // This member is required. Name *string - // Contains information about whether fulfillment of the intent has been confirmed. + // Indicates whether the intent has been Confirmed , Denied , or None if the + // confirmation stage has not yet been reached. ConfirmationState ConfirmationState // A map of all of the slots for the intent. The name of the slot maps to the // value of the slot. If a slot has not been filled, the value is null. Slots map[string]Slot - // Contains fulfillment information for the intent. + // Indicates the fulfillment state for the intent. The meanings of each value are + // as follows: + // - Failed – The bot failed to fulfill the intent. + // - Fulfilled – The bot has completed fulfillment of the intent. + // - FulfillmentInProgress – The bot is in the middle of fulfilling the intent. + // - InProgress – The bot is in the middle of eliciting the slot values that are + // necessary to fulfill the intent. + // - ReadyForFulfillment – The bot has elicited all the slot values for the + // intent and is ready to fulfill the intent. + // - Waiting – The bot is waiting for a response from the user (limited to + // streaming conversations). State IntentState noSmithyDocumentSerde @@ -349,7 +360,8 @@ type IntentResultEvent struct { // each event sent by Amazon Lex V2 in the current session. EventId *string - // Indicates whether the input to the operation was text or speech. + // Indicates whether the input to the operation was text, speech, or from a + // touch-tone keypad. InputMode InputMode // A list of intents that Amazon Lex V2 determined might satisfy the user's @@ -374,14 +386,18 @@ type IntentResultEvent struct { noSmithyDocumentSerde } -// An intent that Amazon Lex V2 determined might satisfy the user's utterance. The -// intents are ordered by the confidence score. +// An object containing information about an intent that Amazon Lex V2 determined +// might satisfy the user's utterance. The intents are ordered by the confidence +// score. type Interpretation struct { // A list of intents that might satisfy the user's utterance. The intents are // ordered by the confidence score. Intent *Intent + // Specifies the service that interpreted the input. + InterpretationSource InterpretationSource + // Determines the threshold where Amazon Lex V2 will insert the // AMAZON.FallbackIntent , AMAZON.KendraSearchIntent , or both when returning // alternative intents in a response. AMAZON.FallbackIntent and @@ -830,21 +846,24 @@ type TranscriptEvent struct { noSmithyDocumentSerde } -// The value of a slot. +// Information about the value provided for a slot and Amazon Lex V2's +// interpretation. type Value struct { - // The value that Amazon Lex V2 determines for the slot. The actual value depends - // on the setting of the value selection strategy for the bot. You can choose to - // use the value entered by the user, or you can have Amazon Lex V2 choose the - // first value in the resolvedValues list. + // The value that Amazon Lex V2 determines for the slot, given the user input. The + // actual value depends on the setting of the value selection strategy for the bot. + // You can choose to use the value entered by the user, or you can have Amazon Lex + // V2 choose the first value in the resolvedValues list. // // This member is required. InterpretedValue *string - // The text of the utterance from the user that was entered for the slot. + // The part of the user's response to the slot elicitation that Amazon Lex V2 + // determines is relevant to the slot value. OriginalValue *string - // A list of additional values that have been recognized for the slot. + // A list of values that Amazon Lex V2 determines are possible resolutions for the + // user input. The first value matches the interpretedValue . ResolvedValues []string noSmithyDocumentSerde diff --git a/service/managedblockchain/api_op_CreateAccessor.go b/service/managedblockchain/api_op_CreateAccessor.go index 292bdff7440..b93a3b821d4 100644 --- a/service/managedblockchain/api_op_CreateAccessor.go +++ b/service/managedblockchain/api_op_CreateAccessor.go @@ -12,9 +12,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new accessor for use with Managed Blockchain Ethereum nodes. An -// accessor contains information required for token based access to your Ethereum -// nodes. +// Creates a new accessor for use with Amazon Managed Blockchain service that +// supports token based access. The accessor contains information required for +// token based access. func (c *Client) CreateAccessor(ctx context.Context, params *CreateAccessorInput, optFns ...func(*Options)) (*CreateAccessorOutput, error) { if params == nil { params = &CreateAccessorInput{} @@ -46,6 +46,16 @@ type CreateAccessorInput struct { // This member is required. ClientRequestToken *string + // The blockchain network that the Accessor token is created for. We recommend + // using the appropriate networkType value for the blockchain network that you are + // creating the Accessor token for. You cannnot use the value + // ETHEREUM_MAINNET_AND_GOERLI to specify a networkType for your Accessor token. + // The default value of ETHEREUM_MAINNET_AND_GOERLI is only applied: + // - when the CreateAccessor action does not set a networkType . + // - to all existing Accessor tokens that were created before the networkType + // property was introduced. + NetworkType types.AccessorNetworkType + // Tags to assign to the Accessor. Each tag consists of a key and an optional // value. You can specify multiple key-value pairs in a single request with an // overall maximum of 50 tags allowed per resource. For more information about @@ -62,12 +72,14 @@ type CreateAccessorOutput struct { // The unique identifier of the accessor. AccessorId *string - // The billing token is a property of the Accessor. Use this token to make - // Ethereum API calls to your Ethereum node. The billing token is used to track - // your accessor object for billing Ethereum API requests made to your Ethereum - // nodes. + // The billing token is a property of the Accessor. Use this token to when making + // calls to the blockchain network. The billing token is used to track your + // accessor token for billing requests. BillingToken *string + // The blockchain network that the accessor token is created for. + NetworkType types.AccessorNetworkType + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/managedblockchain/api_op_ListAccessors.go b/service/managedblockchain/api_op_ListAccessors.go index cf921c963c7..cb63d525101 100644 --- a/service/managedblockchain/api_op_ListAccessors.go +++ b/service/managedblockchain/api_op_ListAccessors.go @@ -35,6 +35,11 @@ type ListAccessorsInput struct { // The maximum number of accessors to list. MaxResults *int32 + // The blockchain network that the Accessor token is created for. Use the value + // ETHEREUM_MAINNET_AND_GOERLI for all existing Accessors tokens that were created + // before the networkType property was introduced. + NetworkType types.AccessorNetworkType + // The pagination token that indicates the next set of results to retrieve. NextToken *string diff --git a/service/managedblockchain/deserializers.go b/service/managedblockchain/deserializers.go index 1f04cce259c..755e65354c5 100644 --- a/service/managedblockchain/deserializers.go +++ b/service/managedblockchain/deserializers.go @@ -188,6 +188,15 @@ func awsRestjson1_deserializeOpDocumentCreateAccessorOutput(v **CreateAccessorOu sv.BillingToken = ptr.String(jtv) } + case "NetworkType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessorNetworkType to be of type string, got %T instead", value) + } + sv.NetworkType = types.AccessorNetworkType(jtv) + } + default: _, _ = key, value @@ -4273,6 +4282,15 @@ func awsRestjson1_deserializeDocumentAccessor(v **types.Accessor, value interfac sv.Id = ptr.String(jtv) } + case "NetworkType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessorNetworkType to be of type string, got %T instead", value) + } + sv.NetworkType = types.AccessorNetworkType(jtv) + } + case "Status": if value != nil { jtv, ok := value.(string) @@ -4358,6 +4376,15 @@ func awsRestjson1_deserializeDocumentAccessorSummary(v **types.AccessorSummary, sv.Id = ptr.String(jtv) } + case "NetworkType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessorNetworkType to be of type string, got %T instead", value) + } + sv.NetworkType = types.AccessorNetworkType(jtv) + } + case "Status": if value != nil { jtv, ok := value.(string) diff --git a/service/managedblockchain/endpoints.go b/service/managedblockchain/endpoints.go index 3db831825a5..0ef23158815 100644 --- a/service/managedblockchain/endpoints.go +++ b/service/managedblockchain/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://managedblockchain-fips.") diff --git a/service/managedblockchain/serializers.go b/service/managedblockchain/serializers.go index effefe1c0b5..7a076863152 100644 --- a/service/managedblockchain/serializers.go +++ b/service/managedblockchain/serializers.go @@ -91,6 +91,11 @@ func awsRestjson1_serializeOpDocumentCreateAccessorInput(v *CreateAccessorInput, ok.String(*v.ClientRequestToken) } + if len(v.NetworkType) > 0 { + ok := object.Key("NetworkType") + ok.String(string(v.NetworkType)) + } + if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentInputTagMap(v.Tags, ok); err != nil { @@ -1173,6 +1178,10 @@ func awsRestjson1_serializeOpHttpBindingsListAccessorsInput(v *ListAccessorsInpu encoder.SetQuery("maxResults").Integer(*v.MaxResults) } + if len(v.NetworkType) > 0 { + encoder.SetQuery("networkType").String(string(v.NetworkType)) + } + if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } diff --git a/service/managedblockchain/types/enums.go b/service/managedblockchain/types/enums.go index f031308ed74..87f0190c8e0 100644 --- a/service/managedblockchain/types/enums.go +++ b/service/managedblockchain/types/enums.go @@ -2,6 +2,30 @@ package types +type AccessorNetworkType string + +// Enum values for AccessorNetworkType +const ( + AccessorNetworkTypeEthereumGoerli AccessorNetworkType = "ETHEREUM_GOERLI" + AccessorNetworkTypeEthereumMainnet AccessorNetworkType = "ETHEREUM_MAINNET" + AccessorNetworkTypeEthereumMainnetAndGoerli AccessorNetworkType = "ETHEREUM_MAINNET_AND_GOERLI" + AccessorNetworkTypePolygonMainnet AccessorNetworkType = "POLYGON_MAINNET" + AccessorNetworkTypePolygonMumbai AccessorNetworkType = "POLYGON_MUMBAI" +) + +// Values returns all known values for AccessorNetworkType. 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 (AccessorNetworkType) Values() []AccessorNetworkType { + return []AccessorNetworkType{ + "ETHEREUM_GOERLI", + "ETHEREUM_MAINNET", + "ETHEREUM_MAINNET_AND_GOERLI", + "POLYGON_MAINNET", + "POLYGON_MUMBAI", + } +} + type AccessorStatus string // Enum values for AccessorStatus diff --git a/service/managedblockchain/types/types.go b/service/managedblockchain/types/types.go index 1e8eb141d87..9b6d048f071 100644 --- a/service/managedblockchain/types/types.go +++ b/service/managedblockchain/types/types.go @@ -15,10 +15,9 @@ type Accessor struct { // in the Amazon Web Services General Reference. Arn *string - // The billing token is a property of the accessor. Use this token to make - // Ethereum API calls to your Ethereum node. The billing token is used to track - // your accessor object for billing Ethereum API requests made to your Ethereum - // nodes. + // The billing token is a property of the Accessor. Use this token to when making + // calls to the blockchain network. The billing token is used to track your + // accessor token for billing requests. BillingToken *string // The creation date and time of the accessor. @@ -27,6 +26,9 @@ type Accessor struct { // The unique identifier of the accessor. Id *string + // The blockchain network that the Accessor token is created for. + NetworkType AccessorNetworkType + // The current status of the accessor. Status AccessorStatus @@ -57,6 +59,9 @@ type AccessorSummary struct { // The unique identifier of the accessor. Id *string + // The blockchain network that the Accessor token is created for. + NetworkType AccessorNetworkType + // The current status of the accessor. Status AccessorStatus @@ -81,7 +86,7 @@ type ApprovalThresholdPolicy struct { ProposalDurationInHours *int32 // Determines whether the vote percentage must be greater than the - // ThresholdPercentage or must be greater than or equal to the ThreholdPercentage + // ThresholdPercentage or must be greater than or equal to the ThresholdPercentage // to be approved. ThresholdComparator ThresholdComparator diff --git a/service/neptune/internal/endpoints/endpoints.go b/service/neptune/internal/endpoints/endpoints.go index 9a5b55d0c30..d8642dc0ea8 100644 --- a/service/neptune/internal/endpoints/endpoints.go +++ b/service/neptune/internal/endpoints/endpoints.go @@ -499,12 +499,96 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "rds-fips.us-iso-east-1", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds-fips.us-iso-west-1", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-iso-east-1", + }: endpoints.Endpoint{ + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-iso-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-iso-west-1", + }: endpoints.Endpoint{ + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-iso-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-west-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "us-iso-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + }, + endpoints.EndpointKey{ + Region: "us-iso-east-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-east-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "us-iso-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + }, + endpoints.EndpointKey{ + Region: "us-iso-west-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-west-1", + }, + Deprecated: aws.TrueTernary, + }, }, }, { @@ -528,9 +612,51 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "rds-fips.us-isob-east-1", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-isob-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-isob-east-1", + }: endpoints.Endpoint{ + CredentialScope: endpoints.CredentialScope{ + Region: "us-isob-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-isob-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-isob-east-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "us-isob-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-isob-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + }, + endpoints.EndpointKey{ + Region: "us-isob-east-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-isob-east-1", + }, + Deprecated: aws.TrueTernary, + }, }, }, { diff --git a/service/personalize/api_op_CreateBatchInferenceJob.go b/service/personalize/api_op_CreateBatchInferenceJob.go index 3999e7f5825..f3b09266edb 100644 --- a/service/personalize/api_op_CreateBatchInferenceJob.go +++ b/service/personalize/api_op_CreateBatchInferenceJob.go @@ -12,10 +12,21 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a batch inference job. The operation can handle up to 50 million -// records and the input file must be in JSON format. For more information, see -// Creating a batch inference job (https://docs.aws.amazon.com/personalize/latest/dg/creating-batch-inference-job.html) -// . +// Generates batch recommendations based on a list of items or users stored in +// Amazon S3 and exports the recommendations to an Amazon S3 bucket. To generate +// batch recommendations, specify the ARN of a solution version and an Amazon S3 +// URI for the input and output data. For user personalization, popular items, and +// personalized ranking solutions, the batch inference job generates a list of +// recommended items for each user ID in the input file. For related items +// solutions, the job generates a list of recommended items for each item ID in the +// input file. For more information, see Creating a batch inference job (https://docs.aws.amazon.com/personalize/latest/dg/getting-batch-recommendations.html) +// . If you use the Similar-Items recipe, Amazon Personalize can add descriptive +// themes to batch recommendations. To generate themes, set the job's mode to +// THEME_GENERATION and specify the name of the field that contains item names in +// the input data. For more information about generating themes, see Batch +// recommendations with themes from Content Generator (https://docs.aws.amazon.com/personalize/latest/dg/themed-batch-recommendations.html) +// . You can't get batch recommendations with the Trending-Now or Next-Best-Action +// recipes. func (c *Client) CreateBatchInferenceJob(ctx context.Context, params *CreateBatchInferenceJobInput, optFns ...func(*Options)) (*CreateBatchInferenceJobOutput, error) { if params == nil { params = &CreateBatchInferenceJobInput{} @@ -64,6 +75,14 @@ type CreateBatchInferenceJobInput struct { // The configuration details of a batch inference job. BatchInferenceJobConfig *types.BatchInferenceJobConfig + // The mode of the batch inference job. To generate descriptive themes for groups + // of similar items, set the job mode to THEME_GENERATION . If you don't want to + // generate themes, use the default BATCH_INFERENCE . When you get batch + // recommendations with themes, you will incur additional costs. For more + // information, see Amazon Personalize pricing (https://aws.amazon.com/personalize/pricing/) + // . + BatchInferenceJobMode types.BatchInferenceJobMode + // The ARN of the filter to apply to the batch inference job. For more information // on using filters, see Filtering batch recommendations (https://docs.aws.amazon.com/personalize/latest/dg/filter-batch.html) // . @@ -76,6 +95,10 @@ type CreateBatchInferenceJobInput struct { // to apply to the batch inference job. Tags []types.Tag + // For theme generation jobs, specify the name of the column in your Items dataset + // that contains each item's name. + ThemeGenerationConfig *types.ThemeGenerationConfig + noSmithyDocumentSerde } diff --git a/service/personalize/api_op_CreateDataset.go b/service/personalize/api_op_CreateDataset.go index cbb4ce895bd..8e1b9d5d238 100644 --- a/service/personalize/api_op_CreateDataset.go +++ b/service/personalize/api_op_CreateDataset.go @@ -14,14 +14,16 @@ import ( // Creates an empty dataset and adds it to the specified dataset group. Use // CreateDatasetImportJob (https://docs.aws.amazon.com/personalize/latest/dg/API_CreateDatasetImportJob.html) -// to import your training data to a dataset. There are three types of datasets: -// - Interactions +// to import your training data to a dataset. There are 5 types of datasets: +// - Item interactions // - Items // - Users +// - Action interactions +// - Actions // // Each dataset type has an associated schema with required field types. Only the -// Interactions dataset is required in order to train a model (also referred to as -// creating a solution). A dataset can be in one of the following states: +// Item interactions dataset is required in order to train a model (also referred +// to as creating a solution). A dataset can be in one of the following states: // - CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED // - DELETE PENDING > DELETE IN_PROGRESS // @@ -57,6 +59,8 @@ type CreateDatasetInput struct { // - Interactions // - Items // - Users + // - Actions + // - Action_Interactions // // This member is required. DatasetType *string diff --git a/service/personalize/api_op_CreateDatasetGroup.go b/service/personalize/api_op_CreateDatasetGroup.go index 66c03dffb60..d2e0e6eaa59 100644 --- a/service/personalize/api_op_CreateDatasetGroup.go +++ b/service/personalize/api_op_CreateDatasetGroup.go @@ -15,9 +15,11 @@ import ( // Creates an empty dataset group. A dataset group is a container for Amazon // Personalize resources. A dataset group can contain at most three datasets, one // for each type of dataset: -// - Interactions +// - Item interactions // - Items // - Users +// - Actions +// - Action interactions // // A dataset group can be a Domain dataset group, where you specify a domain and // use pre-configured resources like recommenders, or a Custom dataset group, where diff --git a/service/personalize/api_op_CreateDatasetImportJob.go b/service/personalize/api_op_CreateDatasetImportJob.go index 51bfca8de0c..5ee6b90ff18 100644 --- a/service/personalize/api_op_CreateDatasetImportJob.go +++ b/service/personalize/api_op_CreateDatasetImportJob.go @@ -18,6 +18,10 @@ import ( // read from the data source, as Amazon Personalize makes a copy of your data and // processes it internally. For information on granting access to your Amazon S3 // bucket, see Giving Amazon Personalize Access to Amazon S3 Resources (https://docs.aws.amazon.com/personalize/latest/dg/granting-personalize-s3-access.html) +// . If you already created a recommender or deployed a custom solution version +// with a campaign, how new bulk records influence recommendations depends on the +// domain use case or recipe that you use. For more information, see How new data +// influences real-time recommendations (https://docs.aws.amazon.com/personalize/latest/dg/how-new-data-influences-recommendations.html) // . By default, a dataset import job replaces any existing data in the dataset // that you imported in bulk. To add new records without replacing existing data, // specify INCREMENTAL for the import mode in the CreateDatasetImportJob operation. diff --git a/service/personalize/api_op_CreateEventTracker.go b/service/personalize/api_op_CreateEventTracker.go index 5b30c20aadb..da2c405b481 100644 --- a/service/personalize/api_op_CreateEventTracker.go +++ b/service/personalize/api_op_CreateEventTracker.go @@ -18,9 +18,9 @@ import ( // an error if you call CreateEventTracker using the same dataset group as an // existing event tracker. When you create an event tracker, the response includes // a tracking ID, which you pass as a parameter when you use the PutEvents (https://docs.aws.amazon.com/personalize/latest/dg/API_UBS_PutEvents.html) -// operation. Amazon Personalize then appends the event data to the Interactions -// dataset of the dataset group you specify in your event tracker. The event -// tracker can be in one of the following states: +// operation. Amazon Personalize then appends the event data to the Item +// interactions dataset of the dataset group you specify in your event tracker. The +// event tracker can be in one of the following states: // - CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED // - DELETE PENDING > DELETE IN_PROGRESS // diff --git a/service/personalize/api_op_CreateSolutionVersion.go b/service/personalize/api_op_CreateSolutionVersion.go index 81e4c03493c..c6754e7c890 100644 --- a/service/personalize/api_op_CreateSolutionVersion.go +++ b/service/personalize/api_op_CreateSolutionVersion.go @@ -65,14 +65,19 @@ type CreateSolutionVersionInput struct { Tags []types.Tag // The scope of training to be performed when creating the solution version. The - // FULL option trains the solution version based on the entirety of the input - // solution's training data, while the UPDATE option processes only the data that - // has changed in comparison to the input solution. Choose UPDATE when you want to - // incrementally update your solution version instead of creating an entirely new - // one. The UPDATE option can only be used when you already have an active - // solution version created from the input solution using the FULL option and the - // input solution was trained with the User-Personalization (https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-new-item-USER_PERSONALIZATION.html) - // recipe or the HRNN-Coldstart (https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-hrnn-coldstart.html) + // default is FULL . This creates a completely new model based on the entirety of + // the training data from the datasets in your dataset group. If you use + // User-Personalization (https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-new-item-USER_PERSONALIZATION.html) + // , you can specify a training mode of UPDATE . This updates the model to consider + // new items for recommendations. It is not a full retraining. You should still + // complete a full retraining weekly. If you specify UPDATE , Amazon Personalize + // will stop automatic updates for the solution version. To resume updates, create + // a new solution with training mode set to FULL and deploy it in a campaign. For + // more information about automatic updates, see Automatic updates (https://docs.aws.amazon.com/personalize/latest/dg/use-case-recipe-features.html#maintaining-with-automatic-updates) + // . The UPDATE option can only be used when you already have an active solution + // version created from the input solution using the FULL option and the input + // solution was trained with the User-Personalization (https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-new-item-USER_PERSONALIZATION.html) + // recipe or the legacy HRNN-Coldstart (https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-hrnn-coldstart.html) // recipe. TrainingMode types.TrainingMode diff --git a/service/personalize/api_op_DeleteEventTracker.go b/service/personalize/api_op_DeleteEventTracker.go index 25bb5d50926..2843b9bdaf7 100644 --- a/service/personalize/api_op_DeleteEventTracker.go +++ b/service/personalize/api_op_DeleteEventTracker.go @@ -11,9 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes the event tracker. Does not delete the event-interactions dataset from -// the associated dataset group. For more information on event trackers, see -// CreateEventTracker (https://docs.aws.amazon.com/personalize/latest/dg/API_CreateEventTracker.html) +// Deletes the event tracker. Does not delete the dataset from the dataset group. +// For more information on event trackers, see CreateEventTracker (https://docs.aws.amazon.com/personalize/latest/dg/API_CreateEventTracker.html) // . func (c *Client) DeleteEventTracker(ctx context.Context, params *DeleteEventTrackerInput, optFns ...func(*Options)) (*DeleteEventTrackerOutput, error) { if params == nil { diff --git a/service/personalize/api_op_ListDatasets.go b/service/personalize/api_op_ListDatasets.go index 790d730142c..e7d6092299a 100644 --- a/service/personalize/api_op_ListDatasets.go +++ b/service/personalize/api_op_ListDatasets.go @@ -40,8 +40,8 @@ type ListDatasetsInput struct { // The maximum number of datasets to return. MaxResults *int32 - // A token returned from the previous call to ListDatasetImportJobs for getting - // the next set of dataset import jobs (if they exist). + // A token returned from the previous call to ListDatasets for getting the next + // set of dataset import jobs (if they exist). NextToken *string noSmithyDocumentSerde diff --git a/service/personalize/api_op_UpdateCampaign.go b/service/personalize/api_op_UpdateCampaign.go index aaaa4369a45..628dcb6adae 100644 --- a/service/personalize/api_op_UpdateCampaign.go +++ b/service/personalize/api_op_UpdateCampaign.go @@ -12,14 +12,17 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Updates a campaign by either deploying a new solution or changing the value of -// the campaign's minProvisionedTPS parameter. To update a campaign, the campaign -// status must be ACTIVE or CREATE FAILED. Check the campaign status using the -// DescribeCampaign (https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeCampaign.html) +// Updates a campaign to deploy a retrained solution version with an existing +// campaign, change your campaign's minProvisionedTPS , or modify your campaign's +// configuration, such as the exploration configuration. To update a campaign, the +// campaign status must be ACTIVE or CREATE FAILED. Check the campaign status using +// the DescribeCampaign (https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeCampaign.html) // operation. You can still get recommendations from a campaign while an update is // in progress. The campaign will use the previous solution version and campaign // configuration to generate recommendations until the latest campaign update -// status is Active . For more information on campaigns, see CreateCampaign (https://docs.aws.amazon.com/personalize/latest/dg/API_CreateCampaign.html) +// status is Active . For more information about updating a campaign, including +// code samples, see Updating a campaign (https://docs.aws.amazon.com/personalize/latest/dg/update-campaigns.html) +// . For more information about campaigns, see Creating a campaign (https://docs.aws.amazon.com/personalize/latest/dg/campaigns.html) // . func (c *Client) UpdateCampaign(ctx context.Context, params *UpdateCampaignInput, optFns ...func(*Options)) (*UpdateCampaignOutput, error) { if params == nil { diff --git a/service/personalize/deserializers.go b/service/personalize/deserializers.go index 39d4ccb523f..adc49f7e6a5 100644 --- a/service/personalize/deserializers.go +++ b/service/personalize/deserializers.go @@ -8260,6 +8260,15 @@ func awsAwsjson11_deserializeDocumentBatchInferenceJob(v **types.BatchInferenceJ return err } + case "batchInferenceJobMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BatchInferenceJobMode to be of type string, got %T instead", value) + } + sv.BatchInferenceJobMode = types.BatchInferenceJobMode(jtv) + } + case "creationDateTime": if value != nil { switch jtv := value.(type) { @@ -8369,6 +8378,11 @@ func awsAwsjson11_deserializeDocumentBatchInferenceJob(v **types.BatchInferenceJ sv.Status = ptr.String(jtv) } + case "themeGenerationConfig": + if err := awsAwsjson11_deserializeDocumentThemeGenerationConfig(&sv.ThemeGenerationConfig, value); err != nil { + return err + } + default: _, _ = key, value @@ -8551,6 +8565,15 @@ func awsAwsjson11_deserializeDocumentBatchInferenceJobSummary(v **types.BatchInf sv.BatchInferenceJobArn = ptr.String(jtv) } + case "batchInferenceJobMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BatchInferenceJobMode to be of type string, got %T instead", value) + } + sv.BatchInferenceJobMode = types.BatchInferenceJobMode(jtv) + } + case "creationDateTime": if value != nil { switch jtv := value.(type) { @@ -9144,6 +9167,15 @@ func awsAwsjson11_deserializeDocumentCampaignConfig(v **types.CampaignConfig, va for key, value := range shape { switch key { + case "enableMetadataWithRecommendations": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.EnableMetadataWithRecommendations = ptr.Bool(jtv) + } + case "itemExplorationConfig": if err := awsAwsjson11_deserializeDocumentHyperParameters(&sv.ItemExplorationConfig, value); err != nil { return err @@ -9805,6 +9837,15 @@ func awsAwsjson11_deserializeDocumentDataset(v **types.Dataset, value interface{ sv.Status = ptr.String(jtv) } + case "trackingId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TrackingId to be of type string, got %T instead", value) + } + sv.TrackingId = ptr.String(jtv) + } + default: _, _ = key, value @@ -11952,6 +11993,46 @@ func awsAwsjson11_deserializeDocumentFeaturizationParameters(v *map[string]strin return nil } +func awsAwsjson11_deserializeDocumentFieldsForThemeGeneration(v **types.FieldsForThemeGeneration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FieldsForThemeGeneration + if *v == nil { + sv = &types.FieldsForThemeGeneration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "itemName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) + } + sv.ItemName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentFilter(v **types.Filter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13572,6 +13653,15 @@ func awsAwsjson11_deserializeDocumentRecommenderConfig(v **types.RecommenderConf for key, value := range shape { switch key { + case "enableMetadataWithRecommendations": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.EnableMetadataWithRecommendations = ptr.Bool(jtv) + } + case "itemExplorationConfig": if err := awsAwsjson11_deserializeDocumentHyperParameters(&sv.ItemExplorationConfig, value); err != nil { return err @@ -14842,6 +14932,42 @@ func awsAwsjson11_deserializeDocumentTags(v *[]types.Tag, value interface{}) err return nil } +func awsAwsjson11_deserializeDocumentThemeGenerationConfig(v **types.ThemeGenerationConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThemeGenerationConfig + if *v == nil { + sv = &types.ThemeGenerationConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fieldsForThemeGeneration": + if err := awsAwsjson11_deserializeDocumentFieldsForThemeGeneration(&sv.FieldsForThemeGeneration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentTooManyTagKeysException(v **types.TooManyTagKeysException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/personalize/endpoints.go b/service/personalize/endpoints.go index 46b532c9adf..2d3323230e1 100644 --- a/service/personalize/endpoints.go +++ b/service/personalize/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://personalize-fips.") diff --git a/service/personalize/serializers.go b/service/personalize/serializers.go index fe119a421e7..17615371fc7 100644 --- a/service/personalize/serializers.go +++ b/service/personalize/serializers.go @@ -3804,6 +3804,11 @@ func awsAwsjson11_serializeDocumentCampaignConfig(v *types.CampaignConfig, value object := value.Object() defer object.Close() + if v.EnableMetadataWithRecommendations != nil { + ok := object.Key("enableMetadataWithRecommendations") + ok.Boolean(*v.EnableMetadataWithRecommendations) + } + if v.ItemExplorationConfig != nil { ok := object.Key("itemExplorationConfig") if err := awsAwsjson11_serializeDocumentHyperParameters(v.ItemExplorationConfig, ok); err != nil { @@ -3982,6 +3987,18 @@ func awsAwsjson11_serializeDocumentFeatureTransformationParameters(v map[string] return nil } +func awsAwsjson11_serializeDocumentFieldsForThemeGeneration(v *types.FieldsForThemeGeneration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ItemName != nil { + ok := object.Key("itemName") + ok.String(*v.ItemName) + } + + return nil +} + func awsAwsjson11_serializeDocumentHPOConfig(v *types.HPOConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4209,6 +4226,11 @@ func awsAwsjson11_serializeDocumentRecommenderConfig(v *types.RecommenderConfig, object := value.Object() defer object.Close() + if v.EnableMetadataWithRecommendations != nil { + ok := object.Key("enableMetadataWithRecommendations") + ok.Boolean(*v.EnableMetadataWithRecommendations) + } + if v.ItemExplorationConfig != nil { ok := object.Key("itemExplorationConfig") if err := awsAwsjson11_serializeDocumentHyperParameters(v.ItemExplorationConfig, ok); err != nil { @@ -4343,6 +4365,20 @@ func awsAwsjson11_serializeDocumentTags(v []types.Tag, value smithyjson.Value) e return nil } +func awsAwsjson11_serializeDocumentThemeGenerationConfig(v *types.ThemeGenerationConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FieldsForThemeGeneration != nil { + ok := object.Key("fieldsForThemeGeneration") + if err := awsAwsjson11_serializeDocumentFieldsForThemeGeneration(v.FieldsForThemeGeneration, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeDocumentTrainingDataConfig(v *types.TrainingDataConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4368,6 +4404,11 @@ func awsAwsjson11_serializeOpDocumentCreateBatchInferenceJobInput(v *CreateBatch } } + if len(v.BatchInferenceJobMode) > 0 { + ok := object.Key("batchInferenceJobMode") + ok.String(string(v.BatchInferenceJobMode)) + } + if v.FilterArn != nil { ok := object.Key("filterArn") ok.String(*v.FilterArn) @@ -4414,6 +4455,13 @@ func awsAwsjson11_serializeOpDocumentCreateBatchInferenceJobInput(v *CreateBatch } } + if v.ThemeGenerationConfig != nil { + ok := object.Key("themeGenerationConfig") + if err := awsAwsjson11_serializeDocumentThemeGenerationConfig(v.ThemeGenerationConfig, ok); err != nil { + return err + } + } + return nil } diff --git a/service/personalize/types/enums.go b/service/personalize/types/enums.go index 5f3d8beaf46..a8a877731ba 100644 --- a/service/personalize/types/enums.go +++ b/service/personalize/types/enums.go @@ -2,6 +2,24 @@ package types +type BatchInferenceJobMode string + +// Enum values for BatchInferenceJobMode +const ( + BatchInferenceJobModeBatchInference BatchInferenceJobMode = "BATCH_INFERENCE" + BatchInferenceJobModeThemeGeneration BatchInferenceJobMode = "THEME_GENERATION" +) + +// Values returns all known values for BatchInferenceJobMode. 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 (BatchInferenceJobMode) Values() []BatchInferenceJobMode { + return []BatchInferenceJobMode{ + "BATCH_INFERENCE", + "THEME_GENERATION", + } +} + type Domain string // Enum values for Domain diff --git a/service/personalize/types/types.go b/service/personalize/types/types.go index bac2df78c0a..02dff214cc1 100644 --- a/service/personalize/types/types.go +++ b/service/personalize/types/types.go @@ -94,6 +94,9 @@ type BatchInferenceJob struct { // A string to string map of the configuration details of a batch inference job. BatchInferenceJobConfig *BatchInferenceJobConfig + // The job's mode. + BatchInferenceJobMode BatchInferenceJobMode + // The time at which the batch inference job was created. CreationDateTime *time.Time @@ -137,6 +140,9 @@ type BatchInferenceJob struct { // - CREATE FAILED Status *string + // The job's theme generation settings. + ThemeGenerationConfig *ThemeGenerationConfig + noSmithyDocumentSerde } @@ -185,6 +191,9 @@ type BatchInferenceJobSummary struct { // The Amazon Resource Name (ARN) of the batch inference job. BatchInferenceJobArn *string + // The job's mode. + BatchInferenceJobMode BatchInferenceJobMode + // The time at which the batch inference job was created. CreationDateTime *time.Time @@ -366,6 +375,14 @@ type Campaign struct { // The configuration details of a campaign. type CampaignConfig struct { + // Whether metadata with recommendations is enabled for the campaign. If enabled, + // you can specify the columns from your Items dataset in your request for + // recommendations. Amazon Personalize returns this data for each item in the + // recommendation response. If you enable metadata in recommendations, you will + // incur additional costs. For more information, see Amazon Personalize pricing (https://aws.amazon.com/personalize/pricing/) + // . + EnableMetadataWithRecommendations *bool + // Specifies the exploration configuration hyperparameters, including // explorationWeight and explorationItemAgeCutOff , you want to use to configure // the amount of item exploration Amazon Personalize uses when recommending items. @@ -481,6 +498,8 @@ type Dataset struct { // - Interactions // - Items // - Users + // - Actions + // - Action_Interactions DatasetType *string // A time stamp that shows when the dataset was updated. @@ -500,6 +519,12 @@ type Dataset struct { // - DELETE PENDING > DELETE IN_PROGRESS Status *string + // The ID of the event tracker for an Action interactions dataset. You specify the + // tracker's ID in the PutActionInteractions API operation. Amazon Personalize + // uses it to direct new data to the Action interactions dataset in your dataset + // group. + TrackingId *string + noSmithyDocumentSerde } @@ -590,8 +615,9 @@ type DatasetExportJobSummary struct { noSmithyDocumentSerde } -// A dataset group is a collection of related datasets (Interactions, User, and -// Item). You create a dataset group by calling CreateDatasetGroup (https://docs.aws.amazon.com/personalize/latest/dg/API_CreateDatasetGroup.html) +// A dataset group is a collection of related datasets (Item interactions, Users, +// Items, Actions, Action interactions). You create a dataset group by calling +// CreateDatasetGroup (https://docs.aws.amazon.com/personalize/latest/dg/API_CreateDatasetGroup.html) // . You then create a dataset and add it to a dataset group by calling // CreateDataset (https://docs.aws.amazon.com/personalize/latest/dg/API_CreateDataset.html) // . The dataset group is used to create and train a solution by calling @@ -622,7 +648,9 @@ type DatasetGroup struct { // The name of the dataset group. Name *string - // The ARN of the IAM role that has permissions to create the dataset group. + // The ARN of the Identity and Access Management (IAM) role that has permissions + // to access the Key Management Service (KMS) key. Supplying an IAM role is only + // valid when also specifying a KMS key. RoleArn *string // The current status of the dataset group. A dataset group can be in one of the @@ -1021,6 +1049,18 @@ type FeatureTransformation struct { noSmithyDocumentSerde } +// A string to string map of the configuration details for theme generation. +type FieldsForThemeGeneration struct { + + // The name of the Items dataset column that stores the name of each item in the + // dataset. + // + // This member is required. + ItemName *string + + noSmithyDocumentSerde +} + // Contains information on a recommendation filter, including its ARN, status, and // filter expression. type Filter struct { @@ -1399,6 +1439,14 @@ type Recommender struct { // The configuration details of the recommender. type RecommenderConfig struct { + // Whether metadata with recommendations is enabled for the recommender. If + // enabled, you can specify the columns from your Items dataset in your request for + // recommendations. Amazon Personalize returns this data for each item in the + // recommendation response. If you enable metadata in recommendations, you will + // incur additional costs. For more information, see Amazon Personalize pricing (https://aws.amazon.com/personalize/pricing/) + // . + EnableMetadataWithRecommendations *bool + // Specifies the exploration configuration hyperparameters, including // explorationWeight and explorationItemAgeCutOff , you want to use to configure // the amount of item exploration Amazon Personalize uses when recommending items. @@ -1563,7 +1611,7 @@ type Solution struct { // Describes the configuration properties for the solution. type SolutionConfig struct { - // Lists the hyperparameter names and ranges. + // Lists the algorithm hyperparameters and their values. AlgorithmHyperParameters map[string]string // The AutoMLConfig (https://docs.aws.amazon.com/personalize/latest/dg/API_AutoMLConfig.html) @@ -1745,6 +1793,17 @@ type Tag struct { noSmithyDocumentSerde } +// The configuration details for generating themes with a batch inference job. +type ThemeGenerationConfig struct { + + // Fields used to generate descriptive themes for a batch inference job. + // + // This member is required. + FieldsForThemeGeneration *FieldsForThemeGeneration + + noSmithyDocumentSerde +} + // The training data configuration to use when creating a domain recommender or // custom solution version (trained model). type TrainingDataConfig struct { diff --git a/service/personalize/validators.go b/service/personalize/validators.go index 766cb8cb53e..3a4a221c096 100644 --- a/service/personalize/validators.go +++ b/service/personalize/validators.go @@ -1329,6 +1329,21 @@ func validateDatasetExportJobOutput(v *types.DatasetExportJobOutput) error { } } +func validateFieldsForThemeGeneration(v *types.FieldsForThemeGeneration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FieldsForThemeGeneration"} + if v.ItemName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ItemName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateMetricAttribute(v *types.MetricAttribute) error { if v == nil { return nil @@ -1437,6 +1452,25 @@ func validateTags(v []types.Tag) error { } } +func validateThemeGenerationConfig(v *types.ThemeGenerationConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ThemeGenerationConfig"} + if v.FieldsForThemeGeneration == nil { + invalidParams.Add(smithy.NewErrParamRequired("FieldsForThemeGeneration")) + } else if v.FieldsForThemeGeneration != nil { + if err := validateFieldsForThemeGeneration(v.FieldsForThemeGeneration); err != nil { + invalidParams.AddNested("FieldsForThemeGeneration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateBatchInferenceJobInput(v *CreateBatchInferenceJobInput) error { if v == nil { return nil @@ -1470,6 +1504,11 @@ func validateOpCreateBatchInferenceJobInput(v *CreateBatchInferenceJobInput) err invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } + if v.ThemeGenerationConfig != nil { + if err := validateThemeGenerationConfig(v.ThemeGenerationConfig); err != nil { + invalidParams.AddNested("ThemeGenerationConfig", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/personalizeevents/api_op_PutActionInteractions.go b/service/personalizeevents/api_op_PutActionInteractions.go new file mode 100644 index 00000000000..bb9a3baa93e --- /dev/null +++ b/service/personalizeevents/api_op_PutActionInteractions.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package personalizeevents + +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/personalizeevents/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Records action interaction event data. An action interaction event is an +// interaction between a user and an action. For example, a user taking an action, +// such a enrolling in a membership program or downloading your app. For more +// information about recording action interactions, see Recording action +// interaction events (https://docs.aws.amazon.com/personalize/latest/dg/recording-action-interaction-events.html) +// . For more information about actions in an Actions dataset, see Actions dataset (https://docs.aws.amazon.com/personalize/latest/dg/actions-datasets.html) +// . +func (c *Client) PutActionInteractions(ctx context.Context, params *PutActionInteractionsInput, optFns ...func(*Options)) (*PutActionInteractionsOutput, error) { + if params == nil { + params = &PutActionInteractionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutActionInteractions", params, optFns, c.addOperationPutActionInteractionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutActionInteractionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutActionInteractionsInput struct { + + // A list of action interaction events from the session. + // + // This member is required. + ActionInteractions []types.ActionInteraction + + // The ID of your action interaction event tracker. When you create an Action + // interactions dataset, Amazon Personalize creates an action interaction event + // tracker for you. For more information, see Action interaction event tracker ID (https://docs.aws.amazon.com/personalize/latest/dg/action-interaction-tracker-id.html) + // . + // + // This member is required. + TrackingId *string + + noSmithyDocumentSerde +} + +type PutActionInteractionsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutActionInteractionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutActionInteractions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutActionInteractions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutActionInteractions"); 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 = addOpPutActionInteractionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutActionInteractions(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_opPutActionInteractions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutActionInteractions", + } +} diff --git a/service/personalizeevents/api_op_PutActions.go b/service/personalizeevents/api_op_PutActions.go new file mode 100644 index 00000000000..c0ff4959119 --- /dev/null +++ b/service/personalizeevents/api_op_PutActions.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package personalizeevents + +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/personalizeevents/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds one or more actions to an Actions dataset. For more information see +// Importing actions individually (https://docs.aws.amazon.com/personalize/latest/dg/importing-actions.html) +// . +func (c *Client) PutActions(ctx context.Context, params *PutActionsInput, optFns ...func(*Options)) (*PutActionsOutput, error) { + if params == nil { + params = &PutActionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutActions", params, optFns, c.addOperationPutActionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutActionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutActionsInput struct { + + // A list of action data. + // + // This member is required. + Actions []types.Action + + // The Amazon Resource Name (ARN) of the Actions dataset you are adding the action + // or actions to. + // + // This member is required. + DatasetArn *string + + noSmithyDocumentSerde +} + +type PutActionsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutActionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutActions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutActions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutActions"); 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 = addOpPutActionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutActions(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_opPutActions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutActions", + } +} diff --git a/service/personalizeevents/api_op_PutEvents.go b/service/personalizeevents/api_op_PutEvents.go index aa95bfe19a1..6d4ec98a111 100644 --- a/service/personalizeevents/api_op_PutEvents.go +++ b/service/personalizeevents/api_op_PutEvents.go @@ -12,7 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Records user interaction event data. For more information see Recording Events (https://docs.aws.amazon.com/personalize/latest/dg/recording-events.html) +// Records item interaction event data. For more information see Recording item +// interaction events (https://docs.aws.amazon.com/personalize/latest/dg/recording-item-interaction-events.html) // . func (c *Client) PutEvents(ctx context.Context, params *PutEventsInput, optFns ...func(*Options)) (*PutEventsOutput, error) { if params == nil { @@ -39,7 +40,7 @@ type PutEventsInput struct { // The session ID associated with the user's visit. Your application generates the // sessionId when a user first visits your website or uses your application. Amazon // Personalize uses the sessionId to associate events with the user before they log - // in. For more information, see Recording Events (https://docs.aws.amazon.com/personalize/latest/dg/recording-events.html) + // in. For more information, see Recording item interaction events (https://docs.aws.amazon.com/personalize/latest/dg/recording-item-interaction-events.html) // . // // This member is required. diff --git a/service/personalizeevents/api_op_PutItems.go b/service/personalizeevents/api_op_PutItems.go index f64e26c56d6..eaaeb7d05c9 100644 --- a/service/personalizeevents/api_op_PutItems.go +++ b/service/personalizeevents/api_op_PutItems.go @@ -13,7 +13,7 @@ import ( ) // Adds one or more items to an Items dataset. For more information see Importing -// Items Incrementally (https://docs.aws.amazon.com/personalize/latest/dg/importing-items.html) +// items individually (https://docs.aws.amazon.com/personalize/latest/dg/importing-items.html) // . func (c *Client) PutItems(ctx context.Context, params *PutItemsInput, optFns ...func(*Options)) (*PutItemsOutput, error) { if params == nil { diff --git a/service/personalizeevents/api_op_PutUsers.go b/service/personalizeevents/api_op_PutUsers.go index eb4f3f38b85..8821f382a38 100644 --- a/service/personalizeevents/api_op_PutUsers.go +++ b/service/personalizeevents/api_op_PutUsers.go @@ -13,7 +13,7 @@ import ( ) // Adds one or more users to a Users dataset. For more information see Importing -// Users Incrementally (https://docs.aws.amazon.com/personalize/latest/dg/importing-users.html) +// users individually (https://docs.aws.amazon.com/personalize/latest/dg/importing-users.html) // . func (c *Client) PutUsers(ctx context.Context, params *PutUsersInput, optFns ...func(*Options)) (*PutUsersOutput, error) { if params == nil { diff --git a/service/personalizeevents/deserializers.go b/service/personalizeevents/deserializers.go index d4b6ad4edbb..26148f2d5e7 100644 --- a/service/personalizeevents/deserializers.go +++ b/service/personalizeevents/deserializers.go @@ -19,6 +19,196 @@ import ( "strings" ) +type awsRestjson1_deserializeOpPutActionInteractions struct { +} + +func (*awsRestjson1_deserializeOpPutActionInteractions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutActionInteractions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorPutActionInteractions(response, &metadata) + } + output := &PutActionInteractionsOutput{} + 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_deserializeOpErrorPutActionInteractions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpPutActions struct { +} + +func (*awsRestjson1_deserializeOpPutActions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutActions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorPutActions(response, &metadata) + } + output := &PutActionsOutput{} + 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_deserializeOpErrorPutActions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpPutEvents struct { } diff --git a/service/personalizeevents/doc.go b/service/personalizeevents/doc.go index be2a386a1c6..d7fc44ae726 100644 --- a/service/personalizeevents/doc.go +++ b/service/personalizeevents/doc.go @@ -5,6 +5,6 @@ // // Amazon Personalize can consume real-time user event data, such as stream or // click data, and use it for model training either alone or combined with -// historical data. For more information see Recording Events (https://docs.aws.amazon.com/personalize/latest/dg/recording-events.html) +// historical data. For more information see Recording item interaction events (https://docs.aws.amazon.com/personalize/latest/dg/recording-item-interaction-events.html) // . package personalizeevents diff --git a/service/personalizeevents/endpoints.go b/service/personalizeevents/endpoints.go index f5787d9d3ae..0216545c14b 100644 --- a/service/personalizeevents/endpoints.go +++ b/service/personalizeevents/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://personalize-events-fips.") diff --git a/service/personalizeevents/generated.json b/service/personalizeevents/generated.json index 8c727d16628..a1991f93e55 100644 --- a/service/personalizeevents/generated.json +++ b/service/personalizeevents/generated.json @@ -9,6 +9,8 @@ "files": [ "api_client.go", "api_client_test.go", + "api_op_PutActionInteractions.go", + "api_op_PutActions.go", "api_op_PutEvents.go", "api_op_PutItems.go", "api_op_PutUsers.go", diff --git a/service/personalizeevents/serializers.go b/service/personalizeevents/serializers.go index 083b7c680a5..98983081800 100644 --- a/service/personalizeevents/serializers.go +++ b/service/personalizeevents/serializers.go @@ -16,6 +16,170 @@ import ( "math" ) +type awsRestjson1_serializeOpPutActionInteractions struct { +} + +func (*awsRestjson1_serializeOpPutActionInteractions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutActionInteractions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutActionInteractionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/action-interactions") + 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_serializeOpDocumentPutActionInteractionsInput(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_serializeOpHttpBindingsPutActionInteractionsInput(v *PutActionInteractionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutActionInteractionsInput(v *PutActionInteractionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ActionInteractions != nil { + ok := object.Key("actionInteractions") + if err := awsRestjson1_serializeDocumentActionInteractionsList(v.ActionInteractions, ok); err != nil { + return err + } + } + + if v.TrackingId != nil { + ok := object.Key("trackingId") + ok.String(*v.TrackingId) + } + + return nil +} + +type awsRestjson1_serializeOpPutActions struct { +} + +func (*awsRestjson1_serializeOpPutActions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutActions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutActionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/actions") + 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_serializeOpDocumentPutActionsInput(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_serializeOpHttpBindingsPutActionsInput(v *PutActionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutActionsInput(v *PutActionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Actions != nil { + ok := object.Key("actions") + if err := awsRestjson1_serializeDocumentActionList(v.Actions, ok); err != nil { + return err + } + } + + if v.DatasetArn != nil { + ok := object.Key("datasetArn") + ok.String(*v.DatasetArn) + } + + return nil +} + type awsRestjson1_serializeOpPutEvents struct { } @@ -272,6 +436,114 @@ func awsRestjson1_serializeOpDocumentPutUsersInput(v *PutUsersInput, value smith return nil } +func awsRestjson1_serializeDocumentAction(v *types.Action, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ActionId != nil { + ok := object.Key("actionId") + ok.String(*v.ActionId) + } + + if v.Properties != nil { + ok := object.Key("properties") + ok.String(*v.Properties) + } + + return nil +} + +func awsRestjson1_serializeDocumentActionImpression(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_serializeDocumentActionInteraction(v *types.ActionInteraction, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ActionId != nil { + ok := object.Key("actionId") + ok.String(*v.ActionId) + } + + if v.EventId != nil { + ok := object.Key("eventId") + ok.String(*v.EventId) + } + + if v.EventType != nil { + ok := object.Key("eventType") + ok.String(*v.EventType) + } + + if v.Impression != nil { + ok := object.Key("impression") + if err := awsRestjson1_serializeDocumentActionImpression(v.Impression, ok); err != nil { + return err + } + } + + if v.Properties != nil { + ok := object.Key("properties") + ok.String(*v.Properties) + } + + if v.RecommendationId != nil { + ok := object.Key("recommendationId") + ok.String(*v.RecommendationId) + } + + if v.SessionId != nil { + ok := object.Key("sessionId") + ok.String(*v.SessionId) + } + + if v.Timestamp != nil { + ok := object.Key("timestamp") + ok.Double(smithytime.FormatEpochSeconds(*v.Timestamp)) + } + + if v.UserId != nil { + ok := object.Key("userId") + ok.String(*v.UserId) + } + + return nil +} + +func awsRestjson1_serializeDocumentActionInteractionsList(v []types.ActionInteraction, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentActionInteraction(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentActionList(v []types.Action, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAction(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentEvent(v *types.Event, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/personalizeevents/types/types.go b/service/personalizeevents/types/types.go index f0eb6790b56..540b4362020 100644 --- a/service/personalizeevents/types/types.go +++ b/service/personalizeevents/types/types.go @@ -7,12 +7,107 @@ import ( "time" ) -// Represents user interaction event information sent using the PutEvents API. +// Represents action metadata added to an Action dataset using the PutActions API. +// For more information see Importing actions individually (https://docs.aws.amazon.com/personalize/latest/dg/importing-actions.html) +// . +type Action struct { + + // The ID associated with the action. + // + // This member is required. + ActionId *string + + // A string map of action-specific metadata. Each element in the map consists of a + // key-value pair. For example, {"value": "100"} . The keys use camel case names + // that match the fields in the schema for the Actions dataset. In the previous + // example, the value matches the 'VALUE' field defined in the Actions schema. For + // categorical string data, to include multiple categories for a single action, + // separate each category with a pipe separator ( | ). For example, + // \"Deluxe|Premium\" . + // + // This value conforms to the media type: application/json + Properties *string + + noSmithyDocumentSerde +} + +// Represents an action interaction event sent using the PutActionInteractions API. +type ActionInteraction struct { + + // The ID of the action the user interacted with. This corresponds to the ACTION_ID + // field of the Action interaction schema. + // + // This member is required. + ActionId *string + + // The type of action interaction event. You can specify Viewed , Taken , and Not + // Taken event types. For more information about action interaction event type + // data, see Event type data (https://docs.aws.amazon.com/personalize/latest/dg/action-interaction-event-type-data.html) + // . + // + // This member is required. + EventType *string + + // The ID associated with the user's visit. Your application generates a unique + // sessionId when a user first visits your website or uses your application. + // + // This member is required. + SessionId *string + + // The timestamp for when the action interaction event occurred. Timestamps must + // be in Unix epoch time format, in seconds. + // + // This member is required. + Timestamp *time.Time + + // An ID associated with the event. If an event ID is not provided, Amazon + // Personalize generates a unique ID for the event. An event ID is not used as an + // input to the model. Amazon Personalize uses the event ID to distinguish unique + // events. Any subsequent events after the first with the same event ID are not + // used in model training. + EventId *string + + // A list of action IDs that represents the sequence of actions you have shown the + // user. For example, ["actionId1", "actionId2", "actionId3"] . Amazon Personalize + // doesn't use impressions data from action interaction events. Instead, record + // multiple events for each action and use the Viewed event type. + Impression []string + + // A string map of event-specific data that you might choose to record. For + // example, if a user takes an action, other than the action ID, you might also + // send the number of actions taken by the user. Each item in the map consists of a + // key-value pair. For example, {"numberOfActions": "12"} The keys use camel case + // names that match the fields in the Action interactions schema. In the above + // example, the numberOfActions would match the 'NUMBER_OF_ACTIONS' field defined + // in the Action interactions schema. The following can't be included as a keyword + // for properties (case insensitive). + // - userId + // - sessionId + // - eventType + // - timestamp + // - recommendationId + // - impression + // + // This value conforms to the media type: application/json + Properties *string + + // The ID of the list of recommendations that contains the action the user + // interacted with. + RecommendationId *string + + // The ID of the user who interacted with the action. This corresponds to the + // USER_ID field of the Action interaction schema. + UserId *string + + noSmithyDocumentSerde +} + +// Represents item interaction event information sent using the PutEvents API. type Event struct { // The type of event, such as click or download. This property corresponds to the - // EVENT_TYPE field of your Interactions schema and depends on the types of events - // you are tracking. + // EVENT_TYPE field of your Item interactions dataset's schema and depends on the + // types of events you are tracking. // // This member is required. EventType *string @@ -24,13 +119,13 @@ type Event struct { // An ID associated with the event. If an event ID is not provided, Amazon // Personalize generates a unique ID for the event. An event ID is not used as an - // input to the model. Amazon Personalize uses the event ID to distinquish unique + // input to the model. Amazon Personalize uses the event ID to distinguish unique // events. Any subsequent events after the first with the same event ID are not // used in model training. EventId *string - // The event value that corresponds to the EVENT_VALUE field of the Interactions - // schema. + // The event value that corresponds to the EVENT_VALUE field of the Item + // interactions schema. EventValue *float32 // A list of item IDs that represents the sequence of items you have shown the @@ -40,8 +135,8 @@ type Event struct { // . Impression []string - // The item ID key that corresponds to the ITEM_ID field of the Interactions - // schema. + // The item ID key that corresponds to the ITEM_ID field of the Item interactions + // dataset's schema. ItemId *string // Contains information about the metric attribution associated with an event. For @@ -55,8 +150,16 @@ type Event struct { // and rating ( eventValue ) , you might also send the number of movie ratings made // by the user. Each item in the map consists of a key-value pair. For example, // {"numberOfRatings": "12"} The keys use camel case names that match the fields in - // the Interactions schema. In the above example, the numberOfRatings would match - // the 'NUMBER_OF_RATINGS' field defined in the Interactions schema. + // the Item interactions dataset's schema. In the above example, the + // numberOfRatings would match the 'NUMBER_OF_RATINGS' field defined in the Item + // interactions dataset's schema. The following can't be included as a keyword for + // properties (case insensitive). + // - userId + // - sessionId + // - eventType + // - timestamp + // - recommendationId + // - impression // // This value conforms to the media type: application/json Properties *string @@ -76,7 +179,7 @@ type Event struct { } // Represents item metadata added to an Items dataset using the PutItems API. For -// more information see Importing Items Incrementally (https://docs.aws.amazon.com/personalize/latest/dg/importing-items.html) +// more information see Importing items individually (https://docs.aws.amazon.com/personalize/latest/dg/importing-items.html) // . type Item struct { @@ -114,7 +217,7 @@ type MetricAttribution struct { } // Represents user metadata added to a Users dataset using the PutUsers API. For -// more information see Importing Users Incrementally (https://docs.aws.amazon.com/personalize/latest/dg/importing-users.html) +// more information see Importing users individually (https://docs.aws.amazon.com/personalize/latest/dg/importing-users.html) // . type User struct { diff --git a/service/personalizeevents/validators.go b/service/personalizeevents/validators.go index 2bf16c564b6..fdb6e42c4c4 100644 --- a/service/personalizeevents/validators.go +++ b/service/personalizeevents/validators.go @@ -10,6 +10,46 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpPutActionInteractions struct { +} + +func (*validateOpPutActionInteractions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutActionInteractions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutActionInteractionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutActionInteractionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutActions struct { +} + +func (*validateOpPutActions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutActions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutActionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutActionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpPutEvents struct { } @@ -70,6 +110,14 @@ func (m *validateOpPutUsers) HandleInitialize(ctx context.Context, in middleware return next.HandleInitialize(ctx, in) } +func addOpPutActionInteractionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutActionInteractions{}, middleware.After) +} + +func addOpPutActionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutActions{}, middleware.After) +} + func addOpPutEventsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutEvents{}, middleware.After) } @@ -82,6 +130,79 @@ func addOpPutUsersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutUsers{}, middleware.After) } +func validateAction(v *types.Action) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Action"} + if v.ActionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ActionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateActionInteraction(v *types.ActionInteraction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ActionInteraction"} + if v.ActionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ActionId")) + } + if v.SessionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SessionId")) + } + if v.Timestamp == nil { + invalidParams.Add(smithy.NewErrParamRequired("Timestamp")) + } + if v.EventType == nil { + invalidParams.Add(smithy.NewErrParamRequired("EventType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateActionInteractionsList(v []types.ActionInteraction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ActionInteractionsList"} + for i := range v { + if err := validateActionInteraction(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateActionList(v []types.Action) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ActionList"} + for i := range v { + if err := validateAction(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateEvent(v *types.Event) error { if v == nil { return nil @@ -201,6 +322,50 @@ func validateUserList(v []types.User) error { } } +func validateOpPutActionInteractionsInput(v *PutActionInteractionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutActionInteractionsInput"} + if v.TrackingId == nil { + invalidParams.Add(smithy.NewErrParamRequired("TrackingId")) + } + if v.ActionInteractions == nil { + invalidParams.Add(smithy.NewErrParamRequired("ActionInteractions")) + } else if v.ActionInteractions != nil { + if err := validateActionInteractionsList(v.ActionInteractions); err != nil { + invalidParams.AddNested("ActionInteractions", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutActionsInput(v *PutActionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutActionsInput"} + if v.DatasetArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DatasetArn")) + } + if v.Actions == nil { + invalidParams.Add(smithy.NewErrParamRequired("Actions")) + } else if v.Actions != nil { + if err := validateActionList(v.Actions); err != nil { + invalidParams.AddNested("Actions", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpPutEventsInput(v *PutEventsInput) error { if v == nil { return nil diff --git a/service/personalizeruntime/api_op_GetActionRecommendations.go b/service/personalizeruntime/api_op_GetActionRecommendations.go new file mode 100644 index 00000000000..efc07d3a448 --- /dev/null +++ b/service/personalizeruntime/api_op_GetActionRecommendations.go @@ -0,0 +1,170 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package personalizeruntime + +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/personalizeruntime/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of recommended actions in sorted in descending order by +// prediction score. Use the GetActionRecommendations API if you have a custom +// campaign that deploys a solution version trained with a PERSONALIZED_ACTIONS +// recipe. For more information about PERSONALIZED_ACTIONS recipes, see +// PERSONALIZED_ACTIONS recipes (https://docs.aws.amazon.com/personalize/latest/dg/nexts-best-action-recipes.html) +// . For more information about getting action recommendations, see Getting action +// recommendations (https://docs.aws.amazon.com/personalize/latest/dg/get-action-recommendations.html) +// . +func (c *Client) GetActionRecommendations(ctx context.Context, params *GetActionRecommendationsInput, optFns ...func(*Options)) (*GetActionRecommendationsOutput, error) { + if params == nil { + params = &GetActionRecommendationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetActionRecommendations", params, optFns, c.addOperationGetActionRecommendationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetActionRecommendationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetActionRecommendationsInput struct { + + // The Amazon Resource Name (ARN) of the campaign to use for getting action + // recommendations. This campaign must deploy a solution version trained with a + // PERSONALIZED_ACTIONS recipe. + CampaignArn *string + + // The ARN of the filter to apply to the returned recommendations. For more + // information, see Filtering Recommendations (https://docs.aws.amazon.com/personalize/latest/dg/filter.html) + // . When using this parameter, be sure the filter resource is ACTIVE . + FilterArn *string + + // The values to use when filtering recommendations. For each placeholder + // parameter in your filter expression, provide the parameter name (in matching + // case) as a key and the filter value(s) as the corresponding value. Separate + // multiple values for one parameter with a comma. For filter expressions that use + // an INCLUDE element to include actions, you must provide values for all + // parameters that are defined in the expression. For filters with expressions that + // use an EXCLUDE element to exclude actions, you can omit the filter-values . In + // this case, Amazon Personalize doesn't use that portion of the expression to + // filter recommendations. For more information, see Filtering recommendations and + // user segments (https://docs.aws.amazon.com/personalize/latest/dg/filter.html) . + FilterValues map[string]string + + // The number of results to return. The default is 5. The maximum is 100. + NumResults int32 + + // The user ID of the user to provide action recommendations for. + UserId *string + + noSmithyDocumentSerde +} + +type GetActionRecommendationsOutput struct { + + // A list of action recommendations sorted in descending order by prediction + // score. There can be a maximum of 100 actions in the list. For information about + // action scores, see How action recommendation scoring works (https://docs.aws.amazon.com/personalize/latest/dg/how-action-recommendation-scoring-works.html) + // . + ActionList []types.PredictedAction + + // The ID of the recommendation. + RecommendationId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetActionRecommendationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetActionRecommendations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetActionRecommendations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetActionRecommendations"); 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_opGetActionRecommendations(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_opGetActionRecommendations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetActionRecommendations", + } +} diff --git a/service/personalizeruntime/api_op_GetPersonalizedRanking.go b/service/personalizeruntime/api_op_GetPersonalizedRanking.go index effb540f509..aa32de59d19 100644 --- a/service/personalizeruntime/api_op_GetPersonalizedRanking.go +++ b/service/personalizeruntime/api_op_GetPersonalizedRanking.go @@ -40,7 +40,8 @@ type GetPersonalizedRankingInput struct { CampaignArn *string // A list of items (by itemId ) to rank. If an item was not included in the - // training dataset, the item is appended to the end of the reranked list. The + // training dataset, the item is appended to the end of the reranked list. If you + // are including metadata in recommendations, the maximum is 50. Otherwise, the // maximum is 500. // // This member is required. @@ -75,6 +76,15 @@ type GetPersonalizedRankingInput struct { // . FilterValues map[string]string + // If you enabled metadata in recommendations when you created or updated the + // campaign, specify metadata columns from your Items dataset to include in the + // personalized ranking. The map key is ITEMS and the value is a list of column + // names from your Items dataset. The maximum number of columns you can provide is + // 10. For information about enabling metadata for a campaign, see Enabling + // metadata in recommendations for a campaign (https://docs.aws.amazon.com/personalize/latest/dg/create-campaign-return-metadata.html) + // . + MetadataColumns map[string][]string + noSmithyDocumentSerde } diff --git a/service/personalizeruntime/api_op_GetRecommendations.go b/service/personalizeruntime/api_op_GetRecommendations.go index f45766b4a1d..a5deb52f6c3 100644 --- a/service/personalizeruntime/api_op_GetRecommendations.go +++ b/service/personalizeruntime/api_op_GetRecommendations.go @@ -72,7 +72,19 @@ type GetRecommendationsInput struct { // type. ItemId *string - // The number of results to return. The default is 25. The maximum is 500. + // If you enabled metadata in recommendations when you created or updated the + // campaign or recommender, specify the metadata columns from your Items dataset to + // include in item recommendations. The map key is ITEMS and the value is a list + // of column names from your Items dataset. The maximum number of columns you can + // provide is 10. For information about enabling metadata for a campaign, see + // Enabling metadata in recommendations for a campaign (https://docs.aws.amazon.com/personalize/latest/dg/create-campaign-return-metadata.html) + // . For information about enabling metadata for a recommender, see Enabling + // metadata in recommendations for a recommender (https://docs.aws.amazon.com/personalize/latest/dg/create-recommender-return-metadata.html) + // . + MetadataColumns map[string][]string + + // The number of results to return. The default is 25. If you are including + // metadata in recommendations, the maximum is 50. Otherwise, the maximum is 500. NumResults int32 // The promotions to apply to the recommendation request. A promotion defines diff --git a/service/personalizeruntime/deserializers.go b/service/personalizeruntime/deserializers.go index 710e89c1083..f3f70224952 100644 --- a/service/personalizeruntime/deserializers.go +++ b/service/personalizeruntime/deserializers.go @@ -19,6 +19,165 @@ import ( "strings" ) +type awsRestjson1_deserializeOpGetActionRecommendations struct { +} + +func (*awsRestjson1_deserializeOpGetActionRecommendations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetActionRecommendations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetActionRecommendations(response, &metadata) + } + output := &GetActionRecommendationsOutput{} + 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_deserializeOpDocumentGetActionRecommendationsOutput(&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_deserializeOpErrorGetActionRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetActionRecommendationsOutput(v **GetActionRecommendationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetActionRecommendationsOutput + if *v == nil { + sv = &GetActionRecommendationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "actionList": + if err := awsRestjson1_deserializeDocumentActionList(&sv.ActionList, value); err != nil { + return err + } + + case "recommendationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationID to be of type string, got %T instead", value) + } + sv.RecommendationId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpGetPersonalizedRanking struct { } @@ -409,6 +568,40 @@ func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp return output } +func awsRestjson1_deserializeDocumentActionList(v *[]types.PredictedAction, 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.PredictedAction + if *v == nil { + cv = []types.PredictedAction{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PredictedAction + destAddr := &col + if err := awsRestjson1_deserializeDocumentPredictedAction(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentInvalidInputException(v **types.InvalidInputException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -483,6 +676,116 @@ func awsRestjson1_deserializeDocumentItemList(v *[]types.PredictedItem, value in return nil } +func awsRestjson1_deserializeDocumentMetadata(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 ColumnValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentPredictedAction(v **types.PredictedAction, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PredictedAction + if *v == nil { + sv = &types.PredictedAction{} + } 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 "score": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Score = 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.Score = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Score to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentPredictedItem(v **types.PredictedItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -514,6 +817,11 @@ func awsRestjson1_deserializeDocumentPredictedItem(v **types.PredictedItem, valu sv.ItemId = ptr.String(jtv) } + case "metadata": + if err := awsRestjson1_deserializeDocumentMetadata(&sv.Metadata, value); err != nil { + return err + } + case "promotionName": if value != nil { jtv, ok := value.(string) diff --git a/service/personalizeruntime/generated.json b/service/personalizeruntime/generated.json index 723b3a20c34..a1eb543ecf1 100644 --- a/service/personalizeruntime/generated.json +++ b/service/personalizeruntime/generated.json @@ -9,6 +9,7 @@ "files": [ "api_client.go", "api_client_test.go", + "api_op_GetActionRecommendations.go", "api_op_GetPersonalizedRanking.go", "api_op_GetRecommendations.go", "auth.go", diff --git a/service/personalizeruntime/serializers.go b/service/personalizeruntime/serializers.go index b91e2f16542..9591c25bea3 100644 --- a/service/personalizeruntime/serializers.go +++ b/service/personalizeruntime/serializers.go @@ -14,6 +14,103 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +type awsRestjson1_serializeOpGetActionRecommendations struct { +} + +func (*awsRestjson1_serializeOpGetActionRecommendations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetActionRecommendations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetActionRecommendationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/action-recommendations") + 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_serializeOpDocumentGetActionRecommendationsInput(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_serializeOpHttpBindingsGetActionRecommendationsInput(v *GetActionRecommendationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetActionRecommendationsInput(v *GetActionRecommendationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CampaignArn != nil { + ok := object.Key("campaignArn") + ok.String(*v.CampaignArn) + } + + if v.FilterArn != nil { + ok := object.Key("filterArn") + ok.String(*v.FilterArn) + } + + if v.FilterValues != nil { + ok := object.Key("filterValues") + if err := awsRestjson1_serializeDocumentFilterValues(v.FilterValues, ok); err != nil { + return err + } + } + + if v.NumResults != 0 { + ok := object.Key("numResults") + ok.Integer(v.NumResults) + } + + if v.UserId != nil { + ok := object.Key("userId") + ok.String(*v.UserId) + } + + return nil +} + type awsRestjson1_serializeOpGetPersonalizedRanking struct { } @@ -112,6 +209,13 @@ func awsRestjson1_serializeOpDocumentGetPersonalizedRankingInput(v *GetPersonali } } + if v.MetadataColumns != nil { + ok := object.Key("metadataColumns") + if err := awsRestjson1_serializeDocumentMetadataColumns(v.MetadataColumns, ok); err != nil { + return err + } + } + if v.UserId != nil { ok := object.Key("userId") ok.String(*v.UserId) @@ -216,6 +320,13 @@ func awsRestjson1_serializeOpDocumentGetRecommendationsInput(v *GetRecommendatio ok.String(*v.ItemId) } + if v.MetadataColumns != nil { + ok := object.Key("metadataColumns") + if err := awsRestjson1_serializeDocumentMetadataColumns(v.MetadataColumns, ok); err != nil { + return err + } + } + if v.NumResults != 0 { ok := object.Key("numResults") ok.Integer(v.NumResults) @@ -241,6 +352,17 @@ func awsRestjson1_serializeOpDocumentGetRecommendationsInput(v *GetRecommendatio return nil } +func awsRestjson1_serializeDocumentColumnNamesList(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_serializeDocumentContext(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -274,6 +396,22 @@ func awsRestjson1_serializeDocumentInputList(v []string, value smithyjson.Value) return nil } +func awsRestjson1_serializeDocumentMetadataColumns(v map[string][]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + if vv := v[key]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentColumnNamesList(v[key], om); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentPromotion(v *types.Promotion, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/personalizeruntime/types/types.go b/service/personalizeruntime/types/types.go index 634fb168592..e8f233726d2 100644 --- a/service/personalizeruntime/types/types.go +++ b/service/personalizeruntime/types/types.go @@ -6,12 +6,29 @@ import ( smithydocument "github.com/aws/smithy-go/document" ) +// An object that identifies an action. The API returns a list of PredictedAction s. +type PredictedAction struct { + + // The ID of the recommended action. + ActionId *string + + // The score of the recommended action. For information about action scores, see + // How action recommendation scoring works (https://docs.aws.amazon.com/personalize/latest/dg/how-action-recommendation-scoring-works.html) + // . + Score *float64 + + noSmithyDocumentSerde +} + // An object that identifies an item. The and APIs return a list of PredictedItem s. type PredictedItem struct { // The recommended item ID. ItemId *string + // Metadata about the item from your Items dataset. + Metadata map[string]string + // The name of the promotion that included the predicted item. PromotionName *string diff --git a/service/quicksight/api_op_DeleteIdentityPropagationConfig.go b/service/quicksight/api_op_DeleteIdentityPropagationConfig.go new file mode 100644 index 00000000000..c7164bc2572 --- /dev/null +++ b/service/quicksight/api_op_DeleteIdentityPropagationConfig.go @@ -0,0 +1,150 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package quicksight + +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/quicksight/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes all access scopes and authorized targets that are associated with a +// service from the Amazon QuickSight IAM Identity Center application. This +// operation is only supported for Amazon QuickSight accounts that use IAM Identity +// Center. +func (c *Client) DeleteIdentityPropagationConfig(ctx context.Context, params *DeleteIdentityPropagationConfigInput, optFns ...func(*Options)) (*DeleteIdentityPropagationConfigOutput, error) { + if params == nil { + params = &DeleteIdentityPropagationConfigInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteIdentityPropagationConfig", params, optFns, c.addOperationDeleteIdentityPropagationConfigMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteIdentityPropagationConfigOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteIdentityPropagationConfigInput struct { + + // The ID of the Amazon Web Services account that you want to delete an identity + // propagation configuration from. + // + // This member is required. + AwsAccountId *string + + // The name of the Amazon Web Services service that you want to delete the + // associated access scopes and authorized targets from. + // + // This member is required. + Service types.ServiceType + + noSmithyDocumentSerde +} + +type DeleteIdentityPropagationConfigOutput struct { + + // The Amazon Web Services request ID for this operation. + RequestId *string + + // The HTTP status of the request. + Status int32 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteIdentityPropagationConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteIdentityPropagationConfig{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteIdentityPropagationConfig{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteIdentityPropagationConfig"); 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 = addOpDeleteIdentityPropagationConfigValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIdentityPropagationConfig(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_opDeleteIdentityPropagationConfig(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteIdentityPropagationConfig", + } +} diff --git a/service/quicksight/api_op_ListIdentityPropagationConfigs.go b/service/quicksight/api_op_ListIdentityPropagationConfigs.go new file mode 100644 index 00000000000..66cdb40926b --- /dev/null +++ b/service/quicksight/api_op_ListIdentityPropagationConfigs.go @@ -0,0 +1,156 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package quicksight + +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/quicksight/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all services and authorized targets that the Amazon QuickSight IAM +// Identity Center application can access. This operation is only supported for +// Amazon QuickSight accounts that use IAM Identity Center. +func (c *Client) ListIdentityPropagationConfigs(ctx context.Context, params *ListIdentityPropagationConfigsInput, optFns ...func(*Options)) (*ListIdentityPropagationConfigsOutput, error) { + if params == nil { + params = &ListIdentityPropagationConfigsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListIdentityPropagationConfigs", params, optFns, c.addOperationListIdentityPropagationConfigsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListIdentityPropagationConfigsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListIdentityPropagationConfigsInput struct { + + // The ID of the Amazon Web Services account that contain the identity propagation + // configurations of. + // + // This member is required. + AwsAccountId *string + + // The maximum number of results to be returned. + MaxResults *int32 + + // The token for the next set of results, or null if there are no more results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListIdentityPropagationConfigsOutput struct { + + // The token for the next set of results, or null if there are no more results. + NextToken *string + + // The Amazon Web Services request ID for this operation. + RequestId *string + + // A list of services and their authorized targets that the Amazon QuickSight IAM + // Identity Center application can access. + Services []types.AuthorizedTargetsByService + + // The HTTP status of the request. + Status int32 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListIdentityPropagationConfigsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListIdentityPropagationConfigs{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListIdentityPropagationConfigs{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListIdentityPropagationConfigs"); 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 = addOpListIdentityPropagationConfigsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListIdentityPropagationConfigs(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_opListIdentityPropagationConfigs(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListIdentityPropagationConfigs", + } +} diff --git a/service/quicksight/api_op_UpdateIdentityPropagationConfig.go b/service/quicksight/api_op_UpdateIdentityPropagationConfig.go new file mode 100644 index 00000000000..0f54394e077 --- /dev/null +++ b/service/quicksight/api_op_UpdateIdentityPropagationConfig.go @@ -0,0 +1,153 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package quicksight + +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/quicksight/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds or updates services and authorized targets to configure what the Amazon +// QuickSight IAM Identity Center application can access. This operation is only +// supported for Amazon QuickSight accounts using IAM Identity Center +func (c *Client) UpdateIdentityPropagationConfig(ctx context.Context, params *UpdateIdentityPropagationConfigInput, optFns ...func(*Options)) (*UpdateIdentityPropagationConfigOutput, error) { + if params == nil { + params = &UpdateIdentityPropagationConfigInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateIdentityPropagationConfig", params, optFns, c.addOperationUpdateIdentityPropagationConfigMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateIdentityPropagationConfigOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateIdentityPropagationConfigInput struct { + + // The ID of the Amazon Web Services account that contains the identity + // propagation configuration that you want to update. + // + // This member is required. + AwsAccountId *string + + // The name of the Amazon Web Services service that contains the authorized + // targets that you want to add or update. + // + // This member is required. + Service types.ServiceType + + // Specifies a list of application ARNs that represent the authorized targets for + // a service. + AuthorizedTargets []string + + noSmithyDocumentSerde +} + +type UpdateIdentityPropagationConfigOutput struct { + + // The Amazon Web Services request ID for this operation. + RequestId *string + + // The HTTP status of the request. + Status int32 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateIdentityPropagationConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateIdentityPropagationConfig{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateIdentityPropagationConfig{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateIdentityPropagationConfig"); 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 = addOpUpdateIdentityPropagationConfigValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateIdentityPropagationConfig(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_opUpdateIdentityPropagationConfig(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateIdentityPropagationConfig", + } +} diff --git a/service/quicksight/deserializers.go b/service/quicksight/deserializers.go index 69f0ab9739d..5a0c879e70f 100644 --- a/service/quicksight/deserializers.go +++ b/service/quicksight/deserializers.go @@ -7113,6 +7113,183 @@ func awsRestjson1_deserializeOpDocumentDeleteIAMPolicyAssignmentOutput(v **Delet return nil } +type awsRestjson1_deserializeOpDeleteIdentityPropagationConfig struct { +} + +func (*awsRestjson1_deserializeOpDeleteIdentityPropagationConfig) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteIdentityPropagationConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteIdentityPropagationConfig(response, &metadata) + } + output := &DeleteIdentityPropagationConfigOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsDeleteIdentityPropagationConfigOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentDeleteIdentityPropagationConfigOutput(&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_deserializeOpErrorDeleteIdentityPropagationConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsDeleteIdentityPropagationConfigOutput(v *DeleteIdentityPropagationConfigOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + v.Status = int32(response.StatusCode) + + return nil +} +func awsRestjson1_deserializeOpDocumentDeleteIdentityPropagationConfigOutput(v **DeleteIdentityPropagationConfigOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteIdentityPropagationConfigOutput + if *v == nil { + sv = &DeleteIdentityPropagationConfigOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RequestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpDeleteNamespace struct { } @@ -21522,6 +21699,197 @@ func awsRestjson1_deserializeOpDocumentListIAMPolicyAssignmentsForUserOutput(v * return nil } +type awsRestjson1_deserializeOpListIdentityPropagationConfigs struct { +} + +func (*awsRestjson1_deserializeOpListIdentityPropagationConfigs) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListIdentityPropagationConfigs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListIdentityPropagationConfigs(response, &metadata) + } + output := &ListIdentityPropagationConfigsOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsListIdentityPropagationConfigsOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListIdentityPropagationConfigsOutput(&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_deserializeOpErrorListIdentityPropagationConfigs(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsListIdentityPropagationConfigsOutput(v *ListIdentityPropagationConfigsOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + v.Status = int32(response.StatusCode) + + return nil +} +func awsRestjson1_deserializeOpDocumentListIdentityPropagationConfigsOutput(v **ListIdentityPropagationConfigsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListIdentityPropagationConfigsOutput + if *v == nil { + sv = &ListIdentityPropagationConfigsOutput{} + } 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 "RequestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + case "Services": + if err := awsRestjson1_deserializeDocumentAuthorizedTargetsByServices(&sv.Services, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListIngestions struct { } @@ -30100,7 +30468,195 @@ func (m *awsRestjson1_deserializeOpUpdateGroup) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateGroupOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateGroupOutput(&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_deserializeOpErrorUpdateGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("PreconditionNotMetException", errorCode): + return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ResourceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsUpdateGroupOutput(v *UpdateGroupOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + v.Status = int32(response.StatusCode) + + return nil +} +func awsRestjson1_deserializeOpDocumentUpdateGroupOutput(v **UpdateGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateGroupOutput + if *v == nil { + sv = &UpdateGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Group": + if err := awsRestjson1_deserializeDocumentGroup(&sv.Group, value); err != nil { + return err + } + + case "RequestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateIAMPolicyAssignment struct { +} + +func (*awsRestjson1_deserializeOpUpdateIAMPolicyAssignment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateIAMPolicyAssignment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateIAMPolicyAssignment(response, &metadata) + } + output := &UpdateIAMPolicyAssignmentOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsUpdateIAMPolicyAssignmentOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentUpdateIAMPolicyAssignmentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -30113,7 +30669,7 @@ func (m *awsRestjson1_deserializeOpUpdateGroup) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateIAMPolicyAssignment(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -30157,21 +30713,21 @@ func awsRestjson1_deserializeOpErrorUpdateGroup(response *smithyhttp.Response, m case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConcurrentUpdatingException", errorCode): + return awsRestjson1_deserializeErrorConcurrentUpdatingException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) - case strings.EqualFold("PreconditionNotMetException", errorCode): - return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) + case strings.EqualFold("ResourceExistsException", errorCode): + return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ResourceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -30185,7 +30741,7 @@ func awsRestjson1_deserializeOpErrorUpdateGroup(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpHttpBindingsUpdateGroupOutput(v *UpdateGroupOutput, response *smithyhttp.Response) error { +func awsRestjson1_deserializeOpHttpBindingsUpdateIAMPolicyAssignmentOutput(v *UpdateIAMPolicyAssignmentOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -30194,7 +30750,7 @@ func awsRestjson1_deserializeOpHttpBindingsUpdateGroupOutput(v *UpdateGroupOutpu return nil } -func awsRestjson1_deserializeOpDocumentUpdateGroupOutput(v **UpdateGroupOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateIAMPolicyAssignmentOutput(v **UpdateIAMPolicyAssignmentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -30207,20 +30763,56 @@ func awsRestjson1_deserializeOpDocumentUpdateGroupOutput(v **UpdateGroupOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateGroupOutput + var sv *UpdateIAMPolicyAssignmentOutput if *v == nil { - sv = &UpdateGroupOutput{} + sv = &UpdateIAMPolicyAssignmentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Group": - if err := awsRestjson1_deserializeDocumentGroup(&sv.Group, value); err != nil { + case "AssignmentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AssignmentId = ptr.String(jtv) + } + + case "AssignmentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IAMPolicyAssignmentName to be of type string, got %T instead", value) + } + sv.AssignmentName = ptr.String(jtv) + } + + case "AssignmentStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssignmentStatus to be of type string, got %T instead", value) + } + sv.AssignmentStatus = types.AssignmentStatus(jtv) + } + + case "Identities": + if err := awsRestjson1_deserializeDocumentIdentityMap(&sv.Identities, value); err != nil { return err } + case "PolicyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.PolicyArn = ptr.String(jtv) + } + case "RequestId": if value != nil { jtv, ok := value.(string) @@ -30239,14 +30831,14 @@ func awsRestjson1_deserializeOpDocumentUpdateGroupOutput(v **UpdateGroupOutput, return nil } -type awsRestjson1_deserializeOpUpdateIAMPolicyAssignment struct { +type awsRestjson1_deserializeOpUpdateIdentityPropagationConfig struct { } -func (*awsRestjson1_deserializeOpUpdateIAMPolicyAssignment) ID() string { +func (*awsRestjson1_deserializeOpUpdateIdentityPropagationConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateIAMPolicyAssignment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateIdentityPropagationConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -30260,12 +30852,12 @@ func (m *awsRestjson1_deserializeOpUpdateIAMPolicyAssignment) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateIAMPolicyAssignment(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateIdentityPropagationConfig(response, &metadata) } - output := &UpdateIAMPolicyAssignmentOutput{} + output := &UpdateIdentityPropagationConfigOutput{} out.Result = output - err = awsRestjson1_deserializeOpHttpBindingsUpdateIAMPolicyAssignmentOutput(output, response) + err = awsRestjson1_deserializeOpHttpBindingsUpdateIdentityPropagationConfigOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -30288,7 +30880,7 @@ func (m *awsRestjson1_deserializeOpUpdateIAMPolicyAssignment) HandleDeserialize( return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateIAMPolicyAssignmentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateIdentityPropagationConfigOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -30301,7 +30893,7 @@ func (m *awsRestjson1_deserializeOpUpdateIAMPolicyAssignment) HandleDeserialize( return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateIAMPolicyAssignment(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateIdentityPropagationConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -30345,18 +30937,12 @@ func awsRestjson1_deserializeOpErrorUpdateIAMPolicyAssignment(response *smithyht case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConcurrentUpdatingException", errorCode): - return awsRestjson1_deserializeErrorConcurrentUpdatingException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) - case strings.EqualFold("ResourceExistsException", errorCode): - return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -30373,7 +30959,7 @@ func awsRestjson1_deserializeOpErrorUpdateIAMPolicyAssignment(response *smithyht } } -func awsRestjson1_deserializeOpHttpBindingsUpdateIAMPolicyAssignmentOutput(v *UpdateIAMPolicyAssignmentOutput, response *smithyhttp.Response) error { +func awsRestjson1_deserializeOpHttpBindingsUpdateIdentityPropagationConfigOutput(v *UpdateIdentityPropagationConfigOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -30382,7 +30968,7 @@ func awsRestjson1_deserializeOpHttpBindingsUpdateIAMPolicyAssignmentOutput(v *Up return nil } -func awsRestjson1_deserializeOpDocumentUpdateIAMPolicyAssignmentOutput(v **UpdateIAMPolicyAssignmentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateIdentityPropagationConfigOutput(v **UpdateIdentityPropagationConfigOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -30395,56 +30981,15 @@ func awsRestjson1_deserializeOpDocumentUpdateIAMPolicyAssignmentOutput(v **Updat return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateIAMPolicyAssignmentOutput + var sv *UpdateIdentityPropagationConfigOutput if *v == nil { - sv = &UpdateIAMPolicyAssignmentOutput{} + sv = &UpdateIdentityPropagationConfigOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "AssignmentId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AssignmentId = ptr.String(jtv) - } - - case "AssignmentName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected IAMPolicyAssignmentName to be of type string, got %T instead", value) - } - sv.AssignmentName = ptr.String(jtv) - } - - case "AssignmentStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AssignmentStatus to be of type string, got %T instead", value) - } - sv.AssignmentStatus = types.AssignmentStatus(jtv) - } - - case "Identities": - if err := awsRestjson1_deserializeDocumentIdentityMap(&sv.Identities, value); err != nil { - return err - } - - case "PolicyArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.PolicyArn = ptr.String(jtv) - } - case "RequestId": if value != nil { jtv, ok := value.(string) @@ -39541,6 +40086,121 @@ func awsRestjson1_deserializeDocumentAuroraPostgreSqlParameters(v **types.Aurora return nil } +func awsRestjson1_deserializeDocumentAuthorizedTargetsByService(v **types.AuthorizedTargetsByService, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AuthorizedTargetsByService + if *v == nil { + sv = &types.AuthorizedTargetsByService{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AuthorizedTargets": + if err := awsRestjson1_deserializeDocumentAuthorizedTargetsList(&sv.AuthorizedTargets, value); err != nil { + return err + } + + case "Service": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceType to be of type string, got %T instead", value) + } + sv.Service = types.ServiceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAuthorizedTargetsByServices(v *[]types.AuthorizedTargetsByService, 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.AuthorizedTargetsByService + if *v == nil { + cv = []types.AuthorizedTargetsByService{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AuthorizedTargetsByService + destAddr := &col + if err := awsRestjson1_deserializeDocumentAuthorizedTargetsByService(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAuthorizedTargetsList(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_deserializeDocumentAuthorSpecifiedAggregations(v *[]types.AuthorSpecifiedAggregation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -58222,6 +58882,46 @@ func awsRestjson1_deserializeDocumentIAMPolicyAssignmentSummaryList(v *[]types.I return nil } +func awsRestjson1_deserializeDocumentIdentityCenterConfiguration(v **types.IdentityCenterConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.IdentityCenterConfiguration + if *v == nil { + sv = &types.IdentityCenterConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EnableIdentityPropagation": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.EnableIdentityPropagation = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentIdentityMap(v *map[string][]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -68573,6 +69273,11 @@ func awsRestjson1_deserializeDocumentRedshiftParameters(v **types.RedshiftParame return err } + case "IdentityCenterConfiguration": + if err := awsRestjson1_deserializeDocumentIdentityCenterConfiguration(&sv.IdentityCenterConfiguration, value); err != nil { + return err + } + case "Port": if value != nil { jtv, ok := value.(json.Number) diff --git a/service/quicksight/generated.json b/service/quicksight/generated.json index d5bb70cfaff..df85f216ae6 100644 --- a/service/quicksight/generated.json +++ b/service/quicksight/generated.json @@ -44,6 +44,7 @@ "api_op_DeleteGroup.go", "api_op_DeleteGroupMembership.go", "api_op_DeleteIAMPolicyAssignment.go", + "api_op_DeleteIdentityPropagationConfig.go", "api_op_DeleteNamespace.go", "api_op_DeleteRefreshSchedule.go", "api_op_DeleteRoleCustomPermission.go", @@ -116,6 +117,7 @@ "api_op_ListGroups.go", "api_op_ListIAMPolicyAssignments.go", "api_op_ListIAMPolicyAssignmentsForUser.go", + "api_op_ListIdentityPropagationConfigs.go", "api_op_ListIngestions.go", "api_op_ListNamespaces.go", "api_op_ListRefreshSchedules.go", @@ -161,6 +163,7 @@ "api_op_UpdateFolderPermissions.go", "api_op_UpdateGroup.go", "api_op_UpdateIAMPolicyAssignment.go", + "api_op_UpdateIdentityPropagationConfig.go", "api_op_UpdateIpRestriction.go", "api_op_UpdatePublicSharingSettings.go", "api_op_UpdateRefreshSchedule.go", diff --git a/service/quicksight/serializers.go b/service/quicksight/serializers.go index 658742e03de..695108adf8c 100644 --- a/service/quicksight/serializers.go +++ b/service/quicksight/serializers.go @@ -3687,6 +3687,80 @@ func awsRestjson1_serializeOpHttpBindingsDeleteIAMPolicyAssignmentInput(v *Delet return nil } +type awsRestjson1_serializeOpDeleteIdentityPropagationConfig struct { +} + +func (*awsRestjson1_serializeOpDeleteIdentityPropagationConfig) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteIdentityPropagationConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteIdentityPropagationConfigInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/accounts/{AwsAccountId}/identity-propagation-config/{Service}") + 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_serializeOpHttpBindingsDeleteIdentityPropagationConfigInput(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_serializeOpHttpBindingsDeleteIdentityPropagationConfigInput(v *DeleteIdentityPropagationConfigInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AwsAccountId == nil || len(*v.AwsAccountId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AwsAccountId must not be empty")} + } + if v.AwsAccountId != nil { + if err := encoder.SetURI("AwsAccountId").String(*v.AwsAccountId); err != nil { + return err + } + } + + if len(v.Service) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Service must not be empty")} + } + if len(v.Service) > 0 { + if err := encoder.SetURI("Service").String(string(v.Service)); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteNamespace struct { } @@ -9446,6 +9520,79 @@ func awsRestjson1_serializeOpHttpBindingsListIAMPolicyAssignmentsForUserInput(v return nil } +type awsRestjson1_serializeOpListIdentityPropagationConfigs struct { +} + +func (*awsRestjson1_serializeOpListIdentityPropagationConfigs) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListIdentityPropagationConfigs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListIdentityPropagationConfigsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/accounts/{AwsAccountId}/identity-propagation-config") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListIdentityPropagationConfigsInput(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_serializeOpHttpBindingsListIdentityPropagationConfigsInput(v *ListIdentityPropagationConfigsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AwsAccountId == nil || len(*v.AwsAccountId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AwsAccountId must not be empty")} + } + if v.AwsAccountId != nil { + if err := encoder.SetURI("AwsAccountId").String(*v.AwsAccountId); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListIngestions struct { } @@ -13862,6 +14009,105 @@ func awsRestjson1_serializeOpDocumentUpdateIAMPolicyAssignmentInput(v *UpdateIAM return nil } +type awsRestjson1_serializeOpUpdateIdentityPropagationConfig struct { +} + +func (*awsRestjson1_serializeOpUpdateIdentityPropagationConfig) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateIdentityPropagationConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateIdentityPropagationConfigInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/accounts/{AwsAccountId}/identity-propagation-config/{Service}") + 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_serializeOpHttpBindingsUpdateIdentityPropagationConfigInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateIdentityPropagationConfigInput(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_serializeOpHttpBindingsUpdateIdentityPropagationConfigInput(v *UpdateIdentityPropagationConfigInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AwsAccountId == nil || len(*v.AwsAccountId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AwsAccountId must not be empty")} + } + if v.AwsAccountId != nil { + if err := encoder.SetURI("AwsAccountId").String(*v.AwsAccountId); err != nil { + return err + } + } + + if len(v.Service) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Service must not be empty")} + } + if len(v.Service) > 0 { + if err := encoder.SetURI("Service").String(string(v.Service)); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateIdentityPropagationConfigInput(v *UpdateIdentityPropagationConfigInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AuthorizedTargets != nil { + ok := object.Key("AuthorizedTargets") + if err := awsRestjson1_serializeDocumentAuthorizedTargetsList(v.AuthorizedTargets, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpUpdateIpRestriction struct { } @@ -17410,6 +17656,17 @@ func awsRestjson1_serializeDocumentAuroraPostgreSqlParameters(v *types.AuroraPos return nil } +func awsRestjson1_serializeDocumentAuthorizedTargetsList(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_serializeDocumentAuthorSpecifiedAggregations(v []types.AuthorSpecifiedAggregation, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -25710,6 +25967,18 @@ func awsRestjson1_serializeDocumentHistogramVisual(v *types.HistogramVisual, val return nil } +func awsRestjson1_serializeDocumentIdentityCenterConfiguration(v *types.IdentityCenterConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EnableIdentityPropagation != nil { + ok := object.Key("EnableIdentityPropagation") + ok.Boolean(*v.EnableIdentityPropagation) + } + + return nil +} + func awsRestjson1_serializeDocumentIdentityMap(v map[string][]string, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -30303,6 +30572,13 @@ func awsRestjson1_serializeDocumentRedshiftParameters(v *types.RedshiftParameter } } + if v.IdentityCenterConfiguration != nil { + ok := object.Key("IdentityCenterConfiguration") + if err := awsRestjson1_serializeDocumentIdentityCenterConfiguration(v.IdentityCenterConfiguration, ok); err != nil { + return err + } + } + if v.Port != 0 { ok := object.Key("Port") ok.Integer(v.Port) diff --git a/service/quicksight/types/enums.go b/service/quicksight/types/enums.go index 1721eed4251..15835ff9ade 100644 --- a/service/quicksight/types/enums.go +++ b/service/quicksight/types/enums.go @@ -3417,6 +3417,22 @@ func (SelectedTooltipType) Values() []SelectedTooltipType { } } +type ServiceType string + +// Enum values for ServiceType +const ( + ServiceTypeRedshift ServiceType = "REDSHIFT" +) + +// Values returns all known values for ServiceType. 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 (ServiceType) Values() []ServiceType { + return []ServiceType{ + "REDSHIFT", + } +} + type SharingModel string // Enum values for SharingModel diff --git a/service/quicksight/types/types.go b/service/quicksight/types/types.go index f06cfd3ce80..6733fa4ea5f 100644 --- a/service/quicksight/types/types.go +++ b/service/quicksight/types/types.go @@ -1451,6 +1451,19 @@ type AuroraPostgreSqlParameters struct { noSmithyDocumentSerde } +// The authorized targets that are associated with a service. +type AuthorizedTargetsByService struct { + + // Aist of authorized targets that are represented by IAM Identity Center + // application ARNs. + AuthorizedTargets []string + + // The name of the Amazon Web Services service. + Service ServiceType + + noSmithyDocumentSerde +} + // The parameters for IoT Analytics. type AwsIotAnalyticsParameters struct { @@ -7098,6 +7111,16 @@ type IAMPolicyAssignmentSummary struct { noSmithyDocumentSerde } +// The parameters for an IAM Identity Center configuration. +type IdentityCenterConfiguration struct { + + // A Boolean option that controls whether Trusted Identity Propagation should be + // used. + EnableIdentityPropagation *bool + + noSmithyDocumentSerde +} + // The incremental refresh configuration for a dataset. type IncrementalRefresh struct { @@ -10020,6 +10043,12 @@ type RedshiftParameters struct { // . IAMParameters *RedshiftIAMParameters + // An optional parameter that configures IAM Identity Center authentication to + // grant Amazon QuickSight access to your cluster. This parameter can only be + // specified if your Amazon QuickSight account is configured with IAM Identity + // Center. + IdentityCenterConfiguration *IdentityCenterConfiguration + // Port. This field can be blank if the ClusterId is provided. Port int32 diff --git a/service/quicksight/validators.go b/service/quicksight/validators.go index d1f28e2d8a0..09a1049fece 100644 --- a/service/quicksight/validators.go +++ b/service/quicksight/validators.go @@ -710,6 +710,26 @@ func (m *validateOpDeleteIAMPolicyAssignment) HandleInitialize(ctx context.Conte return next.HandleInitialize(ctx, in) } +type validateOpDeleteIdentityPropagationConfig struct { +} + +func (*validateOpDeleteIdentityPropagationConfig) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteIdentityPropagationConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteIdentityPropagationConfigInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteIdentityPropagationConfigInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteNamespace struct { } @@ -2150,6 +2170,26 @@ func (m *validateOpListIAMPolicyAssignments) HandleInitialize(ctx context.Contex return next.HandleInitialize(ctx, in) } +type validateOpListIdentityPropagationConfigs struct { +} + +func (*validateOpListIdentityPropagationConfigs) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListIdentityPropagationConfigs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListIdentityPropagationConfigsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListIdentityPropagationConfigsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListIngestions struct { } @@ -3050,6 +3090,26 @@ func (m *validateOpUpdateIAMPolicyAssignment) HandleInitialize(ctx context.Conte return next.HandleInitialize(ctx, in) } +type validateOpUpdateIdentityPropagationConfig struct { +} + +func (*validateOpUpdateIdentityPropagationConfig) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateIdentityPropagationConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateIdentityPropagationConfigInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateIdentityPropagationConfigInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateIpRestriction struct { } @@ -3490,6 +3550,10 @@ func addOpDeleteIAMPolicyAssignmentValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpDeleteIAMPolicyAssignment{}, middleware.After) } +func addOpDeleteIdentityPropagationConfigValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteIdentityPropagationConfig{}, middleware.After) +} + func addOpDeleteNamespaceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteNamespace{}, middleware.After) } @@ -3778,6 +3842,10 @@ func addOpListIAMPolicyAssignmentsValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpListIAMPolicyAssignments{}, middleware.After) } +func addOpListIdentityPropagationConfigsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListIdentityPropagationConfigs{}, middleware.After) +} + func addOpListIngestionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListIngestions{}, middleware.After) } @@ -3958,6 +4026,10 @@ func addOpUpdateIAMPolicyAssignmentValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpUpdateIAMPolicyAssignment{}, middleware.After) } +func addOpUpdateIdentityPropagationConfigValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateIdentityPropagationConfig{}, middleware.After) +} + func addOpUpdateIpRestrictionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateIpRestriction{}, middleware.After) } @@ -18393,6 +18465,24 @@ func validateOpDeleteIAMPolicyAssignmentInput(v *DeleteIAMPolicyAssignmentInput) } } +func validateOpDeleteIdentityPropagationConfigInput(v *DeleteIdentityPropagationConfigInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteIdentityPropagationConfigInput"} + if v.AwsAccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AwsAccountId")) + } + if len(v.Service) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Service")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteNamespaceInput(v *DeleteNamespaceInput) error { if v == nil { return nil @@ -19753,6 +19843,21 @@ func validateOpListIAMPolicyAssignmentsInput(v *ListIAMPolicyAssignmentsInput) e } } +func validateOpListIdentityPropagationConfigsInput(v *ListIdentityPropagationConfigsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListIdentityPropagationConfigsInput"} + if v.AwsAccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AwsAccountId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListIngestionsInput(v *ListIngestionsInput) error { if v == nil { return nil @@ -20815,6 +20920,24 @@ func validateOpUpdateIAMPolicyAssignmentInput(v *UpdateIAMPolicyAssignmentInput) } } +func validateOpUpdateIdentityPropagationConfigInput(v *UpdateIdentityPropagationConfigInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateIdentityPropagationConfigInput"} + if v.AwsAccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AwsAccountId")) + } + if len(v.Service) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Service")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateIpRestrictionInput(v *UpdateIpRestrictionInput) error { if v == nil { return nil diff --git a/service/rds/internal/endpoints/endpoints.go b/service/rds/internal/endpoints/endpoints.go index 8ce10ec3e81..b40bb3e519a 100644 --- a/service/rds/internal/endpoints/endpoints.go +++ b/service/rds/internal/endpoints/endpoints.go @@ -499,12 +499,96 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "rds-fips.us-iso-east-1", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds-fips.us-iso-west-1", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-iso-east-1", + }: endpoints.Endpoint{ + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-iso-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-iso-west-1", + }: endpoints.Endpoint{ + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-iso-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-west-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "us-iso-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + }, + endpoints.EndpointKey{ + Region: "us-iso-east-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-east-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "us-iso-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + }, + endpoints.EndpointKey{ + Region: "us-iso-west-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-west-1", + }, + Deprecated: aws.TrueTernary, + }, }, }, { @@ -528,9 +612,51 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "rds-fips.us-isob-east-1", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-isob-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-isob-east-1", + }: endpoints.Endpoint{ + CredentialScope: endpoints.CredentialScope{ + Region: "us-isob-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-isob-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-isob-east-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "us-isob-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-isob-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + }, + endpoints.EndpointKey{ + Region: "us-isob-east-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-isob-east-1", + }, + Deprecated: aws.TrueTernary, + }, }, }, { diff --git a/service/redshift/api_op_AssociateDataShareConsumer.go b/service/redshift/api_op_AssociateDataShareConsumer.go index a6a5a788c6d..095e71c14f4 100644 --- a/service/redshift/api_op_AssociateDataShareConsumer.go +++ b/service/redshift/api_op_AssociateDataShareConsumer.go @@ -38,6 +38,9 @@ type AssociateDataShareConsumerInput struct { // This member is required. DataShareArn *string + // If set to true, allows write operations for a datashare. + AllowWrites *bool + // A value that specifies whether the datashare is associated with the entire // account. AssociateEntireAccount *bool diff --git a/service/redshift/api_op_AuthorizeDataShare.go b/service/redshift/api_op_AuthorizeDataShare.go index f7716e5a78c..8cb732d4e9d 100644 --- a/service/redshift/api_op_AuthorizeDataShare.go +++ b/service/redshift/api_op_AuthorizeDataShare.go @@ -44,6 +44,9 @@ type AuthorizeDataShareInput struct { // This member is required. DataShareArn *string + // If set to true, allows write operations for a datashare. + AllowWrites *bool + noSmithyDocumentSerde } diff --git a/service/redshift/deserializers.go b/service/redshift/deserializers.go index 7ebfff83836..4a11e669424 100644 --- a/service/redshift/deserializers.go +++ b/service/redshift/deserializers.go @@ -26278,6 +26278,22 @@ func awsAwsquery_deserializeDocumentDataShareAssociation(v **types.DataShareAsso originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("ConsumerAcceptedWrites", 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 BooleanOptional to be of type *bool, got %T instead", val) + } + sv.ConsumerAcceptedWrites = ptr.Bool(xtv) + } + case strings.EqualFold("ConsumerIdentifier", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -26321,6 +26337,22 @@ func awsAwsquery_deserializeDocumentDataShareAssociation(v **types.DataShareAsso sv.CreatedDate = ptr.Time(t) } + case strings.EqualFold("ProducerAllowedWrites", 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 BooleanOptional to be of type *bool, got %T instead", val) + } + sv.ProducerAllowedWrites = ptr.Bool(xtv) + } + case strings.EqualFold("Status", t.Name.Local): val, err := decoder.Value() if err != nil { diff --git a/service/redshift/serializers.go b/service/redshift/serializers.go index bc4991518e8..994c5543acd 100644 --- a/service/redshift/serializers.go +++ b/service/redshift/serializers.go @@ -9086,6 +9086,11 @@ func awsAwsquery_serializeOpDocumentAssociateDataShareConsumerInput(v *Associate object := value.Object() _ = object + if v.AllowWrites != nil { + objectKey := object.Key("AllowWrites") + objectKey.Boolean(*v.AllowWrites) + } + if v.AssociateEntireAccount != nil { objectKey := object.Key("AssociateEntireAccount") objectKey.Boolean(*v.AssociateEntireAccount) @@ -9140,6 +9145,11 @@ func awsAwsquery_serializeOpDocumentAuthorizeDataShareInput(v *AuthorizeDataShar object := value.Object() _ = object + if v.AllowWrites != nil { + objectKey := object.Key("AllowWrites") + objectKey.Boolean(*v.AllowWrites) + } + if v.ConsumerIdentifier != nil { objectKey := object.Key("ConsumerIdentifier") objectKey.String(*v.ConsumerIdentifier) diff --git a/service/redshift/types/types.go b/service/redshift/types/types.go index 39a5f927c09..b1e4369720c 100644 --- a/service/redshift/types/types.go +++ b/service/redshift/types/types.go @@ -645,6 +645,9 @@ type DataShare struct { // The association of a datashare from a producer account with a data consumer. type DataShareAssociation struct { + // Specifies whether write operations were allowed during data share association. + ConsumerAcceptedWrites *bool + // The name of the consumer accounts that have an association with a producer // datashare. ConsumerIdentifier *string @@ -656,6 +659,9 @@ type DataShareAssociation struct { // The creation date of the datashare that is associated. CreatedDate *time.Time + // Specifies whether write operations were allowed during data share authorization. + ProducerAllowedWrites *bool + // The status of the datashare that is associated. Status DataShareStatus diff --git a/service/repostspace/LICENSE.txt b/service/repostspace/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/repostspace/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/repostspace/api_client.go b/service/repostspace/api_client.go new file mode 100644 index 00000000000..2554560b804 --- /dev/null +++ b/service/repostspace/api_client.go @@ -0,0 +1,454 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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 = "repostspace" +const ServiceAPIVersion = "2022-05-13" + +// Client provides the API client to make operations call for AWS re:Post Private. +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, "repostspace", 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/repostspace/api_client_test.go b/service/repostspace/api_client_test.go new file mode 100644 index 00000000000..969ec8059b5 --- /dev/null +++ b/service/repostspace/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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/repostspace/api_op_CreateSpace.go b/service/repostspace/api_op_CreateSpace.go new file mode 100644 index 00000000000..a111425eb4e --- /dev/null +++ b/service/repostspace/api_op_CreateSpace.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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/repostspace/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an AWS re:Post Private private re:Post. +func (c *Client) CreateSpace(ctx context.Context, params *CreateSpaceInput, optFns ...func(*Options)) (*CreateSpaceOutput, error) { + if params == nil { + params = &CreateSpaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSpace", params, optFns, c.addOperationCreateSpaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSpaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSpaceInput struct { + + // The name for the private re:Post. This must be unique in your account. + // + // This member is required. + Name *string + + // The subdomain that you use to access your AWS re:Post Private private re:Post. + // All custom subdomains must be approved by AWS before use. In addition to your + // custom subdomain, all private re:Posts are issued an AWS generated subdomain for + // immediate use. + // + // This member is required. + Subdomain *string + + // The pricing tier for the private re:Post. + // + // This member is required. + Tier types.TierLevel + + // A description for the private re:Post. This is used only to help you identify + // this private re:Post. + Description *string + + // The IAM role that grants permissions to the private re:Post to convert + // unanswered questions into AWS support tickets. + RoleArn *string + + // The list of tags associated with the private re:Post. + Tags map[string]string + + // The AWS KMS key ARN that’s used for the AWS KMS encryption. If you don't + // provide a key, your data is encrypted by default with a key that AWS owns and + // manages for you. + UserKMSKey *string + + noSmithyDocumentSerde +} + +type CreateSpaceOutput struct { + + // The unique ID of the private re:Post. + // + // This member is required. + SpaceId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateSpaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSpace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSpace{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateSpace"); 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 = addOpCreateSpaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSpace(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_opCreateSpace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateSpace", + } +} diff --git a/service/repostspace/api_op_DeleteSpace.go b/service/repostspace/api_op_DeleteSpace.go new file mode 100644 index 00000000000..aa75cbfb132 --- /dev/null +++ b/service/repostspace/api_op_DeleteSpace.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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 AWS re:Post Private private re:Post. +func (c *Client) DeleteSpace(ctx context.Context, params *DeleteSpaceInput, optFns ...func(*Options)) (*DeleteSpaceOutput, error) { + if params == nil { + params = &DeleteSpaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteSpace", params, optFns, c.addOperationDeleteSpaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteSpaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteSpaceInput struct { + + // The unique ID of the private re:Post. + // + // This member is required. + SpaceId *string + + noSmithyDocumentSerde +} + +type DeleteSpaceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteSpaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSpace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSpace{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteSpace"); 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 = addOpDeleteSpaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSpace(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_opDeleteSpace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteSpace", + } +} diff --git a/service/repostspace/api_op_DeregisterAdmin.go b/service/repostspace/api_op_DeregisterAdmin.go new file mode 100644 index 00000000000..7020bfa1737 --- /dev/null +++ b/service/repostspace/api_op_DeregisterAdmin.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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" +) + +// Removes the user or group from the list of administrators of the private +// re:Post. +func (c *Client) DeregisterAdmin(ctx context.Context, params *DeregisterAdminInput, optFns ...func(*Options)) (*DeregisterAdminOutput, error) { + if params == nil { + params = &DeregisterAdminInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeregisterAdmin", params, optFns, c.addOperationDeregisterAdminMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeregisterAdminOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeregisterAdminInput struct { + + // The ID of the admin to remove. + // + // This member is required. + AdminId *string + + // The ID of the private re:Post to remove the admin from. + // + // This member is required. + SpaceId *string + + noSmithyDocumentSerde +} + +type DeregisterAdminOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeregisterAdminMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeregisterAdmin{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeregisterAdmin{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeregisterAdmin"); 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 = addOpDeregisterAdminValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterAdmin(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_opDeregisterAdmin(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeregisterAdmin", + } +} diff --git a/service/repostspace/api_op_GetSpace.go b/service/repostspace/api_op_GetSpace.go new file mode 100644 index 00000000000..33c861af21d --- /dev/null +++ b/service/repostspace/api_op_GetSpace.go @@ -0,0 +1,221 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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/repostspace/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Displays information about the AWS re:Post Private private re:Post. +func (c *Client) GetSpace(ctx context.Context, params *GetSpaceInput, optFns ...func(*Options)) (*GetSpaceOutput, error) { + if params == nil { + params = &GetSpaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSpace", params, optFns, c.addOperationGetSpaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSpaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSpaceInput struct { + + // The ID of the private re:Post. + // + // This member is required. + SpaceId *string + + noSmithyDocumentSerde +} + +type GetSpaceOutput struct { + + // The ARN of the private re:Post. + // + // This member is required. + Arn *string + + // The Identity Center identifier for the Application Instance. + // + // This member is required. + ClientId *string + + // The configuration status of the private re:Post. + // + // This member is required. + ConfigurationStatus types.ConfigurationStatus + + // The date when the private re:Post was created. + // + // This member is required. + CreateDateTime *time.Time + + // The name of the private re:Post. + // + // This member is required. + Name *string + + // The AWS generated subdomain of the private re:Post + // + // This member is required. + RandomDomain *string + + // The unique ID of the private re:Post. + // + // This member is required. + SpaceId *string + + // The creation or deletion status of the private re:Post. + // + // This member is required. + Status *string + + // The storage limit of the private re:Post. + // + // This member is required. + StorageLimit *int64 + + // The pricing tier of the private re:Post. + // + // This member is required. + Tier types.TierLevel + + // The custom subdomain that you use to access your private re:Post. All custom + // subdomains must be approved by AWS before use. + // + // This member is required. + VanityDomain *string + + // The approval status of the custom subdomain. + // + // This member is required. + VanityDomainStatus types.VanityDomainStatus + + // The content size of the private re:Post. + ContentSize *int64 + + // The IAM role that grants permissions to the private re:Post to convert + // unanswered questions into AWS support tickets. + CustomerRoleArn *string + + // The date when the private re:Post was deleted. + DeleteDateTime *time.Time + + // The description of the private re:Post. + Description *string + + // The list of groups that are administrators of the private re:Post. + GroupAdmins []string + + // The list of users that are administrators of the private re:Post. + UserAdmins []string + + // The number of users that have onboarded to the private re:Post. + UserCount *int32 + + // The custom AWS KMS key ARN that’s used for the AWS KMS encryption. + UserKMSKey *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSpaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSpace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSpace{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetSpace"); 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 = addOpGetSpaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSpace(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_opGetSpace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetSpace", + } +} diff --git a/service/repostspace/api_op_ListSpaces.go b/service/repostspace/api_op_ListSpaces.go new file mode 100644 index 00000000000..70b11dbf6e0 --- /dev/null +++ b/service/repostspace/api_op_ListSpaces.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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/repostspace/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of AWS re:Post Private private re:Posts in the account with some +// information about each private re:Post. +func (c *Client) ListSpaces(ctx context.Context, params *ListSpacesInput, optFns ...func(*Options)) (*ListSpacesOutput, error) { + if params == nil { + params = &ListSpacesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSpaces", params, optFns, c.addOperationListSpacesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSpacesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSpacesInput struct { + + // The maximum number of private re:Posts to include in the results. + MaxResults *int32 + + // The token for the next set of private re:Posts to return. You receive this + // token from a previous ListSpaces operation. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSpacesOutput struct { + + // An array of structures that contain some information about the private re:Posts + // in the account. + // + // This member is required. + Spaces []types.SpaceData + + // The token that you use when you request the next set of private re:Posts. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSpacesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSpaces{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSpaces{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListSpaces"); 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_opListSpaces(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 +} + +// ListSpacesAPIClient is a client that implements the ListSpaces operation. +type ListSpacesAPIClient interface { + ListSpaces(context.Context, *ListSpacesInput, ...func(*Options)) (*ListSpacesOutput, error) +} + +var _ ListSpacesAPIClient = (*Client)(nil) + +// ListSpacesPaginatorOptions is the paginator options for ListSpaces +type ListSpacesPaginatorOptions struct { + // The maximum number of private re:Posts to include in the 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 +} + +// ListSpacesPaginator is a paginator for ListSpaces +type ListSpacesPaginator struct { + options ListSpacesPaginatorOptions + client ListSpacesAPIClient + params *ListSpacesInput + nextToken *string + firstPage bool +} + +// NewListSpacesPaginator returns a new ListSpacesPaginator +func NewListSpacesPaginator(client ListSpacesAPIClient, params *ListSpacesInput, optFns ...func(*ListSpacesPaginatorOptions)) *ListSpacesPaginator { + if params == nil { + params = &ListSpacesInput{} + } + + options := ListSpacesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSpacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSpacesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSpaces page. +func (p *ListSpacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSpacesOutput, 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.ListSpaces(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_opListSpaces(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListSpaces", + } +} diff --git a/service/repostspace/api_op_ListTagsForResource.go b/service/repostspace/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..33020e9f6d8 --- /dev/null +++ b/service/repostspace/api_op_ListTagsForResource.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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" +) + +// Returns the tags that are associated with the AWS re:Post Private resource +// specified by the resourceArn. The only resource that can be tagged is a private +// re:Post. +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The ARN of the resource that the tags are associated with. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // The list of tags that are associated with the resource. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(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_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListTagsForResource", + } +} diff --git a/service/repostspace/api_op_RegisterAdmin.go b/service/repostspace/api_op_RegisterAdmin.go new file mode 100644 index 00000000000..f192a3212df --- /dev/null +++ b/service/repostspace/api_op_RegisterAdmin.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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" +) + +// Adds a user or group to the list of administrators of the private re:Post. +func (c *Client) RegisterAdmin(ctx context.Context, params *RegisterAdminInput, optFns ...func(*Options)) (*RegisterAdminOutput, error) { + if params == nil { + params = &RegisterAdminInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RegisterAdmin", params, optFns, c.addOperationRegisterAdminMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RegisterAdminOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RegisterAdminInput struct { + + // The ID of the administrator. + // + // This member is required. + AdminId *string + + // The ID of the private re:Post. + // + // This member is required. + SpaceId *string + + noSmithyDocumentSerde +} + +type RegisterAdminOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRegisterAdminMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterAdmin{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterAdmin{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterAdmin"); 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 = addOpRegisterAdminValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterAdmin(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_opRegisterAdmin(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RegisterAdmin", + } +} diff --git a/service/repostspace/api_op_SendInvites.go b/service/repostspace/api_op_SendInvites.go new file mode 100644 index 00000000000..185deb320f5 --- /dev/null +++ b/service/repostspace/api_op_SendInvites.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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" +) + +// Sends an invitation email to selected users and groups. +func (c *Client) SendInvites(ctx context.Context, params *SendInvitesInput, optFns ...func(*Options)) (*SendInvitesOutput, error) { + if params == nil { + params = &SendInvitesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SendInvites", params, optFns, c.addOperationSendInvitesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SendInvitesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SendInvitesInput struct { + + // The array of identifiers for the users and groups. + // + // This member is required. + AccessorIds []string + + // The body of the invite. + // + // This member is required. + Body *string + + // The ID of the private re:Post. + // + // This member is required. + SpaceId *string + + // The title of the invite. + // + // This member is required. + Title *string + + noSmithyDocumentSerde +} + +type SendInvitesOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSendInvitesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpSendInvites{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSendInvites{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SendInvites"); 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 = addOpSendInvitesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendInvites(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_opSendInvites(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SendInvites", + } +} diff --git a/service/repostspace/api_op_TagResource.go b/service/repostspace/api_op_TagResource.go new file mode 100644 index 00000000000..39eb241672c --- /dev/null +++ b/service/repostspace/api_op_TagResource.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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" +) + +// Associates tags with an AWS re:Post Private resource. Currently, the only +// resource that can be tagged is the private re:Post. If you specify a new tag key +// for the resource, the tag is appended to the list of tags that are associated +// with the resource. If you specify a tag key that’s already associated with the +// resource, the new tag value that you specify replaces the previous value for +// that tag. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The ARN of the resource that the tag is associated with. + // + // This member is required. + ResourceArn *string + + // The list of tag keys and values that must be associated with the resource. You + // can associate tag keys only, tags (key and values) only, or a combination of tag + // keys and tags. + // + // This member is required. + Tags map[string]string + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(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_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "TagResource", + } +} diff --git a/service/repostspace/api_op_UntagResource.go b/service/repostspace/api_op_UntagResource.go new file mode 100644 index 00000000000..7972554ba66 --- /dev/null +++ b/service/repostspace/api_op_UntagResource.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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" +) + +// Removes the association of the tag with the AWS re:Post Private resource. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The ARN of the resource. + // + // This member is required. + ResourceArn *string + + // The key values of the tag. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(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_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UntagResource", + } +} diff --git a/service/repostspace/api_op_UpdateSpace.go b/service/repostspace/api_op_UpdateSpace.go new file mode 100644 index 00000000000..caf0a0410e3 --- /dev/null +++ b/service/repostspace/api_op_UpdateSpace.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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/repostspace/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies an existing AWS re:Post Private private re:Post. +func (c *Client) UpdateSpace(ctx context.Context, params *UpdateSpaceInput, optFns ...func(*Options)) (*UpdateSpaceOutput, error) { + if params == nil { + params = &UpdateSpaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSpace", params, optFns, c.addOperationUpdateSpaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSpaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSpaceInput struct { + + // The unique ID of this private re:Post. + // + // This member is required. + SpaceId *string + + // A description for the private re:Post. This is used only to help you identify + // this private re:Post. + Description *string + + // The IAM role that grants permissions to the private re:Post to convert + // unanswered questions into AWS support tickets. + RoleArn *string + + // The pricing tier of this private re:Post. + Tier types.TierLevel + + noSmithyDocumentSerde +} + +type UpdateSpaceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSpaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSpace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSpace{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateSpace"); 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 = addOpUpdateSpaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSpace(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_opUpdateSpace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateSpace", + } +} diff --git a/service/repostspace/auth.go b/service/repostspace/auth.go new file mode 100644 index 00000000000..4501c12ff83 --- /dev/null +++ b/service/repostspace/auth.go @@ -0,0 +1,256 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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, "repostspace") + 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/repostspace/deserializers.go b/service/repostspace/deserializers.go new file mode 100644 index 00000000000..826eb453d8b --- /dev/null +++ b/service/repostspace/deserializers.go @@ -0,0 +1,2681 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/repostspace/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" + "strconv" + "strings" +) + +type awsRestjson1_deserializeOpCreateSpace struct { +} + +func (*awsRestjson1_deserializeOpCreateSpace) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateSpace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreateSpace(response, &metadata) + } + output := &CreateSpaceOutput{} + 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_deserializeOpDocumentCreateSpaceOutput(&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_deserializeOpErrorCreateSpace(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateSpaceOutput(v **CreateSpaceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateSpaceOutput + if *v == nil { + sv = &CreateSpaceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "spaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SpaceId to be of type string, got %T instead", value) + } + sv.SpaceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteSpace struct { +} + +func (*awsRestjson1_deserializeOpDeleteSpace) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteSpace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteSpace(response, &metadata) + } + output := &DeleteSpaceOutput{} + 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_deserializeOpErrorDeleteSpace(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeregisterAdmin struct { +} + +func (*awsRestjson1_deserializeOpDeregisterAdmin) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeregisterAdmin) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeregisterAdmin(response, &metadata) + } + output := &DeregisterAdminOutput{} + 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_deserializeOpErrorDeregisterAdmin(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetSpace struct { +} + +func (*awsRestjson1_deserializeOpGetSpace) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSpace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetSpace(response, &metadata) + } + output := &GetSpaceOutput{} + 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_deserializeOpDocumentGetSpaceOutput(&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_deserializeOpErrorGetSpace(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentGetSpaceOutput(v **GetSpaceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetSpaceOutput + if *v == nil { + sv = &GetSpaceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "clientId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientId to be of type string, got %T instead", value) + } + sv.ClientId = ptr.String(jtv) + } + + case "configurationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConfigurationStatus to be of type string, got %T instead", value) + } + sv.ConfigurationStatus = types.ConfigurationStatus(jtv) + } + + case "contentSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ContentSize to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ContentSize = ptr.Int64(i64) + } + + case "createDateTime": + 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.CreateDateTime = ptr.Time(t) + } + + case "customerRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.CustomerRoleArn = ptr.String(jtv) + } + + case "deleteDateTime": + 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.DeleteDateTime = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SpaceDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "groupAdmins": + if err := awsRestjson1_deserializeDocumentGroupAdmins(&sv.GroupAdmins, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SpaceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "randomDomain": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.RandomDomain = ptr.String(jtv) + } + + case "spaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SpaceId to be of type string, got %T instead", value) + } + sv.SpaceId = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProvisioningStatus to be of type string, got %T instead", value) + } + sv.Status = ptr.String(jtv) + } + + case "storageLimit": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected StorageLimit to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.StorageLimit = ptr.Int64(i64) + } + + case "tier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TierLevel to be of type string, got %T instead", value) + } + sv.Tier = types.TierLevel(jtv) + } + + case "userAdmins": + if err := awsRestjson1_deserializeDocumentUserAdmins(&sv.UserAdmins, value); err != nil { + return err + } + + case "userCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UserCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.UserCount = ptr.Int32(int32(i64)) + } + + case "userKMSKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KMSKey to be of type string, got %T instead", value) + } + sv.UserKMSKey = ptr.String(jtv) + } + + case "vanityDomain": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.VanityDomain = ptr.String(jtv) + } + + case "vanityDomainStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VanityDomainStatus to be of type string, got %T instead", value) + } + sv.VanityDomainStatus = types.VanityDomainStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSpaces struct { +} + +func (*awsRestjson1_deserializeOpListSpaces) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSpaces) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListSpaces(response, &metadata) + } + output := &ListSpacesOutput{} + 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_deserializeOpDocumentListSpacesOutput(&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_deserializeOpErrorListSpaces(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentListSpacesOutput(v **ListSpacesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListSpacesOutput + if *v == nil { + sv = &ListSpacesOutput{} + } 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 "spaces": + if err := awsRestjson1_deserializeDocumentSpacesList(&sv.Spaces, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpRegisterAdmin struct { +} + +func (*awsRestjson1_deserializeOpRegisterAdmin) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRegisterAdmin) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorRegisterAdmin(response, &metadata) + } + output := &RegisterAdminOutput{} + 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_deserializeOpErrorRegisterAdmin(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpSendInvites struct { +} + +func (*awsRestjson1_deserializeOpSendInvites) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSendInvites) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorSendInvites(response, &metadata) + } + output := &SendInvitesOutput{} + 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_deserializeOpErrorSendInvites(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_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("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateSpace struct { +} + +func (*awsRestjson1_deserializeOpUpdateSpace) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateSpace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateSpace(response, &metadata) + } + output := &UpdateSpaceOutput{} + 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_deserializeOpErrorUpdateSpace(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + 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) + + if err := awsRestjson1_deserializeOpHttpBindingsInternalServerException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_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_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + 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_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) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGroupAdmins(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 AdminId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + 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 "retryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSpaceData(v **types.SpaceData, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SpaceData + if *v == nil { + sv = &types.SpaceData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "configurationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConfigurationStatus to be of type string, got %T instead", value) + } + sv.ConfigurationStatus = types.ConfigurationStatus(jtv) + } + + case "contentSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ContentSize to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ContentSize = ptr.Int64(i64) + } + + case "createDateTime": + 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.CreateDateTime = ptr.Time(t) + } + + case "deleteDateTime": + 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.DeleteDateTime = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SpaceDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SpaceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "randomDomain": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.RandomDomain = ptr.String(jtv) + } + + case "spaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SpaceId to be of type string, got %T instead", value) + } + sv.SpaceId = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProvisioningStatus to be of type string, got %T instead", value) + } + sv.Status = ptr.String(jtv) + } + + case "storageLimit": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected StorageLimit to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.StorageLimit = ptr.Int64(i64) + } + + case "tier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TierLevel to be of type string, got %T instead", value) + } + sv.Tier = types.TierLevel(jtv) + } + + case "userCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UserCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.UserCount = ptr.Int32(int32(i64)) + } + + case "userKMSKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KMSKey to be of type string, got %T instead", value) + } + sv.UserKMSKey = ptr.String(jtv) + } + + case "vanityDomain": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.VanityDomain = ptr.String(jtv) + } + + case "vanityDomainStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VanityDomainStatus to be of type string, got %T instead", value) + } + sv.VanityDomainStatus = types.VanityDomainStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSpacesList(v *[]types.SpaceData, 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.SpaceData + if *v == nil { + cv = []types.SpaceData{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SpaceData + destAddr := &col + if err := awsRestjson1_deserializeDocumentSpaceData(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTags(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_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) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "retryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = ptr.Int32(int32(i64)) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUserAdmins(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 AdminId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + 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 "fieldList": + if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.FieldList, value); err != nil { + return err + } + + 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 "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.ValidationExceptionReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationExceptionField + if *v == nil { + sv = &types.ValidationExceptionField{} + } 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 "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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, 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.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} diff --git a/service/repostspace/doc.go b/service/repostspace/doc.go new file mode 100644 index 00000000000..04b725c6908 --- /dev/null +++ b/service/repostspace/doc.go @@ -0,0 +1,16 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package repostspace provides the API client, operations, and parameter types +// for AWS re:Post Private. +// +// AWS re:Post Private is a private version of AWS re:Post for enterprises with +// Enterprise Support or Enterprise On-Ramp Support plans. It provides access to +// knowledge and experts to accelerate cloud adoption and increase developer +// productivity. With your organization-specific private re:Post, you can build an +// organization-specific developer community that drives efficiencies at scale and +// provides access to valuable knowledge resources. Additionally, re:Post Private +// centralizes trusted AWS technical content and offers private discussion forums +// to improve how your teams collaborate internally and with AWS to remove +// technical obstacles, accelerate innovation, and scale more efficiently in the +// cloud. +package repostspace diff --git a/service/repostspace/endpoints.go b/service/repostspace/endpoints.go new file mode 100644 index 00000000000..c25dabc510e --- /dev/null +++ b/service/repostspace/endpoints.go @@ -0,0 +1,509 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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/repostspace/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 = "repostspace" + } + 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_REPOSTSPACE") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "repostspace", 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://repostspace-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://repostspace-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://repostspace.") + 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://repostspace.") + 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/repostspace/endpoints_config_test.go b/service/repostspace/endpoints_config_test.go new file mode 100644 index 00000000000..76baa415795 --- /dev/null +++ b/service/repostspace/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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-repostspace.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-repostspace.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-repostspace.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-repostspace.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-repostspace.dev", + expectURL: aws.String("https://env-repostspace.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-repostspace.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-repostspace.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-repostspace.dev", + expectURL: aws.String("http://config-repostspace.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-repostspace.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-repostspace.dev", + clientEndpoint: aws.String("https://client-repostspace.dev"), + expectURL: aws.String("https://client-repostspace.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_REPOSTSPACE", 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/repostspace/endpoints_test.go b/service/repostspace/endpoints_test.go new file mode 100644 index 00000000000..edaf8b9fa8a --- /dev/null +++ b/service/repostspace/endpoints_test.go @@ -0,0 +1,856 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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://repostspace-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://repostspace-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://repostspace.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://repostspace.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://repostspace-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://repostspace-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://repostspace.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://repostspace.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://repostspace-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://repostspace-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://repostspace.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://repostspace.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://repostspace-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://repostspace.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://repostspace-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://repostspace.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/repostspace/generated.json b/service/repostspace/generated.json new file mode 100644 index 00000000000..61e7fa5cb68 --- /dev/null +++ b/service/repostspace/generated.json @@ -0,0 +1,43 @@ +{ + "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_CreateSpace.go", + "api_op_DeleteSpace.go", + "api_op_DeregisterAdmin.go", + "api_op_GetSpace.go", + "api_op_ListSpaces.go", + "api_op_ListTagsForResource.go", + "api_op_RegisterAdmin.go", + "api_op_SendInvites.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateSpace.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/repostspace", + "unstable": false +} diff --git a/service/repostspace/go.mod b/service/repostspace/go.mod new file mode 100644 index 00000000000..ace3db45eea --- /dev/null +++ b/service/repostspace/go.mod @@ -0,0 +1,17 @@ +module github.com/aws/aws-sdk-go-v2/service/repostspace + +go 1.19 + +require ( + github.com/aws/aws-sdk-go-v2 v1.23.1 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4 + 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/repostspace/go.sum b/service/repostspace/go.sum new file mode 100644 index 00000000000..42e4fc806b4 --- /dev/null +++ b/service/repostspace/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/repostspace/go_module_metadata.go b/service/repostspace/go_module_metadata.go new file mode 100644 index 00000000000..31b97b4b99a --- /dev/null +++ b/service/repostspace/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package repostspace + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/repostspace/internal/endpoints/endpoints.go b/service/repostspace/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..11b7366467c --- /dev/null +++ b/service/repostspace/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 repostspace 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: "repostspace.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "repostspace-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "repostspace-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "repostspace.{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: "repostspace.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "repostspace-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "repostspace-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "repostspace.{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: "repostspace-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "repostspace.{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: "repostspace-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "repostspace.{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: "repostspace-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "repostspace.{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: "repostspace-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "repostspace.{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: "repostspace.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "repostspace-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "repostspace-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "repostspace.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/repostspace/internal/endpoints/endpoints_test.go b/service/repostspace/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/repostspace/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/repostspace/options.go b/service/repostspace/options.go new file mode 100644 index 00000000000..204a6f04486 --- /dev/null +++ b/service/repostspace/options.go @@ -0,0 +1,219 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +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/repostspace/protocol_test.go b/service/repostspace/protocol_test.go new file mode 100644 index 00000000000..14d0331b227 --- /dev/null +++ b/service/repostspace/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace diff --git a/service/repostspace/serializers.go b/service/repostspace/serializers.go new file mode 100644 index 00000000000..7c14ca9baba --- /dev/null +++ b/service/repostspace/serializers.go @@ -0,0 +1,909 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +import ( + "bytes" + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpCreateSpace struct { +} + +func (*awsRestjson1_serializeOpCreateSpace) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateSpace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateSpaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/spaces") + 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_serializeOpDocumentCreateSpaceInput(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_serializeOpHttpBindingsCreateSpaceInput(v *CreateSpaceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateSpaceInput(v *CreateSpaceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.RoleArn != nil { + ok := object.Key("roleArn") + ok.String(*v.RoleArn) + } + + if v.Subdomain != nil { + ok := object.Key("subdomain") + ok.String(*v.Subdomain) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + if len(v.Tier) > 0 { + ok := object.Key("tier") + ok.String(string(v.Tier)) + } + + if v.UserKMSKey != nil { + ok := object.Key("userKMSKey") + ok.String(*v.UserKMSKey) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteSpace struct { +} + +func (*awsRestjson1_serializeOpDeleteSpace) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteSpace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteSpaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/spaces/{spaceId}") + 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_serializeOpHttpBindingsDeleteSpaceInput(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_serializeOpHttpBindingsDeleteSpaceInput(v *DeleteSpaceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SpaceId == nil || len(*v.SpaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceId must not be empty")} + } + if v.SpaceId != nil { + if err := encoder.SetURI("spaceId").String(*v.SpaceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeregisterAdmin struct { +} + +func (*awsRestjson1_serializeOpDeregisterAdmin) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeregisterAdmin) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeregisterAdminInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/spaces/{spaceId}/admins/{adminId}") + 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_serializeOpHttpBindingsDeregisterAdminInput(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_serializeOpHttpBindingsDeregisterAdminInput(v *DeregisterAdminInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AdminId == nil || len(*v.AdminId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member adminId must not be empty")} + } + if v.AdminId != nil { + if err := encoder.SetURI("adminId").String(*v.AdminId); err != nil { + return err + } + } + + if v.SpaceId == nil || len(*v.SpaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceId must not be empty")} + } + if v.SpaceId != nil { + if err := encoder.SetURI("spaceId").String(*v.SpaceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSpace struct { +} + +func (*awsRestjson1_serializeOpGetSpace) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSpace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSpaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/spaces/{spaceId}") + 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_serializeOpHttpBindingsGetSpaceInput(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_serializeOpHttpBindingsGetSpaceInput(v *GetSpaceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SpaceId == nil || len(*v.SpaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceId must not be empty")} + } + if v.SpaceId != nil { + if err := encoder.SetURI("spaceId").String(*v.SpaceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListSpaces struct { +} + +func (*awsRestjson1_serializeOpListSpaces) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSpaces) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListSpacesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/spaces") + 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_serializeOpHttpBindingsListSpacesInput(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_serializeOpHttpBindingsListSpacesInput(v *ListSpacesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpRegisterAdmin struct { +} + +func (*awsRestjson1_serializeOpRegisterAdmin) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpRegisterAdmin) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RegisterAdminInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/spaces/{spaceId}/admins/{adminId}") + 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_serializeOpHttpBindingsRegisterAdminInput(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_serializeOpHttpBindingsRegisterAdminInput(v *RegisterAdminInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AdminId == nil || len(*v.AdminId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member adminId must not be empty")} + } + if v.AdminId != nil { + if err := encoder.SetURI("adminId").String(*v.AdminId); err != nil { + return err + } + } + + if v.SpaceId == nil || len(*v.SpaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceId must not be empty")} + } + if v.SpaceId != nil { + if err := encoder.SetURI("spaceId").String(*v.SpaceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpSendInvites struct { +} + +func (*awsRestjson1_serializeOpSendInvites) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSendInvites) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SendInvitesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/spaces/{spaceId}/invite") + 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_serializeOpHttpBindingsSendInvitesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSendInvitesInput(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_serializeOpHttpBindingsSendInvitesInput(v *SendInvitesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SpaceId == nil || len(*v.SpaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceId must not be empty")} + } + if v.SpaceId != nil { + if err := encoder.SetURI("spaceId").String(*v.SpaceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentSendInvitesInput(v *SendInvitesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccessorIds != nil { + ok := object.Key("accessorIds") + if err := awsRestjson1_serializeDocumentAccessorIdList(v.AccessorIds, ok); err != nil { + return err + } + } + + if v.Body != nil { + ok := object.Key("body") + ok.String(*v.Body) + } + + if v.Title != nil { + ok := object.Key("title") + ok.String(*v.Title) + } + + 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 { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateSpace struct { +} + +func (*awsRestjson1_serializeOpUpdateSpace) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateSpace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateSpaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/spaces/{spaceId}") + 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_serializeOpHttpBindingsUpdateSpaceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateSpaceInput(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_serializeOpHttpBindingsUpdateSpaceInput(v *UpdateSpaceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SpaceId == nil || len(*v.SpaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceId must not be empty")} + } + if v.SpaceId != nil { + if err := encoder.SetURI("spaceId").String(*v.SpaceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateSpaceInput(v *UpdateSpaceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.RoleArn != nil { + ok := object.Key("roleArn") + ok.String(*v.RoleArn) + } + + if len(v.Tier) > 0 { + ok := object.Key("tier") + ok.String(string(v.Tier)) + } + + return nil +} + +func awsRestjson1_serializeDocumentAccessorIdList(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_serializeDocumentTags(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} diff --git a/service/repostspace/types/enums.go b/service/repostspace/types/enums.go new file mode 100644 index 00000000000..c8bf2ba0784 --- /dev/null +++ b/service/repostspace/types/enums.go @@ -0,0 +1,81 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type ConfigurationStatus string + +// Enum values for ConfigurationStatus +const ( + ConfigurationStatusConfigured ConfigurationStatus = "CONFIGURED" + ConfigurationStatusUnconfigured ConfigurationStatus = "UNCONFIGURED" +) + +// Values returns all known values for ConfigurationStatus. 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 (ConfigurationStatus) Values() []ConfigurationStatus { + return []ConfigurationStatus{ + "CONFIGURED", + "UNCONFIGURED", + } +} + +type TierLevel string + +// Enum values for TierLevel +const ( + TierLevelBasic TierLevel = "BASIC" + TierLevelStandard TierLevel = "STANDARD" +) + +// Values returns all known values for TierLevel. 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 (TierLevel) Values() []TierLevel { + return []TierLevel{ + "BASIC", + "STANDARD", + } +} + +type ValidationExceptionReason string + +// Enum values for ValidationExceptionReason +const ( + ValidationExceptionReasonUnknownOperation ValidationExceptionReason = "unknownOperation" + ValidationExceptionReasonCannotParse ValidationExceptionReason = "cannotParse" + ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "fieldValidationFailed" + ValidationExceptionReasonOther ValidationExceptionReason = "other" +) + +// Values returns all known values for ValidationExceptionReason. 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 (ValidationExceptionReason) Values() []ValidationExceptionReason { + return []ValidationExceptionReason{ + "unknownOperation", + "cannotParse", + "fieldValidationFailed", + "other", + } +} + +type VanityDomainStatus string + +// Enum values for VanityDomainStatus +const ( + VanityDomainStatusPending VanityDomainStatus = "PENDING" + VanityDomainStatusApproved VanityDomainStatus = "APPROVED" + VanityDomainStatusUnapproved VanityDomainStatus = "UNAPPROVED" +) + +// Values returns all known values for VanityDomainStatus. 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 (VanityDomainStatus) Values() []VanityDomainStatus { + return []VanityDomainStatus{ + "PENDING", + "APPROVED", + "UNAPPROVED", + } +} diff --git a/service/repostspace/types/errors.go b/service/repostspace/types/errors.go new file mode 100644 index 00000000000..8fc23fdd361 --- /dev/null +++ b/service/repostspace/types/errors.go @@ -0,0 +1,210 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// User does 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 } + +// Updating or deleting a resource can cause an inconsistent state. +type ConflictException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType *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 } + +// Unexpected error during processing of request. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + RetryAfterSeconds *int32 + + 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 } + +// Request references a resource which does not exist. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Request would cause a service quota to be exceeded. +type ServiceQuotaExceededException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType *string + ServiceCode *string + QuotaCode *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceQuotaExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Request was denied due to request throttling. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + ServiceCode *string + QuotaCode *string + RetryAfterSeconds *int32 + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The input fails to satisfy the constraints specified by an AWS service. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + Reason ValidationExceptionReason + FieldList []ValidationExceptionField + + 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/repostspace/types/types.go b/service/repostspace/types/types.go new file mode 100644 index 00000000000..be528f18642 --- /dev/null +++ b/service/repostspace/types/types.go @@ -0,0 +1,106 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// A structure that contains some information about a private re:Post in the +// account. +type SpaceData struct { + + // The ARN of the private re:Post. + // + // This member is required. + Arn *string + + // The configuration status of the private re:Post. + // + // This member is required. + ConfigurationStatus ConfigurationStatus + + // The date when the private re:Post was created. + // + // This member is required. + CreateDateTime *time.Time + + // The name for the private re:Post. + // + // This member is required. + Name *string + + // The AWS generated subdomain of the private re:Post. + // + // This member is required. + RandomDomain *string + + // The unique ID of the private re:Post. + // + // This member is required. + SpaceId *string + + // The creation/deletion status of the private re:Post. + // + // This member is required. + Status *string + + // The storage limit of the private re:Post. + // + // This member is required. + StorageLimit *int64 + + // The pricing tier of the private re:Post. + // + // This member is required. + Tier TierLevel + + // This custom subdomain that you use to access your private re:Post. All custom + // subdomains must be approved by AWS before use. + // + // This member is required. + VanityDomain *string + + // This approval status of the custom subdomain. + // + // This member is required. + VanityDomainStatus VanityDomainStatus + + // The content size of the private re:Post. + ContentSize *int64 + + // The date when the private re:Post was deleted. + DeleteDateTime *time.Time + + // The description for the private re:Post. This is used only to help you identify + // this private re:Post. + Description *string + + // The number of onboarded users to the private re:Post. + UserCount *int32 + + // The custom AWS KMS key ARN that’s used for the AWS KMS encryption. + UserKMSKey *string + + noSmithyDocumentSerde +} + +// Stores information about a field that’s passed inside a request that resulted +// in an exception. +type ValidationExceptionField struct { + + // The name of the field. + // + // This member is required. + Message *string + + // Message describing why the field failed validation. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/repostspace/validators.go b/service/repostspace/validators.go new file mode 100644 index 00000000000..b68f9456c30 --- /dev/null +++ b/service/repostspace/validators.go @@ -0,0 +1,427 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCreateSpace struct { +} + +func (*validateOpCreateSpace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateSpace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateSpaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateSpaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteSpace struct { +} + +func (*validateOpDeleteSpace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteSpace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteSpaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteSpaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeregisterAdmin struct { +} + +func (*validateOpDeregisterAdmin) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeregisterAdmin) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeregisterAdminInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeregisterAdminInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSpace struct { +} + +func (*validateOpGetSpace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSpace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSpaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSpaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRegisterAdmin struct { +} + +func (*validateOpRegisterAdmin) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRegisterAdmin) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RegisterAdminInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRegisterAdminInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSendInvites struct { +} + +func (*validateOpSendInvites) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSendInvites) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SendInvitesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSendInvitesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSpace struct { +} + +func (*validateOpUpdateSpace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSpace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSpaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSpaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateSpaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateSpace{}, middleware.After) +} + +func addOpDeleteSpaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteSpace{}, middleware.After) +} + +func addOpDeregisterAdminValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeregisterAdmin{}, middleware.After) +} + +func addOpGetSpaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSpace{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpRegisterAdminValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRegisterAdmin{}, middleware.After) +} + +func addOpSendInvitesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSendInvites{}, middleware.After) +} + +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + +func addOpUpdateSpaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSpace{}, middleware.After) +} + +func validateOpCreateSpaceInput(v *CreateSpaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateSpaceInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Subdomain == nil { + invalidParams.Add(smithy.NewErrParamRequired("Subdomain")) + } + if len(v.Tier) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Tier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteSpaceInput(v *DeleteSpaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteSpaceInput"} + if v.SpaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeregisterAdminInput(v *DeregisterAdminInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeregisterAdminInput"} + if v.SpaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceId")) + } + if v.AdminId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AdminId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSpaceInput(v *GetSpaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSpaceInput"} + if v.SpaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRegisterAdminInput(v *RegisterAdminInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RegisterAdminInput"} + if v.SpaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceId")) + } + if v.AdminId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AdminId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSendInvitesInput(v *SendInvitesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SendInvitesInput"} + if v.SpaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceId")) + } + if v.AccessorIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessorIds")) + } + if v.Title == nil { + invalidParams.Add(smithy.NewErrParamRequired("Title")) + } + if v.Body == nil { + invalidParams.Add(smithy.NewErrParamRequired("Body")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateSpaceInput(v *UpdateSpaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSpaceInput"} + if v.SpaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/s3/api_op_AbortMultipartUpload.go b/service/s3/api_op_AbortMultipartUpload.go index c41dfe00c1f..b37cdb56d62 100644 --- a/service/s3/api_op_AbortMultipartUpload.go +++ b/service/s3/api_op_AbortMultipartUpload.go @@ -95,6 +95,7 @@ type AbortMultipartUploadInput struct { func (in *AbortMultipartUploadInput) bindEndpointParams(p *EndpointParameters) { p.Bucket = in.Bucket + p.Key = in.Key } diff --git a/service/s3/api_op_CompleteMultipartUpload.go b/service/s3/api_op_CompleteMultipartUpload.go index 0d43af35822..a50dcf6dbe2 100644 --- a/service/s3/api_op_CompleteMultipartUpload.go +++ b/service/s3/api_op_CompleteMultipartUpload.go @@ -183,6 +183,7 @@ type CompleteMultipartUploadInput struct { func (in *CompleteMultipartUploadInput) bindEndpointParams(p *EndpointParameters) { p.Bucket = in.Bucket + p.Key = in.Key } diff --git a/service/s3/api_op_CreateMultipartUpload.go b/service/s3/api_op_CreateMultipartUpload.go index 190b32dd3ff..739a590b196 100644 --- a/service/s3/api_op_CreateMultipartUpload.go +++ b/service/s3/api_op_CreateMultipartUpload.go @@ -348,6 +348,7 @@ type CreateMultipartUploadInput struct { func (in *CreateMultipartUploadInput) bindEndpointParams(p *EndpointParameters) { p.Bucket = in.Bucket + p.Key = in.Key } diff --git a/service/s3/api_op_DeleteObject.go b/service/s3/api_op_DeleteObject.go index 0c78bbb77dc..09c4bcc5ef3 100644 --- a/service/s3/api_op_DeleteObject.go +++ b/service/s3/api_op_DeleteObject.go @@ -106,6 +106,7 @@ type DeleteObjectInput struct { func (in *DeleteObjectInput) bindEndpointParams(p *EndpointParameters) { p.Bucket = in.Bucket + p.Key = in.Key } diff --git a/service/s3/api_op_GetObject.go b/service/s3/api_op_GetObject.go index e031bdb0f2d..7a4ef1d411f 100644 --- a/service/s3/api_op_GetObject.go +++ b/service/s3/api_op_GetObject.go @@ -238,6 +238,7 @@ type GetObjectInput struct { func (in *GetObjectInput) bindEndpointParams(p *EndpointParameters) { p.Bucket = in.Bucket + p.Key = in.Key } diff --git a/service/s3/api_op_GetObjectAcl.go b/service/s3/api_op_GetObjectAcl.go index 016c1d99dd8..4f3bf8095d9 100644 --- a/service/s3/api_op_GetObjectAcl.go +++ b/service/s3/api_op_GetObjectAcl.go @@ -86,6 +86,7 @@ type GetObjectAclInput struct { func (in *GetObjectAclInput) bindEndpointParams(p *EndpointParameters) { p.Bucket = in.Bucket + p.Key = in.Key } diff --git a/service/s3/api_op_HeadObject.go b/service/s3/api_op_HeadObject.go index a50fdc98d23..a006808d8e2 100644 --- a/service/s3/api_op_HeadObject.go +++ b/service/s3/api_op_HeadObject.go @@ -191,6 +191,7 @@ type HeadObjectInput struct { func (in *HeadObjectInput) bindEndpointParams(p *EndpointParameters) { p.Bucket = in.Bucket + p.Key = in.Key } diff --git a/service/s3/api_op_ListMultipartUploads.go b/service/s3/api_op_ListMultipartUploads.go index 89fa91dd45b..2cc53f65dca 100644 --- a/service/s3/api_op_ListMultipartUploads.go +++ b/service/s3/api_op_ListMultipartUploads.go @@ -134,6 +134,7 @@ type ListMultipartUploadsInput struct { func (in *ListMultipartUploadsInput) bindEndpointParams(p *EndpointParameters) { p.Bucket = in.Bucket + p.Prefix = in.Prefix } diff --git a/service/s3/api_op_ListObjectVersions.go b/service/s3/api_op_ListObjectVersions.go index f3341b5746c..4080fcbdbdb 100644 --- a/service/s3/api_op_ListObjectVersions.go +++ b/service/s3/api_op_ListObjectVersions.go @@ -105,6 +105,7 @@ type ListObjectVersionsInput struct { func (in *ListObjectVersionsInput) bindEndpointParams(p *EndpointParameters) { p.Bucket = in.Bucket + p.Prefix = in.Prefix } diff --git a/service/s3/api_op_ListObjects.go b/service/s3/api_op_ListObjects.go index 81e080deb75..822ce3e4662 100644 --- a/service/s3/api_op_ListObjects.go +++ b/service/s3/api_op_ListObjects.go @@ -104,6 +104,7 @@ type ListObjectsInput struct { func (in *ListObjectsInput) bindEndpointParams(p *EndpointParameters) { p.Bucket = in.Bucket + p.Prefix = in.Prefix } diff --git a/service/s3/api_op_ListObjectsV2.go b/service/s3/api_op_ListObjectsV2.go index 93eb4e6f46c..714edbfa4ae 100644 --- a/service/s3/api_op_ListObjectsV2.go +++ b/service/s3/api_op_ListObjectsV2.go @@ -117,6 +117,7 @@ type ListObjectsV2Input struct { func (in *ListObjectsV2Input) bindEndpointParams(p *EndpointParameters) { p.Bucket = in.Bucket + p.Prefix = in.Prefix } diff --git a/service/s3/api_op_ListParts.go b/service/s3/api_op_ListParts.go index 2a0c55aac62..ff3aab3df60 100644 --- a/service/s3/api_op_ListParts.go +++ b/service/s3/api_op_ListParts.go @@ -126,6 +126,7 @@ type ListPartsInput struct { func (in *ListPartsInput) bindEndpointParams(p *EndpointParameters) { p.Bucket = in.Bucket + p.Key = in.Key } diff --git a/service/s3/api_op_PutObject.go b/service/s3/api_op_PutObject.go index 856fea18657..f4207d49663 100644 --- a/service/s3/api_op_PutObject.go +++ b/service/s3/api_op_PutObject.go @@ -337,6 +337,7 @@ type PutObjectInput struct { func (in *PutObjectInput) bindEndpointParams(p *EndpointParameters) { p.Bucket = in.Bucket + p.Key = in.Key } diff --git a/service/s3/api_op_PutObjectAcl.go b/service/s3/api_op_PutObjectAcl.go index f74465e7937..8aebe7e1418 100644 --- a/service/s3/api_op_PutObjectAcl.go +++ b/service/s3/api_op_PutObjectAcl.go @@ -210,6 +210,7 @@ type PutObjectAclInput struct { func (in *PutObjectAclInput) bindEndpointParams(p *EndpointParameters) { p.Bucket = in.Bucket + p.Key = in.Key } diff --git a/service/s3/api_op_PutObjectLockConfiguration.go b/service/s3/api_op_PutObjectLockConfiguration.go index d300c11c669..2bc5717a1b8 100644 --- a/service/s3/api_op_PutObjectLockConfiguration.go +++ b/service/s3/api_op_PutObjectLockConfiguration.go @@ -21,8 +21,9 @@ import ( // - The DefaultRetention settings require both a mode and a period. // - The DefaultRetention period can be either Days or Years but you must select // one. You cannot specify Days and Years at the same time. -// - You can only enable Object Lock for new buckets. If you want to turn on -// Object Lock for an existing bucket, contact Amazon Web Services Support. +// - You can enable Object Lock for new or existing buckets. For more +// information, see Configuring Object Lock (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-configure.html) +// . func (c *Client) PutObjectLockConfiguration(ctx context.Context, params *PutObjectLockConfigurationInput, optFns ...func(*Options)) (*PutObjectLockConfigurationOutput, error) { if params == nil { params = &PutObjectLockConfigurationInput{} diff --git a/service/s3/api_op_UploadPart.go b/service/s3/api_op_UploadPart.go index 21c753a3405..5077378ba92 100644 --- a/service/s3/api_op_UploadPart.go +++ b/service/s3/api_op_UploadPart.go @@ -227,6 +227,7 @@ type UploadPartInput struct { func (in *UploadPartInput) bindEndpointParams(p *EndpointParameters) { p.Bucket = in.Bucket + p.Key = in.Key } diff --git a/service/s3/endpoints.go b/service/s3/endpoints.go index 1e4266d143c..4ff33428d96 100644 --- a/service/s3/endpoints.go +++ b/service/s3/endpoints.go @@ -303,6 +303,20 @@ type EndpointParameters struct { // Parameter is required. UseObjectLambdaEndpoint *bool + // The S3 Key used to send the request. This is an optional parameter that will be + // set automatically for operations that are scoped to an S3 Key. + // + // Parameter is + // required. + Key *string + + // The S3 Prefix used to send the request. This is an optional parameter that will + // be set automatically for operations that are scoped to an S3 Prefix. + // + // Parameter + // is required. + Prefix *string + // Internal parameter to disable Access Point Buckets // // Parameter is required. diff --git a/service/s3/endpoints_test.go b/service/s3/endpoints_test.go index 4a7864bae48..4f32f617279 100644 --- a/service/s3/endpoints_test.go +++ b/service/s3/endpoints_test.go @@ -2555,8 +2555,70 @@ func TestEndpointCase55(t *testing.T) { } } -// virtual addressing, aws-global region with fips uses the regional fips endpoint +// virtual addressing, aws-global region with Prefix, and Key uses the global +// endpoint. Prefix and Key parameters should not be used in endpoint evaluation. func TestEndpointCase56(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("aws-global"), + Bucket: ptr.String("bucket-name"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + Accelerate: ptr.Bool(false), + Prefix: ptr.String("prefix"), + Key: ptr.String("key"), + } + + 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://bucket-name.s3.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + + smithyhttp.SetDisableDoubleEncoding(&sp, true) + return sp + }(), + }, + }) + return out + }(), + } + + 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) + } +} + +// virtual addressing, aws-global region with fips uses the regional fips endpoint +func TestEndpointCase57(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket-name"), @@ -2616,7 +2678,7 @@ func TestEndpointCase56(t *testing.T) { // virtual addressing, aws-global region with dualstack uses the regional dualstack // endpoint -func TestEndpointCase57(t *testing.T) { +func TestEndpointCase58(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket-name"), @@ -2676,7 +2738,7 @@ func TestEndpointCase57(t *testing.T) { // virtual addressing, aws-global region with fips/dualstack uses the regional // fips/dualstack endpoint -func TestEndpointCase58(t *testing.T) { +func TestEndpointCase59(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket-name"), @@ -2736,7 +2798,7 @@ func TestEndpointCase58(t *testing.T) { // virtual addressing, aws-global region with accelerate uses the global accelerate // endpoint -func TestEndpointCase59(t *testing.T) { +func TestEndpointCase60(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket-name"), @@ -2795,7 +2857,7 @@ func TestEndpointCase59(t *testing.T) { } // virtual addressing, aws-global region with custom endpoint -func TestEndpointCase60(t *testing.T) { +func TestEndpointCase61(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Endpoint: ptr.String("https://example.com"), @@ -2856,7 +2918,7 @@ func TestEndpointCase60(t *testing.T) { // virtual addressing, UseGlobalEndpoint and us-east-1 region uses the global // endpoint -func TestEndpointCase61(t *testing.T) { +func TestEndpointCase62(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseGlobalEndpoint: ptr.Bool(true), @@ -2917,7 +2979,7 @@ func TestEndpointCase61(t *testing.T) { // virtual addressing, UseGlobalEndpoint and us-west-2 region uses the regional // endpoint -func TestEndpointCase62(t *testing.T) { +func TestEndpointCase63(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseGlobalEndpoint: ptr.Bool(true), @@ -2978,7 +3040,7 @@ func TestEndpointCase62(t *testing.T) { // virtual addressing, UseGlobalEndpoint and us-east-1 region and fips uses the // regional fips endpoint -func TestEndpointCase63(t *testing.T) { +func TestEndpointCase64(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseGlobalEndpoint: ptr.Bool(true), @@ -3039,7 +3101,7 @@ func TestEndpointCase63(t *testing.T) { // virtual addressing, UseGlobalEndpoint and us-east-1 region and dualstack uses // the regional dualstack endpoint -func TestEndpointCase64(t *testing.T) { +func TestEndpointCase65(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseGlobalEndpoint: ptr.Bool(true), @@ -3100,7 +3162,7 @@ func TestEndpointCase64(t *testing.T) { // virtual addressing, UseGlobalEndpoint and us-east-1 region and accelerate uses // the global accelerate endpoint -func TestEndpointCase65(t *testing.T) { +func TestEndpointCase66(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseGlobalEndpoint: ptr.Bool(true), @@ -3160,7 +3222,7 @@ func TestEndpointCase65(t *testing.T) { } // virtual addressing, UseGlobalEndpoint and us-east-1 region with custom endpoint -func TestEndpointCase66(t *testing.T) { +func TestEndpointCase67(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Endpoint: ptr.String("https://example.com"), @@ -3221,7 +3283,7 @@ func TestEndpointCase66(t *testing.T) { } // ForcePathStyle, aws-global region uses the global endpoint -func TestEndpointCase67(t *testing.T) { +func TestEndpointCase68(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket-name"), @@ -3281,7 +3343,7 @@ func TestEndpointCase67(t *testing.T) { } // ForcePathStyle, aws-global region with fips is invalid -func TestEndpointCase68(t *testing.T) { +func TestEndpointCase69(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket-name"), @@ -3342,7 +3404,7 @@ func TestEndpointCase68(t *testing.T) { // ForcePathStyle, aws-global region with dualstack uses regional dualstack // endpoint -func TestEndpointCase69(t *testing.T) { +func TestEndpointCase70(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket-name"), @@ -3402,7 +3464,7 @@ func TestEndpointCase69(t *testing.T) { } // ForcePathStyle, aws-global region custom endpoint uses the custom endpoint -func TestEndpointCase70(t *testing.T) { +func TestEndpointCase71(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Endpoint: ptr.String("https://example.com"), @@ -3463,7 +3525,7 @@ func TestEndpointCase70(t *testing.T) { } // ForcePathStyle, UseGlobalEndpoint us-east-1 region uses the global endpoint -func TestEndpointCase71(t *testing.T) { +func TestEndpointCase72(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket-name"), @@ -3524,7 +3586,7 @@ func TestEndpointCase71(t *testing.T) { } // ForcePathStyle, UseGlobalEndpoint us-west-2 region uses the regional endpoint -func TestEndpointCase72(t *testing.T) { +func TestEndpointCase73(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), Bucket: ptr.String("bucket-name"), @@ -3586,7 +3648,7 @@ func TestEndpointCase72(t *testing.T) { // ForcePathStyle, UseGlobalEndpoint us-east-1 region, dualstack uses the regional // dualstack endpoint -func TestEndpointCase73(t *testing.T) { +func TestEndpointCase74(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket-name"), @@ -3648,7 +3710,7 @@ func TestEndpointCase73(t *testing.T) { // ForcePathStyle, UseGlobalEndpoint us-east-1 region custom endpoint uses the // custom endpoint -func TestEndpointCase74(t *testing.T) { +func TestEndpointCase75(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket-name"), @@ -3710,7 +3772,7 @@ func TestEndpointCase74(t *testing.T) { } // ARN with aws-global region and UseArnRegion uses the regional endpoint -func TestEndpointCase75(t *testing.T) { +func TestEndpointCase76(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), UseArnRegion: ptr.Bool(true), @@ -3770,7 +3832,7 @@ func TestEndpointCase75(t *testing.T) { } // cross partition MRAP ARN is an error -func TestEndpointCase76(t *testing.T) { +func TestEndpointCase77(t *testing.T) { var params = EndpointParameters{ Bucket: ptr.String("arn:aws-cn:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap"), Region: ptr.String("us-west-1"), @@ -3789,7 +3851,7 @@ func TestEndpointCase76(t *testing.T) { } // Endpoint override, accesspoint with HTTP, port -func TestEndpointCase77(t *testing.T) { +func TestEndpointCase78(t *testing.T) { var params = EndpointParameters{ Endpoint: ptr.String("http://beta.example.com:1234"), Region: ptr.String("us-west-2"), @@ -3846,7 +3908,7 @@ func TestEndpointCase77(t *testing.T) { } // Endpoint override, accesspoint with http, path, query, and port -func TestEndpointCase78(t *testing.T) { +func TestEndpointCase79(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), Bucket: ptr.String("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint"), @@ -3906,7 +3968,7 @@ func TestEndpointCase78(t *testing.T) { } // non-bucket endpoint override with FIPS = error -func TestEndpointCase79(t *testing.T) { +func TestEndpointCase80(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), Endpoint: ptr.String("http://beta.example.com:1234/path"), @@ -3927,7 +3989,7 @@ func TestEndpointCase79(t *testing.T) { } // FIPS + dualstack + custom endpoint -func TestEndpointCase80(t *testing.T) { +func TestEndpointCase81(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), Endpoint: ptr.String("http://beta.example.com:1234/path"), @@ -3948,7 +4010,7 @@ func TestEndpointCase80(t *testing.T) { } // dualstack + custom endpoint -func TestEndpointCase81(t *testing.T) { +func TestEndpointCase82(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), Endpoint: ptr.String("http://beta.example.com:1234/path"), @@ -3969,7 +4031,7 @@ func TestEndpointCase81(t *testing.T) { } // custom endpoint without FIPS/dualstack -func TestEndpointCase82(t *testing.T) { +func TestEndpointCase83(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), Endpoint: ptr.String("http://beta.example.com:1234/path"), @@ -4027,7 +4089,7 @@ func TestEndpointCase82(t *testing.T) { } // s3 object lambda with access points disabled -func TestEndpointCase83(t *testing.T) { +func TestEndpointCase84(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), Bucket: ptr.String("arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint:myendpoint"), @@ -4047,7 +4109,7 @@ func TestEndpointCase83(t *testing.T) { } // non bucket + FIPS -func TestEndpointCase84(t *testing.T) { +func TestEndpointCase85(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(true), @@ -4104,7 +4166,7 @@ func TestEndpointCase84(t *testing.T) { } // standard non bucket endpoint -func TestEndpointCase85(t *testing.T) { +func TestEndpointCase86(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -4161,7 +4223,7 @@ func TestEndpointCase85(t *testing.T) { } // non bucket endpoint with FIPS + Dualstack -func TestEndpointCase86(t *testing.T) { +func TestEndpointCase87(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(true), @@ -4218,7 +4280,7 @@ func TestEndpointCase86(t *testing.T) { } // non bucket endpoint with dualstack -func TestEndpointCase87(t *testing.T) { +func TestEndpointCase88(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -4275,7 +4337,7 @@ func TestEndpointCase87(t *testing.T) { } // use global endpoint + IP address endpoint override -func TestEndpointCase88(t *testing.T) { +func TestEndpointCase89(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket"), @@ -4335,7 +4397,7 @@ func TestEndpointCase88(t *testing.T) { } // non-dns endpoint + global endpoint -func TestEndpointCase89(t *testing.T) { +func TestEndpointCase90(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket!"), @@ -4394,7 +4456,7 @@ func TestEndpointCase89(t *testing.T) { } // endpoint override + use global endpoint -func TestEndpointCase90(t *testing.T) { +func TestEndpointCase91(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket!"), @@ -4454,7 +4516,7 @@ func TestEndpointCase90(t *testing.T) { } // FIPS + dualstack + non-bucket endpoint -func TestEndpointCase91(t *testing.T) { +func TestEndpointCase92(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket!"), @@ -4512,7 +4574,7 @@ func TestEndpointCase91(t *testing.T) { } // FIPS + dualstack + non-DNS endpoint -func TestEndpointCase92(t *testing.T) { +func TestEndpointCase93(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket!"), @@ -4571,7 +4633,7 @@ func TestEndpointCase92(t *testing.T) { } // endpoint override + FIPS + dualstack (BUG) -func TestEndpointCase93(t *testing.T) { +func TestEndpointCase94(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket!"), @@ -4594,7 +4656,7 @@ func TestEndpointCase93(t *testing.T) { } // endpoint override + non-dns bucket + FIPS (BUG) -func TestEndpointCase94(t *testing.T) { +func TestEndpointCase95(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket!"), @@ -4616,7 +4678,7 @@ func TestEndpointCase94(t *testing.T) { } // FIPS + bucket endpoint + force path style -func TestEndpointCase95(t *testing.T) { +func TestEndpointCase96(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket!"), @@ -4676,7 +4738,7 @@ func TestEndpointCase95(t *testing.T) { } // bucket + FIPS + force path style -func TestEndpointCase96(t *testing.T) { +func TestEndpointCase97(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket"), @@ -4736,7 +4798,7 @@ func TestEndpointCase96(t *testing.T) { } // FIPS + dualstack + use global endpoint -func TestEndpointCase97(t *testing.T) { +func TestEndpointCase98(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket"), @@ -4795,7 +4857,7 @@ func TestEndpointCase97(t *testing.T) { } // URI encoded bucket + use global endpoint -func TestEndpointCase98(t *testing.T) { +func TestEndpointCase99(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket!"), @@ -4818,7 +4880,7 @@ func TestEndpointCase98(t *testing.T) { } // FIPS + path based endpoint -func TestEndpointCase99(t *testing.T) { +func TestEndpointCase100(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket!"), @@ -4878,7 +4940,7 @@ func TestEndpointCase99(t *testing.T) { } // accelerate + dualstack + global endpoint -func TestEndpointCase100(t *testing.T) { +func TestEndpointCase101(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket"), @@ -4938,7 +5000,7 @@ func TestEndpointCase100(t *testing.T) { } // dualstack + global endpoint + non URI safe bucket -func TestEndpointCase101(t *testing.T) { +func TestEndpointCase102(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket!"), @@ -4998,7 +5060,7 @@ func TestEndpointCase101(t *testing.T) { } // FIPS + uri encoded bucket -func TestEndpointCase102(t *testing.T) { +func TestEndpointCase103(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket!"), @@ -5059,7 +5121,7 @@ func TestEndpointCase102(t *testing.T) { } // endpoint override + non-uri safe endpoint + force path style -func TestEndpointCase103(t *testing.T) { +func TestEndpointCase104(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket!"), @@ -5084,7 +5146,7 @@ func TestEndpointCase103(t *testing.T) { } // FIPS + Dualstack + global endpoint + non-dns bucket -func TestEndpointCase104(t *testing.T) { +func TestEndpointCase105(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("bucket!"), @@ -5144,7 +5206,7 @@ func TestEndpointCase104(t *testing.T) { } // endpoint override + FIPS + dualstack -func TestEndpointCase105(t *testing.T) { +func TestEndpointCase106(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseDualStack: ptr.Bool(true), @@ -5166,7 +5228,7 @@ func TestEndpointCase105(t *testing.T) { } // non-bucket endpoint override + dualstack + global endpoint -func TestEndpointCase106(t *testing.T) { +func TestEndpointCase107(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), @@ -5188,7 +5250,7 @@ func TestEndpointCase106(t *testing.T) { } // Endpoint override + UseGlobalEndpoint + us-east-1 -func TestEndpointCase107(t *testing.T) { +func TestEndpointCase108(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), @@ -5210,7 +5272,7 @@ func TestEndpointCase107(t *testing.T) { } // non-FIPS partition with FIPS set + custom endpoint -func TestEndpointCase108(t *testing.T) { +func TestEndpointCase109(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), UseFIPS: ptr.Bool(true), @@ -5231,7 +5293,7 @@ func TestEndpointCase108(t *testing.T) { } // aws-global signs as us-east-1 -func TestEndpointCase109(t *testing.T) { +func TestEndpointCase110(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket!"), @@ -5290,7 +5352,7 @@ func TestEndpointCase109(t *testing.T) { } // aws-global signs as us-east-1 -func TestEndpointCase110(t *testing.T) { +func TestEndpointCase111(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket"), @@ -5350,7 +5412,7 @@ func TestEndpointCase110(t *testing.T) { } // aws-global + dualstack + path-only bucket -func TestEndpointCase111(t *testing.T) { +func TestEndpointCase112(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket!"), @@ -5409,7 +5471,7 @@ func TestEndpointCase111(t *testing.T) { } // aws-global + path-only bucket -func TestEndpointCase112(t *testing.T) { +func TestEndpointCase113(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket!"), @@ -5465,7 +5527,7 @@ func TestEndpointCase112(t *testing.T) { } // aws-global + fips + custom endpoint -func TestEndpointCase113(t *testing.T) { +func TestEndpointCase114(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket!"), @@ -5488,7 +5550,7 @@ func TestEndpointCase113(t *testing.T) { } // aws-global, endpoint override & path only-bucket -func TestEndpointCase114(t *testing.T) { +func TestEndpointCase115(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket!"), @@ -5548,7 +5610,7 @@ func TestEndpointCase114(t *testing.T) { } // aws-global + dualstack + custom endpoint -func TestEndpointCase115(t *testing.T) { +func TestEndpointCase116(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), UseDualStack: ptr.Bool(true), @@ -5570,7 +5632,7 @@ func TestEndpointCase115(t *testing.T) { } // accelerate, dualstack + aws-global -func TestEndpointCase116(t *testing.T) { +func TestEndpointCase117(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket"), @@ -5630,7 +5692,7 @@ func TestEndpointCase116(t *testing.T) { // FIPS + aws-global + path only bucket. This is not supported by S3 but we allow // garbage in garbage out -func TestEndpointCase117(t *testing.T) { +func TestEndpointCase118(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket!"), @@ -5690,7 +5752,7 @@ func TestEndpointCase117(t *testing.T) { } // aws-global + FIPS + endpoint override. -func TestEndpointCase118(t *testing.T) { +func TestEndpointCase119(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), UseFIPS: ptr.Bool(true), @@ -5710,7 +5772,7 @@ func TestEndpointCase118(t *testing.T) { } // force path style, FIPS, aws-global & endpoint override -func TestEndpointCase119(t *testing.T) { +func TestEndpointCase120(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket!"), @@ -5732,7 +5794,7 @@ func TestEndpointCase119(t *testing.T) { } // ip address causes path style to be forced -func TestEndpointCase120(t *testing.T) { +func TestEndpointCase121(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket"), @@ -5789,7 +5851,7 @@ func TestEndpointCase120(t *testing.T) { } // endpoint override with aws-global region -func TestEndpointCase121(t *testing.T) { +func TestEndpointCase122(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), UseFIPS: ptr.Bool(true), @@ -5810,7 +5872,7 @@ func TestEndpointCase121(t *testing.T) { } // FIPS + path-only (TODO: consider making this an error) -func TestEndpointCase122(t *testing.T) { +func TestEndpointCase123(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), Bucket: ptr.String("bucket!"), @@ -5867,7 +5929,7 @@ func TestEndpointCase122(t *testing.T) { } // empty arn type -func TestEndpointCase123(t *testing.T) { +func TestEndpointCase124(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("arn:aws:not-s3:us-west-2:123456789012::myendpoint"), @@ -5886,7 +5948,7 @@ func TestEndpointCase123(t *testing.T) { } // path style can't be used with accelerate -func TestEndpointCase124(t *testing.T) { +func TestEndpointCase125(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("bucket!"), @@ -5906,7 +5968,7 @@ func TestEndpointCase124(t *testing.T) { } // invalid region -func TestEndpointCase125(t *testing.T) { +func TestEndpointCase126(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2!"), Bucket: ptr.String("bucket.subdomain"), @@ -5926,7 +5988,7 @@ func TestEndpointCase125(t *testing.T) { } // invalid region -func TestEndpointCase126(t *testing.T) { +func TestEndpointCase127(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2!"), Bucket: ptr.String("bucket"), @@ -5946,7 +6008,7 @@ func TestEndpointCase126(t *testing.T) { } // empty arn type -func TestEndpointCase127(t *testing.T) { +func TestEndpointCase128(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("arn:aws:s3::123456789012:accesspoint:my_endpoint"), @@ -5965,7 +6027,7 @@ func TestEndpointCase127(t *testing.T) { } // empty arn type -func TestEndpointCase128(t *testing.T) { +func TestEndpointCase129(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("arn:aws:s3:cn-north-1:123456789012:accesspoint:my-endpoint"), @@ -5985,7 +6047,7 @@ func TestEndpointCase128(t *testing.T) { } // invalid arn region -func TestEndpointCase129(t *testing.T) { +func TestEndpointCase130(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("arn:aws:s3-object-lambda:us-east_2:123456789012:accesspoint:my-endpoint"), @@ -6005,7 +6067,7 @@ func TestEndpointCase129(t *testing.T) { } // invalid ARN outpost -func TestEndpointCase130(t *testing.T) { +func TestEndpointCase131(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("arn:aws:s3-outposts:us-east-1:123456789012:outpost/op_01234567890123456/accesspoint/reports"), @@ -6025,7 +6087,7 @@ func TestEndpointCase130(t *testing.T) { } // invalid ARN -func TestEndpointCase131(t *testing.T) { +func TestEndpointCase132(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-01234567890123456/reports"), @@ -6044,7 +6106,7 @@ func TestEndpointCase131(t *testing.T) { } // invalid ARN -func TestEndpointCase132(t *testing.T) { +func TestEndpointCase133(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-01234567890123456"), @@ -6063,7 +6125,7 @@ func TestEndpointCase132(t *testing.T) { } // invalid outpost type -func TestEndpointCase133(t *testing.T) { +func TestEndpointCase134(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-01234567890123456/not-accesspoint/reports"), @@ -6082,7 +6144,7 @@ func TestEndpointCase133(t *testing.T) { } // invalid outpost type -func TestEndpointCase134(t *testing.T) { +func TestEndpointCase135(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("arn:aws:s3-outposts:us-east_1:123456789012:outpost/op-01234567890123456/not-accesspoint/reports"), @@ -6101,7 +6163,7 @@ func TestEndpointCase134(t *testing.T) { } // invalid outpost type -func TestEndpointCase135(t *testing.T) { +func TestEndpointCase136(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("arn:aws:s3-outposts:us-east-1:12345_789012:outpost/op-01234567890123456/not-accesspoint/reports"), @@ -6120,7 +6182,7 @@ func TestEndpointCase135(t *testing.T) { } // invalid outpost type -func TestEndpointCase136(t *testing.T) { +func TestEndpointCase137(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("arn:aws:s3-outposts:us-east-1:12345789012:outpost"), @@ -6139,7 +6201,7 @@ func TestEndpointCase136(t *testing.T) { } // use global endpoint virtual addressing -func TestEndpointCase137(t *testing.T) { +func TestEndpointCase138(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("bucket"), @@ -6197,7 +6259,7 @@ func TestEndpointCase137(t *testing.T) { } // global endpoint + ip address -func TestEndpointCase138(t *testing.T) { +func TestEndpointCase139(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("bucket"), @@ -6255,7 +6317,7 @@ func TestEndpointCase138(t *testing.T) { } // invalid outpost type -func TestEndpointCase139(t *testing.T) { +func TestEndpointCase140(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("bucket!"), @@ -6312,7 +6374,7 @@ func TestEndpointCase139(t *testing.T) { } // invalid outpost type -func TestEndpointCase140(t *testing.T) { +func TestEndpointCase141(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("bucket"), @@ -6370,7 +6432,7 @@ func TestEndpointCase140(t *testing.T) { } // use global endpoint + custom endpoint -func TestEndpointCase141(t *testing.T) { +func TestEndpointCase142(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("bucket!"), @@ -6428,7 +6490,7 @@ func TestEndpointCase141(t *testing.T) { } // use global endpoint, not us-east-1, force path style -func TestEndpointCase142(t *testing.T) { +func TestEndpointCase143(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), Bucket: ptr.String("bucket!"), @@ -6487,7 +6549,7 @@ func TestEndpointCase142(t *testing.T) { } // vanilla virtual addressing@us-west-2 -func TestEndpointCase143(t *testing.T) { +func TestEndpointCase144(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -6547,7 +6609,7 @@ func TestEndpointCase143(t *testing.T) { } // virtual addressing + dualstack@us-west-2 -func TestEndpointCase144(t *testing.T) { +func TestEndpointCase145(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -6607,7 +6669,7 @@ func TestEndpointCase144(t *testing.T) { } // accelerate + dualstack@us-west-2 -func TestEndpointCase145(t *testing.T) { +func TestEndpointCase146(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), Bucket: ptr.String("bucket-name"), @@ -6667,7 +6729,7 @@ func TestEndpointCase145(t *testing.T) { } // accelerate (dualstack=false)@us-west-2 -func TestEndpointCase146(t *testing.T) { +func TestEndpointCase147(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), Bucket: ptr.String("bucket-name"), @@ -6727,7 +6789,7 @@ func TestEndpointCase146(t *testing.T) { } // virtual addressing + fips@us-west-2 -func TestEndpointCase147(t *testing.T) { +func TestEndpointCase148(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -6787,7 +6849,7 @@ func TestEndpointCase147(t *testing.T) { } // virtual addressing + dualstack + fips@us-west-2 -func TestEndpointCase148(t *testing.T) { +func TestEndpointCase149(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -6847,7 +6909,7 @@ func TestEndpointCase148(t *testing.T) { } // accelerate + fips = error@us-west-2 -func TestEndpointCase149(t *testing.T) { +func TestEndpointCase150(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), Bucket: ptr.String("bucket-name"), @@ -6870,7 +6932,7 @@ func TestEndpointCase149(t *testing.T) { } // vanilla virtual addressing@cn-north-1 -func TestEndpointCase150(t *testing.T) { +func TestEndpointCase151(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -6930,7 +6992,7 @@ func TestEndpointCase150(t *testing.T) { } // virtual addressing + dualstack@cn-north-1 -func TestEndpointCase151(t *testing.T) { +func TestEndpointCase152(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -6990,7 +7052,7 @@ func TestEndpointCase151(t *testing.T) { } // accelerate (dualstack=false)@cn-north-1 -func TestEndpointCase152(t *testing.T) { +func TestEndpointCase153(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), Bucket: ptr.String("bucket-name"), @@ -7013,7 +7075,7 @@ func TestEndpointCase152(t *testing.T) { } // virtual addressing + fips@cn-north-1 -func TestEndpointCase153(t *testing.T) { +func TestEndpointCase154(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -7036,7 +7098,7 @@ func TestEndpointCase153(t *testing.T) { } // vanilla virtual addressing@af-south-1 -func TestEndpointCase154(t *testing.T) { +func TestEndpointCase155(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -7096,7 +7158,7 @@ func TestEndpointCase154(t *testing.T) { } // virtual addressing + dualstack@af-south-1 -func TestEndpointCase155(t *testing.T) { +func TestEndpointCase156(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -7156,7 +7218,7 @@ func TestEndpointCase155(t *testing.T) { } // accelerate + dualstack@af-south-1 -func TestEndpointCase156(t *testing.T) { +func TestEndpointCase157(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), Bucket: ptr.String("bucket-name"), @@ -7216,7 +7278,7 @@ func TestEndpointCase156(t *testing.T) { } // accelerate (dualstack=false)@af-south-1 -func TestEndpointCase157(t *testing.T) { +func TestEndpointCase158(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), Bucket: ptr.String("bucket-name"), @@ -7276,7 +7338,7 @@ func TestEndpointCase157(t *testing.T) { } // virtual addressing + fips@af-south-1 -func TestEndpointCase158(t *testing.T) { +func TestEndpointCase159(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -7336,7 +7398,7 @@ func TestEndpointCase158(t *testing.T) { } // virtual addressing + dualstack + fips@af-south-1 -func TestEndpointCase159(t *testing.T) { +func TestEndpointCase160(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -7396,7 +7458,7 @@ func TestEndpointCase159(t *testing.T) { } // accelerate + fips = error@af-south-1 -func TestEndpointCase160(t *testing.T) { +func TestEndpointCase161(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), Bucket: ptr.String("bucket-name"), @@ -7419,7 +7481,7 @@ func TestEndpointCase160(t *testing.T) { } // vanilla path style@us-west-2 -func TestEndpointCase161(t *testing.T) { +func TestEndpointCase162(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -7479,7 +7541,7 @@ func TestEndpointCase161(t *testing.T) { } // fips@us-gov-west-2, bucket is not S3-dns-compatible (subdomains) -func TestEndpointCase162(t *testing.T) { +func TestEndpointCase163(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket.with.dots"), @@ -7538,7 +7600,7 @@ func TestEndpointCase162(t *testing.T) { } // path style + accelerate = error@us-west-2 -func TestEndpointCase163(t *testing.T) { +func TestEndpointCase164(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), Bucket: ptr.String("bucket-name"), @@ -7561,7 +7623,7 @@ func TestEndpointCase163(t *testing.T) { } // path style + dualstack@us-west-2 -func TestEndpointCase164(t *testing.T) { +func TestEndpointCase165(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -7621,7 +7683,7 @@ func TestEndpointCase164(t *testing.T) { } // path style + arn is error@us-west-2 -func TestEndpointCase165(t *testing.T) { +func TestEndpointCase166(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:PARTITION:s3-outposts:REGION:123456789012:outpost:op-01234567890123456:bucket:mybucket"), @@ -7644,7 +7706,7 @@ func TestEndpointCase165(t *testing.T) { } // path style + invalid DNS name@us-west-2 -func TestEndpointCase166(t *testing.T) { +func TestEndpointCase167(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("99a_b"), @@ -7704,7 +7766,7 @@ func TestEndpointCase166(t *testing.T) { } // no path style + invalid DNS name@us-west-2 -func TestEndpointCase167(t *testing.T) { +func TestEndpointCase168(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("99a_b"), @@ -7763,7 +7825,7 @@ func TestEndpointCase167(t *testing.T) { } // vanilla path style@cn-north-1 -func TestEndpointCase168(t *testing.T) { +func TestEndpointCase169(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -7823,7 +7885,7 @@ func TestEndpointCase168(t *testing.T) { } // path style + fips@cn-north-1 -func TestEndpointCase169(t *testing.T) { +func TestEndpointCase170(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -7846,7 +7908,7 @@ func TestEndpointCase169(t *testing.T) { } // path style + accelerate = error@cn-north-1 -func TestEndpointCase170(t *testing.T) { +func TestEndpointCase171(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), Bucket: ptr.String("bucket-name"), @@ -7869,7 +7931,7 @@ func TestEndpointCase170(t *testing.T) { } // path style + dualstack@cn-north-1 -func TestEndpointCase171(t *testing.T) { +func TestEndpointCase172(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -7929,7 +7991,7 @@ func TestEndpointCase171(t *testing.T) { } // path style + arn is error@cn-north-1 -func TestEndpointCase172(t *testing.T) { +func TestEndpointCase173(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:PARTITION:s3-outposts:REGION:123456789012:outpost:op-01234567890123456:bucket:mybucket"), @@ -7952,7 +8014,7 @@ func TestEndpointCase172(t *testing.T) { } // path style + invalid DNS name@cn-north-1 -func TestEndpointCase173(t *testing.T) { +func TestEndpointCase174(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("99a_b"), @@ -8012,7 +8074,7 @@ func TestEndpointCase173(t *testing.T) { } // no path style + invalid DNS name@cn-north-1 -func TestEndpointCase174(t *testing.T) { +func TestEndpointCase175(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("99a_b"), @@ -8071,7 +8133,7 @@ func TestEndpointCase174(t *testing.T) { } // vanilla path style@af-south-1 -func TestEndpointCase175(t *testing.T) { +func TestEndpointCase176(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -8131,7 +8193,7 @@ func TestEndpointCase175(t *testing.T) { } // path style + fips@af-south-1 -func TestEndpointCase176(t *testing.T) { +func TestEndpointCase177(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -8191,7 +8253,7 @@ func TestEndpointCase176(t *testing.T) { } // path style + accelerate = error@af-south-1 -func TestEndpointCase177(t *testing.T) { +func TestEndpointCase178(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), Bucket: ptr.String("bucket-name"), @@ -8214,7 +8276,7 @@ func TestEndpointCase177(t *testing.T) { } // path style + dualstack@af-south-1 -func TestEndpointCase178(t *testing.T) { +func TestEndpointCase179(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -8274,7 +8336,7 @@ func TestEndpointCase178(t *testing.T) { } // path style + arn is error@af-south-1 -func TestEndpointCase179(t *testing.T) { +func TestEndpointCase180(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:PARTITION:s3-outposts:REGION:123456789012:outpost:op-01234567890123456:bucket:mybucket"), @@ -8297,7 +8359,7 @@ func TestEndpointCase179(t *testing.T) { } // path style + invalid DNS name@af-south-1 -func TestEndpointCase180(t *testing.T) { +func TestEndpointCase181(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("99a_b"), @@ -8357,7 +8419,7 @@ func TestEndpointCase180(t *testing.T) { } // no path style + invalid DNS name@af-south-1 -func TestEndpointCase181(t *testing.T) { +func TestEndpointCase182(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("99a_b"), @@ -8416,7 +8478,7 @@ func TestEndpointCase181(t *testing.T) { } // virtual addressing + private link@us-west-2 -func TestEndpointCase182(t *testing.T) { +func TestEndpointCase183(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -8477,7 +8539,7 @@ func TestEndpointCase182(t *testing.T) { } // path style + private link@us-west-2 -func TestEndpointCase183(t *testing.T) { +func TestEndpointCase184(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -8538,7 +8600,7 @@ func TestEndpointCase183(t *testing.T) { } // SDK::Host + FIPS@us-west-2 -func TestEndpointCase184(t *testing.T) { +func TestEndpointCase185(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -8562,7 +8624,7 @@ func TestEndpointCase184(t *testing.T) { } // SDK::Host + DualStack@us-west-2 -func TestEndpointCase185(t *testing.T) { +func TestEndpointCase186(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -8586,7 +8648,7 @@ func TestEndpointCase185(t *testing.T) { } // SDK::HOST + accelerate@us-west-2 -func TestEndpointCase186(t *testing.T) { +func TestEndpointCase187(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), Bucket: ptr.String("bucket-name"), @@ -8610,7 +8672,7 @@ func TestEndpointCase186(t *testing.T) { } // SDK::Host + access point ARN@us-west-2 -func TestEndpointCase187(t *testing.T) { +func TestEndpointCase188(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint"), @@ -8671,7 +8733,7 @@ func TestEndpointCase187(t *testing.T) { } // virtual addressing + private link@cn-north-1 -func TestEndpointCase188(t *testing.T) { +func TestEndpointCase189(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -8732,7 +8794,7 @@ func TestEndpointCase188(t *testing.T) { } // path style + private link@cn-north-1 -func TestEndpointCase189(t *testing.T) { +func TestEndpointCase190(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -8793,7 +8855,7 @@ func TestEndpointCase189(t *testing.T) { } // FIPS@cn-north-1 -func TestEndpointCase190(t *testing.T) { +func TestEndpointCase191(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -8816,7 +8878,7 @@ func TestEndpointCase190(t *testing.T) { } // SDK::Host + DualStack@cn-north-1 -func TestEndpointCase191(t *testing.T) { +func TestEndpointCase192(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -8840,7 +8902,7 @@ func TestEndpointCase191(t *testing.T) { } // SDK::HOST + accelerate@cn-north-1 -func TestEndpointCase192(t *testing.T) { +func TestEndpointCase193(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), Bucket: ptr.String("bucket-name"), @@ -8864,7 +8926,7 @@ func TestEndpointCase192(t *testing.T) { } // SDK::Host + access point ARN@cn-north-1 -func TestEndpointCase193(t *testing.T) { +func TestEndpointCase194(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint"), @@ -8925,7 +8987,7 @@ func TestEndpointCase193(t *testing.T) { } // virtual addressing + private link@af-south-1 -func TestEndpointCase194(t *testing.T) { +func TestEndpointCase195(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -8986,7 +9048,7 @@ func TestEndpointCase194(t *testing.T) { } // path style + private link@af-south-1 -func TestEndpointCase195(t *testing.T) { +func TestEndpointCase196(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -9047,7 +9109,7 @@ func TestEndpointCase195(t *testing.T) { } // SDK::Host + FIPS@af-south-1 -func TestEndpointCase196(t *testing.T) { +func TestEndpointCase197(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -9071,7 +9133,7 @@ func TestEndpointCase196(t *testing.T) { } // SDK::Host + DualStack@af-south-1 -func TestEndpointCase197(t *testing.T) { +func TestEndpointCase198(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("bucket-name"), @@ -9095,7 +9157,7 @@ func TestEndpointCase197(t *testing.T) { } // SDK::HOST + accelerate@af-south-1 -func TestEndpointCase198(t *testing.T) { +func TestEndpointCase199(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), Bucket: ptr.String("bucket-name"), @@ -9119,7 +9181,7 @@ func TestEndpointCase198(t *testing.T) { } // SDK::Host + access point ARN@af-south-1 -func TestEndpointCase199(t *testing.T) { +func TestEndpointCase200(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws:s3:af-south-1:123456789012:accesspoint:myendpoint"), @@ -9180,7 +9242,7 @@ func TestEndpointCase199(t *testing.T) { } // vanilla access point arn@us-west-2 -func TestEndpointCase200(t *testing.T) { +func TestEndpointCase201(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint"), @@ -9240,7 +9302,7 @@ func TestEndpointCase200(t *testing.T) { } // access point arn + FIPS@us-west-2 -func TestEndpointCase201(t *testing.T) { +func TestEndpointCase202(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint"), @@ -9300,7 +9362,7 @@ func TestEndpointCase201(t *testing.T) { } // access point arn + accelerate = error@us-west-2 -func TestEndpointCase202(t *testing.T) { +func TestEndpointCase203(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), Bucket: ptr.String("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint"), @@ -9323,7 +9385,7 @@ func TestEndpointCase202(t *testing.T) { } // access point arn + FIPS + DualStack@us-west-2 -func TestEndpointCase203(t *testing.T) { +func TestEndpointCase204(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint"), @@ -9383,7 +9445,7 @@ func TestEndpointCase203(t *testing.T) { } // vanilla access point arn@cn-north-1 -func TestEndpointCase204(t *testing.T) { +func TestEndpointCase205(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint"), @@ -9443,7 +9505,7 @@ func TestEndpointCase204(t *testing.T) { } // access point arn + FIPS@cn-north-1 -func TestEndpointCase205(t *testing.T) { +func TestEndpointCase206(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint"), @@ -9466,7 +9528,7 @@ func TestEndpointCase205(t *testing.T) { } // access point arn + accelerate = error@cn-north-1 -func TestEndpointCase206(t *testing.T) { +func TestEndpointCase207(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), Bucket: ptr.String("arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint"), @@ -9489,7 +9551,7 @@ func TestEndpointCase206(t *testing.T) { } // access point arn + FIPS + DualStack@cn-north-1 -func TestEndpointCase207(t *testing.T) { +func TestEndpointCase208(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint"), @@ -9512,7 +9574,7 @@ func TestEndpointCase207(t *testing.T) { } // vanilla access point arn@af-south-1 -func TestEndpointCase208(t *testing.T) { +func TestEndpointCase209(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws:s3:af-south-1:123456789012:accesspoint:myendpoint"), @@ -9572,7 +9634,7 @@ func TestEndpointCase208(t *testing.T) { } // access point arn + FIPS@af-south-1 -func TestEndpointCase209(t *testing.T) { +func TestEndpointCase210(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws:s3:af-south-1:123456789012:accesspoint:myendpoint"), @@ -9632,7 +9694,7 @@ func TestEndpointCase209(t *testing.T) { } // access point arn + accelerate = error@af-south-1 -func TestEndpointCase210(t *testing.T) { +func TestEndpointCase211(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), Bucket: ptr.String("arn:aws:s3:af-south-1:123456789012:accesspoint:myendpoint"), @@ -9655,7 +9717,7 @@ func TestEndpointCase210(t *testing.T) { } // access point arn + FIPS + DualStack@af-south-1 -func TestEndpointCase211(t *testing.T) { +func TestEndpointCase212(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws:s3:af-south-1:123456789012:accesspoint:myendpoint"), @@ -9715,7 +9777,7 @@ func TestEndpointCase211(t *testing.T) { } // S3 outposts vanilla test -func TestEndpointCase212(t *testing.T) { +func TestEndpointCase213(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -9774,7 +9836,7 @@ func TestEndpointCase212(t *testing.T) { } // S3 outposts custom endpoint -func TestEndpointCase213(t *testing.T) { +func TestEndpointCase214(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -9834,7 +9896,7 @@ func TestEndpointCase213(t *testing.T) { } // outposts arn with region mismatch and UseArnRegion=false -func TestEndpointCase214(t *testing.T) { +func TestEndpointCase215(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint"), @@ -9858,7 +9920,7 @@ func TestEndpointCase214(t *testing.T) { } // outposts arn with region mismatch, custom region and UseArnRegion=false -func TestEndpointCase215(t *testing.T) { +func TestEndpointCase216(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint"), @@ -9883,7 +9945,7 @@ func TestEndpointCase215(t *testing.T) { } // outposts arn with region mismatch and UseArnRegion=true -func TestEndpointCase216(t *testing.T) { +func TestEndpointCase217(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint"), @@ -9944,7 +10006,7 @@ func TestEndpointCase216(t *testing.T) { } // outposts arn with region mismatch and UseArnRegion unset -func TestEndpointCase217(t *testing.T) { +func TestEndpointCase218(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint"), @@ -10004,7 +10066,7 @@ func TestEndpointCase217(t *testing.T) { } // outposts arn with partition mismatch and UseArnRegion=true -func TestEndpointCase218(t *testing.T) { +func TestEndpointCase219(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint"), @@ -10028,7 +10090,7 @@ func TestEndpointCase218(t *testing.T) { } // ARN with UseGlobalEndpoint and use-east-1 region uses the regional endpoint -func TestEndpointCase219(t *testing.T) { +func TestEndpointCase220(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseGlobalEndpoint: ptr.Bool(true), @@ -10088,7 +10150,7 @@ func TestEndpointCase219(t *testing.T) { } // S3 outposts does not support dualstack -func TestEndpointCase220(t *testing.T) { +func TestEndpointCase221(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), @@ -10110,7 +10172,7 @@ func TestEndpointCase220(t *testing.T) { } // S3 outposts does not support fips -func TestEndpointCase221(t *testing.T) { +func TestEndpointCase222(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), @@ -10132,7 +10194,7 @@ func TestEndpointCase221(t *testing.T) { } // S3 outposts does not support accelerate -func TestEndpointCase222(t *testing.T) { +func TestEndpointCase223(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), @@ -10154,7 +10216,7 @@ func TestEndpointCase222(t *testing.T) { } // validates against subresource -func TestEndpointCase223(t *testing.T) { +func TestEndpointCase224(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -10176,7 +10238,7 @@ func TestEndpointCase223(t *testing.T) { } // object lambda @us-east-1 -func TestEndpointCase224(t *testing.T) { +func TestEndpointCase225(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), @@ -10236,7 +10298,7 @@ func TestEndpointCase224(t *testing.T) { } // object lambda @us-west-2 -func TestEndpointCase225(t *testing.T) { +func TestEndpointCase226(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -10296,7 +10358,7 @@ func TestEndpointCase225(t *testing.T) { } // object lambda, colon resource deliminator @us-west-2 -func TestEndpointCase226(t *testing.T) { +func TestEndpointCase227(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -10356,7 +10418,7 @@ func TestEndpointCase226(t *testing.T) { } // object lambda @us-east-1, client region us-west-2, useArnRegion=true -func TestEndpointCase227(t *testing.T) { +func TestEndpointCase228(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -10416,7 +10478,7 @@ func TestEndpointCase227(t *testing.T) { } // object lambda @us-east-1, client region s3-external-1, useArnRegion=true -func TestEndpointCase228(t *testing.T) { +func TestEndpointCase229(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("s3-external-1"), UseFIPS: ptr.Bool(false), @@ -10476,7 +10538,7 @@ func TestEndpointCase228(t *testing.T) { } // object lambda @us-east-1, client region s3-external-1, useArnRegion=false -func TestEndpointCase229(t *testing.T) { +func TestEndpointCase230(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("s3-external-1"), UseFIPS: ptr.Bool(false), @@ -10499,7 +10561,7 @@ func TestEndpointCase229(t *testing.T) { } // object lambda @us-east-1, client region aws-global, useArnRegion=true -func TestEndpointCase230(t *testing.T) { +func TestEndpointCase231(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), UseFIPS: ptr.Bool(false), @@ -10559,7 +10621,7 @@ func TestEndpointCase230(t *testing.T) { } // object lambda @us-east-1, client region aws-global, useArnRegion=false -func TestEndpointCase231(t *testing.T) { +func TestEndpointCase232(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), UseFIPS: ptr.Bool(false), @@ -10583,7 +10645,7 @@ func TestEndpointCase231(t *testing.T) { // object lambda @cn-north-1, client region us-west-2 (cross partition), // useArnRegion=true -func TestEndpointCase232(t *testing.T) { +func TestEndpointCase233(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("aws-global"), UseFIPS: ptr.Bool(false), @@ -10606,7 +10668,7 @@ func TestEndpointCase232(t *testing.T) { } // object lambda with dualstack -func TestEndpointCase233(t *testing.T) { +func TestEndpointCase234(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -10629,7 +10691,7 @@ func TestEndpointCase233(t *testing.T) { } // object lambda @us-gov-east-1 -func TestEndpointCase234(t *testing.T) { +func TestEndpointCase235(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), UseFIPS: ptr.Bool(false), @@ -10689,7 +10751,7 @@ func TestEndpointCase234(t *testing.T) { } // object lambda @us-gov-east-1, with fips -func TestEndpointCase235(t *testing.T) { +func TestEndpointCase236(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), UseFIPS: ptr.Bool(true), @@ -10749,7 +10811,7 @@ func TestEndpointCase235(t *testing.T) { } // object lambda @cn-north-1, with fips -func TestEndpointCase236(t *testing.T) { +func TestEndpointCase237(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), UseFIPS: ptr.Bool(true), @@ -10772,7 +10834,7 @@ func TestEndpointCase236(t *testing.T) { } // object lambda with accelerate -func TestEndpointCase237(t *testing.T) { +func TestEndpointCase238(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -10795,7 +10857,7 @@ func TestEndpointCase237(t *testing.T) { } // object lambda with invalid arn - bad service and someresource -func TestEndpointCase238(t *testing.T) { +func TestEndpointCase239(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -10818,7 +10880,7 @@ func TestEndpointCase238(t *testing.T) { } // object lambda with invalid arn - invalid resource -func TestEndpointCase239(t *testing.T) { +func TestEndpointCase240(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -10841,7 +10903,7 @@ func TestEndpointCase239(t *testing.T) { } // object lambda with invalid arn - missing region -func TestEndpointCase240(t *testing.T) { +func TestEndpointCase241(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -10864,7 +10926,7 @@ func TestEndpointCase240(t *testing.T) { } // object lambda with invalid arn - missing account-id -func TestEndpointCase241(t *testing.T) { +func TestEndpointCase242(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -10887,7 +10949,7 @@ func TestEndpointCase241(t *testing.T) { } // object lambda with invalid arn - account id contains invalid characters -func TestEndpointCase242(t *testing.T) { +func TestEndpointCase243(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -10910,7 +10972,7 @@ func TestEndpointCase242(t *testing.T) { } // object lambda with invalid arn - missing access point name -func TestEndpointCase243(t *testing.T) { +func TestEndpointCase244(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -10933,7 +10995,7 @@ func TestEndpointCase243(t *testing.T) { } // object lambda with invalid arn - access point name contains invalid character: * -func TestEndpointCase244(t *testing.T) { +func TestEndpointCase245(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -10956,7 +11018,7 @@ func TestEndpointCase244(t *testing.T) { } // object lambda with invalid arn - access point name contains invalid character: . -func TestEndpointCase245(t *testing.T) { +func TestEndpointCase246(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -10979,7 +11041,7 @@ func TestEndpointCase245(t *testing.T) { } // object lambda with invalid arn - access point name contains sub resources -func TestEndpointCase246(t *testing.T) { +func TestEndpointCase247(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -11002,7 +11064,7 @@ func TestEndpointCase246(t *testing.T) { } // object lambda with custom endpoint -func TestEndpointCase247(t *testing.T) { +func TestEndpointCase248(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), @@ -11063,7 +11125,7 @@ func TestEndpointCase247(t *testing.T) { } // object lambda arn with region mismatch and UseArnRegion=false -func TestEndpointCase248(t *testing.T) { +func TestEndpointCase249(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Bucket: ptr.String("arn:aws:s3-object-lambda:us-east-1:123456789012:accesspoint/mybanner"), @@ -11087,7 +11149,7 @@ func TestEndpointCase248(t *testing.T) { } // WriteGetObjectResponse @ us-west-2 -func TestEndpointCase249(t *testing.T) { +func TestEndpointCase250(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), UseObjectLambdaEndpoint: ptr.Bool(true), @@ -11146,7 +11208,7 @@ func TestEndpointCase249(t *testing.T) { } // WriteGetObjectResponse with custom endpoint -func TestEndpointCase250(t *testing.T) { +func TestEndpointCase251(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), UseObjectLambdaEndpoint: ptr.Bool(true), @@ -11206,7 +11268,7 @@ func TestEndpointCase250(t *testing.T) { } // WriteGetObjectResponse @ us-east-1 -func TestEndpointCase251(t *testing.T) { +func TestEndpointCase252(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), UseObjectLambdaEndpoint: ptr.Bool(true), @@ -11265,7 +11327,7 @@ func TestEndpointCase251(t *testing.T) { } // WriteGetObjectResponse with fips -func TestEndpointCase252(t *testing.T) { +func TestEndpointCase253(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), UseObjectLambdaEndpoint: ptr.Bool(true), @@ -11324,7 +11386,7 @@ func TestEndpointCase252(t *testing.T) { } // WriteGetObjectResponse with dualstack -func TestEndpointCase253(t *testing.T) { +func TestEndpointCase254(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), UseObjectLambdaEndpoint: ptr.Bool(true), @@ -11346,7 +11408,7 @@ func TestEndpointCase253(t *testing.T) { } // WriteGetObjectResponse with accelerate -func TestEndpointCase254(t *testing.T) { +func TestEndpointCase255(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(true), UseObjectLambdaEndpoint: ptr.Bool(true), @@ -11368,7 +11430,7 @@ func TestEndpointCase254(t *testing.T) { } // WriteGetObjectResponse with fips in CN -func TestEndpointCase255(t *testing.T) { +func TestEndpointCase256(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), Region: ptr.String("cn-north-1"), @@ -11390,7 +11452,7 @@ func TestEndpointCase255(t *testing.T) { } // WriteGetObjectResponse with invalid partition -func TestEndpointCase256(t *testing.T) { +func TestEndpointCase257(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), UseObjectLambdaEndpoint: ptr.Bool(true), @@ -11412,7 +11474,7 @@ func TestEndpointCase256(t *testing.T) { } // WriteGetObjectResponse with an unknown partition -func TestEndpointCase257(t *testing.T) { +func TestEndpointCase258(t *testing.T) { var params = EndpointParameters{ Accelerate: ptr.Bool(false), UseObjectLambdaEndpoint: ptr.Bool(true), @@ -11471,7 +11533,7 @@ func TestEndpointCase257(t *testing.T) { } // S3 Outposts bucketAlias Real Outpost Prod us-west-1 -func TestEndpointCase258(t *testing.T) { +func TestEndpointCase259(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-1"), Bucket: ptr.String("test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3"), @@ -11530,7 +11592,7 @@ func TestEndpointCase258(t *testing.T) { } // S3 Outposts bucketAlias Real Outpost Prod ap-east-1 -func TestEndpointCase259(t *testing.T) { +func TestEndpointCase260(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-east-1"), Bucket: ptr.String("test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3"), @@ -11589,7 +11651,7 @@ func TestEndpointCase259(t *testing.T) { } // S3 Outposts bucketAlias Ec2 Outpost Prod us-east-1 -func TestEndpointCase260(t *testing.T) { +func TestEndpointCase261(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("test-accessp-e0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3"), @@ -11648,7 +11710,7 @@ func TestEndpointCase260(t *testing.T) { } // S3 Outposts bucketAlias Ec2 Outpost Prod me-south-1 -func TestEndpointCase261(t *testing.T) { +func TestEndpointCase262(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("me-south-1"), Bucket: ptr.String("test-accessp-e0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3"), @@ -11707,7 +11769,7 @@ func TestEndpointCase261(t *testing.T) { } // S3 Outposts bucketAlias Real Outpost Beta -func TestEndpointCase262(t *testing.T) { +func TestEndpointCase263(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kbeta0--op-s3"), @@ -11767,7 +11829,7 @@ func TestEndpointCase262(t *testing.T) { } // S3 Outposts bucketAlias Ec2 Outpost Beta -func TestEndpointCase263(t *testing.T) { +func TestEndpointCase264(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("161743052723-e00000136899934034jeahy1t8gpzpbwjj8kb7beta0--op-s3"), @@ -11827,7 +11889,7 @@ func TestEndpointCase263(t *testing.T) { } // S3 Outposts bucketAlias - No endpoint set for beta -func TestEndpointCase264(t *testing.T) { +func TestEndpointCase265(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kbeta0--op-s3"), @@ -11849,7 +11911,7 @@ func TestEndpointCase264(t *testing.T) { } // S3 Outposts bucketAlias Invalid hardware type -func TestEndpointCase265(t *testing.T) { +func TestEndpointCase266(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("test-accessp-h0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3"), @@ -11871,7 +11933,7 @@ func TestEndpointCase265(t *testing.T) { } // S3 Outposts bucketAlias Special character in Outpost Arn -func TestEndpointCase266(t *testing.T) { +func TestEndpointCase267(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("test-accessp-o00000754%1d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3"), @@ -11893,7 +11955,7 @@ func TestEndpointCase266(t *testing.T) { } // S3 Outposts bucketAlias - No endpoint set for beta -func TestEndpointCase267(t *testing.T) { +func TestEndpointCase268(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), Bucket: ptr.String("test-accessp-e0b1d075431d83bebde8xz5w8ijx1qzlbp3i3ebeta0--op-s3"), @@ -11915,7 +11977,7 @@ func TestEndpointCase267(t *testing.T) { } // S3 Snow with bucket -func TestEndpointCase268(t *testing.T) { +func TestEndpointCase269(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("snow"), Bucket: ptr.String("bucketName"), @@ -11975,7 +12037,7 @@ func TestEndpointCase268(t *testing.T) { } // S3 Snow without bucket -func TestEndpointCase269(t *testing.T) { +func TestEndpointCase270(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("snow"), Endpoint: ptr.String("https://10.0.1.12:433"), @@ -12034,7 +12096,7 @@ func TestEndpointCase269(t *testing.T) { } // S3 Snow no port -func TestEndpointCase270(t *testing.T) { +func TestEndpointCase271(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("snow"), Bucket: ptr.String("bucketName"), @@ -12094,7 +12156,7 @@ func TestEndpointCase270(t *testing.T) { } // S3 Snow dns endpoint -func TestEndpointCase271(t *testing.T) { +func TestEndpointCase272(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("snow"), Bucket: ptr.String("bucketName"), diff --git a/service/s3control/api_op_AssociateAccessGrantsIdentityCenter.go b/service/s3control/api_op_AssociateAccessGrantsIdentityCenter.go new file mode 100644 index 00000000000..98f60277ef4 --- /dev/null +++ b/service/s3control/api_op_AssociateAccessGrantsIdentityCenter.go @@ -0,0 +1,260 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" +) + +// Associate your S3 Access Grants instance with an Amazon Web Services IAM +// Identity Center instance. Use this action if you want to create access grants +// for users or groups from your corporate identity directory. First, you must add +// your corporate identity directory to Amazon Web Services IAM Identity Center. +// Then, you can associate this IAM Identity Center instance with your S3 Access +// Grants instance. Permissions You must have the +// s3:AssociateAccessGrantsIdentityCenter permission to use this operation. +// Additional Permissions You must also have the following permissions: +// sso:CreateApplication , sso:PutApplicationGrant , and +// sso:PutApplicationAuthenticationMethod . +func (c *Client) AssociateAccessGrantsIdentityCenter(ctx context.Context, params *AssociateAccessGrantsIdentityCenterInput, optFns ...func(*Options)) (*AssociateAccessGrantsIdentityCenterOutput, error) { + if params == nil { + params = &AssociateAccessGrantsIdentityCenterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociateAccessGrantsIdentityCenter", params, optFns, c.addOperationAssociateAccessGrantsIdentityCenterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociateAccessGrantsIdentityCenterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssociateAccessGrantsIdentityCenterInput struct { + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + // The Amazon Resource Name (ARN) of the Amazon Web Services IAM Identity Center + // instance that you are associating with your S3 Access Grants instance. An IAM + // Identity Center instance is your corporate identity directory that you added to + // the IAM Identity Center. You can use the ListInstances (https://docs.aws.amazon.com/singlesignon/latest/APIReference/API_ListInstances.html) + // API operation to retrieve a list of your Identity Center instances and their + // ARNs. + // + // This member is required. + IdentityCenterArn *string + + noSmithyDocumentSerde +} + +func (in *AssociateAccessGrantsIdentityCenterInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type AssociateAccessGrantsIdentityCenterOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssociateAccessGrantsIdentityCenterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpAssociateAccessGrantsIdentityCenter{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpAssociateAccessGrantsIdentityCenter{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateAccessGrantsIdentityCenter"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opAssociateAccessGrantsIdentityCenterMiddleware(stack); err != nil { + return err + } + if err = addOpAssociateAccessGrantsIdentityCenterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateAccessGrantsIdentityCenter(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addAssociateAccessGrantsIdentityCenterUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opAssociateAccessGrantsIdentityCenterMiddleware struct { +} + +func (*endpointPrefix_opAssociateAccessGrantsIdentityCenterMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opAssociateAccessGrantsIdentityCenterMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*AssociateAccessGrantsIdentityCenterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opAssociateAccessGrantsIdentityCenterMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opAssociateAccessGrantsIdentityCenterMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opAssociateAccessGrantsIdentityCenter(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AssociateAccessGrantsIdentityCenter", + } +} + +func copyAssociateAccessGrantsIdentityCenterInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*AssociateAccessGrantsIdentityCenterInput) + if !ok { + return nil, fmt.Errorf("expect *AssociateAccessGrantsIdentityCenterInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *AssociateAccessGrantsIdentityCenterInput) copy() interface{} { + v := *in + return &v +} +func backFillAssociateAccessGrantsIdentityCenterAccountID(input interface{}, v string) error { + in := input.(*AssociateAccessGrantsIdentityCenterInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addAssociateAccessGrantsIdentityCenterUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyAssociateAccessGrantsIdentityCenterInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_CreateAccessGrant.go b/service/s3control/api_op_CreateAccessGrant.go new file mode 100644 index 00000000000..1e68f5448c5 --- /dev/null +++ b/service/s3control/api_op_CreateAccessGrant.go @@ -0,0 +1,348 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" + "time" +) + +// Creates an access grant that gives a grantee access to your S3 data. The +// grantee can be an IAM user or role or a directory user, or group. Before you can +// create a grant, you must have an S3 Access Grants instance in the same Region as +// the S3 data. You can create an S3 Access Grants instance using the +// CreateAccessGrantsInstance (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessGrantsInstance.html) +// . You must also have registered at least one S3 data location in your S3 Access +// Grants instance using CreateAccessGrantsLocation (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessGrantsLocation.html) +// . Permissions You must have the s3:CreateAccessGrant permission to use this +// operation. Additional Permissions For any directory identity - +// sso:DescribeInstance and sso:DescribeApplication For directory users - +// identitystore:DescribeUser For directory groups - identitystore:DescribeGroup +func (c *Client) CreateAccessGrant(ctx context.Context, params *CreateAccessGrantInput, optFns ...func(*Options)) (*CreateAccessGrantOutput, error) { + if params == nil { + params = &CreateAccessGrantInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAccessGrant", params, optFns, c.addOperationCreateAccessGrantMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAccessGrantOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAccessGrantInput struct { + + // The ID of the registered location to which you are granting access. S3 Access + // Grants assigns this ID when you register the location. S3 Access Grants assigns + // the ID default to the default location s3:// and assigns an auto-generated ID + // to other locations that you register. If you are passing the default location, + // you cannot create an access grant for the entire default location. You must also + // specify a bucket or a bucket and prefix in the Subprefix field. + // + // This member is required. + AccessGrantsLocationId *string + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + // The user, group, or role to which you are granting access. You can grant access + // to an IAM user or role. If you have added your corporate directory to Amazon Web + // Services IAM Identity Center and associated your Identity Center instance with + // your S3 Access Grants instance, the grantee can also be a corporate directory + // user or group. + // + // This member is required. + Grantee *types.Grantee + + // The type of access that you are granting to your S3 data, which can be set to + // one of the following values: + // - READ – Grant read-only access to the S3 data. + // - WRITE – Grant write-only access to the S3 data. + // - READWRITE – Grant both read and write access to the S3 data. + // + // This member is required. + Permission types.Permission + + // The configuration options of the grant location. The grant location is the S3 + // path to the data to which you are granting access. It contains the S3SubPrefix + // field. The grant scope is the result of appending the subprefix to the location + // scope of the registered location. + AccessGrantsLocationConfiguration *types.AccessGrantsLocationConfiguration + + // The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center + // application associated with your Identity Center instance. If an application ARN + // is included in the request to create an access grant, the grantee can only + // access the S3 data through this application. + ApplicationArn *string + + // The type of S3SubPrefix . The only possible value is Object . Pass this value if + // the access grant scope is an object. Do not pass this value if the access grant + // scope is a bucket or a bucket and a prefix. + S3PrefixType types.S3PrefixType + + // The Amazon Web Services resource tags that you are adding to the access grant. + // Each tag is a label consisting of a user-defined key and value. Tags can help + // you manage, identify, organize, search for, and filter resources. + Tags []types.Tag + + noSmithyDocumentSerde +} + +func (in *CreateAccessGrantInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type CreateAccessGrantOutput struct { + + // The Amazon Resource Name (ARN) of the access grant. + AccessGrantArn *string + + // The ID of the access grant. S3 Access Grants auto-generates this ID when you + // create the access grant. + AccessGrantId *string + + // The configuration options of the grant location. The grant location is the S3 + // path to the data to which you are granting access. + AccessGrantsLocationConfiguration *types.AccessGrantsLocationConfiguration + + // The ID of the registered location to which you are granting access. S3 Access + // Grants assigns this ID when you register the location. S3 Access Grants assigns + // the ID default to the default location s3:// and assigns an auto-generated ID + // to other locations that you register. + AccessGrantsLocationId *string + + // The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center + // application associated with your Identity Center instance. If the grant includes + // an application ARN, the grantee can only access the S3 data through this + // application. + ApplicationArn *string + + // The date and time when you created the access grant. + CreatedAt *time.Time + + // The S3 path of the data to which you are granting access. It is the result of + // appending the Subprefix to the location scope. + GrantScope *string + + // The user, group, or role to which you are granting access. You can grant access + // to an IAM user or role. If you have added your corporate directory to Amazon Web + // Services IAM Identity Center and associated your Identity Center instance with + // your S3 Access Grants instance, the grantee can also be a corporate directory + // user or group. + Grantee *types.Grantee + + // The type of access that you are granting to your S3 data, which can be set to + // one of the following values: + // - READ – Grant read-only access to the S3 data. + // - WRITE – Grant write-only access to the S3 data. + // - READWRITE – Grant both read and write access to the S3 data. + Permission types.Permission + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAccessGrantMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpCreateAccessGrant{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateAccessGrant{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAccessGrant"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opCreateAccessGrantMiddleware(stack); err != nil { + return err + } + if err = addOpCreateAccessGrantValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAccessGrant(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addCreateAccessGrantUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opCreateAccessGrantMiddleware struct { +} + +func (*endpointPrefix_opCreateAccessGrantMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opCreateAccessGrantMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*CreateAccessGrantInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opCreateAccessGrantMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opCreateAccessGrantMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opCreateAccessGrant(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateAccessGrant", + } +} + +func copyCreateAccessGrantInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*CreateAccessGrantInput) + if !ok { + return nil, fmt.Errorf("expect *CreateAccessGrantInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *CreateAccessGrantInput) copy() interface{} { + v := *in + return &v +} +func backFillCreateAccessGrantAccountID(input interface{}, v string) error { + in := input.(*CreateAccessGrantInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addCreateAccessGrantUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyCreateAccessGrantInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_CreateAccessGrantsInstance.go b/service/s3control/api_op_CreateAccessGrantsInstance.go new file mode 100644 index 00000000000..c83f7363429 --- /dev/null +++ b/service/s3control/api_op_CreateAccessGrantsInstance.go @@ -0,0 +1,282 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" + "time" +) + +// Creates an S3 Access Grants instance, which serves as a logical grouping for +// access grants. You can create one S3 Access Grants instance per Region per +// account. Permissions You must have the s3:CreateAccessGrantsInstance permission +// to use this operation. Additional Permissions To associate an IAM Identity +// Center instance with your S3 Access Grants instance, you must also have the +// sso:DescribeInstance , sso:CreateApplication , sso:PutApplicationGrant , and +// sso:PutApplicationAuthenticationMethod permissions. +func (c *Client) CreateAccessGrantsInstance(ctx context.Context, params *CreateAccessGrantsInstanceInput, optFns ...func(*Options)) (*CreateAccessGrantsInstanceOutput, error) { + if params == nil { + params = &CreateAccessGrantsInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAccessGrantsInstance", params, optFns, c.addOperationCreateAccessGrantsInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAccessGrantsInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAccessGrantsInstanceInput struct { + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + // If you would like to associate your S3 Access Grants instance with an Amazon + // Web Services IAM Identity Center instance, use this field to pass the Amazon + // Resource Name (ARN) of the Amazon Web Services IAM Identity Center instance that + // you are associating with your S3 Access Grants instance. An IAM Identity Center + // instance is your corporate identity directory that you added to the IAM Identity + // Center. You can use the ListInstances (https://docs.aws.amazon.com/singlesignon/latest/APIReference/API_ListInstances.html) + // API operation to retrieve a list of your Identity Center instances and their + // ARNs. + IdentityCenterArn *string + + // The Amazon Web Services resource tags that you are adding to the S3 Access + // Grants instance. Each tag is a label consisting of a user-defined key and value. + // Tags can help you manage, identify, organize, search for, and filter resources. + Tags []types.Tag + + noSmithyDocumentSerde +} + +func (in *CreateAccessGrantsInstanceInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type CreateAccessGrantsInstanceOutput struct { + + // The Amazon Resource Name (ARN) of the S3 Access Grants instance. + AccessGrantsInstanceArn *string + + // The ID of the S3 Access Grants instance. The ID is default . You can have one S3 + // Access Grants instance per Region per account. + AccessGrantsInstanceId *string + + // The date and time when you created the S3 Access Grants instance. + CreatedAt *time.Time + + // If you associated your S3 Access Grants instance with an Amazon Web Services + // IAM Identity Center instance, this field returns the Amazon Resource Name (ARN) + // of the IAM Identity Center instance application; a subresource of the original + // Identity Center instance passed in the request. S3 Access Grants creates this + // Identity Center application for this specific S3 Access Grants instance. + IdentityCenterArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAccessGrantsInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpCreateAccessGrantsInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateAccessGrantsInstance{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAccessGrantsInstance"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opCreateAccessGrantsInstanceMiddleware(stack); err != nil { + return err + } + if err = addOpCreateAccessGrantsInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAccessGrantsInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addCreateAccessGrantsInstanceUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opCreateAccessGrantsInstanceMiddleware struct { +} + +func (*endpointPrefix_opCreateAccessGrantsInstanceMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opCreateAccessGrantsInstanceMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*CreateAccessGrantsInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opCreateAccessGrantsInstanceMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opCreateAccessGrantsInstanceMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opCreateAccessGrantsInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateAccessGrantsInstance", + } +} + +func copyCreateAccessGrantsInstanceInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*CreateAccessGrantsInstanceInput) + if !ok { + return nil, fmt.Errorf("expect *CreateAccessGrantsInstanceInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *CreateAccessGrantsInstanceInput) copy() interface{} { + v := *in + return &v +} +func backFillCreateAccessGrantsInstanceAccountID(input interface{}, v string) error { + in := input.(*CreateAccessGrantsInstanceInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addCreateAccessGrantsInstanceUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyCreateAccessGrantsInstanceInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_CreateAccessGrantsLocation.go b/service/s3control/api_op_CreateAccessGrantsLocation.go new file mode 100644 index 00000000000..05831233d05 --- /dev/null +++ b/service/s3control/api_op_CreateAccessGrantsLocation.go @@ -0,0 +1,303 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" + "time" +) + +// The S3 data location that you would like to register in your S3 Access Grants +// instance. Your S3 data must be in the same Region as your S3 Access Grants +// instance. The location can be one of the following: +// - The default S3 location s3:// +// - A bucket - S3:// +// - A bucket and prefix - S3:/// +// +// When you register a location, you must include the IAM role that has permission +// to manage the S3 location that you are registering. Give S3 Access Grants +// permission to assume this role using a policy (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-grants-location.html) +// . S3 Access Grants assumes this role to manage access to the location and to +// vend temporary credentials to grantees or client applications. Permissions You +// must have the s3:CreateAccessGrantsLocation permission to use this operation. +// Additional Permissions You must also have the following permission for the +// specified IAM role: iam:PassRole +func (c *Client) CreateAccessGrantsLocation(ctx context.Context, params *CreateAccessGrantsLocationInput, optFns ...func(*Options)) (*CreateAccessGrantsLocationOutput, error) { + if params == nil { + params = &CreateAccessGrantsLocationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAccessGrantsLocation", params, optFns, c.addOperationCreateAccessGrantsLocationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAccessGrantsLocationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAccessGrantsLocationInput struct { + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + // The Amazon Resource Name (ARN) of the IAM role for the registered location. S3 + // Access Grants assumes this role to manage access to the registered location. + // + // This member is required. + IAMRoleArn *string + + // The S3 path to the location that you are registering. The location scope can be + // the default S3 location s3:// , the S3 path to a bucket s3:// , or the S3 path + // to a bucket and prefix s3:/// . A prefix in S3 is a string of characters at the + // beginning of an object key name used to organize the objects that you store in + // your S3 buckets. For example, object key names that start with the engineering/ + // prefix or object key names that start with the marketing/campaigns/ prefix. + // + // This member is required. + LocationScope *string + + // The Amazon Web Services resource tags that you are adding to the S3 Access + // Grants location. Each tag is a label consisting of a user-defined key and value. + // Tags can help you manage, identify, organize, search for, and filter resources. + Tags []types.Tag + + noSmithyDocumentSerde +} + +func (in *CreateAccessGrantsLocationInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type CreateAccessGrantsLocationOutput struct { + + // The Amazon Resource Name (ARN) of the location you are registering. + AccessGrantsLocationArn *string + + // The ID of the registered location to which you are granting access. S3 Access + // Grants assigns this ID when you register the location. S3 Access Grants assigns + // the ID default to the default location s3:// and assigns an auto-generated ID + // to other locations that you register. + AccessGrantsLocationId *string + + // The date and time when you registered the location. + CreatedAt *time.Time + + // The Amazon Resource Name (ARN) of the IAM role for the registered location. S3 + // Access Grants assumes this role to manage access to the registered location. + IAMRoleArn *string + + // The S3 URI path to the location that you are registering. The location scope + // can be the default S3 location s3:// , the S3 path to a bucket, or the S3 path + // to a bucket and prefix. A prefix in S3 is a string of characters at the + // beginning of an object key name used to organize the objects that you store in + // your S3 buckets. For example, object key names that start with the engineering/ + // prefix or object key names that start with the marketing/campaigns/ prefix. + LocationScope *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAccessGrantsLocationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpCreateAccessGrantsLocation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateAccessGrantsLocation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAccessGrantsLocation"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opCreateAccessGrantsLocationMiddleware(stack); err != nil { + return err + } + if err = addOpCreateAccessGrantsLocationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAccessGrantsLocation(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addCreateAccessGrantsLocationUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opCreateAccessGrantsLocationMiddleware struct { +} + +func (*endpointPrefix_opCreateAccessGrantsLocationMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opCreateAccessGrantsLocationMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*CreateAccessGrantsLocationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opCreateAccessGrantsLocationMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opCreateAccessGrantsLocationMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opCreateAccessGrantsLocation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateAccessGrantsLocation", + } +} + +func copyCreateAccessGrantsLocationInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*CreateAccessGrantsLocationInput) + if !ok { + return nil, fmt.Errorf("expect *CreateAccessGrantsLocationInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *CreateAccessGrantsLocationInput) copy() interface{} { + v := *in + return &v +} +func backFillCreateAccessGrantsLocationAccountID(input interface{}, v string) error { + in := input.(*CreateAccessGrantsLocationInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addCreateAccessGrantsLocationUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyCreateAccessGrantsLocationInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_DeleteAccessGrant.go b/service/s3control/api_op_DeleteAccessGrant.go new file mode 100644 index 00000000000..a5716842b88 --- /dev/null +++ b/service/s3control/api_op_DeleteAccessGrant.go @@ -0,0 +1,250 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" +) + +// Deletes the access grant from the S3 Access Grants instance. You cannot undo an +// access grant deletion and the grantee will no longer have access to the S3 data. +// Permissions You must have the s3:DeleteAccessGrant permission to use this +// operation. +func (c *Client) DeleteAccessGrant(ctx context.Context, params *DeleteAccessGrantInput, optFns ...func(*Options)) (*DeleteAccessGrantOutput, error) { + if params == nil { + params = &DeleteAccessGrantInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAccessGrant", params, optFns, c.addOperationDeleteAccessGrantMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAccessGrantOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAccessGrantInput struct { + + // The ID of the access grant. S3 Access Grants auto-generates this ID when you + // create the access grant. + // + // This member is required. + AccessGrantId *string + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + noSmithyDocumentSerde +} + +func (in *DeleteAccessGrantInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type DeleteAccessGrantOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAccessGrantMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteAccessGrant{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpDeleteAccessGrant{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteAccessGrant"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteAccessGrantMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteAccessGrantValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAccessGrant(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addDeleteAccessGrantUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opDeleteAccessGrantMiddleware struct { +} + +func (*endpointPrefix_opDeleteAccessGrantMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteAccessGrantMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*DeleteAccessGrantInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opDeleteAccessGrantMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opDeleteAccessGrantMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opDeleteAccessGrant(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteAccessGrant", + } +} + +func copyDeleteAccessGrantInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*DeleteAccessGrantInput) + if !ok { + return nil, fmt.Errorf("expect *DeleteAccessGrantInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *DeleteAccessGrantInput) copy() interface{} { + v := *in + return &v +} +func backFillDeleteAccessGrantAccountID(input interface{}, v string) error { + in := input.(*DeleteAccessGrantInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addDeleteAccessGrantUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyDeleteAccessGrantInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_DeleteAccessGrantsInstance.go b/service/s3control/api_op_DeleteAccessGrantsInstance.go new file mode 100644 index 00000000000..dfab25322d0 --- /dev/null +++ b/service/s3control/api_op_DeleteAccessGrantsInstance.go @@ -0,0 +1,251 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" +) + +// Deletes your S3 Access Grants instance. You must first delete the access grants +// and locations before S3 Access Grants can delete the instance. See +// DeleteAccessGrant (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessGrant.html) +// and DeleteAccessGrantsLocation (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessGrantsLocation.html) +// . If you have associated an IAM Identity Center instance with your S3 Access +// Grants instance, you must first dissassociate the Identity Center instance from +// the S3 Access Grants instance before you can delete the S3 Access Grants +// instance. See AssociateAccessGrantsIdentityCenter (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_AssociateAccessGrantsIdentityCenter.html) +// and DissociateAccessGrantsIdentityCenter (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DissociateAccessGrantsIdentityCenter.html) +// . Permissions You must have the s3:DeleteAccessGrantsInstance permission to use +// this operation. +func (c *Client) DeleteAccessGrantsInstance(ctx context.Context, params *DeleteAccessGrantsInstanceInput, optFns ...func(*Options)) (*DeleteAccessGrantsInstanceOutput, error) { + if params == nil { + params = &DeleteAccessGrantsInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAccessGrantsInstance", params, optFns, c.addOperationDeleteAccessGrantsInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAccessGrantsInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAccessGrantsInstanceInput struct { + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + noSmithyDocumentSerde +} + +func (in *DeleteAccessGrantsInstanceInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type DeleteAccessGrantsInstanceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAccessGrantsInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteAccessGrantsInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpDeleteAccessGrantsInstance{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteAccessGrantsInstance"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteAccessGrantsInstanceMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteAccessGrantsInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAccessGrantsInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addDeleteAccessGrantsInstanceUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opDeleteAccessGrantsInstanceMiddleware struct { +} + +func (*endpointPrefix_opDeleteAccessGrantsInstanceMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteAccessGrantsInstanceMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*DeleteAccessGrantsInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opDeleteAccessGrantsInstanceMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opDeleteAccessGrantsInstanceMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opDeleteAccessGrantsInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteAccessGrantsInstance", + } +} + +func copyDeleteAccessGrantsInstanceInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*DeleteAccessGrantsInstanceInput) + if !ok { + return nil, fmt.Errorf("expect *DeleteAccessGrantsInstanceInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *DeleteAccessGrantsInstanceInput) copy() interface{} { + v := *in + return &v +} +func backFillDeleteAccessGrantsInstanceAccountID(input interface{}, v string) error { + in := input.(*DeleteAccessGrantsInstanceInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addDeleteAccessGrantsInstanceUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyDeleteAccessGrantsInstanceInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_DeleteAccessGrantsInstanceResourcePolicy.go b/service/s3control/api_op_DeleteAccessGrantsInstanceResourcePolicy.go new file mode 100644 index 00000000000..61f3d829d75 --- /dev/null +++ b/service/s3control/api_op_DeleteAccessGrantsInstanceResourcePolicy.go @@ -0,0 +1,245 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" +) + +// Deletes the resource policy of the S3 Access Grants instance. The resource +// policy is used to manage cross-account access to your S3 Access Grants instance. +// By deleting the resource policy, you delete any cross-account permissions to +// your S3 Access Grants instance. Permissions You must have the +// s3:DeleteAccessGrantsInstanceResourcePolicy permission to use this operation. +func (c *Client) DeleteAccessGrantsInstanceResourcePolicy(ctx context.Context, params *DeleteAccessGrantsInstanceResourcePolicyInput, optFns ...func(*Options)) (*DeleteAccessGrantsInstanceResourcePolicyOutput, error) { + if params == nil { + params = &DeleteAccessGrantsInstanceResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAccessGrantsInstanceResourcePolicy", params, optFns, c.addOperationDeleteAccessGrantsInstanceResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAccessGrantsInstanceResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAccessGrantsInstanceResourcePolicyInput struct { + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + noSmithyDocumentSerde +} + +func (in *DeleteAccessGrantsInstanceResourcePolicyInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type DeleteAccessGrantsInstanceResourcePolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAccessGrantsInstanceResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteAccessGrantsInstanceResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpDeleteAccessGrantsInstanceResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteAccessGrantsInstanceResourcePolicy"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteAccessGrantsInstanceResourcePolicyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteAccessGrantsInstanceResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAccessGrantsInstanceResourcePolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addDeleteAccessGrantsInstanceResourcePolicyUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opDeleteAccessGrantsInstanceResourcePolicyMiddleware struct { +} + +func (*endpointPrefix_opDeleteAccessGrantsInstanceResourcePolicyMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteAccessGrantsInstanceResourcePolicyMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*DeleteAccessGrantsInstanceResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opDeleteAccessGrantsInstanceResourcePolicyMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opDeleteAccessGrantsInstanceResourcePolicyMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opDeleteAccessGrantsInstanceResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteAccessGrantsInstanceResourcePolicy", + } +} + +func copyDeleteAccessGrantsInstanceResourcePolicyInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*DeleteAccessGrantsInstanceResourcePolicyInput) + if !ok { + return nil, fmt.Errorf("expect *DeleteAccessGrantsInstanceResourcePolicyInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *DeleteAccessGrantsInstanceResourcePolicyInput) copy() interface{} { + v := *in + return &v +} +func backFillDeleteAccessGrantsInstanceResourcePolicyAccountID(input interface{}, v string) error { + in := input.(*DeleteAccessGrantsInstanceResourcePolicyInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addDeleteAccessGrantsInstanceResourcePolicyUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyDeleteAccessGrantsInstanceResourcePolicyInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_DeleteAccessGrantsLocation.go b/service/s3control/api_op_DeleteAccessGrantsLocation.go new file mode 100644 index 00000000000..b78b3ee8f65 --- /dev/null +++ b/service/s3control/api_op_DeleteAccessGrantsLocation.go @@ -0,0 +1,255 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" +) + +// Deregisters a location from your S3 Access Grants instance. You can only delete +// a location registration from an S3 Access Grants instance if there are no grants +// associated with this location. See Delete a grant (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessGrant.html) +// for information on how to delete grants. You need to have at least one +// registered location in your S3 Access Grants instance in order to create access +// grants. Permissions You must have the s3:DeleteAccessGrantsLocation permission +// to use this operation. +func (c *Client) DeleteAccessGrantsLocation(ctx context.Context, params *DeleteAccessGrantsLocationInput, optFns ...func(*Options)) (*DeleteAccessGrantsLocationOutput, error) { + if params == nil { + params = &DeleteAccessGrantsLocationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAccessGrantsLocation", params, optFns, c.addOperationDeleteAccessGrantsLocationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAccessGrantsLocationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAccessGrantsLocationInput struct { + + // The ID of the registered location that you are deregistering from your S3 + // Access Grants instance. S3 Access Grants assigned this ID when you registered + // the location. S3 Access Grants assigns the ID default to the default location + // s3:// and assigns an auto-generated ID to other locations that you register. + // + // This member is required. + AccessGrantsLocationId *string + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + noSmithyDocumentSerde +} + +func (in *DeleteAccessGrantsLocationInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type DeleteAccessGrantsLocationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAccessGrantsLocationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteAccessGrantsLocation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpDeleteAccessGrantsLocation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteAccessGrantsLocation"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteAccessGrantsLocationMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteAccessGrantsLocationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAccessGrantsLocation(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addDeleteAccessGrantsLocationUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opDeleteAccessGrantsLocationMiddleware struct { +} + +func (*endpointPrefix_opDeleteAccessGrantsLocationMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteAccessGrantsLocationMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*DeleteAccessGrantsLocationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opDeleteAccessGrantsLocationMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opDeleteAccessGrantsLocationMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opDeleteAccessGrantsLocation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteAccessGrantsLocation", + } +} + +func copyDeleteAccessGrantsLocationInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*DeleteAccessGrantsLocationInput) + if !ok { + return nil, fmt.Errorf("expect *DeleteAccessGrantsLocationInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *DeleteAccessGrantsLocationInput) copy() interface{} { + v := *in + return &v +} +func backFillDeleteAccessGrantsLocationAccountID(input interface{}, v string) error { + in := input.(*DeleteAccessGrantsLocationInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addDeleteAccessGrantsLocationUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyDeleteAccessGrantsLocationInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_DissociateAccessGrantsIdentityCenter.go b/service/s3control/api_op_DissociateAccessGrantsIdentityCenter.go new file mode 100644 index 00000000000..a6cb5194ae7 --- /dev/null +++ b/service/s3control/api_op_DissociateAccessGrantsIdentityCenter.go @@ -0,0 +1,245 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" +) + +// Dissociates the Amazon Web Services IAM Identity Center instance from the S3 +// Access Grants instance. Permissions You must have the +// s3:DissociateAccessGrantsIdentityCenter permission to use this operation. +// Additional Permissions You must have the sso:DeleteApplication permission to +// use this operation. +func (c *Client) DissociateAccessGrantsIdentityCenter(ctx context.Context, params *DissociateAccessGrantsIdentityCenterInput, optFns ...func(*Options)) (*DissociateAccessGrantsIdentityCenterOutput, error) { + if params == nil { + params = &DissociateAccessGrantsIdentityCenterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DissociateAccessGrantsIdentityCenter", params, optFns, c.addOperationDissociateAccessGrantsIdentityCenterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DissociateAccessGrantsIdentityCenterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DissociateAccessGrantsIdentityCenterInput struct { + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + noSmithyDocumentSerde +} + +func (in *DissociateAccessGrantsIdentityCenterInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type DissociateAccessGrantsIdentityCenterOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDissociateAccessGrantsIdentityCenterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpDissociateAccessGrantsIdentityCenter{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpDissociateAccessGrantsIdentityCenter{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DissociateAccessGrantsIdentityCenter"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDissociateAccessGrantsIdentityCenterMiddleware(stack); err != nil { + return err + } + if err = addOpDissociateAccessGrantsIdentityCenterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDissociateAccessGrantsIdentityCenter(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addDissociateAccessGrantsIdentityCenterUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opDissociateAccessGrantsIdentityCenterMiddleware struct { +} + +func (*endpointPrefix_opDissociateAccessGrantsIdentityCenterMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDissociateAccessGrantsIdentityCenterMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*DissociateAccessGrantsIdentityCenterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opDissociateAccessGrantsIdentityCenterMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opDissociateAccessGrantsIdentityCenterMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opDissociateAccessGrantsIdentityCenter(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DissociateAccessGrantsIdentityCenter", + } +} + +func copyDissociateAccessGrantsIdentityCenterInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*DissociateAccessGrantsIdentityCenterInput) + if !ok { + return nil, fmt.Errorf("expect *DissociateAccessGrantsIdentityCenterInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *DissociateAccessGrantsIdentityCenterInput) copy() interface{} { + v := *in + return &v +} +func backFillDissociateAccessGrantsIdentityCenterAccountID(input interface{}, v string) error { + in := input.(*DissociateAccessGrantsIdentityCenterInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addDissociateAccessGrantsIdentityCenterUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyDissociateAccessGrantsIdentityCenterInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_GetAccessGrant.go b/service/s3control/api_op_GetAccessGrant.go new file mode 100644 index 00000000000..959170d378f --- /dev/null +++ b/service/s3control/api_op_GetAccessGrant.go @@ -0,0 +1,296 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" + "time" +) + +// Get the details of an access grant from your S3 Access Grants instance. +// Permissions You must have the s3:GetAccessGrant permission to use this +// operation. +func (c *Client) GetAccessGrant(ctx context.Context, params *GetAccessGrantInput, optFns ...func(*Options)) (*GetAccessGrantOutput, error) { + if params == nil { + params = &GetAccessGrantInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAccessGrant", params, optFns, c.addOperationGetAccessGrantMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAccessGrantOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAccessGrantInput struct { + + // The ID of the access grant. S3 Access Grants auto-generates this ID when you + // create the access grant. + // + // This member is required. + AccessGrantId *string + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + noSmithyDocumentSerde +} + +func (in *GetAccessGrantInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type GetAccessGrantOutput struct { + + // The Amazon Resource Name (ARN) of the access grant. + AccessGrantArn *string + + // The ID of the access grant. S3 Access Grants auto-generates this ID when you + // create the access grant. + AccessGrantId *string + + // The configuration options of the grant location. The grant location is the S3 + // path to the data to which you are granting access. + AccessGrantsLocationConfiguration *types.AccessGrantsLocationConfiguration + + // The ID of the registered location to which you are granting access. S3 Access + // Grants assigns this ID when you register the location. S3 Access Grants assigns + // the ID default to the default location s3:// and assigns an auto-generated ID + // to other locations that you register. + AccessGrantsLocationId *string + + // The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center + // application associated with your Identity Center instance. If the grant includes + // an application ARN, the grantee can only access the S3 data through this + // application. + ApplicationArn *string + + // The date and time when you created the access grant. + CreatedAt *time.Time + + // The S3 path of the data to which you are granting access. It is the result of + // appending the Subprefix to the location scope. + GrantScope *string + + // The user, group, or role to which you are granting access. You can grant access + // to an IAM user or role. If you have added a corporate directory to Amazon Web + // Services IAM Identity Center and associated this Identity Center instance with + // the S3 Access Grants instance, the grantee can also be a corporate directory + // user or group. + Grantee *types.Grantee + + // The type of permission that was granted in the access grant. Can be one of the + // following values: + // - READ – Grant read-only access to the S3 data. + // - WRITE – Grant write-only access to the S3 data. + // - READWRITE – Grant both read and write access to the S3 data. + Permission types.Permission + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAccessGrantMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpGetAccessGrant{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetAccessGrant{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetAccessGrant"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetAccessGrantMiddleware(stack); err != nil { + return err + } + if err = addOpGetAccessGrantValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessGrant(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addGetAccessGrantUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opGetAccessGrantMiddleware struct { +} + +func (*endpointPrefix_opGetAccessGrantMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetAccessGrantMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*GetAccessGrantInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opGetAccessGrantMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opGetAccessGrantMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opGetAccessGrant(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetAccessGrant", + } +} + +func copyGetAccessGrantInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*GetAccessGrantInput) + if !ok { + return nil, fmt.Errorf("expect *GetAccessGrantInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *GetAccessGrantInput) copy() interface{} { + v := *in + return &v +} +func backFillGetAccessGrantAccountID(input interface{}, v string) error { + in := input.(*GetAccessGrantInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addGetAccessGrantUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyGetAccessGrantInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_GetAccessGrantsInstance.go b/service/s3control/api_op_GetAccessGrantsInstance.go new file mode 100644 index 00000000000..93247577b83 --- /dev/null +++ b/service/s3control/api_op_GetAccessGrantsInstance.go @@ -0,0 +1,262 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" + "time" +) + +// Retrieves the S3 Access Grants instance for a Region in your account. +// Permissions You must have the s3:GetAccessGrantsInstance permission to use this +// operation. +func (c *Client) GetAccessGrantsInstance(ctx context.Context, params *GetAccessGrantsInstanceInput, optFns ...func(*Options)) (*GetAccessGrantsInstanceOutput, error) { + if params == nil { + params = &GetAccessGrantsInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAccessGrantsInstance", params, optFns, c.addOperationGetAccessGrantsInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAccessGrantsInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAccessGrantsInstanceInput struct { + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + noSmithyDocumentSerde +} + +func (in *GetAccessGrantsInstanceInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type GetAccessGrantsInstanceOutput struct { + + // The Amazon Resource Name (ARN) of the S3 Access Grants instance. + AccessGrantsInstanceArn *string + + // The ID of the S3 Access Grants instance. The ID is default . You can have one S3 + // Access Grants instance per Region per account. + AccessGrantsInstanceId *string + + // The date and time when you created the S3 Access Grants instance. + CreatedAt *time.Time + + // If you associated your S3 Access Grants instance with an Amazon Web Services + // IAM Identity Center instance, this field returns the Amazon Resource Name (ARN) + // of the Amazon Web Services IAM Identity Center instance application; a + // subresource of the original Identity Center instance. S3 Access Grants creates + // this Identity Center application for the specific S3 Access Grants instance. + IdentityCenterArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAccessGrantsInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpGetAccessGrantsInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetAccessGrantsInstance{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetAccessGrantsInstance"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetAccessGrantsInstanceMiddleware(stack); err != nil { + return err + } + if err = addOpGetAccessGrantsInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessGrantsInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addGetAccessGrantsInstanceUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opGetAccessGrantsInstanceMiddleware struct { +} + +func (*endpointPrefix_opGetAccessGrantsInstanceMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetAccessGrantsInstanceMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*GetAccessGrantsInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opGetAccessGrantsInstanceMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opGetAccessGrantsInstanceMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opGetAccessGrantsInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetAccessGrantsInstance", + } +} + +func copyGetAccessGrantsInstanceInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*GetAccessGrantsInstanceInput) + if !ok { + return nil, fmt.Errorf("expect *GetAccessGrantsInstanceInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *GetAccessGrantsInstanceInput) copy() interface{} { + v := *in + return &v +} +func backFillGetAccessGrantsInstanceAccountID(input interface{}, v string) error { + in := input.(*GetAccessGrantsInstanceInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addGetAccessGrantsInstanceUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyGetAccessGrantsInstanceInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_GetAccessGrantsInstanceForPrefix.go b/service/s3control/api_op_GetAccessGrantsInstanceForPrefix.go new file mode 100644 index 00000000000..da6d4675438 --- /dev/null +++ b/service/s3control/api_op_GetAccessGrantsInstanceForPrefix.go @@ -0,0 +1,258 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" +) + +// Retrieve the S3 Access Grants instance that contains a particular prefix. +// Permissions You must have the s3:GetAccessGrantsInstanceForPrefix permission +// for the caller account to use this operation. Additional Permissions The prefix +// owner account must grant you the following permissions to their S3 Access Grants +// instance: s3:GetAccessGrantsInstanceForPrefix . +func (c *Client) GetAccessGrantsInstanceForPrefix(ctx context.Context, params *GetAccessGrantsInstanceForPrefixInput, optFns ...func(*Options)) (*GetAccessGrantsInstanceForPrefixOutput, error) { + if params == nil { + params = &GetAccessGrantsInstanceForPrefixInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAccessGrantsInstanceForPrefix", params, optFns, c.addOperationGetAccessGrantsInstanceForPrefixMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAccessGrantsInstanceForPrefixOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAccessGrantsInstanceForPrefixInput struct { + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + // The S3 prefix of the access grants that you would like to retrieve. + // + // This member is required. + S3Prefix *string + + noSmithyDocumentSerde +} + +func (in *GetAccessGrantsInstanceForPrefixInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type GetAccessGrantsInstanceForPrefixOutput struct { + + // The Amazon Resource Name (ARN) of the S3 Access Grants instance. + AccessGrantsInstanceArn *string + + // The ID of the S3 Access Grants instance. The ID is default . You can have one S3 + // Access Grants instance per Region per account. + AccessGrantsInstanceId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAccessGrantsInstanceForPrefixMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpGetAccessGrantsInstanceForPrefix{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetAccessGrantsInstanceForPrefix{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetAccessGrantsInstanceForPrefix"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetAccessGrantsInstanceForPrefixMiddleware(stack); err != nil { + return err + } + if err = addOpGetAccessGrantsInstanceForPrefixValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessGrantsInstanceForPrefix(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addGetAccessGrantsInstanceForPrefixUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opGetAccessGrantsInstanceForPrefixMiddleware struct { +} + +func (*endpointPrefix_opGetAccessGrantsInstanceForPrefixMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetAccessGrantsInstanceForPrefixMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*GetAccessGrantsInstanceForPrefixInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opGetAccessGrantsInstanceForPrefixMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opGetAccessGrantsInstanceForPrefixMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opGetAccessGrantsInstanceForPrefix(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetAccessGrantsInstanceForPrefix", + } +} + +func copyGetAccessGrantsInstanceForPrefixInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*GetAccessGrantsInstanceForPrefixInput) + if !ok { + return nil, fmt.Errorf("expect *GetAccessGrantsInstanceForPrefixInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *GetAccessGrantsInstanceForPrefixInput) copy() interface{} { + v := *in + return &v +} +func backFillGetAccessGrantsInstanceForPrefixAccountID(input interface{}, v string) error { + in := input.(*GetAccessGrantsInstanceForPrefixInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addGetAccessGrantsInstanceForPrefixUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyGetAccessGrantsInstanceForPrefixInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_GetAccessGrantsInstanceResourcePolicy.go b/service/s3control/api_op_GetAccessGrantsInstanceResourcePolicy.go new file mode 100644 index 00000000000..c11b1235c62 --- /dev/null +++ b/service/s3control/api_op_GetAccessGrantsInstanceResourcePolicy.go @@ -0,0 +1,255 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" + "time" +) + +// Returns the resource policy of the S3 Access Grants instance. Permissions You +// must have the s3:GetAccessGrantsInstanceResourcePolicy permission to use this +// operation. +func (c *Client) GetAccessGrantsInstanceResourcePolicy(ctx context.Context, params *GetAccessGrantsInstanceResourcePolicyInput, optFns ...func(*Options)) (*GetAccessGrantsInstanceResourcePolicyOutput, error) { + if params == nil { + params = &GetAccessGrantsInstanceResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAccessGrantsInstanceResourcePolicy", params, optFns, c.addOperationGetAccessGrantsInstanceResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAccessGrantsInstanceResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAccessGrantsInstanceResourcePolicyInput struct { + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + noSmithyDocumentSerde +} + +func (in *GetAccessGrantsInstanceResourcePolicyInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type GetAccessGrantsInstanceResourcePolicyOutput struct { + + // The date and time when you created the S3 Access Grants instance resource + // policy. + CreatedAt *time.Time + + // The Organization of the resource policy of the S3 Access Grants instance. + Organization *string + + // The resource policy of the S3 Access Grants instance. + Policy *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAccessGrantsInstanceResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpGetAccessGrantsInstanceResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetAccessGrantsInstanceResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetAccessGrantsInstanceResourcePolicy"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetAccessGrantsInstanceResourcePolicyMiddleware(stack); err != nil { + return err + } + if err = addOpGetAccessGrantsInstanceResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessGrantsInstanceResourcePolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addGetAccessGrantsInstanceResourcePolicyUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opGetAccessGrantsInstanceResourcePolicyMiddleware struct { +} + +func (*endpointPrefix_opGetAccessGrantsInstanceResourcePolicyMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetAccessGrantsInstanceResourcePolicyMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*GetAccessGrantsInstanceResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opGetAccessGrantsInstanceResourcePolicyMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opGetAccessGrantsInstanceResourcePolicyMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opGetAccessGrantsInstanceResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetAccessGrantsInstanceResourcePolicy", + } +} + +func copyGetAccessGrantsInstanceResourcePolicyInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*GetAccessGrantsInstanceResourcePolicyInput) + if !ok { + return nil, fmt.Errorf("expect *GetAccessGrantsInstanceResourcePolicyInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *GetAccessGrantsInstanceResourcePolicyInput) copy() interface{} { + v := *in + return &v +} +func backFillGetAccessGrantsInstanceResourcePolicyAccountID(input interface{}, v string) error { + in := input.(*GetAccessGrantsInstanceResourcePolicyInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addGetAccessGrantsInstanceResourcePolicyUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyGetAccessGrantsInstanceResourcePolicyInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_GetAccessGrantsLocation.go b/service/s3control/api_op_GetAccessGrantsLocation.go new file mode 100644 index 00000000000..9665752be31 --- /dev/null +++ b/service/s3control/api_op_GetAccessGrantsLocation.go @@ -0,0 +1,277 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" + "time" +) + +// Retrieves the details of a particular location registered in your S3 Access +// Grants instance. Permissions You must have the s3:GetAccessGrantsLocation +// permission to use this operation. +func (c *Client) GetAccessGrantsLocation(ctx context.Context, params *GetAccessGrantsLocationInput, optFns ...func(*Options)) (*GetAccessGrantsLocationOutput, error) { + if params == nil { + params = &GetAccessGrantsLocationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAccessGrantsLocation", params, optFns, c.addOperationGetAccessGrantsLocationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAccessGrantsLocationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAccessGrantsLocationInput struct { + + // The ID of the registered location that you are retrieving. S3 Access Grants + // assigns this ID when you register the location. S3 Access Grants assigns the ID + // default to the default location s3:// and assigns an auto-generated ID to other + // locations that you register. + // + // This member is required. + AccessGrantsLocationId *string + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + noSmithyDocumentSerde +} + +func (in *GetAccessGrantsLocationInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type GetAccessGrantsLocationOutput struct { + + // The Amazon Resource Name (ARN) of the registered location. + AccessGrantsLocationArn *string + + // The ID of the registered location to which you are granting access. S3 Access + // Grants assigns this ID when you register the location. S3 Access Grants assigns + // the ID default to the default location s3:// and assigns an auto-generated ID + // to other locations that you register. + AccessGrantsLocationId *string + + // The date and time when you registered the location. + CreatedAt *time.Time + + // The Amazon Resource Name (ARN) of the IAM role for the registered location. S3 + // Access Grants assumes this role to manage access to the registered location. + IAMRoleArn *string + + // The S3 URI path to the registered location. The location scope can be the + // default S3 location s3:// , the S3 path to a bucket, or the S3 path to a bucket + // and prefix. A prefix in S3 is a string of characters at the beginning of an + // object key name used to organize the objects that you store in your S3 buckets. + // For example, object key names that start with the engineering/ prefix or object + // key names that start with the marketing/campaigns/ prefix. + LocationScope *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAccessGrantsLocationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpGetAccessGrantsLocation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetAccessGrantsLocation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetAccessGrantsLocation"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetAccessGrantsLocationMiddleware(stack); err != nil { + return err + } + if err = addOpGetAccessGrantsLocationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessGrantsLocation(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addGetAccessGrantsLocationUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opGetAccessGrantsLocationMiddleware struct { +} + +func (*endpointPrefix_opGetAccessGrantsLocationMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetAccessGrantsLocationMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*GetAccessGrantsLocationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opGetAccessGrantsLocationMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opGetAccessGrantsLocationMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opGetAccessGrantsLocation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetAccessGrantsLocation", + } +} + +func copyGetAccessGrantsLocationInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*GetAccessGrantsLocationInput) + if !ok { + return nil, fmt.Errorf("expect *GetAccessGrantsLocationInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *GetAccessGrantsLocationInput) copy() interface{} { + v := *in + return &v +} +func backFillGetAccessGrantsLocationAccountID(input interface{}, v string) error { + in := input.(*GetAccessGrantsLocationInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addGetAccessGrantsLocationUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyGetAccessGrantsLocationInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_GetDataAccess.go b/service/s3control/api_op_GetDataAccess.go new file mode 100644 index 00000000000..2f327ade92f --- /dev/null +++ b/service/s3control/api_op_GetDataAccess.go @@ -0,0 +1,294 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" +) + +// Returns a temporary access credential from S3 Access Grants to the grantee or +// client application. The temporary credential (https://docs.aws.amazon.com/STS/latest/APIReference/API_Credentials.html) +// is an Amazon Web Services STS token that grants them access to the S3 data. +// Permissions You must have the s3:GetDataAccess permission to use this +// operation. Additional Permissions The IAM role that S3 Access Grants assumes +// must have the following permissions specified in the trust policy when +// registering the location: sts:AssumeRole , for directory users or groups +// sts:SetContext , and for IAM users or roles sts:SourceIdentity . +func (c *Client) GetDataAccess(ctx context.Context, params *GetDataAccessInput, optFns ...func(*Options)) (*GetDataAccessOutput, error) { + if params == nil { + params = &GetDataAccessInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDataAccess", params, optFns, c.addOperationGetDataAccessMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDataAccessOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDataAccessInput struct { + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + // The type of permission granted to your S3 data, which can be set to one of the + // following values: + // - READ – Grant read-only access to the S3 data. + // - WRITE – Grant write-only access to the S3 data. + // - READWRITE – Grant both read and write access to the S3 data. + // + // This member is required. + Permission types.Permission + + // The S3 URI path of the data to which you are requesting temporary access + // credentials. If the requesting account has an access grant for this data, S3 + // Access Grants vends temporary access credentials in the response. + // + // This member is required. + Target *string + + // The session duration, in seconds, of the temporary access credential that S3 + // Access Grants vends to the grantee or client application. The default value is 1 + // hour, but the grantee can specify a range from 900 seconds (15 minutes) up to + // 43200 seconds (12 hours). If the grantee requests a value higher than this + // maximum, the operation fails. + DurationSeconds *int32 + + // The scope of the temporary access credential that S3 Access Grants vends to the + // grantee or client application. + // - Default – The scope of the returned temporary access token is the scope of + // the grant that is closest to the target scope. + // - Minimal – The scope of the returned temporary access token is the same as + // the requested target scope as long as the requested scope is the same as or a + // subset of the grant scope. + Privilege types.Privilege + + // The type of Target . The only possible value is Object . Pass this value if the + // target data that you would like to access is a path to an object. Do not pass + // this value if the target data is a bucket or a bucket and a prefix. + TargetType types.S3PrefixType + + noSmithyDocumentSerde +} + +func (in *GetDataAccessInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type GetDataAccessOutput struct { + + // The temporary credential token that S3 Access Grants vends. + Credentials *types.Credentials + + // The S3 URI path of the data to which you are being granted temporary access + // credentials. + MatchedGrantTarget *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetDataAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpGetDataAccess{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetDataAccess{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetDataAccess"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetDataAccessMiddleware(stack); err != nil { + return err + } + if err = addOpGetDataAccessValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDataAccess(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addGetDataAccessUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opGetDataAccessMiddleware struct { +} + +func (*endpointPrefix_opGetDataAccessMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetDataAccessMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*GetDataAccessInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opGetDataAccessMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opGetDataAccessMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opGetDataAccess(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetDataAccess", + } +} + +func copyGetDataAccessInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*GetDataAccessInput) + if !ok { + return nil, fmt.Errorf("expect *GetDataAccessInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *GetDataAccessInput) copy() interface{} { + v := *in + return &v +} +func backFillGetDataAccessAccountID(input interface{}, v string) error { + in := input.(*GetDataAccessInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addGetDataAccessUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyGetDataAccessInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_ListAccessGrants.go b/service/s3control/api_op_ListAccessGrants.go new file mode 100644 index 00000000000..66bd69d0c38 --- /dev/null +++ b/service/s3control/api_op_ListAccessGrants.go @@ -0,0 +1,388 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" +) + +// Returns the list of access grants in your S3 Access Grants instance. +// Permissions You must have the s3:ListAccessGrants permission to use this +// operation. +func (c *Client) ListAccessGrants(ctx context.Context, params *ListAccessGrantsInput, optFns ...func(*Options)) (*ListAccessGrantsOutput, error) { + if params == nil { + params = &ListAccessGrantsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAccessGrants", params, optFns, c.addOperationListAccessGrantsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAccessGrantsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAccessGrantsInput struct { + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + // The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center + // application associated with your Identity Center instance. If the grant includes + // an application ARN, the grantee can only access the S3 data through this + // application. + ApplicationArn *string + + // The S3 path of the data to which you are granting access. It is the result of + // appending the Subprefix to the location scope. + GrantScope *string + + // The unique identifer of the Grantee . If the grantee type is IAM , the + // identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the + // grantee type is a directory user or group, the identifier is 128-bit universally + // unique identifier (UUID) in the format a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 . + // You can obtain this UUID from your Amazon Web Services IAM Identity Center + // instance. + GranteeIdentifier *string + + // The type of the grantee to which access has been granted. It can be one of the + // following values: + // - IAM - An IAM user or role. + // - DIRECTORY_USER - Your corporate directory user. You can use this option if + // you have added your corporate identity directory to IAM Identity Center and + // associated the IAM Identity Center instance with your S3 Access Grants instance. + // + // - DIRECTORY_GROUP - Your corporate directory group. You can use this option if + // you have added your corporate identity directory to IAM Identity Center and + // associated the IAM Identity Center instance with your S3 Access Grants instance. + GranteeType types.GranteeType + + // The maximum number of access grants that you would like returned in the List + // Access Grants response. If the results include the pagination token NextToken , + // make another call using the NextToken to determine if there are more results. + MaxResults int32 + + // A pagination token to request the next page of results. Pass this value into a + // subsequent List Access Grants request in order to retrieve the next page of + // results. + NextToken *string + + // The type of permission granted to your S3 data, which can be set to one of the + // following values: + // - READ – Grant read-only access to the S3 data. + // - WRITE – Grant write-only access to the S3 data. + // - READWRITE – Grant both read and write access to the S3 data. + Permission types.Permission + + noSmithyDocumentSerde +} + +func (in *ListAccessGrantsInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type ListAccessGrantsOutput struct { + + // A container for a list of grants in an S3 Access Grants instance. + AccessGrantsList []types.ListAccessGrantEntry + + // A pagination token to request the next page of results. Pass this value into a + // subsequent List Access Grants request in order to retrieve the next page of + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAccessGrantsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpListAccessGrants{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpListAccessGrants{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAccessGrants"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opListAccessGrantsMiddleware(stack); err != nil { + return err + } + if err = addOpListAccessGrantsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccessGrants(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addListAccessGrantsUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opListAccessGrantsMiddleware struct { +} + +func (*endpointPrefix_opListAccessGrantsMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListAccessGrantsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*ListAccessGrantsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opListAccessGrantsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opListAccessGrantsMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +// ListAccessGrantsAPIClient is a client that implements the ListAccessGrants +// operation. +type ListAccessGrantsAPIClient interface { + ListAccessGrants(context.Context, *ListAccessGrantsInput, ...func(*Options)) (*ListAccessGrantsOutput, error) +} + +var _ ListAccessGrantsAPIClient = (*Client)(nil) + +// ListAccessGrantsPaginatorOptions is the paginator options for ListAccessGrants +type ListAccessGrantsPaginatorOptions struct { + // The maximum number of access grants that you would like returned in the List + // Access Grants response. If the results include the pagination token NextToken , + // make another call using the NextToken to determine if there are more 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 +} + +// ListAccessGrantsPaginator is a paginator for ListAccessGrants +type ListAccessGrantsPaginator struct { + options ListAccessGrantsPaginatorOptions + client ListAccessGrantsAPIClient + params *ListAccessGrantsInput + nextToken *string + firstPage bool +} + +// NewListAccessGrantsPaginator returns a new ListAccessGrantsPaginator +func NewListAccessGrantsPaginator(client ListAccessGrantsAPIClient, params *ListAccessGrantsInput, optFns ...func(*ListAccessGrantsPaginatorOptions)) *ListAccessGrantsPaginator { + if params == nil { + params = &ListAccessGrantsInput{} + } + + options := ListAccessGrantsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAccessGrantsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccessGrantsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAccessGrants page. +func (p *ListAccessGrantsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessGrantsOutput, 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.ListAccessGrants(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_opListAccessGrants(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListAccessGrants", + } +} + +func copyListAccessGrantsInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*ListAccessGrantsInput) + if !ok { + return nil, fmt.Errorf("expect *ListAccessGrantsInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *ListAccessGrantsInput) copy() interface{} { + v := *in + return &v +} +func backFillListAccessGrantsAccountID(input interface{}, v string) error { + in := input.(*ListAccessGrantsInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addListAccessGrantsUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyListAccessGrantsInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_ListAccessGrantsInstances.go b/service/s3control/api_op_ListAccessGrantsInstances.go new file mode 100644 index 00000000000..4897ddb0924 --- /dev/null +++ b/service/s3control/api_op_ListAccessGrantsInstances.go @@ -0,0 +1,354 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" +) + +// Returns a list of S3 Access Grants instances. An S3 Access Grants instance +// serves as a logical grouping for your individual access grants. You can only +// have one S3 Access Grants instance per Region per account. Permissions You must +// have the s3:ListAccessGrantsInstances permission to use this operation. +func (c *Client) ListAccessGrantsInstances(ctx context.Context, params *ListAccessGrantsInstancesInput, optFns ...func(*Options)) (*ListAccessGrantsInstancesOutput, error) { + if params == nil { + params = &ListAccessGrantsInstancesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAccessGrantsInstances", params, optFns, c.addOperationListAccessGrantsInstancesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAccessGrantsInstancesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAccessGrantsInstancesInput struct { + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + // The maximum number of access grants that you would like returned in the List + // Access Grants response. If the results include the pagination token NextToken , + // make another call using the NextToken to determine if there are more results. + MaxResults int32 + + // A pagination token to request the next page of results. Pass this value into a + // subsequent List Access Grants Instances request in order to retrieve the next + // page of results. + NextToken *string + + noSmithyDocumentSerde +} + +func (in *ListAccessGrantsInstancesInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type ListAccessGrantsInstancesOutput struct { + + // A container for a list of S3 Access Grants instances. + AccessGrantsInstancesList []types.ListAccessGrantsInstanceEntry + + // A pagination token to request the next page of results. Pass this value into a + // subsequent List Access Grants Instances request in order to retrieve the next + // page of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAccessGrantsInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpListAccessGrantsInstances{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpListAccessGrantsInstances{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAccessGrantsInstances"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opListAccessGrantsInstancesMiddleware(stack); err != nil { + return err + } + if err = addOpListAccessGrantsInstancesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccessGrantsInstances(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addListAccessGrantsInstancesUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opListAccessGrantsInstancesMiddleware struct { +} + +func (*endpointPrefix_opListAccessGrantsInstancesMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListAccessGrantsInstancesMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*ListAccessGrantsInstancesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opListAccessGrantsInstancesMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opListAccessGrantsInstancesMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +// ListAccessGrantsInstancesAPIClient is a client that implements the +// ListAccessGrantsInstances operation. +type ListAccessGrantsInstancesAPIClient interface { + ListAccessGrantsInstances(context.Context, *ListAccessGrantsInstancesInput, ...func(*Options)) (*ListAccessGrantsInstancesOutput, error) +} + +var _ ListAccessGrantsInstancesAPIClient = (*Client)(nil) + +// ListAccessGrantsInstancesPaginatorOptions is the paginator options for +// ListAccessGrantsInstances +type ListAccessGrantsInstancesPaginatorOptions struct { + // The maximum number of access grants that you would like returned in the List + // Access Grants response. If the results include the pagination token NextToken , + // make another call using the NextToken to determine if there are more 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 +} + +// ListAccessGrantsInstancesPaginator is a paginator for ListAccessGrantsInstances +type ListAccessGrantsInstancesPaginator struct { + options ListAccessGrantsInstancesPaginatorOptions + client ListAccessGrantsInstancesAPIClient + params *ListAccessGrantsInstancesInput + nextToken *string + firstPage bool +} + +// NewListAccessGrantsInstancesPaginator returns a new +// ListAccessGrantsInstancesPaginator +func NewListAccessGrantsInstancesPaginator(client ListAccessGrantsInstancesAPIClient, params *ListAccessGrantsInstancesInput, optFns ...func(*ListAccessGrantsInstancesPaginatorOptions)) *ListAccessGrantsInstancesPaginator { + if params == nil { + params = &ListAccessGrantsInstancesInput{} + } + + options := ListAccessGrantsInstancesPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAccessGrantsInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccessGrantsInstancesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAccessGrantsInstances page. +func (p *ListAccessGrantsInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessGrantsInstancesOutput, 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.ListAccessGrantsInstances(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_opListAccessGrantsInstances(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListAccessGrantsInstances", + } +} + +func copyListAccessGrantsInstancesInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*ListAccessGrantsInstancesInput) + if !ok { + return nil, fmt.Errorf("expect *ListAccessGrantsInstancesInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *ListAccessGrantsInstancesInput) copy() interface{} { + v := *in + return &v +} +func backFillListAccessGrantsInstancesAccountID(input interface{}, v string) error { + in := input.(*ListAccessGrantsInstancesInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addListAccessGrantsInstancesUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyListAccessGrantsInstancesInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_ListAccessGrantsLocations.go b/service/s3control/api_op_ListAccessGrantsLocations.go new file mode 100644 index 00000000000..ea7252a39de --- /dev/null +++ b/service/s3control/api_op_ListAccessGrantsLocations.go @@ -0,0 +1,361 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" +) + +// Returns a list of the locations registered in your S3 Access Grants instance. +// Permissions You must have the s3:ListAccessGrantsLocations permission to use +// this operation. +func (c *Client) ListAccessGrantsLocations(ctx context.Context, params *ListAccessGrantsLocationsInput, optFns ...func(*Options)) (*ListAccessGrantsLocationsOutput, error) { + if params == nil { + params = &ListAccessGrantsLocationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAccessGrantsLocations", params, optFns, c.addOperationListAccessGrantsLocationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAccessGrantsLocationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAccessGrantsLocationsInput struct { + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + // The S3 path to the location that you are registering. The location scope can be + // the default S3 location s3:// , the S3 path to a bucket s3:// , or the S3 path + // to a bucket and prefix s3:/// . A prefix in S3 is a string of characters at the + // beginning of an object key name used to organize the objects that you store in + // your S3 buckets. For example, object key names that start with the engineering/ + // prefix or object key names that start with the marketing/campaigns/ prefix. + LocationScope *string + + // The maximum number of access grants that you would like returned in the List + // Access Grants response. If the results include the pagination token NextToken , + // make another call using the NextToken to determine if there are more results. + MaxResults int32 + + // A pagination token to request the next page of results. Pass this value into a + // subsequent List Access Grants Locations request in order to retrieve the next + // page of results. + NextToken *string + + noSmithyDocumentSerde +} + +func (in *ListAccessGrantsLocationsInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type ListAccessGrantsLocationsOutput struct { + + // A container for a list of registered locations in an S3 Access Grants instance. + AccessGrantsLocationsList []types.ListAccessGrantsLocationsEntry + + // A pagination token to request the next page of results. Pass this value into a + // subsequent List Access Grants Locations request in order to retrieve the next + // page of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAccessGrantsLocationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpListAccessGrantsLocations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpListAccessGrantsLocations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAccessGrantsLocations"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opListAccessGrantsLocationsMiddleware(stack); err != nil { + return err + } + if err = addOpListAccessGrantsLocationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccessGrantsLocations(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addListAccessGrantsLocationsUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opListAccessGrantsLocationsMiddleware struct { +} + +func (*endpointPrefix_opListAccessGrantsLocationsMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListAccessGrantsLocationsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*ListAccessGrantsLocationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opListAccessGrantsLocationsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opListAccessGrantsLocationsMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +// ListAccessGrantsLocationsAPIClient is a client that implements the +// ListAccessGrantsLocations operation. +type ListAccessGrantsLocationsAPIClient interface { + ListAccessGrantsLocations(context.Context, *ListAccessGrantsLocationsInput, ...func(*Options)) (*ListAccessGrantsLocationsOutput, error) +} + +var _ ListAccessGrantsLocationsAPIClient = (*Client)(nil) + +// ListAccessGrantsLocationsPaginatorOptions is the paginator options for +// ListAccessGrantsLocations +type ListAccessGrantsLocationsPaginatorOptions struct { + // The maximum number of access grants that you would like returned in the List + // Access Grants response. If the results include the pagination token NextToken , + // make another call using the NextToken to determine if there are more 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 +} + +// ListAccessGrantsLocationsPaginator is a paginator for ListAccessGrantsLocations +type ListAccessGrantsLocationsPaginator struct { + options ListAccessGrantsLocationsPaginatorOptions + client ListAccessGrantsLocationsAPIClient + params *ListAccessGrantsLocationsInput + nextToken *string + firstPage bool +} + +// NewListAccessGrantsLocationsPaginator returns a new +// ListAccessGrantsLocationsPaginator +func NewListAccessGrantsLocationsPaginator(client ListAccessGrantsLocationsAPIClient, params *ListAccessGrantsLocationsInput, optFns ...func(*ListAccessGrantsLocationsPaginatorOptions)) *ListAccessGrantsLocationsPaginator { + if params == nil { + params = &ListAccessGrantsLocationsInput{} + } + + options := ListAccessGrantsLocationsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAccessGrantsLocationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccessGrantsLocationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAccessGrantsLocations page. +func (p *ListAccessGrantsLocationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessGrantsLocationsOutput, 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.ListAccessGrantsLocations(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_opListAccessGrantsLocations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListAccessGrantsLocations", + } +} + +func copyListAccessGrantsLocationsInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*ListAccessGrantsLocationsInput) + if !ok { + return nil, fmt.Errorf("expect *ListAccessGrantsLocationsInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *ListAccessGrantsLocationsInput) copy() interface{} { + v := *in + return &v +} +func backFillListAccessGrantsLocationsAccountID(input interface{}, v string) error { + in := input.(*ListAccessGrantsLocationsInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addListAccessGrantsLocationsUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyListAccessGrantsLocationsInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_ListTagsForResource.go b/service/s3control/api_op_ListTagsForResource.go index d3b52e963b1..c49a7af9225 100644 --- a/service/s3control/api_op_ListTagsForResource.go +++ b/service/s3control/api_op_ListTagsForResource.go @@ -17,13 +17,17 @@ import ( ) // This operation allows you to list all the Amazon Web Services resource tags for -// the specified resource. To use this operation, you must have the permission to -// perform the s3:ListTagsForResource action. For more information about the -// required Storage Lens Groups permissions, see Setting account permissions to -// use S3 Storage Lens groups (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_iam_permissions.html#storage_lens_groups_permissions) +// a specified resource. Each tag is a label consisting of a user-defined key and +// value. Tags can help you manage, identify, organize, search for, and filter +// resources. Permissions You must have the s3:ListTagsForResource permission to +// use this operation. This operation is only supported for S3 Storage Lens groups (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-lens-groups.html) +// and for S3 Access Grants (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-grants-tagging.html) +// . The tagged resource can be an S3 Storage Lens group or S3 Access Grants +// instance, registered location, or grant. For more information about the required +// Storage Lens Groups permissions, see Setting account permissions to use S3 +// Storage Lens groups (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_iam_permissions.html#storage_lens_groups_permissions) // . For information about S3 Tagging errors, see List of Amazon S3 Tagging error // codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#S3TaggingErrorCodeList) -// . This operation is only supported for S3 Storage Lens groups (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-lens-groups.html) // . func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { @@ -48,7 +52,8 @@ type ListTagsForResourceInput struct { AccountId *string // The Amazon Resource Name (ARN) of the S3 resource that you want to list the - // tags for. + // tags for. The tagged resource can be an S3 Storage Lens group or S3 Access + // Grants instance, registered location, or grant. // // This member is required. ResourceArn *string diff --git a/service/s3control/api_op_PutAccessGrantsInstanceResourcePolicy.go b/service/s3control/api_op_PutAccessGrantsInstanceResourcePolicy.go new file mode 100644 index 00000000000..8b5baddf3b1 --- /dev/null +++ b/service/s3control/api_op_PutAccessGrantsInstanceResourcePolicy.go @@ -0,0 +1,263 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" + "time" +) + +// Updates the resource policy of the S3 Access Grants instance. Permissions You +// must have the s3:PutAccessGrantsInstanceResourcePolicy permission to use this +// operation. +func (c *Client) PutAccessGrantsInstanceResourcePolicy(ctx context.Context, params *PutAccessGrantsInstanceResourcePolicyInput, optFns ...func(*Options)) (*PutAccessGrantsInstanceResourcePolicyOutput, error) { + if params == nil { + params = &PutAccessGrantsInstanceResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutAccessGrantsInstanceResourcePolicy", params, optFns, c.addOperationPutAccessGrantsInstanceResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutAccessGrantsInstanceResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutAccessGrantsInstanceResourcePolicyInput struct { + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + // The resource policy of the S3 Access Grants instance that you are updating. + // + // This member is required. + Policy *string + + // The Organization of the resource policy of the S3 Access Grants instance. + Organization *string + + noSmithyDocumentSerde +} + +func (in *PutAccessGrantsInstanceResourcePolicyInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type PutAccessGrantsInstanceResourcePolicyOutput struct { + + // The date and time when you created the S3 Access Grants instance resource + // policy. + CreatedAt *time.Time + + // The Organization of the resource policy of the S3 Access Grants instance. + Organization *string + + // The updated resource policy of the S3 Access Grants instance. + Policy *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutAccessGrantsInstanceResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpPutAccessGrantsInstanceResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpPutAccessGrantsInstanceResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutAccessGrantsInstanceResourcePolicy"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opPutAccessGrantsInstanceResourcePolicyMiddleware(stack); err != nil { + return err + } + if err = addOpPutAccessGrantsInstanceResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutAccessGrantsInstanceResourcePolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addPutAccessGrantsInstanceResourcePolicyUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opPutAccessGrantsInstanceResourcePolicyMiddleware struct { +} + +func (*endpointPrefix_opPutAccessGrantsInstanceResourcePolicyMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opPutAccessGrantsInstanceResourcePolicyMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*PutAccessGrantsInstanceResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opPutAccessGrantsInstanceResourcePolicyMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opPutAccessGrantsInstanceResourcePolicyMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opPutAccessGrantsInstanceResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutAccessGrantsInstanceResourcePolicy", + } +} + +func copyPutAccessGrantsInstanceResourcePolicyInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*PutAccessGrantsInstanceResourcePolicyInput) + if !ok { + return nil, fmt.Errorf("expect *PutAccessGrantsInstanceResourcePolicyInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *PutAccessGrantsInstanceResourcePolicyInput) copy() interface{} { + v := *in + return &v +} +func backFillPutAccessGrantsInstanceResourcePolicyAccountID(input interface{}, v string) error { + in := input.(*PutAccessGrantsInstanceResourcePolicyInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addPutAccessGrantsInstanceResourcePolicyUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyPutAccessGrantsInstanceResourcePolicyInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/api_op_TagResource.go b/service/s3control/api_op_TagResource.go index 96fdf4e2a28..562de96e74e 100644 --- a/service/s3control/api_op_TagResource.go +++ b/service/s3control/api_op_TagResource.go @@ -17,14 +17,18 @@ import ( ) // Creates a new Amazon Web Services resource tag or updates an existing resource -// tag. You can add up to 50 Amazon Web Services resource tags for each S3 -// resource. To use this operation, you must have the permission to perform the -// s3:TagResource action. For more information about the required Storage Lens -// Groups permissions, see Setting account permissions to use S3 Storage Lens -// groups (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_iam_permissions.html#storage_lens_groups_permissions) +// tag. Each tag is a label consisting of a user-defined key and value. Tags can +// help you manage, identify, organize, search for, and filter resources. You can +// add up to 50 Amazon Web Services resource tags for each S3 resource. This +// operation is only supported for S3 Storage Lens groups (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-lens-groups.html) +// and for S3 Access Grants (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-grants-tagging.html) +// . The tagged resource can be an S3 Storage Lens group or S3 Access Grants +// instance, registered location, or grant. Permissions You must have the +// s3:TagResource permission to use this operation. For more information about the +// required Storage Lens Groups permissions, see Setting account permissions to +// use S3 Storage Lens groups (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_iam_permissions.html#storage_lens_groups_permissions) // . For information about S3 Tagging errors, see List of Amazon S3 Tagging error // codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#S3TaggingErrorCodeList) -// . This operation is only supported for S3 Storage Lens groups (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-lens-groups.html) // . func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { @@ -44,13 +48,14 @@ func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optF type TagResourceInput struct { // The Amazon Web Services account ID that created the S3 resource that you're - // trying to add tags to. + // trying to add tags to or the requester's account ID. // // This member is required. AccountId *string // The Amazon Resource Name (ARN) of the S3 resource that you're trying to add - // tags to. + // tags to. The tagged resource can be an S3 Storage Lens group or S3 Access Grants + // instance, registered location, or grant. // // This member is required. ResourceArn *string diff --git a/service/s3control/api_op_UntagResource.go b/service/s3control/api_op_UntagResource.go index a4cf825ce46..f0d62929200 100644 --- a/service/s3control/api_op_UntagResource.go +++ b/service/s3control/api_op_UntagResource.go @@ -16,13 +16,17 @@ import ( ) // This operation removes the specified Amazon Web Services resource tags from an -// S3 resource. To use this operation, you must have the permission to perform the -// s3:UntagResource action. For more information about the required Storage Lens -// Groups permissions, see Setting account permissions to use S3 Storage Lens -// groups (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_iam_permissions.html#storage_lens_groups_permissions) +// S3 resource. Each tag is a label consisting of a user-defined key and value. +// Tags can help you manage, identify, organize, search for, and filter resources. +// This operation is only supported for S3 Storage Lens groups (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-lens-groups.html) +// and for S3 Access Grants (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-grants-tagging.html) +// . The tagged resource can be an S3 Storage Lens group or S3 Access Grants +// instance, registered location, or grant. Permissions You must have the +// s3:UntagResource permission to use this operation. For more information about +// the required Storage Lens Groups permissions, see Setting account permissions +// to use S3 Storage Lens groups (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_iam_permissions.html#storage_lens_groups_permissions) // . For information about S3 Tagging errors, see List of Amazon S3 Tagging error // codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#S3TaggingErrorCodeList) -// . This operation is only supported for S3 Storage Lens groups (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-lens-groups.html) // . func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { @@ -47,13 +51,14 @@ type UntagResourceInput struct { // This member is required. AccountId *string - // The Amazon Resource Name (ARN) of the S3 resource that you want to remove the - // resource tags from. + // The Amazon Resource Name (ARN) of the S3 resource that you're trying to remove + // the tags from. // // This member is required. ResourceArn *string - // The tag key pair of the S3 resource tag that you're trying to remove. + // The array of tag key-value pairs that you're trying to remove from of the S3 + // resource. // // This member is required. TagKeys []string diff --git a/service/s3control/api_op_UpdateAccessGrantsLocation.go b/service/s3control/api_op_UpdateAccessGrantsLocation.go new file mode 100644 index 00000000000..cee1d394430 --- /dev/null +++ b/service/s3control/api_op_UpdateAccessGrantsLocation.go @@ -0,0 +1,288 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "strings" + "time" +) + +// Updates the IAM role of a registered location in your S3 Access Grants +// instance. Permissions You must have the s3:UpdateAccessGrantsLocation +// permission to use this operation. Additional Permissions You must also have the +// following permission: iam:PassRole +func (c *Client) UpdateAccessGrantsLocation(ctx context.Context, params *UpdateAccessGrantsLocationInput, optFns ...func(*Options)) (*UpdateAccessGrantsLocationOutput, error) { + if params == nil { + params = &UpdateAccessGrantsLocationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateAccessGrantsLocation", params, optFns, c.addOperationUpdateAccessGrantsLocationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateAccessGrantsLocationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateAccessGrantsLocationInput struct { + + // The ID of the registered location that you are updating. S3 Access Grants + // assigns this ID when you register the location. S3 Access Grants assigns the ID + // default to the default location s3:// and assigns an auto-generated ID to other + // locations that you register. The ID of the registered location to which you are + // granting access. S3 Access Grants assigned this ID when you registered the + // location. S3 Access Grants assigns the ID default to the default location s3:// + // and assigns an auto-generated ID to other locations that you register. If you + // are passing the default location, you cannot create an access grant for the + // entire default location. You must also specify a bucket or a bucket and prefix + // in the Subprefix field. + // + // This member is required. + AccessGrantsLocationId *string + + // The ID of the Amazon Web Services account that is making this request. + // + // This member is required. + AccountId *string + + // The Amazon Resource Name (ARN) of the IAM role for the registered location. S3 + // Access Grants assumes this role to manage access to the registered location. + // + // This member is required. + IAMRoleArn *string + + noSmithyDocumentSerde +} + +func (in *UpdateAccessGrantsLocationInput) bindEndpointParams(p *EndpointParameters) { + p.AccountId = in.AccountId + p.RequiresAccountId = ptr.Bool(true) +} + +type UpdateAccessGrantsLocationOutput struct { + + // The Amazon Resource Name (ARN) of the registered location that you are updating. + AccessGrantsLocationArn *string + + // The ID of the registered location to which you are granting access. S3 Access + // Grants assigned this ID when you registered the location. S3 Access Grants + // assigns the ID default to the default location s3:// and assigns an + // auto-generated ID to other locations that you register. + AccessGrantsLocationId *string + + // The date and time when you registered the location. + CreatedAt *time.Time + + // The Amazon Resource Name (ARN) of the IAM role of the registered location. S3 + // Access Grants assumes this role to manage access to the registered location. + IAMRoleArn *string + + // The S3 URI path of the location that you are updating. You cannot update the + // scope of the registered location. The location scope can be the default S3 + // location s3:// , the S3 path to a bucket s3:// , or the S3 path to a bucket and + // prefix s3:/// . + LocationScope *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateAccessGrantsLocationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpUpdateAccessGrantsLocation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpUpdateAccessGrantsLocation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateAccessGrantsLocation"); 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 = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opUpdateAccessGrantsLocationMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateAccessGrantsLocationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAccessGrantsLocation(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addUpdateAccessGrantsLocationUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addStashOperationInput(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = s3controlcust.AddDisableHostPrefixMiddleware(stack); err != nil { + return err + } + return nil +} + +type endpointPrefix_opUpdateAccessGrantsLocationMiddleware struct { +} + +func (*endpointPrefix_opUpdateAccessGrantsLocationMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opUpdateAccessGrantsLocationMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*UpdateAccessGrantsLocationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opUpdateAccessGrantsLocationMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opUpdateAccessGrantsLocationMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opUpdateAccessGrantsLocation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateAccessGrantsLocation", + } +} + +func copyUpdateAccessGrantsLocationInputForUpdateEndpoint(params interface{}) (interface{}, error) { + input, ok := params.(*UpdateAccessGrantsLocationInput) + if !ok { + return nil, fmt.Errorf("expect *UpdateAccessGrantsLocationInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func (in *UpdateAccessGrantsLocationInput) copy() interface{} { + v := *in + return &v +} +func backFillUpdateAccessGrantsLocationAccountID(input interface{}, v string) error { + in := input.(*UpdateAccessGrantsLocationInput) + if in.AccountId != nil { + if !strings.EqualFold(*in.AccountId, v) { + return fmt.Errorf("error backfilling account id") + } + return nil + } + in.AccountId = &v + return nil +} +func addUpdateAccessGrantsLocationUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3controlcust.UpdateEndpoint(stack, s3controlcust.UpdateEndpointOptions{ + Accessor: s3controlcust.UpdateEndpointParameterAccessor{GetARNInput: nopGetARNAccessor, + BackfillAccountID: nopBackfillAccountIDAccessor, + GetOutpostIDInput: nopGetOutpostIDFromInput, + UpdateARNField: nopSetARNAccessor, + CopyInput: copyUpdateAccessGrantsLocationInputForUpdateEndpoint, + }, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + }) +} diff --git a/service/s3control/deserializers.go b/service/s3control/deserializers.go index 18a23313039..8edebf905b0 100644 --- a/service/s3control/deserializers.go +++ b/service/s3control/deserializers.go @@ -23,14 +23,14 @@ import ( "strings" ) -type awsRestxml_deserializeOpCreateAccessPoint struct { +type awsRestxml_deserializeOpAssociateAccessGrantsIdentityCenter struct { } -func (*awsRestxml_deserializeOpCreateAccessPoint) ID() string { +func (*awsRestxml_deserializeOpAssociateAccessGrantsIdentityCenter) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpCreateAccessPoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpAssociateAccessGrantsIdentityCenter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -44,9 +44,84 @@ func (m *awsRestxml_deserializeOpCreateAccessPoint) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorCreateAccessPoint(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorAssociateAccessGrantsIdentityCenter(response, &metadata) } - output := &CreateAccessPointOutput{} + output := &AssociateAccessGrantsIdentityCenterOutput{} + 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 awsRestxml_deserializeOpErrorAssociateAccessGrantsIdentityCenter(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestxml_deserializeOpCreateAccessGrant struct { +} + +func (*awsRestxml_deserializeOpCreateAccessGrant) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpCreateAccessGrant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorCreateAccessGrant(response, &metadata) + } + output := &CreateAccessGrantOutput{} out.Result = output var buff [1024]byte @@ -67,7 +142,7 @@ func (m *awsRestxml_deserializeOpCreateAccessPoint) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentCreateAccessPointOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentCreateAccessGrantOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -80,7 +155,7 @@ func (m *awsRestxml_deserializeOpCreateAccessPoint) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestxml_deserializeOpErrorCreateAccessPoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorCreateAccessGrant(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -120,13 +195,13 @@ func awsRestxml_deserializeOpErrorCreateAccessPoint(response *smithyhttp.Respons } } -func awsRestxml_deserializeOpDocumentCreateAccessPointOutput(v **CreateAccessPointOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentCreateAccessGrantOutput(v **CreateAccessGrantOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *CreateAccessPointOutput + var sv *CreateAccessGrantOutput if *v == nil { - sv = &CreateAccessPointOutput{} + sv = &CreateAccessGrantOutput{} } else { sv = *v } @@ -142,7 +217,7 @@ func awsRestxml_deserializeOpDocumentCreateAccessPointOutput(v **CreateAccessPoi originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("AccessPointArn", t.Name.Local): + case strings.EqualFold("AccessGrantArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -152,10 +227,10 @@ func awsRestxml_deserializeOpDocumentCreateAccessPointOutput(v **CreateAccessPoi } { xtv := string(val) - sv.AccessPointArn = ptr.String(xtv) + sv.AccessGrantArn = ptr.String(xtv) } - case strings.EqualFold("Alias", t.Name.Local): + case strings.EqualFold("AccessGrantId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -165,7 +240,88 @@ func awsRestxml_deserializeOpDocumentCreateAccessPointOutput(v **CreateAccessPoi } { xtv := string(val) - sv.Alias = ptr.String(xtv) + sv.AccessGrantId = ptr.String(xtv) + } + + case strings.EqualFold("AccessGrantsLocationConfiguration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentAccessGrantsLocationConfiguration(&sv.AccessGrantsLocationConfiguration, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("AccessGrantsLocationId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessGrantsLocationId = ptr.String(xtv) + } + + case strings.EqualFold("ApplicationArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ApplicationArn = ptr.String(xtv) + } + + case strings.EqualFold("CreatedAt", 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.CreatedAt = ptr.Time(t) + } + + case strings.EqualFold("Grantee", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentGrantee(&sv.Grantee, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("GrantScope", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.GrantScope = ptr.String(xtv) + } + + case strings.EqualFold("Permission", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Permission = types.Permission(xtv) } default: @@ -182,14 +338,14 @@ func awsRestxml_deserializeOpDocumentCreateAccessPointOutput(v **CreateAccessPoi return nil } -type awsRestxml_deserializeOpCreateAccessPointForObjectLambda struct { +type awsRestxml_deserializeOpCreateAccessGrantsInstance struct { } -func (*awsRestxml_deserializeOpCreateAccessPointForObjectLambda) ID() string { +func (*awsRestxml_deserializeOpCreateAccessGrantsInstance) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpCreateAccessPointForObjectLambda) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpCreateAccessGrantsInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -203,9 +359,9 @@ func (m *awsRestxml_deserializeOpCreateAccessPointForObjectLambda) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorCreateAccessPointForObjectLambda(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorCreateAccessGrantsInstance(response, &metadata) } - output := &CreateAccessPointForObjectLambdaOutput{} + output := &CreateAccessGrantsInstanceOutput{} out.Result = output var buff [1024]byte @@ -226,7 +382,7 @@ func (m *awsRestxml_deserializeOpCreateAccessPointForObjectLambda) HandleDeseria } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentCreateAccessPointForObjectLambdaOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentCreateAccessGrantsInstanceOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -239,7 +395,7 @@ func (m *awsRestxml_deserializeOpCreateAccessPointForObjectLambda) HandleDeseria return out, metadata, err } -func awsRestxml_deserializeOpErrorCreateAccessPointForObjectLambda(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorCreateAccessGrantsInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -279,13 +435,13 @@ func awsRestxml_deserializeOpErrorCreateAccessPointForObjectLambda(response *smi } } -func awsRestxml_deserializeOpDocumentCreateAccessPointForObjectLambdaOutput(v **CreateAccessPointForObjectLambdaOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentCreateAccessGrantsInstanceOutput(v **CreateAccessGrantsInstanceOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *CreateAccessPointForObjectLambdaOutput + var sv *CreateAccessGrantsInstanceOutput if *v == nil { - sv = &CreateAccessPointForObjectLambdaOutput{} + sv = &CreateAccessGrantsInstanceOutput{} } else { sv = *v } @@ -301,13 +457,20 @@ func awsRestxml_deserializeOpDocumentCreateAccessPointForObjectLambdaOutput(v ** originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Alias", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentObjectLambdaAccessPointAlias(&sv.Alias, nodeDecoder); err != nil { + case strings.EqualFold("AccessGrantsInstanceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessGrantsInstanceArn = ptr.String(xtv) + } - case strings.EqualFold("ObjectLambdaAccessPointArn", t.Name.Local): + case strings.EqualFold("AccessGrantsInstanceId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -317,7 +480,37 @@ func awsRestxml_deserializeOpDocumentCreateAccessPointForObjectLambdaOutput(v ** } { xtv := string(val) - sv.ObjectLambdaAccessPointArn = ptr.String(xtv) + sv.AccessGrantsInstanceId = ptr.String(xtv) + } + + case strings.EqualFold("CreatedAt", 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.CreatedAt = ptr.Time(t) + } + + case strings.EqualFold("IdentityCenterArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IdentityCenterArn = ptr.String(xtv) } default: @@ -334,14 +527,14 @@ func awsRestxml_deserializeOpDocumentCreateAccessPointForObjectLambdaOutput(v ** return nil } -type awsRestxml_deserializeOpCreateBucket struct { +type awsRestxml_deserializeOpCreateAccessGrantsLocation struct { } -func (*awsRestxml_deserializeOpCreateBucket) ID() string { +func (*awsRestxml_deserializeOpCreateAccessGrantsLocation) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpCreateBucket) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpCreateAccessGrantsLocation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -355,16 +548,11 @@ func (m *awsRestxml_deserializeOpCreateBucket) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorCreateBucket(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorCreateAccessGrantsLocation(response, &metadata) } - output := &CreateBucketOutput{} + output := &CreateAccessGrantsLocationOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsCreateBucketOutput(output, response) - if err != nil { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} - } - var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) @@ -383,7 +571,7 @@ func (m *awsRestxml_deserializeOpCreateBucket) HandleDeserialize(ctx context.Con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentCreateBucketOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentCreateAccessGrantsLocationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -396,7 +584,7 @@ func (m *awsRestxml_deserializeOpCreateBucket) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestxml_deserializeOpErrorCreateBucket(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorCreateAccessGrantsLocation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -426,12 +614,6 @@ func awsRestxml_deserializeOpErrorCreateBucket(response *smithyhttp.Response, me } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("BucketAlreadyExists", errorCode): - return awsRestxml_deserializeErrorBucketAlreadyExists(response, errorBody) - - case strings.EqualFold("BucketAlreadyOwnedByYou", errorCode): - return awsRestxml_deserializeErrorBucketAlreadyOwnedByYou(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -442,25 +624,13 @@ func awsRestxml_deserializeOpErrorCreateBucket(response *smithyhttp.Response, me } } -func awsRestxml_deserializeOpHttpBindingsCreateBucketOutput(v *CreateBucketOutput, response *smithyhttp.Response) error { - if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) - } - - if headerValues := response.Header.Values("Location"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - v.Location = ptr.String(headerValues[0]) - } - - return nil -} -func awsRestxml_deserializeOpDocumentCreateBucketOutput(v **CreateBucketOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentCreateAccessGrantsLocationOutput(v **CreateAccessGrantsLocationOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *CreateBucketOutput + var sv *CreateAccessGrantsLocationOutput if *v == nil { - sv = &CreateBucketOutput{} + sv = &CreateAccessGrantsLocationOutput{} } else { sv = *v } @@ -476,7 +646,7 @@ func awsRestxml_deserializeOpDocumentCreateBucketOutput(v **CreateBucketOutput, originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("BucketArn", t.Name.Local): + case strings.EqualFold("AccessGrantsLocationArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -486,31 +656,87 @@ func awsRestxml_deserializeOpDocumentCreateBucketOutput(v **CreateBucketOutput, } { xtv := string(val) - sv.BucketArn = ptr.String(xtv) + sv.AccessGrantsLocationArn = ptr.String(xtv) } - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() + case strings.EqualFold("AccessGrantsLocationId", t.Name.Local): + val, err := decoder.Value() if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessGrantsLocationId = ptr.String(xtv) + } - } - decoder = originalDecoder - } - *v = sv - return nil -} + case strings.EqualFold("CreatedAt", 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.CreatedAt = ptr.Time(t) + } -type awsRestxml_deserializeOpCreateJob struct { + case strings.EqualFold("IAMRoleArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IAMRoleArn = ptr.String(xtv) + } + + case strings.EqualFold("LocationScope", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LocationScope = 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 (*awsRestxml_deserializeOpCreateJob) ID() string { +type awsRestxml_deserializeOpCreateAccessPoint struct { +} + +func (*awsRestxml_deserializeOpCreateAccessPoint) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpCreateJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpCreateAccessPoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -524,9 +750,9 @@ func (m *awsRestxml_deserializeOpCreateJob) HandleDeserialize(ctx context.Contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorCreateJob(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorCreateAccessPoint(response, &metadata) } - output := &CreateJobOutput{} + output := &CreateAccessPointOutput{} out.Result = output var buff [1024]byte @@ -547,7 +773,7 @@ func (m *awsRestxml_deserializeOpCreateJob) HandleDeserialize(ctx context.Contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentCreateJobOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentCreateAccessPointOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -560,7 +786,7 @@ func (m *awsRestxml_deserializeOpCreateJob) HandleDeserialize(ctx context.Contex return out, metadata, err } -func awsRestxml_deserializeOpErrorCreateJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorCreateAccessPoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -590,18 +816,6 @@ func awsRestxml_deserializeOpErrorCreateJob(response *smithyhttp.Response, metad } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("BadRequestException", errorCode): - return awsRestxml_deserializeErrorBadRequestException(response, errorBody) - - case strings.EqualFold("IdempotencyException", errorCode): - return awsRestxml_deserializeErrorIdempotencyException(response, errorBody) - - case strings.EqualFold("InternalServiceException", errorCode): - return awsRestxml_deserializeErrorInternalServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsRestxml_deserializeErrorTooManyRequestsException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -612,13 +826,13 @@ func awsRestxml_deserializeOpErrorCreateJob(response *smithyhttp.Response, metad } } -func awsRestxml_deserializeOpDocumentCreateJobOutput(v **CreateJobOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentCreateAccessPointOutput(v **CreateAccessPointOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *CreateJobOutput + var sv *CreateAccessPointOutput if *v == nil { - sv = &CreateJobOutput{} + sv = &CreateAccessPointOutput{} } else { sv = *v } @@ -634,7 +848,7 @@ func awsRestxml_deserializeOpDocumentCreateJobOutput(v **CreateJobOutput, decode originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("JobId", t.Name.Local): + case strings.EqualFold("AccessPointArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -644,7 +858,20 @@ func awsRestxml_deserializeOpDocumentCreateJobOutput(v **CreateJobOutput, decode } { xtv := string(val) - sv.JobId = ptr.String(xtv) + sv.AccessPointArn = ptr.String(xtv) + } + + case strings.EqualFold("Alias", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Alias = ptr.String(xtv) } default: @@ -661,14 +888,14 @@ func awsRestxml_deserializeOpDocumentCreateJobOutput(v **CreateJobOutput, decode return nil } -type awsRestxml_deserializeOpCreateMultiRegionAccessPoint struct { +type awsRestxml_deserializeOpCreateAccessPointForObjectLambda struct { } -func (*awsRestxml_deserializeOpCreateMultiRegionAccessPoint) ID() string { +func (*awsRestxml_deserializeOpCreateAccessPointForObjectLambda) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpCreateMultiRegionAccessPoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpCreateAccessPointForObjectLambda) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -682,9 +909,9 @@ func (m *awsRestxml_deserializeOpCreateMultiRegionAccessPoint) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorCreateMultiRegionAccessPoint(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorCreateAccessPointForObjectLambda(response, &metadata) } - output := &CreateMultiRegionAccessPointOutput{} + output := &CreateAccessPointForObjectLambdaOutput{} out.Result = output var buff [1024]byte @@ -705,7 +932,7 @@ func (m *awsRestxml_deserializeOpCreateMultiRegionAccessPoint) HandleDeserialize } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentCreateMultiRegionAccessPointOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentCreateAccessPointForObjectLambdaOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -718,7 +945,7 @@ func (m *awsRestxml_deserializeOpCreateMultiRegionAccessPoint) HandleDeserialize return out, metadata, err } -func awsRestxml_deserializeOpErrorCreateMultiRegionAccessPoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorCreateAccessPointForObjectLambda(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -758,13 +985,13 @@ func awsRestxml_deserializeOpErrorCreateMultiRegionAccessPoint(response *smithyh } } -func awsRestxml_deserializeOpDocumentCreateMultiRegionAccessPointOutput(v **CreateMultiRegionAccessPointOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentCreateAccessPointForObjectLambdaOutput(v **CreateAccessPointForObjectLambdaOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *CreateMultiRegionAccessPointOutput + var sv *CreateAccessPointForObjectLambdaOutput if *v == nil { - sv = &CreateMultiRegionAccessPointOutput{} + sv = &CreateAccessPointForObjectLambdaOutput{} } else { sv = *v } @@ -780,7 +1007,13 @@ func awsRestxml_deserializeOpDocumentCreateMultiRegionAccessPointOutput(v **Crea originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("RequestTokenARN", t.Name.Local): + case strings.EqualFold("Alias", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentObjectLambdaAccessPointAlias(&sv.Alias, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ObjectLambdaAccessPointArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -790,7 +1023,7 @@ func awsRestxml_deserializeOpDocumentCreateMultiRegionAccessPointOutput(v **Crea } { xtv := string(val) - sv.RequestTokenARN = ptr.String(xtv) + sv.ObjectLambdaAccessPointArn = ptr.String(xtv) } default: @@ -807,14 +1040,14 @@ func awsRestxml_deserializeOpDocumentCreateMultiRegionAccessPointOutput(v **Crea return nil } -type awsRestxml_deserializeOpCreateStorageLensGroup struct { +type awsRestxml_deserializeOpCreateBucket struct { } -func (*awsRestxml_deserializeOpCreateStorageLensGroup) ID() string { +func (*awsRestxml_deserializeOpCreateBucket) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpCreateStorageLensGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpCreateBucket) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -828,21 +1061,48 @@ func (m *awsRestxml_deserializeOpCreateStorageLensGroup) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorCreateStorageLensGroup(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorCreateBucket(response, &metadata) } - output := &CreateStorageLensGroupOutput{} + output := &CreateBucketOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + err = awsRestxml_deserializeOpHttpBindingsCreateBucketOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + 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 discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeOpDocumentCreateBucketOutput(&output, decoder) + 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(), } } return out, metadata, err } -func awsRestxml_deserializeOpErrorCreateStorageLensGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorCreateBucket(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -872,6 +1132,12 @@ func awsRestxml_deserializeOpErrorCreateStorageLensGroup(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("BucketAlreadyExists", errorCode): + return awsRestxml_deserializeErrorBucketAlreadyExists(response, errorBody) + + case strings.EqualFold("BucketAlreadyOwnedByYou", errorCode): + return awsRestxml_deserializeErrorBucketAlreadyOwnedByYou(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -882,14 +1148,75 @@ func awsRestxml_deserializeOpErrorCreateStorageLensGroup(response *smithyhttp.Re } } -type awsRestxml_deserializeOpDeleteAccessPoint struct { +func awsRestxml_deserializeOpHttpBindingsCreateBucketOutput(v *CreateBucketOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Location"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.Location = ptr.String(headerValues[0]) + } + + return nil } +func awsRestxml_deserializeOpDocumentCreateBucketOutput(v **CreateBucketOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateBucketOutput + if *v == nil { + sv = &CreateBucketOutput{} + } else { + sv = *v + } -func (*awsRestxml_deserializeOpDeleteAccessPoint) ID() string { + 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("BucketArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.BucketArn = 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 +} + +type awsRestxml_deserializeOpCreateJob struct { +} + +func (*awsRestxml_deserializeOpCreateJob) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteAccessPoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpCreateJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -903,21 +1230,43 @@ func (m *awsRestxml_deserializeOpDeleteAccessPoint) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteAccessPoint(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorCreateJob(response, &metadata) } - output := &DeleteAccessPointOutput{} + output := &CreateJobOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + 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 = awsRestxml_deserializeOpDocumentCreateJobOutput(&output, decoder) + 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(), + } + } return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteAccessPoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorCreateJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -947,6 +1296,18 @@ func awsRestxml_deserializeOpErrorDeleteAccessPoint(response *smithyhttp.Respons } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestxml_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("IdempotencyException", errorCode): + return awsRestxml_deserializeErrorIdempotencyException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestxml_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestxml_deserializeErrorTooManyRequestsException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -957,14 +1318,63 @@ func awsRestxml_deserializeOpErrorDeleteAccessPoint(response *smithyhttp.Respons } } -type awsRestxml_deserializeOpDeleteAccessPointForObjectLambda struct { +func awsRestxml_deserializeOpDocumentCreateJobOutput(v **CreateJobOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateJobOutput + if *v == nil { + sv = &CreateJobOutput{} + } 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("JobId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.JobId = 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 (*awsRestxml_deserializeOpDeleteAccessPointForObjectLambda) ID() string { +type awsRestxml_deserializeOpCreateMultiRegionAccessPoint struct { +} + +func (*awsRestxml_deserializeOpCreateMultiRegionAccessPoint) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteAccessPointForObjectLambda) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpCreateMultiRegionAccessPoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -978,21 +1388,43 @@ func (m *awsRestxml_deserializeOpDeleteAccessPointForObjectLambda) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteAccessPointForObjectLambda(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorCreateMultiRegionAccessPoint(response, &metadata) } - output := &DeleteAccessPointForObjectLambdaOutput{} + output := &CreateMultiRegionAccessPointOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + 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 discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeOpDocumentCreateMultiRegionAccessPointOutput(&output, decoder) + 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(), } } return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteAccessPointForObjectLambda(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorCreateMultiRegionAccessPoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1032,14 +1464,63 @@ func awsRestxml_deserializeOpErrorDeleteAccessPointForObjectLambda(response *smi } } -type awsRestxml_deserializeOpDeleteAccessPointPolicy struct { +func awsRestxml_deserializeOpDocumentCreateMultiRegionAccessPointOutput(v **CreateMultiRegionAccessPointOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateMultiRegionAccessPointOutput + if *v == nil { + sv = &CreateMultiRegionAccessPointOutput{} + } 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("RequestTokenARN", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.RequestTokenARN = 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 (*awsRestxml_deserializeOpDeleteAccessPointPolicy) ID() string { +type awsRestxml_deserializeOpCreateStorageLensGroup struct { +} + +func (*awsRestxml_deserializeOpCreateStorageLensGroup) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteAccessPointPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpCreateStorageLensGroup) HandleDeserialize(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 +1534,9 @@ func (m *awsRestxml_deserializeOpDeleteAccessPointPolicy) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteAccessPointPolicy(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorCreateStorageLensGroup(response, &metadata) } - output := &DeleteAccessPointPolicyOutput{} + output := &CreateStorageLensGroupOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1067,7 +1548,7 @@ func (m *awsRestxml_deserializeOpDeleteAccessPointPolicy) HandleDeserialize(ctx return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteAccessPointPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorCreateStorageLensGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1107,14 +1588,14 @@ func awsRestxml_deserializeOpErrorDeleteAccessPointPolicy(response *smithyhttp.R } } -type awsRestxml_deserializeOpDeleteAccessPointPolicyForObjectLambda struct { +type awsRestxml_deserializeOpDeleteAccessGrant struct { } -func (*awsRestxml_deserializeOpDeleteAccessPointPolicyForObjectLambda) ID() string { +func (*awsRestxml_deserializeOpDeleteAccessGrant) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteAccessPointPolicyForObjectLambda) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteAccessGrant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1128,9 +1609,9 @@ func (m *awsRestxml_deserializeOpDeleteAccessPointPolicyForObjectLambda) HandleD } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteAccessPointPolicyForObjectLambda(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteAccessGrant(response, &metadata) } - output := &DeleteAccessPointPolicyForObjectLambdaOutput{} + output := &DeleteAccessGrantOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1142,7 +1623,7 @@ func (m *awsRestxml_deserializeOpDeleteAccessPointPolicyForObjectLambda) HandleD return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteAccessPointPolicyForObjectLambda(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteAccessGrant(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1182,14 +1663,14 @@ func awsRestxml_deserializeOpErrorDeleteAccessPointPolicyForObjectLambda(respons } } -type awsRestxml_deserializeOpDeleteBucket struct { +type awsRestxml_deserializeOpDeleteAccessGrantsInstance struct { } -func (*awsRestxml_deserializeOpDeleteBucket) ID() string { +func (*awsRestxml_deserializeOpDeleteAccessGrantsInstance) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteBucket) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteAccessGrantsInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1203,9 +1684,9 @@ func (m *awsRestxml_deserializeOpDeleteBucket) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteBucket(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteAccessGrantsInstance(response, &metadata) } - output := &DeleteBucketOutput{} + output := &DeleteAccessGrantsInstanceOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1217,7 +1698,7 @@ func (m *awsRestxml_deserializeOpDeleteBucket) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteBucket(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteAccessGrantsInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1257,14 +1738,14 @@ func awsRestxml_deserializeOpErrorDeleteBucket(response *smithyhttp.Response, me } } -type awsRestxml_deserializeOpDeleteBucketLifecycleConfiguration struct { +type awsRestxml_deserializeOpDeleteAccessGrantsInstanceResourcePolicy struct { } -func (*awsRestxml_deserializeOpDeleteBucketLifecycleConfiguration) ID() string { +func (*awsRestxml_deserializeOpDeleteAccessGrantsInstanceResourcePolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteBucketLifecycleConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteAccessGrantsInstanceResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1278,9 +1759,9 @@ func (m *awsRestxml_deserializeOpDeleteBucketLifecycleConfiguration) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketLifecycleConfiguration(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteAccessGrantsInstanceResourcePolicy(response, &metadata) } - output := &DeleteBucketLifecycleConfigurationOutput{} + output := &DeleteAccessGrantsInstanceResourcePolicyOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1292,7 +1773,7 @@ func (m *awsRestxml_deserializeOpDeleteBucketLifecycleConfiguration) HandleDeser return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteBucketLifecycleConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteAccessGrantsInstanceResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1332,14 +1813,14 @@ func awsRestxml_deserializeOpErrorDeleteBucketLifecycleConfiguration(response *s } } -type awsRestxml_deserializeOpDeleteBucketPolicy struct { +type awsRestxml_deserializeOpDeleteAccessGrantsLocation struct { } -func (*awsRestxml_deserializeOpDeleteBucketPolicy) ID() string { +func (*awsRestxml_deserializeOpDeleteAccessGrantsLocation) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteBucketPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteAccessGrantsLocation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1353,9 +1834,9 @@ func (m *awsRestxml_deserializeOpDeleteBucketPolicy) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketPolicy(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteAccessGrantsLocation(response, &metadata) } - output := &DeleteBucketPolicyOutput{} + output := &DeleteAccessGrantsLocationOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1367,7 +1848,7 @@ func (m *awsRestxml_deserializeOpDeleteBucketPolicy) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteBucketPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteAccessGrantsLocation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1407,14 +1888,14 @@ func awsRestxml_deserializeOpErrorDeleteBucketPolicy(response *smithyhttp.Respon } } -type awsRestxml_deserializeOpDeleteBucketReplication struct { +type awsRestxml_deserializeOpDeleteAccessPoint struct { } -func (*awsRestxml_deserializeOpDeleteBucketReplication) ID() string { +func (*awsRestxml_deserializeOpDeleteAccessPoint) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteBucketReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteAccessPoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1428,9 +1909,9 @@ func (m *awsRestxml_deserializeOpDeleteBucketReplication) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketReplication(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteAccessPoint(response, &metadata) } - output := &DeleteBucketReplicationOutput{} + output := &DeleteAccessPointOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1442,7 +1923,7 @@ func (m *awsRestxml_deserializeOpDeleteBucketReplication) HandleDeserialize(ctx return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteBucketReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteAccessPoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1482,14 +1963,14 @@ func awsRestxml_deserializeOpErrorDeleteBucketReplication(response *smithyhttp.R } } -type awsRestxml_deserializeOpDeleteBucketTagging struct { +type awsRestxml_deserializeOpDeleteAccessPointForObjectLambda struct { } -func (*awsRestxml_deserializeOpDeleteBucketTagging) ID() string { +func (*awsRestxml_deserializeOpDeleteAccessPointForObjectLambda) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteBucketTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteAccessPointForObjectLambda) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1503,9 +1984,9 @@ func (m *awsRestxml_deserializeOpDeleteBucketTagging) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketTagging(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteAccessPointForObjectLambda(response, &metadata) } - output := &DeleteBucketTaggingOutput{} + output := &DeleteAccessPointForObjectLambdaOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1517,7 +1998,7 @@ func (m *awsRestxml_deserializeOpDeleteBucketTagging) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteBucketTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteAccessPointForObjectLambda(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1557,14 +2038,14 @@ func awsRestxml_deserializeOpErrorDeleteBucketTagging(response *smithyhttp.Respo } } -type awsRestxml_deserializeOpDeleteJobTagging struct { +type awsRestxml_deserializeOpDeleteAccessPointPolicy struct { } -func (*awsRestxml_deserializeOpDeleteJobTagging) ID() string { +func (*awsRestxml_deserializeOpDeleteAccessPointPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteJobTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteAccessPointPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1578,15 +2059,21 @@ func (m *awsRestxml_deserializeOpDeleteJobTagging) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteJobTagging(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteAccessPointPolicy(response, &metadata) } - output := &DeleteJobTaggingOutput{} + output := &DeleteAccessPointPolicyOutput{} 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 awsRestxml_deserializeOpErrorDeleteJobTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteAccessPointPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1616,15 +2103,6 @@ func awsRestxml_deserializeOpErrorDeleteJobTagging(response *smithyhttp.Response } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("InternalServiceException", errorCode): - return awsRestxml_deserializeErrorInternalServiceException(response, errorBody) - - case strings.EqualFold("NotFoundException", errorCode): - return awsRestxml_deserializeErrorNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsRestxml_deserializeErrorTooManyRequestsException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1635,14 +2113,14 @@ func awsRestxml_deserializeOpErrorDeleteJobTagging(response *smithyhttp.Response } } -type awsRestxml_deserializeOpDeleteMultiRegionAccessPoint struct { +type awsRestxml_deserializeOpDeleteAccessPointPolicyForObjectLambda struct { } -func (*awsRestxml_deserializeOpDeleteMultiRegionAccessPoint) ID() string { +func (*awsRestxml_deserializeOpDeleteAccessPointPolicyForObjectLambda) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteMultiRegionAccessPoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteAccessPointPolicyForObjectLambda) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1656,43 +2134,21 @@ func (m *awsRestxml_deserializeOpDeleteMultiRegionAccessPoint) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteMultiRegionAccessPoint(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteAccessPointPolicyForObjectLambda(response, &metadata) } - output := &DeleteMultiRegionAccessPointOutput{} + output := &DeleteAccessPointPolicyForObjectLambdaOutput{} 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 = awsRestxml_deserializeOpDocumentDeleteMultiRegionAccessPointOutput(&output, decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteMultiRegionAccessPoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteAccessPointPolicyForObjectLambda(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1732,63 +2188,14 @@ func awsRestxml_deserializeOpErrorDeleteMultiRegionAccessPoint(response *smithyh } } -func awsRestxml_deserializeOpDocumentDeleteMultiRegionAccessPointOutput(v **DeleteMultiRegionAccessPointOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DeleteMultiRegionAccessPointOutput - if *v == nil { - sv = &DeleteMultiRegionAccessPointOutput{} - } 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("RequestTokenARN", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RequestTokenARN = 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 -} - -type awsRestxml_deserializeOpDeletePublicAccessBlock struct { +type awsRestxml_deserializeOpDeleteBucket struct { } -func (*awsRestxml_deserializeOpDeletePublicAccessBlock) ID() string { +func (*awsRestxml_deserializeOpDeleteBucket) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeletePublicAccessBlock) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteBucket) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1802,9 +2209,9 @@ func (m *awsRestxml_deserializeOpDeletePublicAccessBlock) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeletePublicAccessBlock(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteBucket(response, &metadata) } - output := &DeletePublicAccessBlockOutput{} + output := &DeleteBucketOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1816,7 +2223,7 @@ func (m *awsRestxml_deserializeOpDeletePublicAccessBlock) HandleDeserialize(ctx return out, metadata, err } -func awsRestxml_deserializeOpErrorDeletePublicAccessBlock(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteBucket(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1856,14 +2263,14 @@ func awsRestxml_deserializeOpErrorDeletePublicAccessBlock(response *smithyhttp.R } } -type awsRestxml_deserializeOpDeleteStorageLensConfiguration struct { +type awsRestxml_deserializeOpDeleteBucketLifecycleConfiguration struct { } -func (*awsRestxml_deserializeOpDeleteStorageLensConfiguration) ID() string { +func (*awsRestxml_deserializeOpDeleteBucketLifecycleConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteStorageLensConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteBucketLifecycleConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1877,9 +2284,9 @@ func (m *awsRestxml_deserializeOpDeleteStorageLensConfiguration) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteStorageLensConfiguration(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketLifecycleConfiguration(response, &metadata) } - output := &DeleteStorageLensConfigurationOutput{} + output := &DeleteBucketLifecycleConfigurationOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1891,7 +2298,7 @@ func (m *awsRestxml_deserializeOpDeleteStorageLensConfiguration) HandleDeseriali return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteStorageLensConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteBucketLifecycleConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1931,14 +2338,14 @@ func awsRestxml_deserializeOpErrorDeleteStorageLensConfiguration(response *smith } } -type awsRestxml_deserializeOpDeleteStorageLensConfigurationTagging struct { +type awsRestxml_deserializeOpDeleteBucketPolicy struct { } -func (*awsRestxml_deserializeOpDeleteStorageLensConfigurationTagging) ID() string { +func (*awsRestxml_deserializeOpDeleteBucketPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteStorageLensConfigurationTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteBucketPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1952,15 +2359,21 @@ func (m *awsRestxml_deserializeOpDeleteStorageLensConfigurationTagging) HandleDe } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteStorageLensConfigurationTagging(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketPolicy(response, &metadata) } - output := &DeleteStorageLensConfigurationTaggingOutput{} + output := &DeleteBucketPolicyOutput{} 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 awsRestxml_deserializeOpErrorDeleteStorageLensConfigurationTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteBucketPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2000,14 +2413,14 @@ func awsRestxml_deserializeOpErrorDeleteStorageLensConfigurationTagging(response } } -type awsRestxml_deserializeOpDeleteStorageLensGroup struct { +type awsRestxml_deserializeOpDeleteBucketReplication struct { } -func (*awsRestxml_deserializeOpDeleteStorageLensGroup) ID() string { +func (*awsRestxml_deserializeOpDeleteBucketReplication) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteStorageLensGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteBucketReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2021,9 +2434,9 @@ func (m *awsRestxml_deserializeOpDeleteStorageLensGroup) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteStorageLensGroup(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketReplication(response, &metadata) } - output := &DeleteStorageLensGroupOutput{} + output := &DeleteBucketReplicationOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -2035,7 +2448,7 @@ func (m *awsRestxml_deserializeOpDeleteStorageLensGroup) HandleDeserialize(ctx c return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteStorageLensGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteBucketReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2075,14 +2488,14 @@ func awsRestxml_deserializeOpErrorDeleteStorageLensGroup(response *smithyhttp.Re } } -type awsRestxml_deserializeOpDescribeJob struct { +type awsRestxml_deserializeOpDeleteBucketTagging struct { } -func (*awsRestxml_deserializeOpDescribeJob) ID() string { +func (*awsRestxml_deserializeOpDeleteBucketTagging) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDescribeJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteBucketTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2096,43 +2509,21 @@ func (m *awsRestxml_deserializeOpDescribeJob) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDescribeJob(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketTagging(response, &metadata) } - output := &DescribeJobOutput{} + output := &DeleteBucketTaggingOutput{} 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 = awsRestxml_deserializeOpDocumentDescribeJobOutput(&output, decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } -func awsRestxml_deserializeOpErrorDescribeJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteBucketTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2162,18 +2553,6 @@ func awsRestxml_deserializeOpErrorDescribeJob(response *smithyhttp.Response, met } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("BadRequestException", errorCode): - return awsRestxml_deserializeErrorBadRequestException(response, errorBody) - - case strings.EqualFold("InternalServiceException", errorCode): - return awsRestxml_deserializeErrorInternalServiceException(response, errorBody) - - case strings.EqualFold("NotFoundException", errorCode): - return awsRestxml_deserializeErrorNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsRestxml_deserializeErrorTooManyRequestsException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2184,56 +2563,14 @@ func awsRestxml_deserializeOpErrorDescribeJob(response *smithyhttp.Response, met } } -func awsRestxml_deserializeOpDocumentDescribeJobOutput(v **DescribeJobOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeJobOutput - if *v == nil { - sv = &DescribeJobOutput{} - } 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("Job", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentJobDescriptor(&sv.Job, 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 -} - -type awsRestxml_deserializeOpDescribeMultiRegionAccessPointOperation struct { +type awsRestxml_deserializeOpDeleteJobTagging struct { } -func (*awsRestxml_deserializeOpDescribeMultiRegionAccessPointOperation) ID() string { +func (*awsRestxml_deserializeOpDeleteJobTagging) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDescribeMultiRegionAccessPointOperation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteJobTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2247,43 +2584,15 @@ func (m *awsRestxml_deserializeOpDescribeMultiRegionAccessPointOperation) Handle } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDescribeMultiRegionAccessPointOperation(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteJobTagging(response, &metadata) } - output := &DescribeMultiRegionAccessPointOperationOutput{} + output := &DeleteJobTaggingOutput{} 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 = awsRestxml_deserializeOpDocumentDescribeMultiRegionAccessPointOperationOutput(&output, decoder) - 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(), - } - } - return out, metadata, err } -func awsRestxml_deserializeOpErrorDescribeMultiRegionAccessPointOperation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteJobTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2313,6 +2622,15 @@ func awsRestxml_deserializeOpErrorDescribeMultiRegionAccessPointOperation(respon } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestxml_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestxml_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestxml_deserializeErrorTooManyRequestsException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2323,56 +2641,14 @@ func awsRestxml_deserializeOpErrorDescribeMultiRegionAccessPointOperation(respon } } -func awsRestxml_deserializeOpDocumentDescribeMultiRegionAccessPointOperationOutput(v **DescribeMultiRegionAccessPointOperationOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeMultiRegionAccessPointOperationOutput - if *v == nil { - sv = &DescribeMultiRegionAccessPointOperationOutput{} - } 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("AsyncOperation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentAsyncOperation(&sv.AsyncOperation, 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 -} - -type awsRestxml_deserializeOpGetAccessPoint struct { +type awsRestxml_deserializeOpDeleteMultiRegionAccessPoint struct { } -func (*awsRestxml_deserializeOpGetAccessPoint) ID() string { +func (*awsRestxml_deserializeOpDeleteMultiRegionAccessPoint) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetAccessPoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteMultiRegionAccessPoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2386,9 +2662,9 @@ func (m *awsRestxml_deserializeOpGetAccessPoint) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetAccessPoint(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteMultiRegionAccessPoint(response, &metadata) } - output := &GetAccessPointOutput{} + output := &DeleteMultiRegionAccessPointOutput{} out.Result = output var buff [1024]byte @@ -2409,7 +2685,7 @@ func (m *awsRestxml_deserializeOpGetAccessPoint) HandleDeserialize(ctx context.C } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetAccessPointOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentDeleteMultiRegionAccessPointOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2422,7 +2698,7 @@ func (m *awsRestxml_deserializeOpGetAccessPoint) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestxml_deserializeOpErrorGetAccessPoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteMultiRegionAccessPoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2462,13 +2738,13 @@ func awsRestxml_deserializeOpErrorGetAccessPoint(response *smithyhttp.Response, } } -func awsRestxml_deserializeOpDocumentGetAccessPointOutput(v **GetAccessPointOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentDeleteMultiRegionAccessPointOutput(v **DeleteMultiRegionAccessPointOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetAccessPointOutput + var sv *DeleteMultiRegionAccessPointOutput if *v == nil { - sv = &GetAccessPointOutput{} + sv = &DeleteMultiRegionAccessPointOutput{} } else { sv = *v } @@ -2484,95 +2760,7 @@ func awsRestxml_deserializeOpDocumentGetAccessPointOutput(v **GetAccessPointOutp originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("AccessPointArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AccessPointArn = ptr.String(xtv) - } - - case strings.EqualFold("Alias", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Alias = ptr.String(xtv) - } - - case strings.EqualFold("Bucket", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Bucket = ptr.String(xtv) - } - - case strings.EqualFold("BucketAccountId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.BucketAccountId = ptr.String(xtv) - } - - case strings.EqualFold("CreationDate", 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.CreationDate = ptr.Time(t) - } - - case strings.EqualFold("Endpoints", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentEndpoints(&sv.Endpoints, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("Name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } - - case strings.EqualFold("NetworkOrigin", t.Name.Local): + case strings.EqualFold("RequestTokenARN", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -2582,19 +2770,7 @@ func awsRestxml_deserializeOpDocumentGetAccessPointOutput(v **GetAccessPointOutp } { xtv := string(val) - sv.NetworkOrigin = types.NetworkOrigin(xtv) - } - - case strings.EqualFold("PublicAccessBlockConfiguration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(&sv.PublicAccessBlockConfiguration, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("VpcConfiguration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentVpcConfiguration(&sv.VpcConfiguration, nodeDecoder); err != nil { - return err + sv.RequestTokenARN = ptr.String(xtv) } default: @@ -2611,14 +2787,14 @@ func awsRestxml_deserializeOpDocumentGetAccessPointOutput(v **GetAccessPointOutp return nil } -type awsRestxml_deserializeOpGetAccessPointConfigurationForObjectLambda struct { +type awsRestxml_deserializeOpDeletePublicAccessBlock struct { } -func (*awsRestxml_deserializeOpGetAccessPointConfigurationForObjectLambda) ID() string { +func (*awsRestxml_deserializeOpDeletePublicAccessBlock) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetAccessPointConfigurationForObjectLambda) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeletePublicAccessBlock) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2632,43 +2808,21 @@ func (m *awsRestxml_deserializeOpGetAccessPointConfigurationForObjectLambda) Han } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetAccessPointConfigurationForObjectLambda(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeletePublicAccessBlock(response, &metadata) } - output := &GetAccessPointConfigurationForObjectLambdaOutput{} + output := &DeletePublicAccessBlockOutput{} 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 = awsRestxml_deserializeOpDocumentGetAccessPointConfigurationForObjectLambdaOutput(&output, decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } -func awsRestxml_deserializeOpErrorGetAccessPointConfigurationForObjectLambda(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeletePublicAccessBlock(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2708,33 +2862,2393 @@ func awsRestxml_deserializeOpErrorGetAccessPointConfigurationForObjectLambda(res } } -func awsRestxml_deserializeOpDocumentGetAccessPointConfigurationForObjectLambdaOutput(v **GetAccessPointConfigurationForObjectLambdaOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *GetAccessPointConfigurationForObjectLambdaOutput - if *v == nil { - sv = &GetAccessPointConfigurationForObjectLambdaOutput{} - } else { - sv = *v - } +type awsRestxml_deserializeOpDeleteStorageLensConfiguration struct { +} - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { +func (*awsRestxml_deserializeOpDeleteStorageLensConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpDeleteStorageLensConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorDeleteStorageLensConfiguration(response, &metadata) + } + output := &DeleteStorageLensConfigurationOutput{} + 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 awsRestxml_deserializeOpErrorDeleteStorageLensConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestxml_deserializeOpDeleteStorageLensConfigurationTagging struct { +} + +func (*awsRestxml_deserializeOpDeleteStorageLensConfigurationTagging) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpDeleteStorageLensConfigurationTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorDeleteStorageLensConfigurationTagging(response, &metadata) + } + output := &DeleteStorageLensConfigurationTaggingOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorDeleteStorageLensConfigurationTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestxml_deserializeOpDeleteStorageLensGroup struct { +} + +func (*awsRestxml_deserializeOpDeleteStorageLensGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpDeleteStorageLensGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorDeleteStorageLensGroup(response, &metadata) + } + output := &DeleteStorageLensGroupOutput{} + 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 awsRestxml_deserializeOpErrorDeleteStorageLensGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestxml_deserializeOpDescribeJob struct { +} + +func (*awsRestxml_deserializeOpDescribeJob) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpDescribeJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorDescribeJob(response, &metadata) + } + output := &DescribeJobOutput{} + 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 = awsRestxml_deserializeOpDocumentDescribeJobOutput(&output, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorDescribeJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + 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("BadRequestException", errorCode): + return awsRestxml_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestxml_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestxml_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestxml_deserializeErrorTooManyRequestsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentDescribeJobOutput(v **DescribeJobOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeJobOutput + if *v == nil { + sv = &DescribeJobOutput{} + } 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("Job", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentJobDescriptor(&sv.Job, 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 +} + +type awsRestxml_deserializeOpDescribeMultiRegionAccessPointOperation struct { +} + +func (*awsRestxml_deserializeOpDescribeMultiRegionAccessPointOperation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpDescribeMultiRegionAccessPointOperation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorDescribeMultiRegionAccessPointOperation(response, &metadata) + } + output := &DescribeMultiRegionAccessPointOperationOutput{} + 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 = awsRestxml_deserializeOpDocumentDescribeMultiRegionAccessPointOperationOutput(&output, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorDescribeMultiRegionAccessPointOperation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentDescribeMultiRegionAccessPointOperationOutput(v **DescribeMultiRegionAccessPointOperationOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeMultiRegionAccessPointOperationOutput + if *v == nil { + sv = &DescribeMultiRegionAccessPointOperationOutput{} + } 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("AsyncOperation", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentAsyncOperation(&sv.AsyncOperation, 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 +} + +type awsRestxml_deserializeOpDissociateAccessGrantsIdentityCenter struct { +} + +func (*awsRestxml_deserializeOpDissociateAccessGrantsIdentityCenter) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpDissociateAccessGrantsIdentityCenter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorDissociateAccessGrantsIdentityCenter(response, &metadata) + } + output := &DissociateAccessGrantsIdentityCenterOutput{} + 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 awsRestxml_deserializeOpErrorDissociateAccessGrantsIdentityCenter(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestxml_deserializeOpGetAccessGrant struct { +} + +func (*awsRestxml_deserializeOpGetAccessGrant) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetAccessGrant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorGetAccessGrant(response, &metadata) + } + output := &GetAccessGrantOutput{} + 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 = awsRestxml_deserializeOpDocumentGetAccessGrantOutput(&output, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetAccessGrant(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentGetAccessGrantOutput(v **GetAccessGrantOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetAccessGrantOutput + if *v == nil { + sv = &GetAccessGrantOutput{} + } 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("AccessGrantArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessGrantArn = ptr.String(xtv) + } + + case strings.EqualFold("AccessGrantId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessGrantId = ptr.String(xtv) + } + + case strings.EqualFold("AccessGrantsLocationConfiguration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentAccessGrantsLocationConfiguration(&sv.AccessGrantsLocationConfiguration, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("AccessGrantsLocationId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessGrantsLocationId = ptr.String(xtv) + } + + case strings.EqualFold("ApplicationArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ApplicationArn = ptr.String(xtv) + } + + case strings.EqualFold("CreatedAt", 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.CreatedAt = ptr.Time(t) + } + + case strings.EqualFold("Grantee", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentGrantee(&sv.Grantee, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("GrantScope", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.GrantScope = ptr.String(xtv) + } + + case strings.EqualFold("Permission", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Permission = types.Permission(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 +} + +type awsRestxml_deserializeOpGetAccessGrantsInstance struct { +} + +func (*awsRestxml_deserializeOpGetAccessGrantsInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetAccessGrantsInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorGetAccessGrantsInstance(response, &metadata) + } + output := &GetAccessGrantsInstanceOutput{} + 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 = awsRestxml_deserializeOpDocumentGetAccessGrantsInstanceOutput(&output, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetAccessGrantsInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentGetAccessGrantsInstanceOutput(v **GetAccessGrantsInstanceOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetAccessGrantsInstanceOutput + if *v == nil { + sv = &GetAccessGrantsInstanceOutput{} + } 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("AccessGrantsInstanceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessGrantsInstanceArn = ptr.String(xtv) + } + + case strings.EqualFold("AccessGrantsInstanceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessGrantsInstanceId = ptr.String(xtv) + } + + case strings.EqualFold("CreatedAt", 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.CreatedAt = ptr.Time(t) + } + + case strings.EqualFold("IdentityCenterArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IdentityCenterArn = 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 +} + +type awsRestxml_deserializeOpGetAccessGrantsInstanceForPrefix struct { +} + +func (*awsRestxml_deserializeOpGetAccessGrantsInstanceForPrefix) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetAccessGrantsInstanceForPrefix) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorGetAccessGrantsInstanceForPrefix(response, &metadata) + } + output := &GetAccessGrantsInstanceForPrefixOutput{} + 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 = awsRestxml_deserializeOpDocumentGetAccessGrantsInstanceForPrefixOutput(&output, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetAccessGrantsInstanceForPrefix(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentGetAccessGrantsInstanceForPrefixOutput(v **GetAccessGrantsInstanceForPrefixOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetAccessGrantsInstanceForPrefixOutput + if *v == nil { + sv = &GetAccessGrantsInstanceForPrefixOutput{} + } 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("AccessGrantsInstanceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessGrantsInstanceArn = ptr.String(xtv) + } + + case strings.EqualFold("AccessGrantsInstanceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessGrantsInstanceId = 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 +} + +type awsRestxml_deserializeOpGetAccessGrantsInstanceResourcePolicy struct { +} + +func (*awsRestxml_deserializeOpGetAccessGrantsInstanceResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetAccessGrantsInstanceResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorGetAccessGrantsInstanceResourcePolicy(response, &metadata) + } + output := &GetAccessGrantsInstanceResourcePolicyOutput{} + 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 = awsRestxml_deserializeOpDocumentGetAccessGrantsInstanceResourcePolicyOutput(&output, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetAccessGrantsInstanceResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentGetAccessGrantsInstanceResourcePolicyOutput(v **GetAccessGrantsInstanceResourcePolicyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetAccessGrantsInstanceResourcePolicyOutput + if *v == nil { + sv = &GetAccessGrantsInstanceResourcePolicyOutput{} + } 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("CreatedAt", 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.CreatedAt = ptr.Time(t) + } + + case strings.EqualFold("Organization", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Organization = ptr.String(xtv) + } + + case strings.EqualFold("Policy", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Policy = 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 +} + +type awsRestxml_deserializeOpGetAccessGrantsLocation struct { +} + +func (*awsRestxml_deserializeOpGetAccessGrantsLocation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetAccessGrantsLocation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorGetAccessGrantsLocation(response, &metadata) + } + output := &GetAccessGrantsLocationOutput{} + 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 = awsRestxml_deserializeOpDocumentGetAccessGrantsLocationOutput(&output, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetAccessGrantsLocation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentGetAccessGrantsLocationOutput(v **GetAccessGrantsLocationOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetAccessGrantsLocationOutput + if *v == nil { + sv = &GetAccessGrantsLocationOutput{} + } 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("AccessGrantsLocationArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessGrantsLocationArn = ptr.String(xtv) + } + + case strings.EqualFold("AccessGrantsLocationId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessGrantsLocationId = ptr.String(xtv) + } + + case strings.EqualFold("CreatedAt", 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.CreatedAt = ptr.Time(t) + } + + case strings.EqualFold("IAMRoleArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IAMRoleArn = ptr.String(xtv) + } + + case strings.EqualFold("LocationScope", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LocationScope = 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 +} + +type awsRestxml_deserializeOpGetAccessPoint struct { +} + +func (*awsRestxml_deserializeOpGetAccessPoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetAccessPoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorGetAccessPoint(response, &metadata) + } + output := &GetAccessPointOutput{} + 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 = awsRestxml_deserializeOpDocumentGetAccessPointOutput(&output, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetAccessPoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentGetAccessPointOutput(v **GetAccessPointOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetAccessPointOutput + if *v == nil { + sv = &GetAccessPointOutput{} + } 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("AccessPointArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessPointArn = ptr.String(xtv) + } + + case strings.EqualFold("Alias", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Alias = ptr.String(xtv) + } + + case strings.EqualFold("Bucket", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Bucket = ptr.String(xtv) + } + + case strings.EqualFold("BucketAccountId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.BucketAccountId = ptr.String(xtv) + } + + case strings.EqualFold("CreationDate", 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.CreationDate = ptr.Time(t) + } + + case strings.EqualFold("Endpoints", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentEndpoints(&sv.Endpoints, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("NetworkOrigin", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NetworkOrigin = types.NetworkOrigin(xtv) + } + + case strings.EqualFold("PublicAccessBlockConfiguration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(&sv.PublicAccessBlockConfiguration, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("VpcConfiguration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentVpcConfiguration(&sv.VpcConfiguration, 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 +} + +type awsRestxml_deserializeOpGetAccessPointConfigurationForObjectLambda struct { +} + +func (*awsRestxml_deserializeOpGetAccessPointConfigurationForObjectLambda) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetAccessPointConfigurationForObjectLambda) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorGetAccessPointConfigurationForObjectLambda(response, &metadata) + } + output := &GetAccessPointConfigurationForObjectLambdaOutput{} + 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 = awsRestxml_deserializeOpDocumentGetAccessPointConfigurationForObjectLambdaOutput(&output, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetAccessPointConfigurationForObjectLambda(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentGetAccessPointConfigurationForObjectLambdaOutput(v **GetAccessPointConfigurationForObjectLambdaOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetAccessPointConfigurationForObjectLambdaOutput + if *v == nil { + sv = &GetAccessPointConfigurationForObjectLambdaOutput{} + } 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("Configuration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentObjectLambdaConfiguration(&sv.Configuration, 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 +} + +type awsRestxml_deserializeOpGetAccessPointForObjectLambda struct { +} + +func (*awsRestxml_deserializeOpGetAccessPointForObjectLambda) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetAccessPointForObjectLambda) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorGetAccessPointForObjectLambda(response, &metadata) + } + output := &GetAccessPointForObjectLambdaOutput{} + 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 = awsRestxml_deserializeOpDocumentGetAccessPointForObjectLambdaOutput(&output, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetAccessPointForObjectLambda(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentGetAccessPointForObjectLambdaOutput(v **GetAccessPointForObjectLambdaOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetAccessPointForObjectLambdaOutput + if *v == nil { + sv = &GetAccessPointForObjectLambdaOutput{} + } 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("Alias", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentObjectLambdaAccessPointAlias(&sv.Alias, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("CreationDate", 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.CreationDate = ptr.Time(t) + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("PublicAccessBlockConfiguration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(&sv.PublicAccessBlockConfiguration, 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 +} + +type awsRestxml_deserializeOpGetAccessPointPolicy struct { +} + +func (*awsRestxml_deserializeOpGetAccessPointPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetAccessPointPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorGetAccessPointPolicy(response, &metadata) + } + output := &GetAccessPointPolicyOutput{} + 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 = awsRestxml_deserializeOpDocumentGetAccessPointPolicyOutput(&output, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetAccessPointPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentGetAccessPointPolicyOutput(v **GetAccessPointPolicyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetAccessPointPolicyOutput + if *v == nil { + sv = &GetAccessPointPolicyOutput{} + } 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("Policy", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Policy = 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 +} + +type awsRestxml_deserializeOpGetAccessPointPolicyForObjectLambda struct { +} + +func (*awsRestxml_deserializeOpGetAccessPointPolicyForObjectLambda) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetAccessPointPolicyForObjectLambda) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorGetAccessPointPolicyForObjectLambda(response, &metadata) + } + output := &GetAccessPointPolicyForObjectLambdaOutput{} + 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 = awsRestxml_deserializeOpDocumentGetAccessPointPolicyForObjectLambdaOutput(&output, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetAccessPointPolicyForObjectLambda(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentGetAccessPointPolicyForObjectLambdaOutput(v **GetAccessPointPolicyForObjectLambdaOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetAccessPointPolicyForObjectLambdaOutput + if *v == nil { + sv = &GetAccessPointPolicyForObjectLambdaOutput{} + } 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("Configuration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentObjectLambdaConfiguration(&sv.Configuration, nodeDecoder); err != nil { + case strings.EqualFold("Policy", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.Policy = ptr.String(xtv) + } default: // Do nothing and ignore the unexpected tag element @@ -2750,14 +5264,14 @@ func awsRestxml_deserializeOpDocumentGetAccessPointConfigurationForObjectLambdaO return nil } -type awsRestxml_deserializeOpGetAccessPointForObjectLambda struct { +type awsRestxml_deserializeOpGetAccessPointPolicyStatus struct { } -func (*awsRestxml_deserializeOpGetAccessPointForObjectLambda) ID() string { +func (*awsRestxml_deserializeOpGetAccessPointPolicyStatus) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetAccessPointForObjectLambda) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetAccessPointPolicyStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2771,9 +5285,9 @@ func (m *awsRestxml_deserializeOpGetAccessPointForObjectLambda) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetAccessPointForObjectLambda(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetAccessPointPolicyStatus(response, &metadata) } - output := &GetAccessPointForObjectLambdaOutput{} + output := &GetAccessPointPolicyStatusOutput{} out.Result = output var buff [1024]byte @@ -2794,7 +5308,7 @@ func (m *awsRestxml_deserializeOpGetAccessPointForObjectLambda) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetAccessPointForObjectLambdaOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetAccessPointPolicyStatusOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2807,7 +5321,7 @@ func (m *awsRestxml_deserializeOpGetAccessPointForObjectLambda) HandleDeserializ return out, metadata, err } -func awsRestxml_deserializeOpErrorGetAccessPointForObjectLambda(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetAccessPointPolicyStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2847,13 +5361,13 @@ func awsRestxml_deserializeOpErrorGetAccessPointForObjectLambda(response *smithy } } -func awsRestxml_deserializeOpDocumentGetAccessPointForObjectLambdaOutput(v **GetAccessPointForObjectLambdaOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetAccessPointPolicyStatusOutput(v **GetAccessPointPolicyStatusOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetAccessPointForObjectLambdaOutput + var sv *GetAccessPointPolicyStatusOutput if *v == nil { - sv = &GetAccessPointForObjectLambdaOutput{} + sv = &GetAccessPointPolicyStatusOutput{} } else { sv = *v } @@ -2869,45 +5383,148 @@ func awsRestxml_deserializeOpDocumentGetAccessPointForObjectLambdaOutput(v **Get originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Alias", t.Name.Local): + case strings.EqualFold("PolicyStatus", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentObjectLambdaAccessPointAlias(&sv.Alias, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentPolicyStatus(&sv.PolicyStatus, nodeDecoder); err != nil { return err } - case strings.EqualFold("CreationDate", 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) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreationDate = ptr.Time(t) - } - case strings.EqualFold("Name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } + } + decoder = originalDecoder + } + *v = sv + return nil +} - case strings.EqualFold("PublicAccessBlockConfiguration", t.Name.Local): +type awsRestxml_deserializeOpGetAccessPointPolicyStatusForObjectLambda struct { +} + +func (*awsRestxml_deserializeOpGetAccessPointPolicyStatusForObjectLambda) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetAccessPointPolicyStatusForObjectLambda) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorGetAccessPointPolicyStatusForObjectLambda(response, &metadata) + } + output := &GetAccessPointPolicyStatusForObjectLambdaOutput{} + 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 = awsRestxml_deserializeOpDocumentGetAccessPointPolicyStatusForObjectLambdaOutput(&output, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetAccessPointPolicyStatusForObjectLambda(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentGetAccessPointPolicyStatusForObjectLambdaOutput(v **GetAccessPointPolicyStatusForObjectLambdaOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetAccessPointPolicyStatusForObjectLambdaOutput + if *v == nil { + sv = &GetAccessPointPolicyStatusForObjectLambdaOutput{} + } 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("PolicyStatus", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(&sv.PublicAccessBlockConfiguration, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentPolicyStatus(&sv.PolicyStatus, nodeDecoder); err != nil { return err } @@ -2925,14 +5542,14 @@ func awsRestxml_deserializeOpDocumentGetAccessPointForObjectLambdaOutput(v **Get return nil } -type awsRestxml_deserializeOpGetAccessPointPolicy struct { +type awsRestxml_deserializeOpGetBucket struct { } -func (*awsRestxml_deserializeOpGetAccessPointPolicy) ID() string { +func (*awsRestxml_deserializeOpGetBucket) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetAccessPointPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetBucket) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2946,9 +5563,9 @@ func (m *awsRestxml_deserializeOpGetAccessPointPolicy) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetAccessPointPolicy(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetBucket(response, &metadata) } - output := &GetAccessPointPolicyOutput{} + output := &GetBucketOutput{} out.Result = output var buff [1024]byte @@ -2969,7 +5586,7 @@ func (m *awsRestxml_deserializeOpGetAccessPointPolicy) HandleDeserialize(ctx con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetAccessPointPolicyOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetBucketOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2982,7 +5599,7 @@ func (m *awsRestxml_deserializeOpGetAccessPointPolicy) HandleDeserialize(ctx con return out, metadata, err } -func awsRestxml_deserializeOpErrorGetAccessPointPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetBucket(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3022,13 +5639,13 @@ func awsRestxml_deserializeOpErrorGetAccessPointPolicy(response *smithyhttp.Resp } } -func awsRestxml_deserializeOpDocumentGetAccessPointPolicyOutput(v **GetAccessPointPolicyOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetBucketOutput(v **GetBucketOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetAccessPointPolicyOutput + var sv *GetBucketOutput if *v == nil { - sv = &GetAccessPointPolicyOutput{} + sv = &GetBucketOutput{} } else { sv = *v } @@ -3044,7 +5661,7 @@ func awsRestxml_deserializeOpDocumentGetAccessPointPolicyOutput(v **GetAccessPoi originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Policy", t.Name.Local): + case strings.EqualFold("Bucket", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -3054,7 +5671,40 @@ func awsRestxml_deserializeOpDocumentGetAccessPointPolicyOutput(v **GetAccessPoi } { xtv := string(val) - sv.Policy = ptr.String(xtv) + sv.Bucket = ptr.String(xtv) + } + + case strings.EqualFold("CreationDate", 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.CreationDate = ptr.Time(t) + } + + case strings.EqualFold("PublicAccessBlockEnabled", 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 PublicAccessBlockEnabled to be of type *bool, got %T instead", val) + } + sv.PublicAccessBlockEnabled = xtv } default: @@ -3071,14 +5721,14 @@ func awsRestxml_deserializeOpDocumentGetAccessPointPolicyOutput(v **GetAccessPoi return nil } -type awsRestxml_deserializeOpGetAccessPointPolicyForObjectLambda struct { +type awsRestxml_deserializeOpGetBucketLifecycleConfiguration struct { } -func (*awsRestxml_deserializeOpGetAccessPointPolicyForObjectLambda) ID() string { +func (*awsRestxml_deserializeOpGetBucketLifecycleConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetAccessPointPolicyForObjectLambda) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetBucketLifecycleConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3092,9 +5742,9 @@ func (m *awsRestxml_deserializeOpGetAccessPointPolicyForObjectLambda) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetAccessPointPolicyForObjectLambda(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetBucketLifecycleConfiguration(response, &metadata) } - output := &GetAccessPointPolicyForObjectLambdaOutput{} + output := &GetBucketLifecycleConfigurationOutput{} out.Result = output var buff [1024]byte @@ -3115,7 +5765,7 @@ func (m *awsRestxml_deserializeOpGetAccessPointPolicyForObjectLambda) HandleDese } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetAccessPointPolicyForObjectLambdaOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetBucketLifecycleConfigurationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3128,7 +5778,7 @@ func (m *awsRestxml_deserializeOpGetAccessPointPolicyForObjectLambda) HandleDese return out, metadata, err } -func awsRestxml_deserializeOpErrorGetAccessPointPolicyForObjectLambda(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetBucketLifecycleConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3168,13 +5818,13 @@ func awsRestxml_deserializeOpErrorGetAccessPointPolicyForObjectLambda(response * } } -func awsRestxml_deserializeOpDocumentGetAccessPointPolicyForObjectLambdaOutput(v **GetAccessPointPolicyForObjectLambdaOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetBucketLifecycleConfigurationOutput(v **GetBucketLifecycleConfigurationOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetAccessPointPolicyForObjectLambdaOutput + var sv *GetBucketLifecycleConfigurationOutput if *v == nil { - sv = &GetAccessPointPolicyForObjectLambdaOutput{} + sv = &GetBucketLifecycleConfigurationOutput{} } else { sv = *v } @@ -3190,18 +5840,11 @@ func awsRestxml_deserializeOpDocumentGetAccessPointPolicyForObjectLambdaOutput(v originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Policy", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("Rules", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentLifecycleRules(&sv.Rules, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.Policy = ptr.String(xtv) - } default: // Do nothing and ignore the unexpected tag element @@ -3217,14 +5860,14 @@ func awsRestxml_deserializeOpDocumentGetAccessPointPolicyForObjectLambdaOutput(v return nil } -type awsRestxml_deserializeOpGetAccessPointPolicyStatus struct { +type awsRestxml_deserializeOpGetBucketPolicy struct { } -func (*awsRestxml_deserializeOpGetAccessPointPolicyStatus) ID() string { +func (*awsRestxml_deserializeOpGetBucketPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetAccessPointPolicyStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetBucketPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3238,9 +5881,9 @@ func (m *awsRestxml_deserializeOpGetAccessPointPolicyStatus) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetAccessPointPolicyStatus(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetBucketPolicy(response, &metadata) } - output := &GetAccessPointPolicyStatusOutput{} + output := &GetBucketPolicyOutput{} out.Result = output var buff [1024]byte @@ -3261,7 +5904,7 @@ func (m *awsRestxml_deserializeOpGetAccessPointPolicyStatus) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetAccessPointPolicyStatusOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetBucketPolicyOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3274,7 +5917,7 @@ func (m *awsRestxml_deserializeOpGetAccessPointPolicyStatus) HandleDeserialize(c return out, metadata, err } -func awsRestxml_deserializeOpErrorGetAccessPointPolicyStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetBucketPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3314,13 +5957,13 @@ func awsRestxml_deserializeOpErrorGetAccessPointPolicyStatus(response *smithyhtt } } -func awsRestxml_deserializeOpDocumentGetAccessPointPolicyStatusOutput(v **GetAccessPointPolicyStatusOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetBucketPolicyOutput(v **GetBucketPolicyOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetAccessPointPolicyStatusOutput + var sv *GetBucketPolicyOutput if *v == nil { - sv = &GetAccessPointPolicyStatusOutput{} + sv = &GetBucketPolicyOutput{} } else { sv = *v } @@ -3336,11 +5979,18 @@ func awsRestxml_deserializeOpDocumentGetAccessPointPolicyStatusOutput(v **GetAcc originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("PolicyStatus", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentPolicyStatus(&sv.PolicyStatus, nodeDecoder); err != nil { + case strings.EqualFold("Policy", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.Policy = ptr.String(xtv) + } default: // Do nothing and ignore the unexpected tag element @@ -3356,14 +6006,14 @@ func awsRestxml_deserializeOpDocumentGetAccessPointPolicyStatusOutput(v **GetAcc return nil } -type awsRestxml_deserializeOpGetAccessPointPolicyStatusForObjectLambda struct { +type awsRestxml_deserializeOpGetBucketReplication struct { } -func (*awsRestxml_deserializeOpGetAccessPointPolicyStatusForObjectLambda) ID() string { +func (*awsRestxml_deserializeOpGetBucketReplication) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetAccessPointPolicyStatusForObjectLambda) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetBucketReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3377,9 +6027,9 @@ func (m *awsRestxml_deserializeOpGetAccessPointPolicyStatusForObjectLambda) Hand } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetAccessPointPolicyStatusForObjectLambda(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetBucketReplication(response, &metadata) } - output := &GetAccessPointPolicyStatusForObjectLambdaOutput{} + output := &GetBucketReplicationOutput{} out.Result = output var buff [1024]byte @@ -3400,7 +6050,7 @@ func (m *awsRestxml_deserializeOpGetAccessPointPolicyStatusForObjectLambda) Hand } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetAccessPointPolicyStatusForObjectLambdaOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetBucketReplicationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3413,7 +6063,7 @@ func (m *awsRestxml_deserializeOpGetAccessPointPolicyStatusForObjectLambda) Hand return out, metadata, err } -func awsRestxml_deserializeOpErrorGetAccessPointPolicyStatusForObjectLambda(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetBucketReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3453,13 +6103,13 @@ func awsRestxml_deserializeOpErrorGetAccessPointPolicyStatusForObjectLambda(resp } } -func awsRestxml_deserializeOpDocumentGetAccessPointPolicyStatusForObjectLambdaOutput(v **GetAccessPointPolicyStatusForObjectLambdaOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetBucketReplicationOutput(v **GetBucketReplicationOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetAccessPointPolicyStatusForObjectLambdaOutput + var sv *GetBucketReplicationOutput if *v == nil { - sv = &GetAccessPointPolicyStatusForObjectLambdaOutput{} + sv = &GetBucketReplicationOutput{} } else { sv = *v } @@ -3475,9 +6125,9 @@ func awsRestxml_deserializeOpDocumentGetAccessPointPolicyStatusForObjectLambdaOu originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("PolicyStatus", t.Name.Local): + case strings.EqualFold("ReplicationConfiguration", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentPolicyStatus(&sv.PolicyStatus, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentReplicationConfiguration(&sv.ReplicationConfiguration, nodeDecoder); err != nil { return err } @@ -3495,14 +6145,14 @@ func awsRestxml_deserializeOpDocumentGetAccessPointPolicyStatusForObjectLambdaOu return nil } -type awsRestxml_deserializeOpGetBucket struct { +type awsRestxml_deserializeOpGetBucketTagging struct { } -func (*awsRestxml_deserializeOpGetBucket) ID() string { +func (*awsRestxml_deserializeOpGetBucketTagging) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetBucket) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetBucketTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3516,9 +6166,9 @@ func (m *awsRestxml_deserializeOpGetBucket) HandleDeserialize(ctx context.Contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetBucket(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetBucketTagging(response, &metadata) } - output := &GetBucketOutput{} + output := &GetBucketTaggingOutput{} out.Result = output var buff [1024]byte @@ -3539,7 +6189,7 @@ func (m *awsRestxml_deserializeOpGetBucket) HandleDeserialize(ctx context.Contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetBucketOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetBucketTaggingOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3552,7 +6202,7 @@ func (m *awsRestxml_deserializeOpGetBucket) HandleDeserialize(ctx context.Contex return out, metadata, err } -func awsRestxml_deserializeOpErrorGetBucket(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetBucketTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3592,13 +6242,13 @@ func awsRestxml_deserializeOpErrorGetBucket(response *smithyhttp.Response, metad } } -func awsRestxml_deserializeOpDocumentGetBucketOutput(v **GetBucketOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetBucketTaggingOutput(v **GetBucketTaggingOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetBucketOutput + var sv *GetBucketTaggingOutput if *v == nil { - sv = &GetBucketOutput{} + sv = &GetBucketTaggingOutput{} } else { sv = *v } @@ -3614,51 +6264,11 @@ func awsRestxml_deserializeOpDocumentGetBucketOutput(v **GetBucketOutput, decode originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Bucket", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Bucket = ptr.String(xtv) - } - - case strings.EqualFold("CreationDate", 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.CreationDate = ptr.Time(t) - } - - case strings.EqualFold("PublicAccessBlockEnabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("TagSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentS3TagSet(&sv.TagSet, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected PublicAccessBlockEnabled to be of type *bool, got %T instead", val) - } - sv.PublicAccessBlockEnabled = xtv - } default: // Do nothing and ignore the unexpected tag element @@ -3674,14 +6284,14 @@ func awsRestxml_deserializeOpDocumentGetBucketOutput(v **GetBucketOutput, decode return nil } -type awsRestxml_deserializeOpGetBucketLifecycleConfiguration struct { +type awsRestxml_deserializeOpGetBucketVersioning struct { } -func (*awsRestxml_deserializeOpGetBucketLifecycleConfiguration) ID() string { +func (*awsRestxml_deserializeOpGetBucketVersioning) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetBucketLifecycleConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetBucketVersioning) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3695,9 +6305,9 @@ func (m *awsRestxml_deserializeOpGetBucketLifecycleConfiguration) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetBucketLifecycleConfiguration(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetBucketVersioning(response, &metadata) } - output := &GetBucketLifecycleConfigurationOutput{} + output := &GetBucketVersioningOutput{} out.Result = output var buff [1024]byte @@ -3718,7 +6328,7 @@ func (m *awsRestxml_deserializeOpGetBucketLifecycleConfiguration) HandleDeserial } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetBucketLifecycleConfigurationOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetBucketVersioningOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3731,7 +6341,7 @@ func (m *awsRestxml_deserializeOpGetBucketLifecycleConfiguration) HandleDeserial return out, metadata, err } -func awsRestxml_deserializeOpErrorGetBucketLifecycleConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetBucketVersioning(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3771,13 +6381,13 @@ func awsRestxml_deserializeOpErrorGetBucketLifecycleConfiguration(response *smit } } -func awsRestxml_deserializeOpDocumentGetBucketLifecycleConfigurationOutput(v **GetBucketLifecycleConfigurationOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetBucketVersioningOutput(v **GetBucketVersioningOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetBucketLifecycleConfigurationOutput + var sv *GetBucketVersioningOutput if *v == nil { - sv = &GetBucketLifecycleConfigurationOutput{} + sv = &GetBucketVersioningOutput{} } else { sv = *v } @@ -3793,11 +6403,31 @@ func awsRestxml_deserializeOpDocumentGetBucketLifecycleConfigurationOutput(v **G originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Rules", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentLifecycleRules(&sv.Rules, nodeDecoder); err != nil { + case strings.EqualFold("MfaDelete", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MFADelete = types.MFADeleteStatus(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.BucketVersioningStatus(xtv) + } default: // Do nothing and ignore the unexpected tag element @@ -3813,14 +6443,14 @@ func awsRestxml_deserializeOpDocumentGetBucketLifecycleConfigurationOutput(v **G return nil } -type awsRestxml_deserializeOpGetBucketPolicy struct { +type awsRestxml_deserializeOpGetDataAccess struct { } -func (*awsRestxml_deserializeOpGetBucketPolicy) ID() string { +func (*awsRestxml_deserializeOpGetDataAccess) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetBucketPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetDataAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3834,9 +6464,9 @@ func (m *awsRestxml_deserializeOpGetBucketPolicy) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetBucketPolicy(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetDataAccess(response, &metadata) } - output := &GetBucketPolicyOutput{} + output := &GetDataAccessOutput{} out.Result = output var buff [1024]byte @@ -3857,7 +6487,7 @@ func (m *awsRestxml_deserializeOpGetBucketPolicy) HandleDeserialize(ctx context. } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetBucketPolicyOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetDataAccessOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3870,7 +6500,7 @@ func (m *awsRestxml_deserializeOpGetBucketPolicy) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestxml_deserializeOpErrorGetBucketPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetDataAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3910,13 +6540,13 @@ func awsRestxml_deserializeOpErrorGetBucketPolicy(response *smithyhttp.Response, } } -func awsRestxml_deserializeOpDocumentGetBucketPolicyOutput(v **GetBucketPolicyOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetDataAccessOutput(v **GetDataAccessOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetBucketPolicyOutput + var sv *GetDataAccessOutput if *v == nil { - sv = &GetBucketPolicyOutput{} + sv = &GetDataAccessOutput{} } else { sv = *v } @@ -3932,7 +6562,13 @@ func awsRestxml_deserializeOpDocumentGetBucketPolicyOutput(v **GetBucketPolicyOu originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Policy", t.Name.Local): + case strings.EqualFold("Credentials", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("MatchedGrantTarget", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -3942,7 +6578,7 @@ func awsRestxml_deserializeOpDocumentGetBucketPolicyOutput(v **GetBucketPolicyOu } { xtv := string(val) - sv.Policy = ptr.String(xtv) + sv.MatchedGrantTarget = ptr.String(xtv) } default: @@ -3959,14 +6595,14 @@ func awsRestxml_deserializeOpDocumentGetBucketPolicyOutput(v **GetBucketPolicyOu return nil } -type awsRestxml_deserializeOpGetBucketReplication struct { +type awsRestxml_deserializeOpGetJobTagging struct { } -func (*awsRestxml_deserializeOpGetBucketReplication) ID() string { +func (*awsRestxml_deserializeOpGetJobTagging) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetBucketReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetJobTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3980,9 +6616,9 @@ func (m *awsRestxml_deserializeOpGetBucketReplication) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetBucketReplication(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetJobTagging(response, &metadata) } - output := &GetBucketReplicationOutput{} + output := &GetJobTaggingOutput{} out.Result = output var buff [1024]byte @@ -4003,7 +6639,7 @@ func (m *awsRestxml_deserializeOpGetBucketReplication) HandleDeserialize(ctx con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetBucketReplicationOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetJobTaggingOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4016,7 +6652,7 @@ func (m *awsRestxml_deserializeOpGetBucketReplication) HandleDeserialize(ctx con return out, metadata, err } -func awsRestxml_deserializeOpErrorGetBucketReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetJobTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4046,6 +6682,15 @@ func awsRestxml_deserializeOpErrorGetBucketReplication(response *smithyhttp.Resp } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestxml_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestxml_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestxml_deserializeErrorTooManyRequestsException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4056,13 +6701,13 @@ func awsRestxml_deserializeOpErrorGetBucketReplication(response *smithyhttp.Resp } } -func awsRestxml_deserializeOpDocumentGetBucketReplicationOutput(v **GetBucketReplicationOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetJobTaggingOutput(v **GetJobTaggingOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetBucketReplicationOutput + var sv *GetJobTaggingOutput if *v == nil { - sv = &GetBucketReplicationOutput{} + sv = &GetJobTaggingOutput{} } else { sv = *v } @@ -4078,9 +6723,9 @@ func awsRestxml_deserializeOpDocumentGetBucketReplicationOutput(v **GetBucketRep originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ReplicationConfiguration", t.Name.Local): + case strings.EqualFold("Tags", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentReplicationConfiguration(&sv.ReplicationConfiguration, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentS3TagSet(&sv.Tags, nodeDecoder); err != nil { return err } @@ -4098,14 +6743,14 @@ func awsRestxml_deserializeOpDocumentGetBucketReplicationOutput(v **GetBucketRep return nil } -type awsRestxml_deserializeOpGetBucketTagging struct { +type awsRestxml_deserializeOpGetMultiRegionAccessPoint struct { } -func (*awsRestxml_deserializeOpGetBucketTagging) ID() string { +func (*awsRestxml_deserializeOpGetMultiRegionAccessPoint) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetBucketTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetMultiRegionAccessPoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4119,9 +6764,9 @@ func (m *awsRestxml_deserializeOpGetBucketTagging) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetBucketTagging(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetMultiRegionAccessPoint(response, &metadata) } - output := &GetBucketTaggingOutput{} + output := &GetMultiRegionAccessPointOutput{} out.Result = output var buff [1024]byte @@ -4142,7 +6787,7 @@ func (m *awsRestxml_deserializeOpGetBucketTagging) HandleDeserialize(ctx context } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetBucketTaggingOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4155,7 +6800,7 @@ func (m *awsRestxml_deserializeOpGetBucketTagging) HandleDeserialize(ctx context return out, metadata, err } -func awsRestxml_deserializeOpErrorGetBucketTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetMultiRegionAccessPoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4195,13 +6840,13 @@ func awsRestxml_deserializeOpErrorGetBucketTagging(response *smithyhttp.Response } } -func awsRestxml_deserializeOpDocumentGetBucketTaggingOutput(v **GetBucketTaggingOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointOutput(v **GetMultiRegionAccessPointOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetBucketTaggingOutput + var sv *GetMultiRegionAccessPointOutput if *v == nil { - sv = &GetBucketTaggingOutput{} + sv = &GetMultiRegionAccessPointOutput{} } else { sv = *v } @@ -4217,9 +6862,9 @@ func awsRestxml_deserializeOpDocumentGetBucketTaggingOutput(v **GetBucketTagging originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("TagSet", t.Name.Local): + case strings.EqualFold("AccessPoint", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentS3TagSet(&sv.TagSet, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentMultiRegionAccessPointReport(&sv.AccessPoint, nodeDecoder); err != nil { return err } @@ -4237,14 +6882,14 @@ func awsRestxml_deserializeOpDocumentGetBucketTaggingOutput(v **GetBucketTagging return nil } -type awsRestxml_deserializeOpGetBucketVersioning struct { +type awsRestxml_deserializeOpGetMultiRegionAccessPointPolicy struct { } -func (*awsRestxml_deserializeOpGetBucketVersioning) ID() string { +func (*awsRestxml_deserializeOpGetMultiRegionAccessPointPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetBucketVersioning) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4258,9 +6903,9 @@ func (m *awsRestxml_deserializeOpGetBucketVersioning) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetBucketVersioning(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetMultiRegionAccessPointPolicy(response, &metadata) } - output := &GetBucketVersioningOutput{} + output := &GetMultiRegionAccessPointPolicyOutput{} out.Result = output var buff [1024]byte @@ -4281,7 +6926,7 @@ func (m *awsRestxml_deserializeOpGetBucketVersioning) HandleDeserialize(ctx cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetBucketVersioningOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointPolicyOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4294,7 +6939,7 @@ func (m *awsRestxml_deserializeOpGetBucketVersioning) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestxml_deserializeOpErrorGetBucketVersioning(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetMultiRegionAccessPointPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4334,13 +6979,13 @@ func awsRestxml_deserializeOpErrorGetBucketVersioning(response *smithyhttp.Respo } } -func awsRestxml_deserializeOpDocumentGetBucketVersioningOutput(v **GetBucketVersioningOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointPolicyOutput(v **GetMultiRegionAccessPointPolicyOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetBucketVersioningOutput + var sv *GetMultiRegionAccessPointPolicyOutput if *v == nil { - sv = &GetBucketVersioningOutput{} + sv = &GetMultiRegionAccessPointPolicyOutput{} } else { sv = *v } @@ -4356,31 +7001,11 @@ func awsRestxml_deserializeOpDocumentGetBucketVersioningOutput(v **GetBucketVers originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("MfaDelete", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MFADelete = types.MFADeleteStatus(xtv) - } - - case strings.EqualFold("Status", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("Policy", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentMultiRegionAccessPointPolicyDocument(&sv.Policy, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.BucketVersioningStatus(xtv) - } default: // Do nothing and ignore the unexpected tag element @@ -4396,14 +7021,14 @@ func awsRestxml_deserializeOpDocumentGetBucketVersioningOutput(v **GetBucketVers return nil } -type awsRestxml_deserializeOpGetJobTagging struct { +type awsRestxml_deserializeOpGetMultiRegionAccessPointPolicyStatus struct { } -func (*awsRestxml_deserializeOpGetJobTagging) ID() string { +func (*awsRestxml_deserializeOpGetMultiRegionAccessPointPolicyStatus) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetJobTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointPolicyStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4417,9 +7042,9 @@ func (m *awsRestxml_deserializeOpGetJobTagging) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetJobTagging(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetMultiRegionAccessPointPolicyStatus(response, &metadata) } - output := &GetJobTaggingOutput{} + output := &GetMultiRegionAccessPointPolicyStatusOutput{} out.Result = output var buff [1024]byte @@ -4440,7 +7065,7 @@ func (m *awsRestxml_deserializeOpGetJobTagging) HandleDeserialize(ctx context.Co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetJobTaggingOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointPolicyStatusOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4453,7 +7078,7 @@ func (m *awsRestxml_deserializeOpGetJobTagging) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestxml_deserializeOpErrorGetJobTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetMultiRegionAccessPointPolicyStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4483,15 +7108,6 @@ func awsRestxml_deserializeOpErrorGetJobTagging(response *smithyhttp.Response, m } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("InternalServiceException", errorCode): - return awsRestxml_deserializeErrorInternalServiceException(response, errorBody) - - case strings.EqualFold("NotFoundException", errorCode): - return awsRestxml_deserializeErrorNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsRestxml_deserializeErrorTooManyRequestsException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4502,13 +7118,13 @@ func awsRestxml_deserializeOpErrorGetJobTagging(response *smithyhttp.Response, m } } -func awsRestxml_deserializeOpDocumentGetJobTaggingOutput(v **GetJobTaggingOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointPolicyStatusOutput(v **GetMultiRegionAccessPointPolicyStatusOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetJobTaggingOutput + var sv *GetMultiRegionAccessPointPolicyStatusOutput if *v == nil { - sv = &GetJobTaggingOutput{} + sv = &GetMultiRegionAccessPointPolicyStatusOutput{} } else { sv = *v } @@ -4524,9 +7140,9 @@ func awsRestxml_deserializeOpDocumentGetJobTaggingOutput(v **GetJobTaggingOutput originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Tags", t.Name.Local): + case strings.EqualFold("Established", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentS3TagSet(&sv.Tags, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentPolicyStatus(&sv.Established, nodeDecoder); err != nil { return err } @@ -4544,14 +7160,14 @@ func awsRestxml_deserializeOpDocumentGetJobTaggingOutput(v **GetJobTaggingOutput return nil } -type awsRestxml_deserializeOpGetMultiRegionAccessPoint struct { +type awsRestxml_deserializeOpGetMultiRegionAccessPointRoutes struct { } -func (*awsRestxml_deserializeOpGetMultiRegionAccessPoint) ID() string { +func (*awsRestxml_deserializeOpGetMultiRegionAccessPointRoutes) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetMultiRegionAccessPoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointRoutes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4565,9 +7181,9 @@ func (m *awsRestxml_deserializeOpGetMultiRegionAccessPoint) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetMultiRegionAccessPoint(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetMultiRegionAccessPointRoutes(response, &metadata) } - output := &GetMultiRegionAccessPointOutput{} + output := &GetMultiRegionAccessPointRoutesOutput{} out.Result = output var buff [1024]byte @@ -4588,7 +7204,7 @@ func (m *awsRestxml_deserializeOpGetMultiRegionAccessPoint) HandleDeserialize(ct } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointRoutesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4601,7 +7217,7 @@ func (m *awsRestxml_deserializeOpGetMultiRegionAccessPoint) HandleDeserialize(ct return out, metadata, err } -func awsRestxml_deserializeOpErrorGetMultiRegionAccessPoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetMultiRegionAccessPointRoutes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4641,13 +7257,13 @@ func awsRestxml_deserializeOpErrorGetMultiRegionAccessPoint(response *smithyhttp } } -func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointOutput(v **GetMultiRegionAccessPointOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointRoutesOutput(v **GetMultiRegionAccessPointRoutesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetMultiRegionAccessPointOutput + var sv *GetMultiRegionAccessPointRoutesOutput if *v == nil { - sv = &GetMultiRegionAccessPointOutput{} + sv = &GetMultiRegionAccessPointRoutesOutput{} } else { sv = *v } @@ -4663,9 +7279,22 @@ func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointOutput(v **GetMult originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("AccessPoint", t.Name.Local): + case strings.EqualFold("Mrap", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Mrap = ptr.String(xtv) + } + + case strings.EqualFold("Routes", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentMultiRegionAccessPointReport(&sv.AccessPoint, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentRouteList(&sv.Routes, nodeDecoder); err != nil { return err } @@ -4683,14 +7312,14 @@ func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointOutput(v **GetMult return nil } -type awsRestxml_deserializeOpGetMultiRegionAccessPointPolicy struct { +type awsRestxml_deserializeOpGetPublicAccessBlock struct { } -func (*awsRestxml_deserializeOpGetMultiRegionAccessPointPolicy) ID() string { +func (*awsRestxml_deserializeOpGetPublicAccessBlock) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetPublicAccessBlock) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4704,9 +7333,9 @@ func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointPolicy) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetMultiRegionAccessPointPolicy(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetPublicAccessBlock(response, &metadata) } - output := &GetMultiRegionAccessPointPolicyOutput{} + output := &GetPublicAccessBlockOutput{} out.Result = output var buff [1024]byte @@ -4727,7 +7356,7 @@ func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointPolicy) HandleDeserial } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointPolicyOutput(&output, decoder) + err = awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(&output.PublicAccessBlockConfiguration, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4740,7 +7369,7 @@ func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointPolicy) HandleDeserial return out, metadata, err } -func awsRestxml_deserializeOpErrorGetMultiRegionAccessPointPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetPublicAccessBlock(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4770,6 +7399,9 @@ func awsRestxml_deserializeOpErrorGetMultiRegionAccessPointPolicy(response *smit } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("NoSuchPublicAccessBlockConfiguration", errorCode): + return awsRestxml_deserializeErrorNoSuchPublicAccessBlockConfiguration(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4780,13 +7412,13 @@ func awsRestxml_deserializeOpErrorGetMultiRegionAccessPointPolicy(response *smit } } -func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointPolicyOutput(v **GetMultiRegionAccessPointPolicyOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetPublicAccessBlockOutput(v **GetPublicAccessBlockOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetMultiRegionAccessPointPolicyOutput + var sv *GetPublicAccessBlockOutput if *v == nil { - sv = &GetMultiRegionAccessPointPolicyOutput{} + sv = &GetPublicAccessBlockOutput{} } else { sv = *v } @@ -4802,9 +7434,9 @@ func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointPolicyOutput(v **G originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Policy", t.Name.Local): + case strings.EqualFold("PublicAccessBlockConfiguration", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentMultiRegionAccessPointPolicyDocument(&sv.Policy, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(&sv.PublicAccessBlockConfiguration, nodeDecoder); err != nil { return err } @@ -4822,14 +7454,14 @@ func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointPolicyOutput(v **G return nil } -type awsRestxml_deserializeOpGetMultiRegionAccessPointPolicyStatus struct { +type awsRestxml_deserializeOpGetStorageLensConfiguration struct { } -func (*awsRestxml_deserializeOpGetMultiRegionAccessPointPolicyStatus) ID() string { +func (*awsRestxml_deserializeOpGetStorageLensConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointPolicyStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetStorageLensConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4843,9 +7475,9 @@ func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointPolicyStatus) HandleDe } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetMultiRegionAccessPointPolicyStatus(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetStorageLensConfiguration(response, &metadata) } - output := &GetMultiRegionAccessPointPolicyStatusOutput{} + output := &GetStorageLensConfigurationOutput{} out.Result = output var buff [1024]byte @@ -4866,7 +7498,7 @@ func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointPolicyStatus) HandleDe } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointPolicyStatusOutput(&output, decoder) + err = awsRestxml_deserializeDocumentStorageLensConfiguration(&output.StorageLensConfiguration, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4879,7 +7511,7 @@ func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointPolicyStatus) HandleDe return out, metadata, err } -func awsRestxml_deserializeOpErrorGetMultiRegionAccessPointPolicyStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetStorageLensConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4919,13 +7551,13 @@ func awsRestxml_deserializeOpErrorGetMultiRegionAccessPointPolicyStatus(response } } -func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointPolicyStatusOutput(v **GetMultiRegionAccessPointPolicyStatusOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetStorageLensConfigurationOutput(v **GetStorageLensConfigurationOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetMultiRegionAccessPointPolicyStatusOutput + var sv *GetStorageLensConfigurationOutput if *v == nil { - sv = &GetMultiRegionAccessPointPolicyStatusOutput{} + sv = &GetStorageLensConfigurationOutput{} } else { sv = *v } @@ -4941,9 +7573,9 @@ func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointPolicyStatusOutput originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Established", t.Name.Local): + case strings.EqualFold("StorageLensConfiguration", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentPolicyStatus(&sv.Established, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentStorageLensConfiguration(&sv.StorageLensConfiguration, nodeDecoder); err != nil { return err } @@ -4961,14 +7593,14 @@ func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointPolicyStatusOutput return nil } -type awsRestxml_deserializeOpGetMultiRegionAccessPointRoutes struct { +type awsRestxml_deserializeOpGetStorageLensConfigurationTagging struct { } -func (*awsRestxml_deserializeOpGetMultiRegionAccessPointRoutes) ID() string { +func (*awsRestxml_deserializeOpGetStorageLensConfigurationTagging) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointRoutes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetStorageLensConfigurationTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4982,9 +7614,9 @@ func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointRoutes) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetMultiRegionAccessPointRoutes(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetStorageLensConfigurationTagging(response, &metadata) } - output := &GetMultiRegionAccessPointRoutesOutput{} + output := &GetStorageLensConfigurationTaggingOutput{} out.Result = output var buff [1024]byte @@ -5005,7 +7637,7 @@ func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointRoutes) HandleDeserial } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointRoutesOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetStorageLensConfigurationTaggingOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5018,7 +7650,7 @@ func (m *awsRestxml_deserializeOpGetMultiRegionAccessPointRoutes) HandleDeserial return out, metadata, err } -func awsRestxml_deserializeOpErrorGetMultiRegionAccessPointRoutes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetStorageLensConfigurationTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5058,13 +7690,13 @@ func awsRestxml_deserializeOpErrorGetMultiRegionAccessPointRoutes(response *smit } } -func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointRoutesOutput(v **GetMultiRegionAccessPointRoutesOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetStorageLensConfigurationTaggingOutput(v **GetStorageLensConfigurationTaggingOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetMultiRegionAccessPointRoutesOutput + var sv *GetStorageLensConfigurationTaggingOutput if *v == nil { - sv = &GetMultiRegionAccessPointRoutesOutput{} + sv = &GetStorageLensConfigurationTaggingOutput{} } else { sv = *v } @@ -5080,22 +7712,9 @@ func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointRoutesOutput(v **G originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Mrap", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Mrap = ptr.String(xtv) - } - - case strings.EqualFold("Routes", t.Name.Local): + case strings.EqualFold("Tags", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentRouteList(&sv.Routes, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentStorageLensTags(&sv.Tags, nodeDecoder); err != nil { return err } @@ -5113,14 +7732,14 @@ func awsRestxml_deserializeOpDocumentGetMultiRegionAccessPointRoutesOutput(v **G return nil } -type awsRestxml_deserializeOpGetPublicAccessBlock struct { +type awsRestxml_deserializeOpGetStorageLensGroup struct { } -func (*awsRestxml_deserializeOpGetPublicAccessBlock) ID() string { +func (*awsRestxml_deserializeOpGetStorageLensGroup) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetPublicAccessBlock) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetStorageLensGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5134,9 +7753,9 @@ func (m *awsRestxml_deserializeOpGetPublicAccessBlock) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetPublicAccessBlock(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetStorageLensGroup(response, &metadata) } - output := &GetPublicAccessBlockOutput{} + output := &GetStorageLensGroupOutput{} out.Result = output var buff [1024]byte @@ -5157,7 +7776,7 @@ func (m *awsRestxml_deserializeOpGetPublicAccessBlock) HandleDeserialize(ctx con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(&output.PublicAccessBlockConfiguration, decoder) + err = awsRestxml_deserializeDocumentStorageLensGroup(&output.StorageLensGroup, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5170,7 +7789,7 @@ func (m *awsRestxml_deserializeOpGetPublicAccessBlock) HandleDeserialize(ctx con return out, metadata, err } -func awsRestxml_deserializeOpErrorGetPublicAccessBlock(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetStorageLensGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5200,9 +7819,6 @@ func awsRestxml_deserializeOpErrorGetPublicAccessBlock(response *smithyhttp.Resp } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("NoSuchPublicAccessBlockConfiguration", errorCode): - return awsRestxml_deserializeErrorNoSuchPublicAccessBlockConfiguration(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5213,13 +7829,13 @@ func awsRestxml_deserializeOpErrorGetPublicAccessBlock(response *smithyhttp.Resp } } -func awsRestxml_deserializeOpDocumentGetPublicAccessBlockOutput(v **GetPublicAccessBlockOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetStorageLensGroupOutput(v **GetStorageLensGroupOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetPublicAccessBlockOutput + var sv *GetStorageLensGroupOutput if *v == nil { - sv = &GetPublicAccessBlockOutput{} + sv = &GetStorageLensGroupOutput{} } else { sv = *v } @@ -5235,9 +7851,9 @@ func awsRestxml_deserializeOpDocumentGetPublicAccessBlockOutput(v **GetPublicAcc originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("PublicAccessBlockConfiguration", t.Name.Local): + case strings.EqualFold("StorageLensGroup", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(&sv.PublicAccessBlockConfiguration, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentStorageLensGroup(&sv.StorageLensGroup, nodeDecoder); err != nil { return err } @@ -5255,14 +7871,14 @@ func awsRestxml_deserializeOpDocumentGetPublicAccessBlockOutput(v **GetPublicAcc return nil } -type awsRestxml_deserializeOpGetStorageLensConfiguration struct { +type awsRestxml_deserializeOpListAccessGrants struct { } -func (*awsRestxml_deserializeOpGetStorageLensConfiguration) ID() string { +func (*awsRestxml_deserializeOpListAccessGrants) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetStorageLensConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListAccessGrants) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5276,9 +7892,9 @@ func (m *awsRestxml_deserializeOpGetStorageLensConfiguration) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetStorageLensConfiguration(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListAccessGrants(response, &metadata) } - output := &GetStorageLensConfigurationOutput{} + output := &ListAccessGrantsOutput{} out.Result = output var buff [1024]byte @@ -5299,7 +7915,7 @@ func (m *awsRestxml_deserializeOpGetStorageLensConfiguration) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentStorageLensConfiguration(&output.StorageLensConfiguration, decoder) + err = awsRestxml_deserializeOpDocumentListAccessGrantsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5312,7 +7928,7 @@ func (m *awsRestxml_deserializeOpGetStorageLensConfiguration) HandleDeserialize( return out, metadata, err } -func awsRestxml_deserializeOpErrorGetStorageLensConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListAccessGrants(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5352,13 +7968,13 @@ func awsRestxml_deserializeOpErrorGetStorageLensConfiguration(response *smithyht } } -func awsRestxml_deserializeOpDocumentGetStorageLensConfigurationOutput(v **GetStorageLensConfigurationOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListAccessGrantsOutput(v **ListAccessGrantsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetStorageLensConfigurationOutput + var sv *ListAccessGrantsOutput if *v == nil { - sv = &GetStorageLensConfigurationOutput{} + sv = &ListAccessGrantsOutput{} } else { sv = *v } @@ -5374,12 +7990,25 @@ func awsRestxml_deserializeOpDocumentGetStorageLensConfigurationOutput(v **GetSt originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("StorageLensConfiguration", t.Name.Local): + case strings.EqualFold("AccessGrantsList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentStorageLensConfiguration(&sv.StorageLensConfiguration, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentAccessGrantsList(&sv.AccessGrantsList, 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() @@ -5394,14 +8023,14 @@ func awsRestxml_deserializeOpDocumentGetStorageLensConfigurationOutput(v **GetSt return nil } -type awsRestxml_deserializeOpGetStorageLensConfigurationTagging struct { +type awsRestxml_deserializeOpListAccessGrantsInstances struct { } -func (*awsRestxml_deserializeOpGetStorageLensConfigurationTagging) ID() string { +func (*awsRestxml_deserializeOpListAccessGrantsInstances) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetStorageLensConfigurationTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListAccessGrantsInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5415,9 +8044,9 @@ func (m *awsRestxml_deserializeOpGetStorageLensConfigurationTagging) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetStorageLensConfigurationTagging(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListAccessGrantsInstances(response, &metadata) } - output := &GetStorageLensConfigurationTaggingOutput{} + output := &ListAccessGrantsInstancesOutput{} out.Result = output var buff [1024]byte @@ -5438,7 +8067,7 @@ func (m *awsRestxml_deserializeOpGetStorageLensConfigurationTagging) HandleDeser } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetStorageLensConfigurationTaggingOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListAccessGrantsInstancesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5451,7 +8080,7 @@ func (m *awsRestxml_deserializeOpGetStorageLensConfigurationTagging) HandleDeser return out, metadata, err } -func awsRestxml_deserializeOpErrorGetStorageLensConfigurationTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListAccessGrantsInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5491,13 +8120,13 @@ func awsRestxml_deserializeOpErrorGetStorageLensConfigurationTagging(response *s } } -func awsRestxml_deserializeOpDocumentGetStorageLensConfigurationTaggingOutput(v **GetStorageLensConfigurationTaggingOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListAccessGrantsInstancesOutput(v **ListAccessGrantsInstancesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetStorageLensConfigurationTaggingOutput + var sv *ListAccessGrantsInstancesOutput if *v == nil { - sv = &GetStorageLensConfigurationTaggingOutput{} + sv = &ListAccessGrantsInstancesOutput{} } else { sv = *v } @@ -5513,11 +8142,24 @@ func awsRestxml_deserializeOpDocumentGetStorageLensConfigurationTaggingOutput(v originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Tags", t.Name.Local): + case strings.EqualFold("AccessGrantsInstancesList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentStorageLensTags(&sv.Tags, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentAccessGrantsInstancesList(&sv.AccessGrantsInstancesList, 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 @@ -5533,14 +8175,14 @@ func awsRestxml_deserializeOpDocumentGetStorageLensConfigurationTaggingOutput(v return nil } -type awsRestxml_deserializeOpGetStorageLensGroup struct { +type awsRestxml_deserializeOpListAccessGrantsLocations struct { } -func (*awsRestxml_deserializeOpGetStorageLensGroup) ID() string { +func (*awsRestxml_deserializeOpListAccessGrantsLocations) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetStorageLensGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListAccessGrantsLocations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5554,9 +8196,9 @@ func (m *awsRestxml_deserializeOpGetStorageLensGroup) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetStorageLensGroup(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListAccessGrantsLocations(response, &metadata) } - output := &GetStorageLensGroupOutput{} + output := &ListAccessGrantsLocationsOutput{} out.Result = output var buff [1024]byte @@ -5577,7 +8219,7 @@ func (m *awsRestxml_deserializeOpGetStorageLensGroup) HandleDeserialize(ctx cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentStorageLensGroup(&output.StorageLensGroup, decoder) + err = awsRestxml_deserializeOpDocumentListAccessGrantsLocationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5590,7 +8232,7 @@ func (m *awsRestxml_deserializeOpGetStorageLensGroup) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestxml_deserializeOpErrorGetStorageLensGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListAccessGrantsLocations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5630,13 +8272,13 @@ func awsRestxml_deserializeOpErrorGetStorageLensGroup(response *smithyhttp.Respo } } -func awsRestxml_deserializeOpDocumentGetStorageLensGroupOutput(v **GetStorageLensGroupOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListAccessGrantsLocationsOutput(v **ListAccessGrantsLocationsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetStorageLensGroupOutput + var sv *ListAccessGrantsLocationsOutput if *v == nil { - sv = &GetStorageLensGroupOutput{} + sv = &ListAccessGrantsLocationsOutput{} } else { sv = *v } @@ -5652,11 +8294,24 @@ func awsRestxml_deserializeOpDocumentGetStorageLensGroupOutput(v **GetStorageLen originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("StorageLensGroup", t.Name.Local): + case strings.EqualFold("AccessGrantsLocationsList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentStorageLensGroup(&sv.StorageLensGroup, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentAccessGrantsLocationsList(&sv.AccessGrantsLocationsList, 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 @@ -6752,7 +9407,146 @@ func (*awsRestxml_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_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, awsRestxml_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + 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 = awsRestxml_deserializeOpDocumentListTagsForResourceOutput(&output, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_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 + + errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } 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("Tags", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentTagList(&sv.Tags, 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 +} + +type awsRestxml_deserializeOpPutAccessGrantsInstanceResourcePolicy struct { +} + +func (*awsRestxml_deserializeOpPutAccessGrantsInstanceResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpPutAccessGrantsInstanceResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6766,9 +9560,9 @@ func (m *awsRestxml_deserializeOpListTagsForResource) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorPutAccessGrantsInstanceResourcePolicy(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &PutAccessGrantsInstanceResourcePolicyOutput{} out.Result = output var buff [1024]byte @@ -6789,7 +9583,7 @@ func (m *awsRestxml_deserializeOpListTagsForResource) HandleDeserialize(ctx cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListTagsForResourceOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentPutAccessGrantsInstanceResourcePolicyOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6802,7 +9596,7 @@ func (m *awsRestxml_deserializeOpListTagsForResource) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestxml_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorPutAccessGrantsInstanceResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6842,13 +9636,13 @@ func awsRestxml_deserializeOpErrorListTagsForResource(response *smithyhttp.Respo } } -func awsRestxml_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentPutAccessGrantsInstanceResourcePolicyOutput(v **PutAccessGrantsInstanceResourcePolicyOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListTagsForResourceOutput + var sv *PutAccessGrantsInstanceResourcePolicyOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &PutAccessGrantsInstanceResourcePolicyOutput{} } else { sv = *v } @@ -6864,11 +9658,48 @@ func awsRestxml_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForRe originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Tags", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { + case strings.EqualFold("CreatedAt", 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.CreatedAt = ptr.Time(t) + } + + case strings.EqualFold("Organization", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Organization = ptr.String(xtv) + } + + case strings.EqualFold("Policy", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.Policy = ptr.String(xtv) + } default: // Do nothing and ignore the unexpected tag element @@ -8107,34 +10938,236 @@ func awsRestxml_deserializeOpErrorUntagResource(response *smithyhttp.Response, m errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ - IsWrappedWithErrorTag: true, - }) - if err != nil { - return err - } - if hostID := errorComponents.HostID; len(hostID) != 0 { - s3shared.SetHostIDMetadata(metadata, hostID) - } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code - } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message - } - errorBody.Seek(0, io.SeekStart) - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, + errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestxml_deserializeOpUpdateAccessGrantsLocation struct { +} + +func (*awsRestxml_deserializeOpUpdateAccessGrantsLocation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpUpdateAccessGrantsLocation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsRestxml_deserializeOpErrorUpdateAccessGrantsLocation(response, &metadata) + } + output := &UpdateAccessGrantsLocationOutput{} + 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 = awsRestxml_deserializeOpDocumentUpdateAccessGrantsLocationOutput(&output, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorUpdateAccessGrantsLocation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + IsWrappedWithErrorTag: true, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentUpdateAccessGrantsLocationOutput(v **UpdateAccessGrantsLocationOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *UpdateAccessGrantsLocationOutput + if *v == nil { + sv = &UpdateAccessGrantsLocationOutput{} + } 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("AccessGrantsLocationArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessGrantsLocationArn = ptr.String(xtv) + } + + case strings.EqualFold("AccessGrantsLocationId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessGrantsLocationId = ptr.String(xtv) + } + + case strings.EqualFold("CreatedAt", 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.CreatedAt = ptr.Time(t) + } + + case strings.EqualFold("IAMRoleArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IAMRoleArn = ptr.String(xtv) + } + + case strings.EqualFold("LocationScope", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LocationScope = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + } - return genericError - + decoder = originalDecoder } + *v = sv + return nil } type awsRestxml_deserializeOpUpdateJobPriority struct { @@ -8936,101 +11969,339 @@ func awsRestxml_deserializeErrorNotFoundException(response *smithyhttp.Response, return output } -func awsRestxml_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyRequestsException{} - 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(), - } +func awsRestxml_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyRequestsException{} + 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 = awsRestxml_deserializeDocumentTooManyRequestsException(&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 awsRestxml_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyTagsException{} + 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 = awsRestxml_deserializeDocumentTooManyTagsException(&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 awsRestxml_deserializeDocumentAbortIncompleteMultipartUpload(v **types.AbortIncompleteMultipartUpload, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AbortIncompleteMultipartUpload + if *v == nil { + sv = &types.AbortIncompleteMultipartUpload{} + } 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("DaysAfterInitiation", 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.DaysAfterInitiation = 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 awsRestxml_deserializeDocumentAccessControlTranslation(v **types.AccessControlTranslation, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AccessControlTranslation + if *v == nil { + sv = &types.AccessControlTranslation{} + } 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("Owner", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Owner = types.OwnerOverride(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 awsRestxml_deserializeDocumentAccessGrantsInstancesList(v *[]types.ListAccessGrantsInstanceEntry, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ListAccessGrantsInstanceEntry + if *v == nil { + sv = make([]types.ListAccessGrantsInstanceEntry, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("AccessGrantsInstance", t.Name.Local): + var col types.ListAccessGrantsInstanceEntry + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsRestxml_deserializeDocumentListAccessGrantsInstanceEntry(&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 awsRestxml_deserializeDocumentAccessGrantsInstancesListUnwrapped(v *[]types.ListAccessGrantsInstanceEntry, decoder smithyxml.NodeDecoder) error { + var sv []types.ListAccessGrantsInstanceEntry + if *v == nil { + sv = make([]types.ListAccessGrantsInstanceEntry, 0) + } else { + sv = *v } - 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(), + switch { + default: + var mv types.ListAccessGrantsInstanceEntry + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsRestxml_deserializeDocumentListAccessGrantsInstanceEntry(&destAddr, nodeDecoder); err != nil { + return err } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsRestxml_deserializeDocumentAccessGrantsList(v *[]types.ListAccessGrantEntry, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ListAccessGrantEntry + if *v == nil { + sv = make([]types.ListAccessGrantEntry, 0) + } else { + sv = *v } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentTooManyRequestsException(&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(), + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err } - } + if done { + break + } + switch { + case strings.EqualFold("AccessGrant", t.Name.Local): + var col types.ListAccessGrantEntry + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsRestxml_deserializeDocumentListAccessGrantEntry(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) - return output -} + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } -func awsRestxml_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyTagsException{} - 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 = originalDecoder } + *v = sv + return nil +} - 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(), - } +func awsRestxml_deserializeDocumentAccessGrantsListUnwrapped(v *[]types.ListAccessGrantEntry, decoder smithyxml.NodeDecoder) error { + var sv []types.ListAccessGrantEntry + if *v == nil { + sv = make([]types.ListAccessGrantEntry, 0) + } else { + sv = *v } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentTooManyTagsException(&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(), + switch { + default: + var mv types.ListAccessGrantEntry + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsRestxml_deserializeDocumentListAccessGrantEntry(&destAddr, nodeDecoder); err != nil { + return err } + mv = *destAddr + sv = append(sv, mv) } - - return output + *v = sv + return nil } - -func awsRestxml_deserializeDocumentAbortIncompleteMultipartUpload(v **types.AbortIncompleteMultipartUpload, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentAccessGrantsLocationConfiguration(v **types.AccessGrantsLocationConfiguration, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.AbortIncompleteMultipartUpload + var sv *types.AccessGrantsLocationConfiguration if *v == nil { - sv = &types.AbortIncompleteMultipartUpload{} + sv = &types.AccessGrantsLocationConfiguration{} } else { sv = *v } @@ -9046,7 +12317,7 @@ func awsRestxml_deserializeDocumentAbortIncompleteMultipartUpload(v **types.Abor originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("DaysAfterInitiation", t.Name.Local): + case strings.EqualFold("S3SubPrefix", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -9056,11 +12327,7 @@ func awsRestxml_deserializeDocumentAbortIncompleteMultipartUpload(v **types.Abor } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.DaysAfterInitiation = int32(i64) + sv.S3SubPrefix = ptr.String(xtv) } default: @@ -9077,17 +12344,18 @@ func awsRestxml_deserializeDocumentAbortIncompleteMultipartUpload(v **types.Abor return nil } -func awsRestxml_deserializeDocumentAccessControlTranslation(v **types.AccessControlTranslation, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentAccessGrantsLocationsList(v *[]types.ListAccessGrantsLocationsEntry, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.AccessControlTranslation + var sv []types.ListAccessGrantsLocationsEntry if *v == nil { - sv = &types.AccessControlTranslation{} + sv = make([]types.ListAccessGrantsLocationsEntry, 0) } else { sv = *v } + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -9096,24 +12364,18 @@ func awsRestxml_deserializeDocumentAccessControlTranslation(v **types.AccessCont if done { break } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Owner", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("AccessGrantsLocation", t.Name.Local): + var col types.ListAccessGrantsLocationsEntry + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsRestxml_deserializeDocumentListAccessGrantsLocationsEntry(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.Owner = types.OwnerOverride(xtv) - } + col = *destAddr + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -9126,6 +12388,30 @@ func awsRestxml_deserializeDocumentAccessControlTranslation(v **types.AccessCont return nil } +func awsRestxml_deserializeDocumentAccessGrantsLocationsListUnwrapped(v *[]types.ListAccessGrantsLocationsEntry, decoder smithyxml.NodeDecoder) error { + var sv []types.ListAccessGrantsLocationsEntry + if *v == nil { + sv = make([]types.ListAccessGrantsLocationsEntry, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ListAccessGrantsLocationsEntry + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsRestxml_deserializeDocumentListAccessGrantsLocationsEntry(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} func awsRestxml_deserializeDocumentAccessPoint(v **types.AccessPoint, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10278,6 +13564,98 @@ func awsRestxml_deserializeDocumentCreateMultiRegionAccessPointInput(v **types.C return nil } +func awsRestxml_deserializeDocumentCredentials(v **types.Credentials, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Credentials + if *v == nil { + sv = &types.Credentials{} + } 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("AccessKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessKeyId = ptr.String(xtv) + } + + case strings.EqualFold("Expiration", 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.Expiration = ptr.Time(t) + } + + case strings.EqualFold("SecretAccessKey", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SecretAccessKey = ptr.String(xtv) + } + + case strings.EqualFold("SessionToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SessionToken = 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 awsRestxml_deserializeDocumentDeleteMarkerReplication(v **types.DeleteMarkerReplication, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10680,7 +14058,263 @@ func awsRestxml_deserializeDocumentEstablishedMultiRegionAccessPointPolicy(v **t } var sv *types.EstablishedMultiRegionAccessPointPolicy if *v == nil { - sv = &types.EstablishedMultiRegionAccessPointPolicy{} + sv = &types.EstablishedMultiRegionAccessPointPolicy{} + } 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("Policy", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Policy = 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 awsRestxml_deserializeDocumentExclude(v **types.Exclude, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Exclude + if *v == nil { + sv = &types.Exclude{} + } 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("Buckets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentBuckets(&sv.Buckets, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Regions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentRegions(&sv.Regions, 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 awsRestxml_deserializeDocumentExistingObjectReplication(v **types.ExistingObjectReplication, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ExistingObjectReplication + if *v == nil { + sv = &types.ExistingObjectReplication{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.ExistingObjectReplicationStatus(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 awsRestxml_deserializeDocumentGeneratedManifestEncryption(v **types.GeneratedManifestEncryption, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.GeneratedManifestEncryption + if *v == nil { + sv = &types.GeneratedManifestEncryption{} + } 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("SSE-KMS", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentSSEKMSEncryption(&sv.SSEKMS, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SSE-S3", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentSSES3Encryption(&sv.SSES3, 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 awsRestxml_deserializeDocumentGrantee(v **types.Grantee, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Grantee + if *v == nil { + sv = &types.Grantee{} + } 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("GranteeIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.GranteeIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("GranteeType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.GranteeType = types.GranteeType(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 awsRestxml_deserializeDocumentIdempotencyException(v **types.IdempotencyException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IdempotencyException + if *v == nil { + sv = &types.IdempotencyException{} } else { sv = *v } @@ -10696,7 +14330,7 @@ func awsRestxml_deserializeDocumentEstablishedMultiRegionAccessPointPolicy(v **t originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Policy", t.Name.Local): + case strings.EqualFold("Message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -10706,7 +14340,7 @@ func awsRestxml_deserializeDocumentEstablishedMultiRegionAccessPointPolicy(v **t } { xtv := string(val) - sv.Policy = ptr.String(xtv) + sv.Message = ptr.String(xtv) } default: @@ -10723,13 +14357,13 @@ func awsRestxml_deserializeDocumentEstablishedMultiRegionAccessPointPolicy(v **t return nil } -func awsRestxml_deserializeDocumentExclude(v **types.Exclude, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentInclude(v **types.Include, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.Exclude + var sv *types.Include if *v == nil { - sv = &types.Exclude{} + sv = &types.Include{} } else { sv = *v } @@ -10771,13 +14405,13 @@ func awsRestxml_deserializeDocumentExclude(v **types.Exclude, decoder smithyxml. return nil } -func awsRestxml_deserializeDocumentExistingObjectReplication(v **types.ExistingObjectReplication, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentInternalServiceException(v **types.InternalServiceException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.ExistingObjectReplication + var sv *types.InternalServiceException if *v == nil { - sv = &types.ExistingObjectReplication{} + sv = &types.InternalServiceException{} } else { sv = *v } @@ -10793,7 +14427,7 @@ func awsRestxml_deserializeDocumentExistingObjectReplication(v **types.ExistingO originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Status", t.Name.Local): + case strings.EqualFold("Message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -10803,7 +14437,7 @@ func awsRestxml_deserializeDocumentExistingObjectReplication(v **types.ExistingO } { xtv := string(val) - sv.Status = types.ExistingObjectReplicationStatus(xtv) + sv.Message = ptr.String(xtv) } default: @@ -10820,13 +14454,13 @@ func awsRestxml_deserializeDocumentExistingObjectReplication(v **types.ExistingO return nil } -func awsRestxml_deserializeDocumentGeneratedManifestEncryption(v **types.GeneratedManifestEncryption, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentInvalidNextTokenException(v **types.InvalidNextTokenException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.GeneratedManifestEncryption + var sv *types.InvalidNextTokenException if *v == nil { - sv = &types.GeneratedManifestEncryption{} + sv = &types.InvalidNextTokenException{} } else { sv = *v } @@ -10842,16 +14476,17 @@ func awsRestxml_deserializeDocumentGeneratedManifestEncryption(v **types.Generat originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("SSE-KMS", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentSSEKMSEncryption(&sv.SSEKMS, nodeDecoder); err != nil { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - - case strings.EqualFold("SSE-S3", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentSSES3Encryption(&sv.SSES3, nodeDecoder); err != nil { - return err + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) } default: @@ -10868,13 +14503,13 @@ func awsRestxml_deserializeDocumentGeneratedManifestEncryption(v **types.Generat return nil } -func awsRestxml_deserializeDocumentIdempotencyException(v **types.IdempotencyException, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.IdempotencyException + var sv *types.InvalidRequestException if *v == nil { - sv = &types.IdempotencyException{} + sv = &types.InvalidRequestException{} } else { sv = *v } @@ -10917,13 +14552,13 @@ func awsRestxml_deserializeDocumentIdempotencyException(v **types.IdempotencyExc return nil } -func awsRestxml_deserializeDocumentInclude(v **types.Include, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentJobDescriptor(v **types.JobDescriptor, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.Include + var sv *types.JobDescriptor if *v == nil { - sv = &types.Include{} + sv = &types.JobDescriptor{} } else { sv = *v } @@ -10939,17 +14574,222 @@ func awsRestxml_deserializeDocumentInclude(v **types.Include, decoder smithyxml. originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Buckets", t.Name.Local): + case strings.EqualFold("ConfirmationRequired", 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 ConfirmationRequired to be of type *bool, got %T instead", val) + } + sv.ConfirmationRequired = ptr.Bool(xtv) + } + + case strings.EqualFold("CreationTime", 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.CreationTime = ptr.Time(t) + } + + 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("FailureReasons", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentBuckets(&sv.Buckets, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentJobFailureList(&sv.FailureReasons, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("GeneratedManifestDescriptor", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentS3GeneratedManifestDescriptor(&sv.GeneratedManifestDescriptor, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("JobArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.JobArn = ptr.String(xtv) + } + + case strings.EqualFold("JobId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.JobId = ptr.String(xtv) + } + + case strings.EqualFold("Manifest", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentJobManifest(&sv.Manifest, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ManifestGenerator", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentJobManifestGenerator(&sv.ManifestGenerator, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Operation", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentJobOperation(&sv.Operation, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Priority", 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.Priority = int32(i64) + } + + case strings.EqualFold("ProgressSummary", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentJobProgressSummary(&sv.ProgressSummary, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Report", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentJobReport(&sv.Report, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("RoleArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.RoleArn = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.JobStatus(xtv) + } + + case strings.EqualFold("StatusUpdateReason", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StatusUpdateReason = ptr.String(xtv) + } + + case strings.EqualFold("SuspendedCause", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SuspendedCause = ptr.String(xtv) + } + + case strings.EqualFold("SuspendedDate", 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.SuspendedDate = ptr.Time(t) + } - case strings.EqualFold("Regions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentRegions(&sv.Regions, nodeDecoder); err != nil { + case strings.EqualFold("TerminationDate", 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.TerminationDate = ptr.Time(t) + } default: // Do nothing and ignore the unexpected tag element @@ -10965,13 +14805,13 @@ func awsRestxml_deserializeDocumentInclude(v **types.Include, decoder smithyxml. return nil } -func awsRestxml_deserializeDocumentInternalServiceException(v **types.InternalServiceException, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentJobFailure(v **types.JobFailure, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InternalServiceException + var sv *types.JobFailure if *v == nil { - sv = &types.InternalServiceException{} + sv = &types.JobFailure{} } else { sv = *v } @@ -10987,7 +14827,7 @@ func awsRestxml_deserializeDocumentInternalServiceException(v **types.InternalSe originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): + case strings.EqualFold("FailureCode", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -10997,46 +14837,10 @@ func awsRestxml_deserializeDocumentInternalServiceException(v **types.InternalSe } { 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 + sv.FailureCode = ptr.String(xtv) } - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsRestxml_deserializeDocumentInvalidNextTokenException(v **types.InvalidNextTokenException, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InvalidNextTokenException - if *v == nil { - sv = &types.InvalidNextTokenException{} - } 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): + case strings.EqualFold("FailureReason", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11046,7 +14850,7 @@ func awsRestxml_deserializeDocumentInvalidNextTokenException(v **types.InvalidNe } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.FailureReason = ptr.String(xtv) } default: @@ -11063,17 +14867,18 @@ func awsRestxml_deserializeDocumentInvalidNextTokenException(v **types.InvalidNe return nil } -func awsRestxml_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentJobFailureList(v *[]types.JobFailure, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidRequestException + var sv []types.JobFailure if *v == nil { - sv = &types.InvalidRequestException{} + sv = make([]types.JobFailure, 0) } else { sv = *v } + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -11082,24 +14887,18 @@ func awsRestxml_deserializeDocumentInvalidRequestException(v **types.InvalidRequ 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 { + case strings.EqualFold("member", t.Name.Local): + var col types.JobFailure + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsRestxml_deserializeDocumentJobFailure(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } + col = *destAddr + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -11112,13 +14911,37 @@ func awsRestxml_deserializeDocumentInvalidRequestException(v **types.InvalidRequ return nil } -func awsRestxml_deserializeDocumentJobDescriptor(v **types.JobDescriptor, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentJobFailureListUnwrapped(v *[]types.JobFailure, decoder smithyxml.NodeDecoder) error { + var sv []types.JobFailure + if *v == nil { + sv = make([]types.JobFailure, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.JobFailure + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsRestxml_deserializeDocumentJobFailure(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsRestxml_deserializeDocumentJobListDescriptor(v **types.JobListDescriptor, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.JobDescriptor + var sv *types.JobListDescriptor if *v == nil { - sv = &types.JobDescriptor{} + sv = &types.JobListDescriptor{} } else { sv = *v } @@ -11134,22 +14957,6 @@ func awsRestxml_deserializeDocumentJobDescriptor(v **types.JobDescriptor, decode originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ConfirmationRequired", 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 ConfirmationRequired to be of type *bool, got %T instead", val) - } - sv.ConfirmationRequired = ptr.Bool(xtv) - } - case strings.EqualFold("CreationTime", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -11180,19 +14987,7 @@ func awsRestxml_deserializeDocumentJobDescriptor(v **types.JobDescriptor, decode sv.Description = ptr.String(xtv) } - case strings.EqualFold("FailureReasons", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentJobFailureList(&sv.FailureReasons, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("GeneratedManifestDescriptor", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentS3GeneratedManifestDescriptor(&sv.GeneratedManifestDescriptor, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("JobArn", t.Name.Local): + case strings.EqualFold("JobId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11202,10 +14997,10 @@ func awsRestxml_deserializeDocumentJobDescriptor(v **types.JobDescriptor, decode } { xtv := string(val) - sv.JobArn = ptr.String(xtv) + sv.JobId = ptr.String(xtv) } - case strings.EqualFold("JobId", t.Name.Local): + case strings.EqualFold("Operation", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11215,25 +15010,7 @@ func awsRestxml_deserializeDocumentJobDescriptor(v **types.JobDescriptor, decode } { xtv := string(val) - sv.JobId = ptr.String(xtv) - } - - case strings.EqualFold("Manifest", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentJobManifest(&sv.Manifest, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ManifestGenerator", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentJobManifestGenerator(&sv.ManifestGenerator, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("Operation", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentJobOperation(&sv.Operation, nodeDecoder); err != nil { - return err + sv.Operation = types.OperationName(xtv) } case strings.EqualFold("Priority", t.Name.Local): @@ -11259,25 +15036,6 @@ func awsRestxml_deserializeDocumentJobDescriptor(v **types.JobDescriptor, decode return err } - case strings.EqualFold("Report", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentJobReport(&sv.Report, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("RoleArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.RoleArn = ptr.String(xtv) - } - case strings.EqualFold("Status", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -11291,33 +15049,7 @@ func awsRestxml_deserializeDocumentJobDescriptor(v **types.JobDescriptor, decode sv.Status = types.JobStatus(xtv) } - case strings.EqualFold("StatusUpdateReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StatusUpdateReason = ptr.String(xtv) - } - - case strings.EqualFold("SuspendedCause", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SuspendedCause = ptr.String(xtv) - } - - case strings.EqualFold("SuspendedDate", t.Name.Local): + case strings.EqualFold("TerminationDate", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11331,28 +15063,55 @@ func awsRestxml_deserializeDocumentJobDescriptor(v **types.JobDescriptor, decode if err != nil { return err } - sv.SuspendedDate = ptr.Time(t) + sv.TerminationDate = ptr.Time(t) } - case strings.EqualFold("TerminationDate", 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) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.TerminationDate = ptr.Time(t) - } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentJobListDescriptorList(v *[]types.JobListDescriptor, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.JobListDescriptor + if *v == nil { + sv = make([]types.JobListDescriptor, 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.JobListDescriptor + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsRestxml_deserializeDocumentJobListDescriptor(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -11365,13 +15124,37 @@ func awsRestxml_deserializeDocumentJobDescriptor(v **types.JobDescriptor, decode return nil } -func awsRestxml_deserializeDocumentJobFailure(v **types.JobFailure, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentJobListDescriptorListUnwrapped(v *[]types.JobListDescriptor, decoder smithyxml.NodeDecoder) error { + var sv []types.JobListDescriptor + if *v == nil { + sv = make([]types.JobListDescriptor, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.JobListDescriptor + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsRestxml_deserializeDocumentJobListDescriptor(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsRestxml_deserializeDocumentJobManifest(v **types.JobManifest, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.JobFailure + var sv *types.JobManifest if *v == nil { - sv = &types.JobFailure{} + sv = &types.JobManifest{} } else { sv = *v } @@ -11387,31 +15170,17 @@ func awsRestxml_deserializeDocumentJobFailure(v **types.JobFailure, decoder smit originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("FailureCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("Location", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentJobManifestLocation(&sv.Location, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.FailureCode = ptr.String(xtv) - } - case strings.EqualFold("FailureReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("Spec", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentJobManifestSpec(&sv.Spec, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.FailureReason = ptr.String(xtv) - } default: // Do nothing and ignore the unexpected tag element @@ -11427,13 +15196,13 @@ func awsRestxml_deserializeDocumentJobFailure(v **types.JobFailure, decoder smit return nil } -func awsRestxml_deserializeDocumentJobFailureList(v *[]types.JobFailure, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentJobManifestFieldList(v *[]types.JobManifestFieldName, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.JobFailure + var sv []types.JobManifestFieldName if *v == nil { - sv = make([]types.JobFailure, 0) + sv = make([]types.JobManifestFieldName, 0) } else { sv = *v } @@ -11447,15 +15216,22 @@ func awsRestxml_deserializeDocumentJobFailureList(v *[]types.JobFailure, decoder if done { break } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder switch { case strings.EqualFold("member", t.Name.Local): - var col types.JobFailure - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsRestxml_deserializeDocumentJobFailure(&destAddr, nodeDecoder); err != nil { + var col types.JobManifestFieldName + val, err := decoder.Value() + if err != nil { return err } - col = *destAddr + if val == nil { + break + } + { + xtv := string(val) + col = types.JobManifestFieldName(xtv) + } sv = append(sv, col) default: @@ -11471,37 +15247,86 @@ func awsRestxml_deserializeDocumentJobFailureList(v *[]types.JobFailure, decoder return nil } -func awsRestxml_deserializeDocumentJobFailureListUnwrapped(v *[]types.JobFailure, decoder smithyxml.NodeDecoder) error { - var sv []types.JobFailure +func awsRestxml_deserializeDocumentJobManifestFieldListUnwrapped(v *[]types.JobManifestFieldName, decoder smithyxml.NodeDecoder) error { + var sv []types.JobManifestFieldName if *v == nil { - sv = make([]types.JobFailure, 0) + sv = make([]types.JobManifestFieldName, 0) } else { sv = *v } switch { default: - var mv types.JobFailure + var mv types.JobManifestFieldName t := decoder.StartEl _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsRestxml_deserializeDocumentJobFailure(&destAddr, nodeDecoder); err != nil { + val, err := decoder.Value() + if err != nil { return err } - mv = *destAddr + if val == nil { + break + } + { + xtv := string(val) + mv = types.JobManifestFieldName(xtv) + } sv = append(sv, mv) } *v = sv return nil } -func awsRestxml_deserializeDocumentJobListDescriptor(v **types.JobListDescriptor, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentJobManifestGenerator(v *types.JobManifestGenerator, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.JobListDescriptor + var uv types.JobManifestGenerator + 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("S3JobManifestGenerator", t.Name.Local): + var mv types.S3JobManifestGenerator + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsRestxml_deserializeDocumentS3JobManifestGenerator(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + uv = &types.JobManifestGeneratorMemberS3JobManifestGenerator{Value: mv} + memberFound = true + + default: + uv = &types.UnknownUnionMember{Tag: t.Name.Local} + memberFound = true + + } + decoder = originalDecoder + } + *v = uv + return nil +} + +func awsRestxml_deserializeDocumentJobManifestGeneratorFilter(v **types.JobManifestGeneratorFilter, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.JobManifestGeneratorFilter if *v == nil { - sv = &types.JobListDescriptor{} + sv = &types.JobManifestGeneratorFilter{} } else { sv = *v } @@ -11517,7 +15342,7 @@ func awsRestxml_deserializeDocumentJobListDescriptor(v **types.JobListDescriptor originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("CreationTime", t.Name.Local): + case strings.EqualFold("CreatedAfter", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11531,10 +15356,10 @@ func awsRestxml_deserializeDocumentJobListDescriptor(v **types.JobListDescriptor if err != nil { return err } - sv.CreationTime = ptr.Time(t) + sv.CreatedAfter = ptr.Time(t) } - case strings.EqualFold("Description", t.Name.Local): + case strings.EqualFold("CreatedBefore", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11544,10 +15369,48 @@ func awsRestxml_deserializeDocumentJobListDescriptor(v **types.JobListDescriptor } { xtv := string(val) - sv.Description = ptr.String(xtv) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreatedBefore = ptr.Time(t) } - case strings.EqualFold("JobId", t.Name.Local): + case strings.EqualFold("EligibleForReplication", 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.EligibleForReplication = ptr.Bool(xtv) + } + + case strings.EqualFold("KeyNameConstraint", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentKeyNameConstraint(&sv.KeyNameConstraint, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("MatchAnyStorageClass", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentStorageClassList(&sv.MatchAnyStorageClass, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ObjectReplicationStatuses", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentReplicationStatusFilterList(&sv.ObjectReplicationStatuses, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ObjectSizeGreaterThanBytes", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11557,10 +15420,14 @@ func awsRestxml_deserializeDocumentJobListDescriptor(v **types.JobListDescriptor } { xtv := string(val) - sv.JobId = ptr.String(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.ObjectSizeGreaterThanBytes = ptr.Int64(i64) } - case strings.EqualFold("Operation", t.Name.Local): + case strings.EqualFold("ObjectSizeLessThanBytes", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11570,10 +15437,50 @@ func awsRestxml_deserializeDocumentJobListDescriptor(v **types.JobListDescriptor } { xtv := string(val) - sv.Operation = types.OperationName(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.ObjectSizeLessThanBytes = ptr.Int64(i64) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err } - case strings.EqualFold("Priority", t.Name.Local): + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentJobManifestLocation(v **types.JobManifestLocation, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.JobManifestLocation + if *v == nil { + sv = &types.JobManifestLocation{} + } 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("ETag", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11583,20 +15490,10 @@ func awsRestxml_deserializeDocumentJobListDescriptor(v **types.JobListDescriptor } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Priority = int32(i64) - } - - case strings.EqualFold("ProgressSummary", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentJobProgressSummary(&sv.ProgressSummary, nodeDecoder); err != nil { - return err + sv.ETag = ptr.String(xtv) } - case strings.EqualFold("Status", t.Name.Local): + case strings.EqualFold("ObjectArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11606,10 +15503,10 @@ func awsRestxml_deserializeDocumentJobListDescriptor(v **types.JobListDescriptor } { xtv := string(val) - sv.Status = types.JobStatus(xtv) + sv.ObjectArn = ptr.String(xtv) } - case strings.EqualFold("TerminationDate", t.Name.Local): + case strings.EqualFold("ObjectVersionId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11619,11 +15516,7 @@ func awsRestxml_deserializeDocumentJobListDescriptor(v **types.JobListDescriptor } { xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.TerminationDate = ptr.Time(t) + sv.ObjectVersionId = ptr.String(xtv) } default: @@ -11640,18 +15533,17 @@ func awsRestxml_deserializeDocumentJobListDescriptor(v **types.JobListDescriptor return nil } -func awsRestxml_deserializeDocumentJobListDescriptorList(v *[]types.JobListDescriptor, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentJobManifestSpec(v **types.JobManifestSpec, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.JobListDescriptor + var sv *types.JobManifestSpec if *v == nil { - sv = make([]types.JobListDescriptor, 0) + sv = &types.JobManifestSpec{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -11660,18 +15552,30 @@ func awsRestxml_deserializeDocumentJobListDescriptorList(v *[]types.JobListDescr if done { break } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("member", t.Name.Local): - var col types.JobListDescriptor + case strings.EqualFold("Fields", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsRestxml_deserializeDocumentJobListDescriptor(&destAddr, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentJobManifestFieldList(&sv.Fields, nodeDecoder); err != nil { return err } - col = *destAddr - sv = append(sv, col) + + case strings.EqualFold("Format", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Format = types.JobManifestFormat(xtv) + } default: + // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -11684,37 +15588,13 @@ func awsRestxml_deserializeDocumentJobListDescriptorList(v *[]types.JobListDescr return nil } -func awsRestxml_deserializeDocumentJobListDescriptorListUnwrapped(v *[]types.JobListDescriptor, decoder smithyxml.NodeDecoder) error { - var sv []types.JobListDescriptor - if *v == nil { - sv = make([]types.JobListDescriptor, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.JobListDescriptor - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsRestxml_deserializeDocumentJobListDescriptor(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsRestxml_deserializeDocumentJobManifest(v **types.JobManifest, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentJobOperation(v **types.JobOperation, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.JobManifest + var sv *types.JobOperation if *v == nil { - sv = &types.JobManifest{} + sv = &types.JobOperation{} } else { sv = *v } @@ -11730,15 +15610,57 @@ func awsRestxml_deserializeDocumentJobManifest(v **types.JobManifest, decoder sm originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Location", t.Name.Local): + case strings.EqualFold("LambdaInvoke", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentJobManifestLocation(&sv.Location, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentLambdaInvokeOperation(&sv.LambdaInvoke, nodeDecoder); err != nil { return err } - case strings.EqualFold("Spec", t.Name.Local): + case strings.EqualFold("S3DeleteObjectTagging", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentJobManifestSpec(&sv.Spec, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentS3DeleteObjectTaggingOperation(&sv.S3DeleteObjectTagging, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("S3InitiateRestoreObject", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentS3InitiateRestoreObjectOperation(&sv.S3InitiateRestoreObject, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("S3PutObjectAcl", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentS3SetObjectAclOperation(&sv.S3PutObjectAcl, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("S3PutObjectCopy", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentS3CopyObjectOperation(&sv.S3PutObjectCopy, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("S3PutObjectLegalHold", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentS3SetObjectLegalHoldOperation(&sv.S3PutObjectLegalHold, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("S3PutObjectRetention", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentS3SetObjectRetentionOperation(&sv.S3PutObjectRetention, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("S3PutObjectTagging", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentS3SetObjectTaggingOperation(&sv.S3PutObjectTagging, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("S3ReplicateObject", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentS3ReplicateObjectOperation(&sv.S3ReplicateObject, nodeDecoder); err != nil { return err } @@ -11756,18 +15678,17 @@ func awsRestxml_deserializeDocumentJobManifest(v **types.JobManifest, decoder sm return nil } -func awsRestxml_deserializeDocumentJobManifestFieldList(v *[]types.JobManifestFieldName, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentJobProgressSummary(v **types.JobProgressSummary, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.JobManifestFieldName + var sv *types.JobProgressSummary if *v == nil { - sv = make([]types.JobManifestFieldName, 0) + sv = &types.JobProgressSummary{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -11776,11 +15697,10 @@ func awsRestxml_deserializeDocumentJobManifestFieldList(v *[]types.JobManifestFi if done { break } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("member", t.Name.Local): - var col types.JobManifestFieldName + case strings.EqualFold("NumberOfTasksFailed", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11790,103 +15710,74 @@ func awsRestxml_deserializeDocumentJobManifestFieldList(v *[]types.JobManifestFi } { xtv := string(val) - col = types.JobManifestFieldName(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.NumberOfTasksFailed = ptr.Int64(i64) } - sv = append(sv, col) - default: - err = decoder.Decoder.Skip() + case strings.EqualFold("NumberOfTasksSucceeded", t.Name.Local): + val, err := decoder.Value() if err != nil { return err } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsRestxml_deserializeDocumentJobManifestFieldListUnwrapped(v *[]types.JobManifestFieldName, decoder smithyxml.NodeDecoder) error { - var sv []types.JobManifestFieldName - if *v == nil { - sv = make([]types.JobManifestFieldName, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.JobManifestFieldName - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = types.JobManifestFieldName(xtv) - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsRestxml_deserializeDocumentJobManifestGenerator(v *types.JobManifestGenerator, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var uv types.JobManifestGenerator - 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 + if val == nil { + break } - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("S3JobManifestGenerator", t.Name.Local): - var mv types.S3JobManifestGenerator + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.NumberOfTasksSucceeded = ptr.Int64(i64) + } + + case strings.EqualFold("Timers", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsRestxml_deserializeDocumentS3JobManifestGenerator(&destAddr, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentJobTimers(&sv.Timers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TotalNumberOfTasks", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - mv = *destAddr - uv = &types.JobManifestGeneratorMemberS3JobManifestGenerator{Value: mv} - memberFound = true + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.TotalNumberOfTasks = ptr.Int64(i64) + } default: - uv = &types.UnknownUnionMember{Tag: t.Name.Local} - memberFound = true + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } } decoder = originalDecoder } - *v = uv + *v = sv return nil } -func awsRestxml_deserializeDocumentJobManifestGeneratorFilter(v **types.JobManifestGeneratorFilter, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentJobReport(v **types.JobReport, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.JobManifestGeneratorFilter + var sv *types.JobReport if *v == nil { - sv = &types.JobManifestGeneratorFilter{} + sv = &types.JobReport{} } else { sv = *v } @@ -11902,7 +15793,7 @@ func awsRestxml_deserializeDocumentJobManifestGeneratorFilter(v **types.JobManif originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("CreatedAfter", t.Name.Local): + case strings.EqualFold("Bucket", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11912,14 +15803,10 @@ func awsRestxml_deserializeDocumentJobManifestGeneratorFilter(v **types.JobManif } { xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.CreatedAfter = ptr.Time(t) + sv.Bucket = ptr.String(xtv) } - case strings.EqualFold("CreatedBefore", t.Name.Local): + case strings.EqualFold("Enabled", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11928,15 +15815,14 @@ func awsRestxml_deserializeDocumentJobManifestGeneratorFilter(v **types.JobManif break } { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) + xtv, err := strconv.ParseBool(string(val)) if err != nil { - return err + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) } - sv.CreatedBefore = ptr.Time(t) + sv.Enabled = xtv } - case strings.EqualFold("EligibleForReplication", t.Name.Local): + case strings.EqualFold("Format", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11945,32 +15831,11 @@ func awsRestxml_deserializeDocumentJobManifestGeneratorFilter(v **types.JobManif 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.EligibleForReplication = ptr.Bool(xtv) - } - - case strings.EqualFold("KeyNameConstraint", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentKeyNameConstraint(&sv.KeyNameConstraint, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("MatchAnyStorageClass", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentStorageClassList(&sv.MatchAnyStorageClass, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ObjectReplicationStatuses", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentReplicationStatusFilterList(&sv.ObjectReplicationStatuses, nodeDecoder); err != nil { - return err + xtv := string(val) + sv.Format = types.JobReportFormat(xtv) } - case strings.EqualFold("ObjectSizeGreaterThanBytes", t.Name.Local): + case strings.EqualFold("Prefix", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11980,14 +15845,10 @@ func awsRestxml_deserializeDocumentJobManifestGeneratorFilter(v **types.JobManif } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ObjectSizeGreaterThanBytes = ptr.Int64(i64) + sv.Prefix = ptr.String(xtv) } - case strings.EqualFold("ObjectSizeLessThanBytes", t.Name.Local): + case strings.EqualFold("ReportScope", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11997,11 +15858,7 @@ func awsRestxml_deserializeDocumentJobManifestGeneratorFilter(v **types.JobManif } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ObjectSizeLessThanBytes = ptr.Int64(i64) + sv.ReportScope = types.JobReportScope(xtv) } default: @@ -12018,13 +15875,13 @@ func awsRestxml_deserializeDocumentJobManifestGeneratorFilter(v **types.JobManif return nil } -func awsRestxml_deserializeDocumentJobManifestLocation(v **types.JobManifestLocation, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentJobStatusException(v **types.JobStatusException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.JobManifestLocation + var sv *types.JobStatusException if *v == nil { - sv = &types.JobManifestLocation{} + sv = &types.JobStatusException{} } else { sv = *v } @@ -12040,33 +15897,7 @@ func awsRestxml_deserializeDocumentJobManifestLocation(v **types.JobManifestLoca originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ETag", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ETag = ptr.String(xtv) - } - - case strings.EqualFold("ObjectArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ObjectArn = ptr.String(xtv) - } - - case strings.EqualFold("ObjectVersionId", t.Name.Local): + case strings.EqualFold("Message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12076,7 +15907,7 @@ func awsRestxml_deserializeDocumentJobManifestLocation(v **types.JobManifestLoca } { xtv := string(val) - sv.ObjectVersionId = ptr.String(xtv) + sv.Message = ptr.String(xtv) } default: @@ -12093,13 +15924,13 @@ func awsRestxml_deserializeDocumentJobManifestLocation(v **types.JobManifestLoca return nil } -func awsRestxml_deserializeDocumentJobManifestSpec(v **types.JobManifestSpec, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentJobTimers(v **types.JobTimers, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.JobManifestSpec + var sv *types.JobTimers if *v == nil { - sv = &types.JobManifestSpec{} + sv = &types.JobTimers{} } else { sv = *v } @@ -12115,13 +15946,7 @@ func awsRestxml_deserializeDocumentJobManifestSpec(v **types.JobManifestSpec, de originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Fields", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentJobManifestFieldList(&sv.Fields, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("Format", t.Name.Local): + case strings.EqualFold("ElapsedTimeInActiveSeconds", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12131,7 +15956,11 @@ func awsRestxml_deserializeDocumentJobManifestSpec(v **types.JobManifestSpec, de } { xtv := string(val) - sv.Format = types.JobManifestFormat(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.ElapsedTimeInActiveSeconds = ptr.Int64(i64) } default: @@ -12148,13 +15977,13 @@ func awsRestxml_deserializeDocumentJobManifestSpec(v **types.JobManifestSpec, de return nil } -func awsRestxml_deserializeDocumentJobOperation(v **types.JobOperation, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentKeyNameConstraint(v **types.KeyNameConstraint, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.JobOperation + var sv *types.KeyNameConstraint if *v == nil { - sv = &types.JobOperation{} + sv = &types.KeyNameConstraint{} } else { sv = *v } @@ -12170,58 +15999,71 @@ func awsRestxml_deserializeDocumentJobOperation(v **types.JobOperation, decoder originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("LambdaInvoke", t.Name.Local): + case strings.EqualFold("MatchAnyPrefix", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentLambdaInvokeOperation(&sv.LambdaInvoke, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentNonEmptyMaxLength1024StringList(&sv.MatchAnyPrefix, nodeDecoder); err != nil { return err } - case strings.EqualFold("S3DeleteObjectTagging", t.Name.Local): + case strings.EqualFold("MatchAnySubstring", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentS3DeleteObjectTaggingOperation(&sv.S3DeleteObjectTagging, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentNonEmptyMaxLength1024StringList(&sv.MatchAnySubstring, nodeDecoder); err != nil { return err } - case strings.EqualFold("S3InitiateRestoreObject", t.Name.Local): + case strings.EqualFold("MatchAnySuffix", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentS3InitiateRestoreObjectOperation(&sv.S3InitiateRestoreObject, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentNonEmptyMaxLength1024StringList(&sv.MatchAnySuffix, nodeDecoder); err != nil { return err } - case strings.EqualFold("S3PutObjectAcl", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentS3SetObjectAclOperation(&sv.S3PutObjectAcl, nodeDecoder); err != nil { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { return err } - case strings.EqualFold("S3PutObjectCopy", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentS3CopyObjectOperation(&sv.S3PutObjectCopy, nodeDecoder); err != nil { - return err - } + } + decoder = originalDecoder + } + *v = sv + return nil +} - case strings.EqualFold("S3PutObjectLegalHold", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentS3SetObjectLegalHoldOperation(&sv.S3PutObjectLegalHold, nodeDecoder); err != nil { - return err - } +func awsRestxml_deserializeDocumentLambdaInvokeOperation(v **types.LambdaInvokeOperation, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.LambdaInvokeOperation + if *v == nil { + sv = &types.LambdaInvokeOperation{} + } else { + sv = *v + } - case strings.EqualFold("S3PutObjectRetention", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentS3SetObjectRetentionOperation(&sv.S3PutObjectRetention, nodeDecoder); err != nil { + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("FunctionArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - - case strings.EqualFold("S3PutObjectTagging", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentS3SetObjectTaggingOperation(&sv.S3PutObjectTagging, nodeDecoder); err != nil { - return err + if val == nil { + break } - - case strings.EqualFold("S3ReplicateObject", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentS3ReplicateObjectOperation(&sv.S3ReplicateObject, nodeDecoder); err != nil { - return err + { + xtv := string(val) + sv.FunctionArn = ptr.String(xtv) } default: @@ -12238,13 +16080,13 @@ func awsRestxml_deserializeDocumentJobOperation(v **types.JobOperation, decoder return nil } -func awsRestxml_deserializeDocumentJobProgressSummary(v **types.JobProgressSummary, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentLifecycleExpiration(v **types.LifecycleExpiration, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.JobProgressSummary + var sv *types.LifecycleExpiration if *v == nil { - sv = &types.JobProgressSummary{} + sv = &types.LifecycleExpiration{} } else { sv = *v } @@ -12260,7 +16102,7 @@ func awsRestxml_deserializeDocumentJobProgressSummary(v **types.JobProgressSumma originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("NumberOfTasksFailed", t.Name.Local): + case strings.EqualFold("Date", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12270,14 +16112,14 @@ func awsRestxml_deserializeDocumentJobProgressSummary(v **types.JobProgressSumma } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) + t, err := smithytime.ParseDateTime(xtv) if err != nil { return err } - sv.NumberOfTasksFailed = ptr.Int64(i64) + sv.Date = ptr.Time(t) } - case strings.EqualFold("NumberOfTasksSucceeded", t.Name.Local): + case strings.EqualFold("Days", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12291,16 +16133,10 @@ func awsRestxml_deserializeDocumentJobProgressSummary(v **types.JobProgressSumma if err != nil { return err } - sv.NumberOfTasksSucceeded = ptr.Int64(i64) - } - - case strings.EqualFold("Timers", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentJobTimers(&sv.Timers, nodeDecoder); err != nil { - return err + sv.Days = int32(i64) } - case strings.EqualFold("TotalNumberOfTasks", t.Name.Local): + case strings.EqualFold("ExpiredObjectDeleteMarker", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12309,12 +16145,11 @@ func awsRestxml_deserializeDocumentJobProgressSummary(v **types.JobProgressSumma break } { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) + xtv, err := strconv.ParseBool(string(val)) if err != nil { - return err + return fmt.Errorf("expected ExpiredObjectDeleteMarker to be of type *bool, got %T instead", val) } - sv.TotalNumberOfTasks = ptr.Int64(i64) + sv.ExpiredObjectDeleteMarker = xtv } default: @@ -12331,13 +16166,13 @@ func awsRestxml_deserializeDocumentJobProgressSummary(v **types.JobProgressSumma return nil } -func awsRestxml_deserializeDocumentJobReport(v **types.JobReport, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentLifecycleRule(v **types.LifecycleRule, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.JobReport + var sv *types.LifecycleRule if *v == nil { - sv = &types.JobReport{} + sv = &types.LifecycleRule{} } else { sv = *v } @@ -12353,36 +16188,25 @@ func awsRestxml_deserializeDocumentJobReport(v **types.JobReport, decoder smithy originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Bucket", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("AbortIncompleteMultipartUpload", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentAbortIncompleteMultipartUpload(&sv.AbortIncompleteMultipartUpload, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.Bucket = ptr.String(xtv) - } - case strings.EqualFold("Enabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("Expiration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentLifecycleExpiration(&sv.Expiration, nodeDecoder); 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.Enabled = xtv + + case strings.EqualFold("Filter", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentLifecycleRuleFilter(&sv.Filter, nodeDecoder); err != nil { + return err } - case strings.EqualFold("Format", t.Name.Local): + case strings.EqualFold("ID", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12392,23 +16216,22 @@ func awsRestxml_deserializeDocumentJobReport(v **types.JobReport, decoder smithy } { xtv := string(val) - sv.Format = types.JobReportFormat(xtv) + sv.ID = ptr.String(xtv) } - case strings.EqualFold("Prefix", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("NoncurrentVersionExpiration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentNoncurrentVersionExpiration(&sv.NoncurrentVersionExpiration, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.Prefix = ptr.String(xtv) + + case strings.EqualFold("NoncurrentVersionTransitions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentNoncurrentVersionTransitionList(&sv.NoncurrentVersionTransitions, nodeDecoder); err != nil { + return err } - case strings.EqualFold("ReportScope", t.Name.Local): + case strings.EqualFold("Status", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12418,7 +16241,13 @@ func awsRestxml_deserializeDocumentJobReport(v **types.JobReport, decoder smithy } { xtv := string(val) - sv.ReportScope = types.JobReportScope(xtv) + sv.Status = types.ExpirationStatus(xtv) + } + + case strings.EqualFold("Transitions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentTransitionList(&sv.Transitions, nodeDecoder); err != nil { + return err } default: @@ -12435,13 +16264,13 @@ func awsRestxml_deserializeDocumentJobReport(v **types.JobReport, decoder smithy return nil } -func awsRestxml_deserializeDocumentJobStatusException(v **types.JobStatusException, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentLifecycleRuleAndOperator(v **types.LifecycleRuleAndOperator, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.JobStatusException + var sv *types.LifecycleRuleAndOperator if *v == nil { - sv = &types.JobStatusException{} + sv = &types.LifecycleRuleAndOperator{} } else { sv = *v } @@ -12457,7 +16286,7 @@ func awsRestxml_deserializeDocumentJobStatusException(v **types.JobStatusExcepti originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): + case strings.EqualFold("ObjectSizeGreaterThan", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12467,7 +16296,47 @@ func awsRestxml_deserializeDocumentJobStatusException(v **types.JobStatusExcepti } { xtv := string(val) - sv.Message = ptr.String(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.ObjectSizeGreaterThan = ptr.Int64(i64) + } + + case strings.EqualFold("ObjectSizeLessThan", 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.ObjectSizeLessThan = ptr.Int64(i64) + } + + case strings.EqualFold("Prefix", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Prefix = ptr.String(xtv) + } + + case strings.EqualFold("Tags", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentS3TagSet(&sv.Tags, nodeDecoder); err != nil { + return err } default: @@ -12484,13 +16353,13 @@ func awsRestxml_deserializeDocumentJobStatusException(v **types.JobStatusExcepti return nil } -func awsRestxml_deserializeDocumentJobTimers(v **types.JobTimers, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentLifecycleRuleFilter(v **types.LifecycleRuleFilter, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.JobTimers + var sv *types.LifecycleRuleFilter if *v == nil { - sv = &types.JobTimers{} + sv = &types.LifecycleRuleFilter{} } else { sv = *v } @@ -12506,7 +16375,13 @@ func awsRestxml_deserializeDocumentJobTimers(v **types.JobTimers, decoder smithy originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ElapsedTimeInActiveSeconds", t.Name.Local): + case strings.EqualFold("And", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentLifecycleRuleAndOperator(&sv.And, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ObjectSizeGreaterThan", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12520,7 +16395,43 @@ func awsRestxml_deserializeDocumentJobTimers(v **types.JobTimers, decoder smithy if err != nil { return err } - sv.ElapsedTimeInActiveSeconds = ptr.Int64(i64) + sv.ObjectSizeGreaterThan = ptr.Int64(i64) + } + + case strings.EqualFold("ObjectSizeLessThan", 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.ObjectSizeLessThan = ptr.Int64(i64) + } + + case strings.EqualFold("Prefix", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Prefix = ptr.String(xtv) + } + + case strings.EqualFold("Tag", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentS3Tag(&sv.Tag, nodeDecoder); err != nil { + return err } default: @@ -12537,17 +16448,18 @@ func awsRestxml_deserializeDocumentJobTimers(v **types.JobTimers, decoder smithy return nil } -func awsRestxml_deserializeDocumentKeyNameConstraint(v **types.KeyNameConstraint, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentLifecycleRules(v *[]types.LifecycleRule, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.KeyNameConstraint + var sv []types.LifecycleRule if *v == nil { - sv = &types.KeyNameConstraint{} + sv = make([]types.LifecycleRule, 0) } else { sv = *v } + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -12556,29 +16468,18 @@ func awsRestxml_deserializeDocumentKeyNameConstraint(v **types.KeyNameConstraint if done { break } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("MatchAnyPrefix", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentNonEmptyMaxLength1024StringList(&sv.MatchAnyPrefix, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("MatchAnySubstring", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentNonEmptyMaxLength1024StringList(&sv.MatchAnySubstring, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("MatchAnySuffix", t.Name.Local): + case strings.EqualFold("Rule", t.Name.Local): + var col types.LifecycleRule nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentNonEmptyMaxLength1024StringList(&sv.MatchAnySuffix, nodeDecoder); err != nil { + destAddr := &col + if err := awsRestxml_deserializeDocumentLifecycleRule(&destAddr, nodeDecoder); err != nil { return err } + col = *destAddr + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -12591,62 +16492,37 @@ func awsRestxml_deserializeDocumentKeyNameConstraint(v **types.KeyNameConstraint return nil } -func awsRestxml_deserializeDocumentLambdaInvokeOperation(v **types.LambdaInvokeOperation, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LambdaInvokeOperation +func awsRestxml_deserializeDocumentLifecycleRulesUnwrapped(v *[]types.LifecycleRule, decoder smithyxml.NodeDecoder) error { + var sv []types.LifecycleRule if *v == nil { - sv = &types.LambdaInvokeOperation{} + sv = make([]types.LifecycleRule, 0) } else { sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("FunctionArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FunctionArn = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - + switch { + default: + var mv types.LifecycleRule + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsRestxml_deserializeDocumentLifecycleRule(&destAddr, nodeDecoder); err != nil { + return err } - decoder = originalDecoder + mv = *destAddr + sv = append(sv, mv) } *v = sv return nil } - -func awsRestxml_deserializeDocumentLifecycleExpiration(v **types.LifecycleExpiration, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentListAccessGrantEntry(v **types.ListAccessGrantEntry, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.LifecycleExpiration + var sv *types.ListAccessGrantEntry if *v == nil { - sv = &types.LifecycleExpiration{} + sv = &types.ListAccessGrantEntry{} } else { sv = *v } @@ -12662,7 +16538,7 @@ func awsRestxml_deserializeDocumentLifecycleExpiration(v **types.LifecycleExpira originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Date", t.Name.Local): + case strings.EqualFold("AccessGrantArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12672,14 +16548,10 @@ func awsRestxml_deserializeDocumentLifecycleExpiration(v **types.LifecycleExpira } { xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.Date = ptr.Time(t) + sv.AccessGrantArn = ptr.String(xtv) } - case strings.EqualFold("Days", t.Name.Local): + case strings.EqualFold("AccessGrantId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12689,14 +16561,16 @@ func awsRestxml_deserializeDocumentLifecycleExpiration(v **types.LifecycleExpira } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Days = int32(i64) + sv.AccessGrantId = ptr.String(xtv) } - case strings.EqualFold("ExpiredObjectDeleteMarker", t.Name.Local): + case strings.EqualFold("AccessGrantsLocationConfiguration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentAccessGrantsLocationConfiguration(&sv.AccessGrantsLocationConfiguration, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("AccessGrantsLocationId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12705,68 +16579,24 @@ func awsRestxml_deserializeDocumentLifecycleExpiration(v **types.LifecycleExpira break } { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected ExpiredObjectDeleteMarker to be of type *bool, got %T instead", val) - } - sv.ExpiredObjectDeleteMarker = xtv + xtv := string(val) + sv.AccessGrantsLocationId = ptr.String(xtv) } - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() + case strings.EqualFold("ApplicationArn", t.Name.Local): + val, err := decoder.Value() if err != nil { return err } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsRestxml_deserializeDocumentLifecycleRule(v **types.LifecycleRule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.LifecycleRule - if *v == nil { - sv = &types.LifecycleRule{} - } 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("AbortIncompleteMultipartUpload", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentAbortIncompleteMultipartUpload(&sv.AbortIncompleteMultipartUpload, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("Expiration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentLifecycleExpiration(&sv.Expiration, nodeDecoder); err != nil { - return err + if val == nil { + break } - - case strings.EqualFold("Filter", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentLifecycleRuleFilter(&sv.Filter, nodeDecoder); err != nil { - return err + { + xtv := string(val) + sv.ApplicationArn = ptr.String(xtv) } - case strings.EqualFold("ID", t.Name.Local): + case strings.EqualFold("CreatedAt", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12776,22 +16606,20 @@ func awsRestxml_deserializeDocumentLifecycleRule(v **types.LifecycleRule, decode } { xtv := string(val) - sv.ID = ptr.String(xtv) - } - - case strings.EqualFold("NoncurrentVersionExpiration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentNoncurrentVersionExpiration(&sv.NoncurrentVersionExpiration, nodeDecoder); err != nil { - return err + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) } - case strings.EqualFold("NoncurrentVersionTransitions", t.Name.Local): + case strings.EqualFold("Grantee", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentNoncurrentVersionTransitionList(&sv.NoncurrentVersionTransitions, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentGrantee(&sv.Grantee, nodeDecoder); err != nil { return err } - case strings.EqualFold("Status", t.Name.Local): + case strings.EqualFold("GrantScope", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12801,14 +16629,21 @@ func awsRestxml_deserializeDocumentLifecycleRule(v **types.LifecycleRule, decode } { xtv := string(val) - sv.Status = types.ExpirationStatus(xtv) + sv.GrantScope = ptr.String(xtv) } - case strings.EqualFold("Transitions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentTransitionList(&sv.Transitions, nodeDecoder); err != nil { + case strings.EqualFold("Permission", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.Permission = types.Permission(xtv) + } default: // Do nothing and ignore the unexpected tag element @@ -12824,13 +16659,13 @@ func awsRestxml_deserializeDocumentLifecycleRule(v **types.LifecycleRule, decode return nil } -func awsRestxml_deserializeDocumentLifecycleRuleAndOperator(v **types.LifecycleRuleAndOperator, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentListAccessGrantsInstanceEntry(v **types.ListAccessGrantsInstanceEntry, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.LifecycleRuleAndOperator + var sv *types.ListAccessGrantsInstanceEntry if *v == nil { - sv = &types.LifecycleRuleAndOperator{} + sv = &types.ListAccessGrantsInstanceEntry{} } else { sv = *v } @@ -12846,7 +16681,7 @@ func awsRestxml_deserializeDocumentLifecycleRuleAndOperator(v **types.LifecycleR originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ObjectSizeGreaterThan", t.Name.Local): + case strings.EqualFold("AccessGrantsInstanceArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12856,14 +16691,10 @@ func awsRestxml_deserializeDocumentLifecycleRuleAndOperator(v **types.LifecycleR } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ObjectSizeGreaterThan = ptr.Int64(i64) + sv.AccessGrantsInstanceArn = ptr.String(xtv) } - case strings.EqualFold("ObjectSizeLessThan", t.Name.Local): + case strings.EqualFold("AccessGrantsInstanceId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12873,14 +16704,10 @@ func awsRestxml_deserializeDocumentLifecycleRuleAndOperator(v **types.LifecycleR } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ObjectSizeLessThan = ptr.Int64(i64) + sv.AccessGrantsInstanceId = ptr.String(xtv) } - case strings.EqualFold("Prefix", t.Name.Local): + case strings.EqualFold("CreatedAt", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12890,14 +16717,25 @@ func awsRestxml_deserializeDocumentLifecycleRuleAndOperator(v **types.LifecycleR } { xtv := string(val) - sv.Prefix = ptr.String(xtv) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) } - case strings.EqualFold("Tags", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentS3TagSet(&sv.Tags, nodeDecoder); err != nil { + case strings.EqualFold("IdentityCenterArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.IdentityCenterArn = ptr.String(xtv) + } default: // Do nothing and ignore the unexpected tag element @@ -12913,13 +16751,13 @@ func awsRestxml_deserializeDocumentLifecycleRuleAndOperator(v **types.LifecycleR return nil } -func awsRestxml_deserializeDocumentLifecycleRuleFilter(v **types.LifecycleRuleFilter, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentListAccessGrantsLocationsEntry(v **types.ListAccessGrantsLocationsEntry, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.LifecycleRuleFilter + var sv *types.ListAccessGrantsLocationsEntry if *v == nil { - sv = &types.LifecycleRuleFilter{} + sv = &types.ListAccessGrantsLocationsEntry{} } else { sv = *v } @@ -12935,13 +16773,20 @@ func awsRestxml_deserializeDocumentLifecycleRuleFilter(v **types.LifecycleRuleFi originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("And", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentLifecycleRuleAndOperator(&sv.And, nodeDecoder); err != nil { + case strings.EqualFold("AccessGrantsLocationArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessGrantsLocationArn = ptr.String(xtv) + } - case strings.EqualFold("ObjectSizeGreaterThan", t.Name.Local): + case strings.EqualFold("AccessGrantsLocationId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12951,14 +16796,10 @@ func awsRestxml_deserializeDocumentLifecycleRuleFilter(v **types.LifecycleRuleFi } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ObjectSizeGreaterThan = ptr.Int64(i64) + sv.AccessGrantsLocationId = ptr.String(xtv) } - case strings.EqualFold("ObjectSizeLessThan", t.Name.Local): + case strings.EqualFold("CreatedAt", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12968,14 +16809,14 @@ func awsRestxml_deserializeDocumentLifecycleRuleFilter(v **types.LifecycleRuleFi } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) + t, err := smithytime.ParseDateTime(xtv) if err != nil { return err } - sv.ObjectSizeLessThan = ptr.Int64(i64) + sv.CreatedAt = ptr.Time(t) } - case strings.EqualFold("Prefix", t.Name.Local): + case strings.EqualFold("IAMRoleArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12985,61 +16826,24 @@ func awsRestxml_deserializeDocumentLifecycleRuleFilter(v **types.LifecycleRuleFi } { xtv := string(val) - sv.Prefix = ptr.String(xtv) - } - - case strings.EqualFold("Tag", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentS3Tag(&sv.Tag, nodeDecoder); err != nil { - return err + sv.IAMRoleArn = ptr.String(xtv) } - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() + case strings.EqualFold("LocationScope", t.Name.Local): + val, err := decoder.Value() if err != nil { return err } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsRestxml_deserializeDocumentLifecycleRules(v *[]types.LifecycleRule, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.LifecycleRule - if *v == nil { - sv = make([]types.LifecycleRule, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("Rule", t.Name.Local): - var col types.LifecycleRule - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsRestxml_deserializeDocumentLifecycleRule(&destAddr, nodeDecoder); err != nil { - return err + if val == nil { + break + } + { + xtv := string(val) + sv.LocationScope = ptr.String(xtv) } - col = *destAddr - sv = append(sv, col) default: + // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -13052,30 +16856,6 @@ func awsRestxml_deserializeDocumentLifecycleRules(v *[]types.LifecycleRule, deco return nil } -func awsRestxml_deserializeDocumentLifecycleRulesUnwrapped(v *[]types.LifecycleRule, decoder smithyxml.NodeDecoder) error { - var sv []types.LifecycleRule - if *v == nil { - sv = make([]types.LifecycleRule, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.LifecycleRule - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsRestxml_deserializeDocumentLifecycleRule(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} func awsRestxml_deserializeDocumentListStorageLensConfigurationEntry(v **types.ListStorageLensConfigurationEntry, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/s3control/generated.json b/service/s3control/generated.json index 8a26c182fc4..c46c24893f8 100644 --- a/service/s3control/generated.json +++ b/service/s3control/generated.json @@ -10,12 +10,20 @@ "files": [ "api_client.go", "api_client_test.go", + "api_op_AssociateAccessGrantsIdentityCenter.go", + "api_op_CreateAccessGrant.go", + "api_op_CreateAccessGrantsInstance.go", + "api_op_CreateAccessGrantsLocation.go", "api_op_CreateAccessPoint.go", "api_op_CreateAccessPointForObjectLambda.go", "api_op_CreateBucket.go", "api_op_CreateJob.go", "api_op_CreateMultiRegionAccessPoint.go", "api_op_CreateStorageLensGroup.go", + "api_op_DeleteAccessGrant.go", + "api_op_DeleteAccessGrantsInstance.go", + "api_op_DeleteAccessGrantsInstanceResourcePolicy.go", + "api_op_DeleteAccessGrantsLocation.go", "api_op_DeleteAccessPoint.go", "api_op_DeleteAccessPointForObjectLambda.go", "api_op_DeleteAccessPointPolicy.go", @@ -33,6 +41,12 @@ "api_op_DeleteStorageLensGroup.go", "api_op_DescribeJob.go", "api_op_DescribeMultiRegionAccessPointOperation.go", + "api_op_DissociateAccessGrantsIdentityCenter.go", + "api_op_GetAccessGrant.go", + "api_op_GetAccessGrantsInstance.go", + "api_op_GetAccessGrantsInstanceForPrefix.go", + "api_op_GetAccessGrantsInstanceResourcePolicy.go", + "api_op_GetAccessGrantsLocation.go", "api_op_GetAccessPoint.go", "api_op_GetAccessPointConfigurationForObjectLambda.go", "api_op_GetAccessPointForObjectLambda.go", @@ -46,6 +60,7 @@ "api_op_GetBucketReplication.go", "api_op_GetBucketTagging.go", "api_op_GetBucketVersioning.go", + "api_op_GetDataAccess.go", "api_op_GetJobTagging.go", "api_op_GetMultiRegionAccessPoint.go", "api_op_GetMultiRegionAccessPointPolicy.go", @@ -55,6 +70,9 @@ "api_op_GetStorageLensConfiguration.go", "api_op_GetStorageLensConfigurationTagging.go", "api_op_GetStorageLensGroup.go", + "api_op_ListAccessGrants.go", + "api_op_ListAccessGrantsInstances.go", + "api_op_ListAccessGrantsLocations.go", "api_op_ListAccessPoints.go", "api_op_ListAccessPointsForObjectLambda.go", "api_op_ListJobs.go", @@ -63,6 +81,7 @@ "api_op_ListStorageLensConfigurations.go", "api_op_ListStorageLensGroups.go", "api_op_ListTagsForResource.go", + "api_op_PutAccessGrantsInstanceResourcePolicy.go", "api_op_PutAccessPointConfigurationForObjectLambda.go", "api_op_PutAccessPointPolicy.go", "api_op_PutAccessPointPolicyForObjectLambda.go", @@ -79,6 +98,7 @@ "api_op_SubmitMultiRegionAccessPointRoutes.go", "api_op_TagResource.go", "api_op_UntagResource.go", + "api_op_UpdateAccessGrantsLocation.go", "api_op_UpdateJobPriority.go", "api_op_UpdateJobStatus.go", "api_op_UpdateStorageLensGroup.go", diff --git a/service/s3control/serializers.go b/service/s3control/serializers.go index 2d3a938c733..7dc5eeb9b38 100644 --- a/service/s3control/serializers.go +++ b/service/s3control/serializers.go @@ -16,14 +16,14 @@ import ( "math" ) -type awsRestxml_serializeOpCreateAccessPoint struct { +type awsRestxml_serializeOpAssociateAccessGrantsIdentityCenter struct { } -func (*awsRestxml_serializeOpCreateAccessPoint) ID() string { +func (*awsRestxml_serializeOpAssociateAccessGrantsIdentityCenter) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpCreateAccessPoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpAssociateAccessGrantsIdentityCenter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -31,16 +31,16 @@ func (m *awsRestxml_serializeOpCreateAccessPoint) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateAccessPointInput) + input, ok := in.Parameters.(*AssociateAccessGrantsIdentityCenterInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance/identitycenter") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -53,7 +53,7 @@ func (m *awsRestxml_serializeOpCreateAccessPoint) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsCreateAccessPointInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsAssociateAccessGrantsIdentityCenterInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -63,12 +63,12 @@ func (m *awsRestxml_serializeOpCreateAccessPoint) HandleSerialize(ctx context.Co rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "CreateAccessPointRequest", + Local: "AssociateAccessGrantsIdentityCenterRequest", }, Attr: rootAttr, } root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/")) - if err := awsRestxml_serializeOpDocumentCreateAccessPointInput(input, xmlEncoder.RootElement(root)); err != nil { + if err := awsRestxml_serializeOpDocumentAssociateAccessGrantsIdentityCenterInput(input, xmlEncoder.RootElement(root)); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(xmlEncoder.Bytes())); err != nil { @@ -82,7 +82,7 @@ func (m *awsRestxml_serializeOpCreateAccessPoint) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsCreateAccessPointInput(v *CreateAccessPointInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsAssociateAccessGrantsIdentityCenterInput(v *AssociateAccessGrantsIdentityCenterInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -92,79 +92,200 @@ func awsRestxml_serializeOpHttpBindingsCreateAccessPointInput(v *CreateAccessPoi encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} - } - if v.Name != nil { - if err := encoder.SetURI("Name").String(*v.Name); err != nil { - return err + return nil +} + +func awsRestxml_serializeOpDocumentAssociateAccessGrantsIdentityCenterInput(v *AssociateAccessGrantsIdentityCenterInput, value smithyxml.Value) error { + defer value.Close() + if v.IdentityCenterArn != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "IdentityCenterArn", + }, + Attr: rootAttr, } + el := value.MemberElement(root) + el.String(*v.IdentityCenterArn) + } + return nil +} + +type awsRestxml_serializeOpCreateAccessGrant struct { +} + +func (*awsRestxml_serializeOpCreateAccessGrant) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpCreateAccessGrant) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateAccessGrantInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance/grant") + 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 := awsRestxml_serializeOpHttpBindingsCreateAccessGrantInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/xml") + + xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "CreateAccessGrantRequest", + }, + Attr: rootAttr, + } + root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/")) + if err := awsRestxml_serializeOpDocumentCreateAccessGrantInput(input, xmlEncoder.RootElement(root)); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsCreateAccessGrantInput(v *CreateAccessGrantInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) } return nil } -func awsRestxml_serializeOpDocumentCreateAccessPointInput(v *CreateAccessPointInput, value smithyxml.Value) error { +func awsRestxml_serializeOpDocumentCreateAccessGrantInput(v *CreateAccessGrantInput, value smithyxml.Value) error { defer value.Close() - if v.Bucket != nil { + if v.AccessGrantsLocationConfiguration != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "Bucket", + Local: "AccessGrantsLocationConfiguration", }, Attr: rootAttr, } el := value.MemberElement(root) - el.String(*v.Bucket) + if err := awsRestxml_serializeDocumentAccessGrantsLocationConfiguration(v.AccessGrantsLocationConfiguration, el); err != nil { + return err + } } - if v.BucketAccountId != nil { + if v.AccessGrantsLocationId != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "BucketAccountId", + Local: "AccessGrantsLocationId", }, Attr: rootAttr, } el := value.MemberElement(root) - el.String(*v.BucketAccountId) + el.String(*v.AccessGrantsLocationId) } - if v.PublicAccessBlockConfiguration != nil { + if v.ApplicationArn != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "PublicAccessBlockConfiguration", + Local: "ApplicationArn", }, Attr: rootAttr, } el := value.MemberElement(root) - if err := awsRestxml_serializeDocumentPublicAccessBlockConfiguration(v.PublicAccessBlockConfiguration, el); err != nil { + el.String(*v.ApplicationArn) + } + if v.Grantee != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Grantee", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentGrantee(v.Grantee, el); err != nil { return err } } - if v.VpcConfiguration != nil { + if len(v.Permission) > 0 { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "VpcConfiguration", + Local: "Permission", }, Attr: rootAttr, } el := value.MemberElement(root) - if err := awsRestxml_serializeDocumentVpcConfiguration(v.VpcConfiguration, el); err != nil { + el.String(string(v.Permission)) + } + if len(v.S3PrefixType) > 0 { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "S3PrefixType", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(string(v.S3PrefixType)) + } + if v.Tags != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Tags", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentTagList(v.Tags, el); err != nil { return err } } return nil } -type awsRestxml_serializeOpCreateAccessPointForObjectLambda struct { +type awsRestxml_serializeOpCreateAccessGrantsInstance struct { } -func (*awsRestxml_serializeOpCreateAccessPointForObjectLambda) ID() string { +func (*awsRestxml_serializeOpCreateAccessGrantsInstance) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpCreateAccessPointForObjectLambda) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpCreateAccessGrantsInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -172,16 +293,16 @@ func (m *awsRestxml_serializeOpCreateAccessPointForObjectLambda) HandleSerialize return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateAccessPointForObjectLambdaInput) + input, ok := in.Parameters.(*CreateAccessGrantsInstanceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -194,7 +315,7 @@ func (m *awsRestxml_serializeOpCreateAccessPointForObjectLambda) HandleSerialize return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsCreateAccessPointForObjectLambdaInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsCreateAccessGrantsInstanceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -204,12 +325,12 @@ func (m *awsRestxml_serializeOpCreateAccessPointForObjectLambda) HandleSerialize rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "CreateAccessPointForObjectLambdaRequest", + Local: "CreateAccessGrantsInstanceRequest", }, Attr: rootAttr, } root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/")) - if err := awsRestxml_serializeOpDocumentCreateAccessPointForObjectLambdaInput(input, xmlEncoder.RootElement(root)); err != nil { + if err := awsRestxml_serializeOpDocumentCreateAccessGrantsInstanceInput(input, xmlEncoder.RootElement(root)); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(xmlEncoder.Bytes())); err != nil { @@ -223,7 +344,7 @@ func (m *awsRestxml_serializeOpCreateAccessPointForObjectLambda) HandleSerialize return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsCreateAccessPointForObjectLambdaInput(v *CreateAccessPointForObjectLambdaInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsCreateAccessGrantsInstanceInput(v *CreateAccessGrantsInstanceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -233,44 +354,46 @@ func awsRestxml_serializeOpHttpBindingsCreateAccessPointForObjectLambdaInput(v * encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} - } - if v.Name != nil { - if err := encoder.SetURI("Name").String(*v.Name); err != nil { - return err - } - } - return nil } -func awsRestxml_serializeOpDocumentCreateAccessPointForObjectLambdaInput(v *CreateAccessPointForObjectLambdaInput, value smithyxml.Value) error { +func awsRestxml_serializeOpDocumentCreateAccessGrantsInstanceInput(v *CreateAccessGrantsInstanceInput, value smithyxml.Value) error { defer value.Close() - if v.Configuration != nil { + if v.IdentityCenterArn != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "Configuration", + Local: "IdentityCenterArn", }, Attr: rootAttr, } el := value.MemberElement(root) - if err := awsRestxml_serializeDocumentObjectLambdaConfiguration(v.Configuration, el); err != nil { + el.String(*v.IdentityCenterArn) + } + if v.Tags != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Tags", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentTagList(v.Tags, el); err != nil { return err } } return nil } -type awsRestxml_serializeOpCreateBucket struct { +type awsRestxml_serializeOpCreateAccessGrantsLocation struct { } -func (*awsRestxml_serializeOpCreateBucket) ID() string { +func (*awsRestxml_serializeOpCreateAccessGrantsLocation) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpCreateBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpCreateAccessGrantsLocation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -278,16 +401,16 @@ func (m *awsRestxml_serializeOpCreateBucket) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateBucketInput) + input, ok := in.Parameters.(*CreateAccessGrantsLocationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance/location") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -300,32 +423,26 @@ func (m *awsRestxml_serializeOpCreateBucket) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsCreateBucketInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsCreateAccessGrantsLocationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if input.CreateBucketConfiguration != nil { - if !restEncoder.HasHeader("Content-Type") { - ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) - restEncoder.SetHeader("Content-Type").String("application/xml") - } + restEncoder.SetHeader("Content-Type").String("application/xml") - xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) - payloadRootAttr := []smithyxml.Attr{} - payloadRoot := smithyxml.StartElement{ - Name: smithyxml.Name{ - Local: "CreateBucketConfiguration", - }, - Attr: payloadRootAttr, - } - payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/")) - if err := awsRestxml_serializeDocumentCreateBucketConfiguration(input.CreateBucketConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - payload := bytes.NewReader(xmlEncoder.Bytes()) - if request, err = request.SetStream(payload); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } + xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "CreateAccessGrantsLocationRequest", + }, + Attr: rootAttr, + } + root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/")) + if err := awsRestxml_serializeOpDocumentCreateAccessGrantsLocationInput(input, xmlEncoder.RootElement(root)); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + if request, err = request.SetStream(bytes.NewReader(xmlEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { @@ -335,71 +452,67 @@ func (m *awsRestxml_serializeOpCreateBucket) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsCreateBucketInput(v *CreateBucketInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsCreateAccessGrantsLocationInput(v *CreateAccessGrantsLocationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if len(v.ACL) > 0 { - locationName := "X-Amz-Acl" - encoder.SetHeader(locationName).String(string(v.ACL)) + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Bucket == nil || len(*v.Bucket) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} - } - if v.Bucket != nil { - if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { - return err + return nil +} + +func awsRestxml_serializeOpDocumentCreateAccessGrantsLocationInput(v *CreateAccessGrantsLocationInput, value smithyxml.Value) error { + defer value.Close() + if v.IAMRoleArn != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "IAMRoleArn", + }, + Attr: rootAttr, } + el := value.MemberElement(root) + el.String(*v.IAMRoleArn) } - - if v.GrantFullControl != nil && len(*v.GrantFullControl) > 0 { - locationName := "X-Amz-Grant-Full-Control" - encoder.SetHeader(locationName).String(*v.GrantFullControl) + if v.LocationScope != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "LocationScope", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.LocationScope) } - - if v.GrantRead != nil && len(*v.GrantRead) > 0 { - locationName := "X-Amz-Grant-Read" - encoder.SetHeader(locationName).String(*v.GrantRead) - } - - if v.GrantReadACP != nil && len(*v.GrantReadACP) > 0 { - locationName := "X-Amz-Grant-Read-Acp" - encoder.SetHeader(locationName).String(*v.GrantReadACP) - } - - if v.GrantWrite != nil && len(*v.GrantWrite) > 0 { - locationName := "X-Amz-Grant-Write" - encoder.SetHeader(locationName).String(*v.GrantWrite) - } - - if v.GrantWriteACP != nil && len(*v.GrantWriteACP) > 0 { - locationName := "X-Amz-Grant-Write-Acp" - encoder.SetHeader(locationName).String(*v.GrantWriteACP) - } - - if v.ObjectLockEnabledForBucket { - locationName := "X-Amz-Bucket-Object-Lock-Enabled" - encoder.SetHeader(locationName).Boolean(v.ObjectLockEnabledForBucket) - } - - if v.OutpostId != nil && len(*v.OutpostId) > 0 { - locationName := "X-Amz-Outpost-Id" - encoder.SetHeader(locationName).String(*v.OutpostId) + if v.Tags != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Tags", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentTagList(v.Tags, el); err != nil { + return err + } } - return nil } -type awsRestxml_serializeOpCreateJob struct { +type awsRestxml_serializeOpCreateAccessPoint struct { } -func (*awsRestxml_serializeOpCreateJob) ID() string { +func (*awsRestxml_serializeOpCreateAccessPoint) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpCreateJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpCreateAccessPoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -407,16 +520,16 @@ func (m *awsRestxml_serializeOpCreateJob) HandleSerialize(ctx context.Context, i return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateJobInput) + input, ok := in.Parameters.(*CreateAccessPointInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/jobs") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "PUT" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -429,7 +542,7 @@ func (m *awsRestxml_serializeOpCreateJob) HandleSerialize(ctx context.Context, i return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsCreateJobInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsCreateAccessPointInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -439,12 +552,12 @@ func (m *awsRestxml_serializeOpCreateJob) HandleSerialize(ctx context.Context, i rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "CreateJobRequest", + Local: "CreateAccessPointRequest", }, Attr: rootAttr, } root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/")) - if err := awsRestxml_serializeOpDocumentCreateJobInput(input, xmlEncoder.RootElement(root)); err != nil { + if err := awsRestxml_serializeOpDocumentCreateAccessPointInput(input, xmlEncoder.RootElement(root)); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(xmlEncoder.Bytes())); err != nil { @@ -458,7 +571,7 @@ func (m *awsRestxml_serializeOpCreateJob) HandleSerialize(ctx context.Context, i return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsCreateJobInput(v *CreateJobInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsCreateAccessPointInput(v *CreateAccessPointInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -468,142 +581,79 @@ func awsRestxml_serializeOpHttpBindingsCreateJobInput(v *CreateJobInput, encoder encoder.SetHeader(locationName).String(*v.AccountId) } - return nil -} - -func awsRestxml_serializeOpDocumentCreateJobInput(v *CreateJobInput, value smithyxml.Value) error { - defer value.Close() - if v.ClientRequestToken != nil { - rootAttr := []smithyxml.Attr{} - root := smithyxml.StartElement{ - Name: smithyxml.Name{ - Local: "ClientRequestToken", - }, - Attr: rootAttr, - } - el := value.MemberElement(root) - el.String(*v.ClientRequestToken) - } - if v.ConfirmationRequired != nil { - rootAttr := []smithyxml.Attr{} - root := smithyxml.StartElement{ - Name: smithyxml.Name{ - Local: "ConfirmationRequired", - }, - Attr: rootAttr, - } - el := value.MemberElement(root) - el.Boolean(*v.ConfirmationRequired) - } - if v.Description != nil { - rootAttr := []smithyxml.Attr{} - root := smithyxml.StartElement{ - Name: smithyxml.Name{ - Local: "Description", - }, - Attr: rootAttr, - } - el := value.MemberElement(root) - el.String(*v.Description) - } - if v.Manifest != nil { - rootAttr := []smithyxml.Attr{} - root := smithyxml.StartElement{ - Name: smithyxml.Name{ - Local: "Manifest", - }, - Attr: rootAttr, - } - el := value.MemberElement(root) - if err := awsRestxml_serializeDocumentJobManifest(v.Manifest, el); err != nil { - return err - } + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } - if v.ManifestGenerator != nil { - rootAttr := []smithyxml.Attr{} - root := smithyxml.StartElement{ - Name: smithyxml.Name{ - Local: "ManifestGenerator", - }, - Attr: rootAttr, - } - el := value.MemberElement(root) - if err := awsRestxml_serializeDocumentJobManifestGenerator(v.ManifestGenerator, el); err != nil { + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } - if v.Operation != nil { + + return nil +} + +func awsRestxml_serializeOpDocumentCreateAccessPointInput(v *CreateAccessPointInput, value smithyxml.Value) error { + defer value.Close() + if v.Bucket != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "Operation", + Local: "Bucket", }, Attr: rootAttr, } el := value.MemberElement(root) - if err := awsRestxml_serializeDocumentJobOperation(v.Operation, el); err != nil { - return err - } + el.String(*v.Bucket) } - if v.Priority != nil { + if v.BucketAccountId != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "Priority", + Local: "BucketAccountId", }, Attr: rootAttr, } el := value.MemberElement(root) - el.Integer(*v.Priority) + el.String(*v.BucketAccountId) } - if v.Report != nil { + if v.PublicAccessBlockConfiguration != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "Report", + Local: "PublicAccessBlockConfiguration", }, Attr: rootAttr, } el := value.MemberElement(root) - if err := awsRestxml_serializeDocumentJobReport(v.Report, el); err != nil { + if err := awsRestxml_serializeDocumentPublicAccessBlockConfiguration(v.PublicAccessBlockConfiguration, el); err != nil { return err } } - if v.RoleArn != nil { - rootAttr := []smithyxml.Attr{} - root := smithyxml.StartElement{ - Name: smithyxml.Name{ - Local: "RoleArn", - }, - Attr: rootAttr, - } - el := value.MemberElement(root) - el.String(*v.RoleArn) - } - if v.Tags != nil { + if v.VpcConfiguration != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "Tags", + Local: "VpcConfiguration", }, Attr: rootAttr, } el := value.MemberElement(root) - if err := awsRestxml_serializeDocumentS3TagSet(v.Tags, el); err != nil { + if err := awsRestxml_serializeDocumentVpcConfiguration(v.VpcConfiguration, el); err != nil { return err } } return nil } -type awsRestxml_serializeOpCreateMultiRegionAccessPoint struct { +type awsRestxml_serializeOpCreateAccessPointForObjectLambda struct { } -func (*awsRestxml_serializeOpCreateMultiRegionAccessPoint) ID() string { +func (*awsRestxml_serializeOpCreateAccessPointForObjectLambda) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpCreateMultiRegionAccessPoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpCreateAccessPointForObjectLambda) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -611,16 +661,16 @@ func (m *awsRestxml_serializeOpCreateMultiRegionAccessPoint) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateMultiRegionAccessPointInput) + input, ok := in.Parameters.(*CreateAccessPointForObjectLambdaInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/async-requests/mrap/create") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "PUT" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -633,7 +683,7 @@ func (m *awsRestxml_serializeOpCreateMultiRegionAccessPoint) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsCreateMultiRegionAccessPointInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsCreateAccessPointForObjectLambdaInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -643,12 +693,12 @@ func (m *awsRestxml_serializeOpCreateMultiRegionAccessPoint) HandleSerialize(ctx rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "CreateMultiRegionAccessPointRequest", + Local: "CreateAccessPointForObjectLambdaRequest", }, Attr: rootAttr, } root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/")) - if err := awsRestxml_serializeOpDocumentCreateMultiRegionAccessPointInput(input, xmlEncoder.RootElement(root)); err != nil { + if err := awsRestxml_serializeOpDocumentCreateAccessPointForObjectLambdaInput(input, xmlEncoder.RootElement(root)); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(xmlEncoder.Bytes())); err != nil { @@ -662,7 +712,7 @@ func (m *awsRestxml_serializeOpCreateMultiRegionAccessPoint) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsCreateMultiRegionAccessPointInput(v *CreateMultiRegionAccessPointInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsCreateAccessPointForObjectLambdaInput(v *CreateAccessPointForObjectLambdaInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -672,46 +722,44 @@ func awsRestxml_serializeOpHttpBindingsCreateMultiRegionAccessPointInput(v *Crea encoder.SetHeader(locationName).String(*v.AccountId) } + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + return nil } -func awsRestxml_serializeOpDocumentCreateMultiRegionAccessPointInput(v *CreateMultiRegionAccessPointInput, value smithyxml.Value) error { +func awsRestxml_serializeOpDocumentCreateAccessPointForObjectLambdaInput(v *CreateAccessPointForObjectLambdaInput, value smithyxml.Value) error { defer value.Close() - if v.ClientToken != nil { - rootAttr := []smithyxml.Attr{} - root := smithyxml.StartElement{ - Name: smithyxml.Name{ - Local: "ClientToken", - }, - Attr: rootAttr, - } - el := value.MemberElement(root) - el.String(*v.ClientToken) - } - if v.Details != nil { + if v.Configuration != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "Details", + Local: "Configuration", }, Attr: rootAttr, } el := value.MemberElement(root) - if err := awsRestxml_serializeDocumentCreateMultiRegionAccessPointInput(v.Details, el); err != nil { + if err := awsRestxml_serializeDocumentObjectLambdaConfiguration(v.Configuration, el); err != nil { return err } } return nil } -type awsRestxml_serializeOpCreateStorageLensGroup struct { +type awsRestxml_serializeOpCreateBucket struct { } -func (*awsRestxml_serializeOpCreateStorageLensGroup) ID() string { +func (*awsRestxml_serializeOpCreateBucket) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpCreateStorageLensGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpCreateBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -719,16 +767,16 @@ func (m *awsRestxml_serializeOpCreateStorageLensGroup) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateStorageLensGroupInput) + input, ok := in.Parameters.(*CreateBucketInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelensgroup") + opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "PUT" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -741,36 +789,1321 @@ func (m *awsRestxml_serializeOpCreateStorageLensGroup) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsCreateStorageLensGroupInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/xml") - - xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) - rootAttr := []smithyxml.Attr{} - root := smithyxml.StartElement{ - Name: smithyxml.Name{ - Local: "CreateStorageLensGroupRequest", - }, - Attr: rootAttr, - } - root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/")) - if err := awsRestxml_serializeOpDocumentCreateStorageLensGroupInput(input, xmlEncoder.RootElement(root)); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - if request, err = request.SetStream(bytes.NewReader(xmlEncoder.Bytes())); err != nil { + if err := awsRestxml_serializeOpHttpBindingsCreateBucketInput(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 + if input.CreateBucketConfiguration != nil { + if !restEncoder.HasHeader("Content-Type") { + ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) + restEncoder.SetHeader("Content-Type").String("application/xml") + } + + xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) + payloadRootAttr := []smithyxml.Attr{} + payloadRoot := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "CreateBucketConfiguration", + }, + Attr: payloadRootAttr, + } + payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/")) + if err := awsRestxml_serializeDocumentCreateBucketConfiguration(input.CreateBucketConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + payload := bytes.NewReader(xmlEncoder.Bytes()) + if request, err = request.SetStream(payload); 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 awsRestxml_serializeOpHttpBindingsCreateBucketInput(v *CreateBucketInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.ACL) > 0 { + locationName := "X-Amz-Acl" + encoder.SetHeader(locationName).String(string(v.ACL)) + } + + if v.Bucket == nil || len(*v.Bucket) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} + } + if v.Bucket != nil { + if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { + return err + } + } + + if v.GrantFullControl != nil && len(*v.GrantFullControl) > 0 { + locationName := "X-Amz-Grant-Full-Control" + encoder.SetHeader(locationName).String(*v.GrantFullControl) + } + + if v.GrantRead != nil && len(*v.GrantRead) > 0 { + locationName := "X-Amz-Grant-Read" + encoder.SetHeader(locationName).String(*v.GrantRead) + } + + if v.GrantReadACP != nil && len(*v.GrantReadACP) > 0 { + locationName := "X-Amz-Grant-Read-Acp" + encoder.SetHeader(locationName).String(*v.GrantReadACP) + } + + if v.GrantWrite != nil && len(*v.GrantWrite) > 0 { + locationName := "X-Amz-Grant-Write" + encoder.SetHeader(locationName).String(*v.GrantWrite) + } + + if v.GrantWriteACP != nil && len(*v.GrantWriteACP) > 0 { + locationName := "X-Amz-Grant-Write-Acp" + encoder.SetHeader(locationName).String(*v.GrantWriteACP) + } + + if v.ObjectLockEnabledForBucket { + locationName := "X-Amz-Bucket-Object-Lock-Enabled" + encoder.SetHeader(locationName).Boolean(v.ObjectLockEnabledForBucket) + } + + if v.OutpostId != nil && len(*v.OutpostId) > 0 { + locationName := "X-Amz-Outpost-Id" + encoder.SetHeader(locationName).String(*v.OutpostId) + } + + return nil +} + +type awsRestxml_serializeOpCreateJob struct { +} + +func (*awsRestxml_serializeOpCreateJob) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpCreateJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/jobs") + 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 := awsRestxml_serializeOpHttpBindingsCreateJobInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/xml") + + xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "CreateJobRequest", + }, + Attr: rootAttr, + } + root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/")) + if err := awsRestxml_serializeOpDocumentCreateJobInput(input, xmlEncoder.RootElement(root)); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsCreateJobInput(v *CreateJobInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + return nil +} + +func awsRestxml_serializeOpDocumentCreateJobInput(v *CreateJobInput, value smithyxml.Value) error { + defer value.Close() + if v.ClientRequestToken != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "ClientRequestToken", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.ClientRequestToken) + } + if v.ConfirmationRequired != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "ConfirmationRequired", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.Boolean(*v.ConfirmationRequired) + } + if v.Description != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Description", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.Description) + } + if v.Manifest != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Manifest", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentJobManifest(v.Manifest, el); err != nil { + return err + } + } + if v.ManifestGenerator != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "ManifestGenerator", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentJobManifestGenerator(v.ManifestGenerator, el); err != nil { + return err + } + } + if v.Operation != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Operation", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentJobOperation(v.Operation, el); err != nil { + return err + } + } + if v.Priority != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Priority", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.Integer(*v.Priority) + } + if v.Report != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Report", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentJobReport(v.Report, el); err != nil { + return err + } + } + if v.RoleArn != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "RoleArn", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.RoleArn) + } + if v.Tags != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Tags", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentS3TagSet(v.Tags, el); err != nil { + return err + } + } + return nil +} + +type awsRestxml_serializeOpCreateMultiRegionAccessPoint struct { +} + +func (*awsRestxml_serializeOpCreateMultiRegionAccessPoint) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpCreateMultiRegionAccessPoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateMultiRegionAccessPointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/async-requests/mrap/create") + 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 := awsRestxml_serializeOpHttpBindingsCreateMultiRegionAccessPointInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/xml") + + xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "CreateMultiRegionAccessPointRequest", + }, + Attr: rootAttr, + } + root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/")) + if err := awsRestxml_serializeOpDocumentCreateMultiRegionAccessPointInput(input, xmlEncoder.RootElement(root)); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsCreateMultiRegionAccessPointInput(v *CreateMultiRegionAccessPointInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + return nil +} + +func awsRestxml_serializeOpDocumentCreateMultiRegionAccessPointInput(v *CreateMultiRegionAccessPointInput, value smithyxml.Value) error { + defer value.Close() + if v.ClientToken != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "ClientToken", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.ClientToken) + } + if v.Details != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Details", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentCreateMultiRegionAccessPointInput(v.Details, el); err != nil { + return err + } + } + return nil +} + +type awsRestxml_serializeOpCreateStorageLensGroup struct { +} + +func (*awsRestxml_serializeOpCreateStorageLensGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpCreateStorageLensGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateStorageLensGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelensgroup") + 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 := awsRestxml_serializeOpHttpBindingsCreateStorageLensGroupInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/xml") + + xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "CreateStorageLensGroupRequest", + }, + Attr: rootAttr, + } + root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/")) + if err := awsRestxml_serializeOpDocumentCreateStorageLensGroupInput(input, xmlEncoder.RootElement(root)); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsCreateStorageLensGroupInput(v *CreateStorageLensGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + return nil +} + +func awsRestxml_serializeOpDocumentCreateStorageLensGroupInput(v *CreateStorageLensGroupInput, value smithyxml.Value) error { + defer value.Close() + if v.StorageLensGroup != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "StorageLensGroup", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentStorageLensGroup(v.StorageLensGroup, el); err != nil { + return err + } + } + if v.Tags != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Tags", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentTagList(v.Tags, el); err != nil { + return err + } + } + return nil +} + +type awsRestxml_serializeOpDeleteAccessGrant struct { +} + +func (*awsRestxml_serializeOpDeleteAccessGrant) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteAccessGrant) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteAccessGrantInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance/grant/{AccessGrantId}") + 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 := awsRestxml_serializeOpHttpBindingsDeleteAccessGrantInput(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 awsRestxml_serializeOpHttpBindingsDeleteAccessGrantInput(v *DeleteAccessGrantInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccessGrantId == nil || len(*v.AccessGrantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AccessGrantId must not be empty")} + } + if v.AccessGrantId != nil { + if err := encoder.SetURI("AccessGrantId").String(*v.AccessGrantId); err != nil { + return err + } + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + return nil +} + +type awsRestxml_serializeOpDeleteAccessGrantsInstance struct { +} + +func (*awsRestxml_serializeOpDeleteAccessGrantsInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteAccessGrantsInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteAccessGrantsInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance") + 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 := awsRestxml_serializeOpHttpBindingsDeleteAccessGrantsInstanceInput(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 awsRestxml_serializeOpHttpBindingsDeleteAccessGrantsInstanceInput(v *DeleteAccessGrantsInstanceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + return nil +} + +type awsRestxml_serializeOpDeleteAccessGrantsInstanceResourcePolicy struct { +} + +func (*awsRestxml_serializeOpDeleteAccessGrantsInstanceResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteAccessGrantsInstanceResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteAccessGrantsInstanceResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance/resourcepolicy") + 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 := awsRestxml_serializeOpHttpBindingsDeleteAccessGrantsInstanceResourcePolicyInput(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 awsRestxml_serializeOpHttpBindingsDeleteAccessGrantsInstanceResourcePolicyInput(v *DeleteAccessGrantsInstanceResourcePolicyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + return nil +} + +type awsRestxml_serializeOpDeleteAccessGrantsLocation struct { +} + +func (*awsRestxml_serializeOpDeleteAccessGrantsLocation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteAccessGrantsLocation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteAccessGrantsLocationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance/location/{AccessGrantsLocationId}") + 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 := awsRestxml_serializeOpHttpBindingsDeleteAccessGrantsLocationInput(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 awsRestxml_serializeOpHttpBindingsDeleteAccessGrantsLocationInput(v *DeleteAccessGrantsLocationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccessGrantsLocationId == nil || len(*v.AccessGrantsLocationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AccessGrantsLocationId must not be empty")} + } + if v.AccessGrantsLocationId != nil { + if err := encoder.SetURI("AccessGrantsLocationId").String(*v.AccessGrantsLocationId); err != nil { + return err + } + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + return nil +} + +type awsRestxml_serializeOpDeleteAccessPoint struct { +} + +func (*awsRestxml_serializeOpDeleteAccessPoint) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteAccessPoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteAccessPointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}") + 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 := awsRestxml_serializeOpHttpBindingsDeleteAccessPointInput(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 awsRestxml_serializeOpHttpBindingsDeleteAccessPointInput(v *DeleteAccessPointInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +type awsRestxml_serializeOpDeleteAccessPointForObjectLambda struct { +} + +func (*awsRestxml_serializeOpDeleteAccessPointForObjectLambda) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteAccessPointForObjectLambda) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteAccessPointForObjectLambdaInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}") + 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 := awsRestxml_serializeOpHttpBindingsDeleteAccessPointForObjectLambdaInput(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 awsRestxml_serializeOpHttpBindingsDeleteAccessPointForObjectLambdaInput(v *DeleteAccessPointForObjectLambdaInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +type awsRestxml_serializeOpDeleteAccessPointPolicy struct { +} + +func (*awsRestxml_serializeOpDeleteAccessPointPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteAccessPointPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteAccessPointPolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}/policy") + 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 := awsRestxml_serializeOpHttpBindingsDeleteAccessPointPolicyInput(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 awsRestxml_serializeOpHttpBindingsDeleteAccessPointPolicyInput(v *DeleteAccessPointPolicyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +type awsRestxml_serializeOpDeleteAccessPointPolicyForObjectLambda struct { +} + +func (*awsRestxml_serializeOpDeleteAccessPointPolicyForObjectLambda) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteAccessPointPolicyForObjectLambda) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteAccessPointPolicyForObjectLambdaInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}/policy") + 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 := awsRestxml_serializeOpHttpBindingsDeleteAccessPointPolicyForObjectLambdaInput(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 awsRestxml_serializeOpHttpBindingsDeleteAccessPointPolicyForObjectLambdaInput(v *DeleteAccessPointPolicyForObjectLambdaInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +type awsRestxml_serializeOpDeleteBucket struct { +} + +func (*awsRestxml_serializeOpDeleteBucket) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteBucketInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}") + 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 := awsRestxml_serializeOpHttpBindingsDeleteBucketInput(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 awsRestxml_serializeOpHttpBindingsDeleteBucketInput(v *DeleteBucketInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + if v.Bucket == nil || len(*v.Bucket) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} + } + if v.Bucket != nil { + if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { + return err + } + } + + return nil +} + +type awsRestxml_serializeOpDeleteBucketLifecycleConfiguration struct { +} + +func (*awsRestxml_serializeOpDeleteBucketLifecycleConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteBucketLifecycleConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteBucketLifecycleConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/lifecycleconfiguration") + 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 := awsRestxml_serializeOpHttpBindingsDeleteBucketLifecycleConfigurationInput(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 awsRestxml_serializeOpHttpBindingsDeleteBucketLifecycleConfigurationInput(v *DeleteBucketLifecycleConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + if v.Bucket == nil || len(*v.Bucket) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} + } + if v.Bucket != nil { + if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { + return err + } + } + + return nil +} + +type awsRestxml_serializeOpDeleteBucketPolicy struct { +} + +func (*awsRestxml_serializeOpDeleteBucketPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteBucketPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteBucketPolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/policy") + 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 := awsRestxml_serializeOpHttpBindingsDeleteBucketPolicyInput(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 awsRestxml_serializeOpHttpBindingsDeleteBucketPolicyInput(v *DeleteBucketPolicyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + if v.Bucket == nil || len(*v.Bucket) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} + } + if v.Bucket != nil { + if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { + return err + } + } + + return nil +} + +type awsRestxml_serializeOpDeleteBucketReplication struct { +} + +func (*awsRestxml_serializeOpDeleteBucketReplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteBucketReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteBucketReplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/replication") + 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 := awsRestxml_serializeOpHttpBindingsDeleteBucketReplicationInput(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 awsRestxml_serializeOpHttpBindingsCreateStorageLensGroupInput(v *CreateStorageLensGroupInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsDeleteBucketReplicationInput(v *DeleteBucketReplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -780,48 +2113,96 @@ func awsRestxml_serializeOpHttpBindingsCreateStorageLensGroupInput(v *CreateStor encoder.SetHeader(locationName).String(*v.AccountId) } + if v.Bucket == nil || len(*v.Bucket) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} + } + if v.Bucket != nil { + if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { + return err + } + } + return nil } -func awsRestxml_serializeOpDocumentCreateStorageLensGroupInput(v *CreateStorageLensGroupInput, value smithyxml.Value) error { - defer value.Close() - if v.StorageLensGroup != nil { - rootAttr := []smithyxml.Attr{} - root := smithyxml.StartElement{ - Name: smithyxml.Name{ - Local: "StorageLensGroup", - }, - Attr: rootAttr, - } - el := value.MemberElement(root) - if err := awsRestxml_serializeDocumentStorageLensGroup(v.StorageLensGroup, el); err != nil { - return err - } +type awsRestxml_serializeOpDeleteBucketTagging struct { +} + +func (*awsRestxml_serializeOpDeleteBucketTagging) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteBucketTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, 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.Tags != nil { - rootAttr := []smithyxml.Attr{} - root := smithyxml.StartElement{ - Name: smithyxml.Name{ - Local: "Tags", - }, - Attr: rootAttr, - } - el := value.MemberElement(root) - if err := awsRestxml_serializeDocumentTagList(v.Tags, el); err != nil { + + input, ok := in.Parameters.(*DeleteBucketTaggingInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/tagging") + 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 := awsRestxml_serializeOpHttpBindingsDeleteBucketTaggingInput(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 awsRestxml_serializeOpHttpBindingsDeleteBucketTaggingInput(v *DeleteBucketTaggingInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + if v.Bucket == nil || len(*v.Bucket) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} + } + if v.Bucket != nil { + if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { return err } } + return nil } -type awsRestxml_serializeOpDeleteAccessPoint struct { +type awsRestxml_serializeOpDeleteJobTagging struct { } -func (*awsRestxml_serializeOpDeleteAccessPoint) ID() string { +func (*awsRestxml_serializeOpDeleteJobTagging) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDeleteAccessPoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpDeleteJobTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -829,13 +2210,13 @@ func (m *awsRestxml_serializeOpDeleteAccessPoint) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteAccessPointInput) + input, ok := in.Parameters.(*DeleteJobTaggingInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}") + opPath, opQuery := httpbinding.SplitURI("/v20180820/jobs/{JobId}/tagging") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" @@ -851,7 +2232,7 @@ func (m *awsRestxml_serializeOpDeleteAccessPoint) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDeleteAccessPointInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsDeleteJobTaggingInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -862,7 +2243,7 @@ func (m *awsRestxml_serializeOpDeleteAccessPoint) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDeleteAccessPointInput(v *DeleteAccessPointInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsDeleteJobTaggingInput(v *DeleteJobTaggingInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -872,11 +2253,11 @@ func awsRestxml_serializeOpHttpBindingsDeleteAccessPointInput(v *DeleteAccessPoi encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + if v.JobId == nil || len(*v.JobId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member JobId must not be empty")} } - if v.Name != nil { - if err := encoder.SetURI("Name").String(*v.Name); err != nil { + if v.JobId != nil { + if err := encoder.SetURI("JobId").String(*v.JobId); err != nil { return err } } @@ -884,14 +2265,122 @@ func awsRestxml_serializeOpHttpBindingsDeleteAccessPointInput(v *DeleteAccessPoi return nil } -type awsRestxml_serializeOpDeleteAccessPointForObjectLambda struct { +type awsRestxml_serializeOpDeleteMultiRegionAccessPoint struct { +} + +func (*awsRestxml_serializeOpDeleteMultiRegionAccessPoint) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteMultiRegionAccessPoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteMultiRegionAccessPointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/async-requests/mrap/delete") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestxml_serializeOpHttpBindingsDeleteMultiRegionAccessPointInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/xml") + + xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "DeleteMultiRegionAccessPointRequest", + }, + Attr: rootAttr, + } + root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/")) + if err := awsRestxml_serializeOpDocumentDeleteMultiRegionAccessPointInput(input, xmlEncoder.RootElement(root)); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsDeleteMultiRegionAccessPointInput(v *DeleteMultiRegionAccessPointInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + return nil +} + +func awsRestxml_serializeOpDocumentDeleteMultiRegionAccessPointInput(v *DeleteMultiRegionAccessPointInput, value smithyxml.Value) error { + defer value.Close() + if v.ClientToken != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "ClientToken", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.ClientToken) + } + if v.Details != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Details", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentDeleteMultiRegionAccessPointInput(v.Details, el); err != nil { + return err + } + } + return nil +} + +type awsRestxml_serializeOpDeletePublicAccessBlock struct { } -func (*awsRestxml_serializeOpDeleteAccessPointForObjectLambda) ID() string { +func (*awsRestxml_serializeOpDeletePublicAccessBlock) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDeleteAccessPointForObjectLambda) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpDeletePublicAccessBlock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -899,13 +2388,13 @@ func (m *awsRestxml_serializeOpDeleteAccessPointForObjectLambda) HandleSerialize return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteAccessPointForObjectLambdaInput) + input, ok := in.Parameters.(*DeletePublicAccessBlockInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}") + opPath, opQuery := httpbinding.SplitURI("/v20180820/configuration/publicAccessBlock") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" @@ -921,7 +2410,7 @@ func (m *awsRestxml_serializeOpDeleteAccessPointForObjectLambda) HandleSerialize return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDeleteAccessPointForObjectLambdaInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsDeletePublicAccessBlockInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -932,7 +2421,7 @@ func (m *awsRestxml_serializeOpDeleteAccessPointForObjectLambda) HandleSerialize return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDeleteAccessPointForObjectLambdaInput(v *DeleteAccessPointForObjectLambdaInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsDeletePublicAccessBlockInput(v *DeletePublicAccessBlockInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -942,26 +2431,17 @@ func awsRestxml_serializeOpHttpBindingsDeleteAccessPointForObjectLambdaInput(v * encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} - } - if v.Name != nil { - if err := encoder.SetURI("Name").String(*v.Name); err != nil { - return err - } - } - return nil } -type awsRestxml_serializeOpDeleteAccessPointPolicy struct { +type awsRestxml_serializeOpDeleteStorageLensConfiguration struct { } -func (*awsRestxml_serializeOpDeleteAccessPointPolicy) ID() string { +func (*awsRestxml_serializeOpDeleteStorageLensConfiguration) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDeleteAccessPointPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpDeleteStorageLensConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -969,13 +2449,13 @@ func (m *awsRestxml_serializeOpDeleteAccessPointPolicy) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteAccessPointPolicyInput) + input, ok := in.Parameters.(*DeleteStorageLensConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}/policy") + opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelens/{ConfigId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" @@ -991,7 +2471,7 @@ func (m *awsRestxml_serializeOpDeleteAccessPointPolicy) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDeleteAccessPointPolicyInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsDeleteStorageLensConfigurationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1002,7 +2482,7 @@ func (m *awsRestxml_serializeOpDeleteAccessPointPolicy) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDeleteAccessPointPolicyInput(v *DeleteAccessPointPolicyInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsDeleteStorageLensConfigurationInput(v *DeleteStorageLensConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1012,11 +2492,11 @@ func awsRestxml_serializeOpHttpBindingsDeleteAccessPointPolicyInput(v *DeleteAcc encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + if v.ConfigId == nil || len(*v.ConfigId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigId must not be empty")} } - if v.Name != nil { - if err := encoder.SetURI("Name").String(*v.Name); err != nil { + if v.ConfigId != nil { + if err := encoder.SetURI("ConfigId").String(*v.ConfigId); err != nil { return err } } @@ -1024,14 +2504,14 @@ func awsRestxml_serializeOpHttpBindingsDeleteAccessPointPolicyInput(v *DeleteAcc return nil } -type awsRestxml_serializeOpDeleteAccessPointPolicyForObjectLambda struct { +type awsRestxml_serializeOpDeleteStorageLensConfigurationTagging struct { } -func (*awsRestxml_serializeOpDeleteAccessPointPolicyForObjectLambda) ID() string { +func (*awsRestxml_serializeOpDeleteStorageLensConfigurationTagging) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDeleteAccessPointPolicyForObjectLambda) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpDeleteStorageLensConfigurationTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1039,13 +2519,13 @@ func (m *awsRestxml_serializeOpDeleteAccessPointPolicyForObjectLambda) HandleSer return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteAccessPointPolicyForObjectLambdaInput) + input, ok := in.Parameters.(*DeleteStorageLensConfigurationTaggingInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}/policy") + opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelens/{ConfigId}/tagging") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" @@ -1061,7 +2541,7 @@ func (m *awsRestxml_serializeOpDeleteAccessPointPolicyForObjectLambda) HandleSer return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDeleteAccessPointPolicyForObjectLambdaInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsDeleteStorageLensConfigurationTaggingInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1072,7 +2552,7 @@ func (m *awsRestxml_serializeOpDeleteAccessPointPolicyForObjectLambda) HandleSer return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDeleteAccessPointPolicyForObjectLambdaInput(v *DeleteAccessPointPolicyForObjectLambdaInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsDeleteStorageLensConfigurationTaggingInput(v *DeleteStorageLensConfigurationTaggingInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1082,11 +2562,11 @@ func awsRestxml_serializeOpHttpBindingsDeleteAccessPointPolicyForObjectLambdaInp encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + if v.ConfigId == nil || len(*v.ConfigId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigId must not be empty")} } - if v.Name != nil { - if err := encoder.SetURI("Name").String(*v.Name); err != nil { + if v.ConfigId != nil { + if err := encoder.SetURI("ConfigId").String(*v.ConfigId); err != nil { return err } } @@ -1094,14 +2574,14 @@ func awsRestxml_serializeOpHttpBindingsDeleteAccessPointPolicyForObjectLambdaInp return nil } -type awsRestxml_serializeOpDeleteBucket struct { +type awsRestxml_serializeOpDeleteStorageLensGroup struct { } -func (*awsRestxml_serializeOpDeleteBucket) ID() string { +func (*awsRestxml_serializeOpDeleteStorageLensGroup) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDeleteBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpDeleteStorageLensGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1109,13 +2589,13 @@ func (m *awsRestxml_serializeOpDeleteBucket) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteBucketInput) + input, ok := in.Parameters.(*DeleteStorageLensGroupInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}") + opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelensgroup/{Name}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" @@ -1131,7 +2611,7 @@ func (m *awsRestxml_serializeOpDeleteBucket) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDeleteBucketInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsDeleteStorageLensGroupInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1142,7 +2622,7 @@ func (m *awsRestxml_serializeOpDeleteBucket) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDeleteBucketInput(v *DeleteBucketInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsDeleteStorageLensGroupInput(v *DeleteStorageLensGroupInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1152,11 +2632,11 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketInput(v *DeleteBucketInput, e encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Bucket == nil || len(*v.Bucket) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } - if v.Bucket != nil { - if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } @@ -1164,14 +2644,14 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketInput(v *DeleteBucketInput, e return nil } -type awsRestxml_serializeOpDeleteBucketLifecycleConfiguration struct { +type awsRestxml_serializeOpDescribeJob struct { } -func (*awsRestxml_serializeOpDeleteBucketLifecycleConfiguration) ID() string { +func (*awsRestxml_serializeOpDescribeJob) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDeleteBucketLifecycleConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpDescribeJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1179,16 +2659,16 @@ func (m *awsRestxml_serializeOpDeleteBucketLifecycleConfiguration) HandleSeriali return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteBucketLifecycleConfigurationInput) + input, ok := in.Parameters.(*DescribeJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/lifecycleconfiguration") + opPath, opQuery := httpbinding.SplitURI("/v20180820/jobs/{JobId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1201,7 +2681,7 @@ func (m *awsRestxml_serializeOpDeleteBucketLifecycleConfiguration) HandleSeriali return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDeleteBucketLifecycleConfigurationInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsDescribeJobInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1212,7 +2692,7 @@ func (m *awsRestxml_serializeOpDeleteBucketLifecycleConfiguration) HandleSeriali return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDeleteBucketLifecycleConfigurationInput(v *DeleteBucketLifecycleConfigurationInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsDescribeJobInput(v *DescribeJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1222,11 +2702,11 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketLifecycleConfigurationInput(v encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Bucket == nil || len(*v.Bucket) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} + if v.JobId == nil || len(*v.JobId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member JobId must not be empty")} } - if v.Bucket != nil { - if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { + if v.JobId != nil { + if err := encoder.SetURI("JobId").String(*v.JobId); err != nil { return err } } @@ -1234,14 +2714,14 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketLifecycleConfigurationInput(v return nil } -type awsRestxml_serializeOpDeleteBucketPolicy struct { +type awsRestxml_serializeOpDescribeMultiRegionAccessPointOperation struct { } -func (*awsRestxml_serializeOpDeleteBucketPolicy) ID() string { +func (*awsRestxml_serializeOpDescribeMultiRegionAccessPointOperation) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDeleteBucketPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpDescribeMultiRegionAccessPointOperation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1249,16 +2729,16 @@ func (m *awsRestxml_serializeOpDeleteBucketPolicy) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteBucketPolicyInput) + input, ok := in.Parameters.(*DescribeMultiRegionAccessPointOperationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/policy") + opPath, opQuery := httpbinding.SplitURI("/v20180820/async-requests/mrap/{RequestTokenARN+}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1271,7 +2751,7 @@ func (m *awsRestxml_serializeOpDeleteBucketPolicy) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDeleteBucketPolicyInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsDescribeMultiRegionAccessPointOperationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1282,7 +2762,7 @@ func (m *awsRestxml_serializeOpDeleteBucketPolicy) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDeleteBucketPolicyInput(v *DeleteBucketPolicyInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsDescribeMultiRegionAccessPointOperationInput(v *DescribeMultiRegionAccessPointOperationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1292,11 +2772,11 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketPolicyInput(v *DeleteBucketPo encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Bucket == nil || len(*v.Bucket) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} + if v.RequestTokenARN == nil || len(*v.RequestTokenARN) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member RequestTokenARN must not be empty")} } - if v.Bucket != nil { - if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { + if v.RequestTokenARN != nil { + if err := encoder.SetURI("RequestTokenARN").String(*v.RequestTokenARN); err != nil { return err } } @@ -1304,14 +2784,14 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketPolicyInput(v *DeleteBucketPo return nil } -type awsRestxml_serializeOpDeleteBucketReplication struct { +type awsRestxml_serializeOpDissociateAccessGrantsIdentityCenter struct { } -func (*awsRestxml_serializeOpDeleteBucketReplication) ID() string { +func (*awsRestxml_serializeOpDissociateAccessGrantsIdentityCenter) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDeleteBucketReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpDissociateAccessGrantsIdentityCenter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1319,13 +2799,13 @@ func (m *awsRestxml_serializeOpDeleteBucketReplication) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteBucketReplicationInput) + input, ok := in.Parameters.(*DissociateAccessGrantsIdentityCenterInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/replication") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance/identitycenter") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" @@ -1341,7 +2821,7 @@ func (m *awsRestxml_serializeOpDeleteBucketReplication) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDeleteBucketReplicationInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsDissociateAccessGrantsIdentityCenterInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1352,7 +2832,7 @@ func (m *awsRestxml_serializeOpDeleteBucketReplication) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDeleteBucketReplicationInput(v *DeleteBucketReplicationInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsDissociateAccessGrantsIdentityCenterInput(v *DissociateAccessGrantsIdentityCenterInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1362,26 +2842,17 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketReplicationInput(v *DeleteBuc encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Bucket == nil || len(*v.Bucket) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} - } - if v.Bucket != nil { - if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { - return err - } - } - return nil } -type awsRestxml_serializeOpDeleteBucketTagging struct { +type awsRestxml_serializeOpGetAccessGrant struct { } -func (*awsRestxml_serializeOpDeleteBucketTagging) ID() string { +func (*awsRestxml_serializeOpGetAccessGrant) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDeleteBucketTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetAccessGrant) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1389,16 +2860,16 @@ func (m *awsRestxml_serializeOpDeleteBucketTagging) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteBucketTaggingInput) + input, ok := in.Parameters.(*GetAccessGrantInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/tagging") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance/grant/{AccessGrantId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1411,7 +2882,7 @@ func (m *awsRestxml_serializeOpDeleteBucketTagging) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDeleteBucketTaggingInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetAccessGrantInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1422,36 +2893,36 @@ func (m *awsRestxml_serializeOpDeleteBucketTagging) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDeleteBucketTaggingInput(v *DeleteBucketTaggingInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetAccessGrantInput(v *GetAccessGrantInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AccountId != nil && len(*v.AccountId) > 0 { - locationName := "X-Amz-Account-Id" - encoder.SetHeader(locationName).String(*v.AccountId) - } - - if v.Bucket == nil || len(*v.Bucket) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} + if v.AccessGrantId == nil || len(*v.AccessGrantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AccessGrantId must not be empty")} } - if v.Bucket != nil { - if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { + if v.AccessGrantId != nil { + if err := encoder.SetURI("AccessGrantId").String(*v.AccessGrantId); err != nil { return err } } + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + return nil } -type awsRestxml_serializeOpDeleteJobTagging struct { +type awsRestxml_serializeOpGetAccessGrantsInstance struct { } -func (*awsRestxml_serializeOpDeleteJobTagging) ID() string { +func (*awsRestxml_serializeOpGetAccessGrantsInstance) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDeleteJobTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetAccessGrantsInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1459,16 +2930,16 @@ func (m *awsRestxml_serializeOpDeleteJobTagging) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteJobTaggingInput) + input, ok := in.Parameters.(*GetAccessGrantsInstanceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/jobs/{JobId}/tagging") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1481,7 +2952,7 @@ func (m *awsRestxml_serializeOpDeleteJobTagging) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDeleteJobTaggingInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetAccessGrantsInstanceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1492,7 +2963,7 @@ func (m *awsRestxml_serializeOpDeleteJobTagging) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDeleteJobTaggingInput(v *DeleteJobTaggingInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetAccessGrantsInstanceInput(v *GetAccessGrantsInstanceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1502,26 +2973,17 @@ func awsRestxml_serializeOpHttpBindingsDeleteJobTaggingInput(v *DeleteJobTagging encoder.SetHeader(locationName).String(*v.AccountId) } - if v.JobId == nil || len(*v.JobId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member JobId must not be empty")} - } - if v.JobId != nil { - if err := encoder.SetURI("JobId").String(*v.JobId); err != nil { - return err - } - } - return nil } -type awsRestxml_serializeOpDeleteMultiRegionAccessPoint struct { +type awsRestxml_serializeOpGetAccessGrantsInstanceForPrefix struct { } -func (*awsRestxml_serializeOpDeleteMultiRegionAccessPoint) ID() string { +func (*awsRestxml_serializeOpGetAccessGrantsInstanceForPrefix) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDeleteMultiRegionAccessPoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetAccessGrantsInstanceForPrefix) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1529,16 +2991,16 @@ func (m *awsRestxml_serializeOpDeleteMultiRegionAccessPoint) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteMultiRegionAccessPointInput) + input, ok := in.Parameters.(*GetAccessGrantsInstanceForPrefixInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/async-requests/mrap/delete") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance/prefix") 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) @@ -1551,25 +3013,7 @@ func (m *awsRestxml_serializeOpDeleteMultiRegionAccessPoint) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDeleteMultiRegionAccessPointInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/xml") - - xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) - rootAttr := []smithyxml.Attr{} - root := smithyxml.StartElement{ - Name: smithyxml.Name{ - Local: "DeleteMultiRegionAccessPointRequest", - }, - Attr: rootAttr, - } - root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/")) - if err := awsRestxml_serializeOpDocumentDeleteMultiRegionAccessPointInput(input, xmlEncoder.RootElement(root)); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - if request, err = request.SetStream(bytes.NewReader(xmlEncoder.Bytes())); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetAccessGrantsInstanceForPrefixInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1580,7 +3024,7 @@ func (m *awsRestxml_serializeOpDeleteMultiRegionAccessPoint) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDeleteMultiRegionAccessPointInput(v *DeleteMultiRegionAccessPointInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetAccessGrantsInstanceForPrefixInput(v *GetAccessGrantsInstanceForPrefixInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1590,46 +3034,21 @@ func awsRestxml_serializeOpHttpBindingsDeleteMultiRegionAccessPointInput(v *Dele encoder.SetHeader(locationName).String(*v.AccountId) } - return nil -} - -func awsRestxml_serializeOpDocumentDeleteMultiRegionAccessPointInput(v *DeleteMultiRegionAccessPointInput, value smithyxml.Value) error { - defer value.Close() - if v.ClientToken != nil { - rootAttr := []smithyxml.Attr{} - root := smithyxml.StartElement{ - Name: smithyxml.Name{ - Local: "ClientToken", - }, - Attr: rootAttr, - } - el := value.MemberElement(root) - el.String(*v.ClientToken) - } - if v.Details != nil { - rootAttr := []smithyxml.Attr{} - root := smithyxml.StartElement{ - Name: smithyxml.Name{ - Local: "Details", - }, - Attr: rootAttr, - } - el := value.MemberElement(root) - if err := awsRestxml_serializeDocumentDeleteMultiRegionAccessPointInput(v.Details, el); err != nil { - return err - } + if v.S3Prefix != nil { + encoder.SetQuery("s3prefix").String(*v.S3Prefix) } + return nil } -type awsRestxml_serializeOpDeletePublicAccessBlock struct { +type awsRestxml_serializeOpGetAccessGrantsInstanceResourcePolicy struct { } -func (*awsRestxml_serializeOpDeletePublicAccessBlock) ID() string { +func (*awsRestxml_serializeOpGetAccessGrantsInstanceResourcePolicy) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDeletePublicAccessBlock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetAccessGrantsInstanceResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1637,16 +3056,16 @@ func (m *awsRestxml_serializeOpDeletePublicAccessBlock) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeletePublicAccessBlockInput) + input, ok := in.Parameters.(*GetAccessGrantsInstanceResourcePolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/configuration/publicAccessBlock") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance/resourcepolicy") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1659,7 +3078,7 @@ func (m *awsRestxml_serializeOpDeletePublicAccessBlock) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDeletePublicAccessBlockInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetAccessGrantsInstanceResourcePolicyInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1670,7 +3089,7 @@ func (m *awsRestxml_serializeOpDeletePublicAccessBlock) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDeletePublicAccessBlockInput(v *DeletePublicAccessBlockInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetAccessGrantsInstanceResourcePolicyInput(v *GetAccessGrantsInstanceResourcePolicyInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1683,14 +3102,14 @@ func awsRestxml_serializeOpHttpBindingsDeletePublicAccessBlockInput(v *DeletePub return nil } -type awsRestxml_serializeOpDeleteStorageLensConfiguration struct { +type awsRestxml_serializeOpGetAccessGrantsLocation struct { } -func (*awsRestxml_serializeOpDeleteStorageLensConfiguration) ID() string { +func (*awsRestxml_serializeOpGetAccessGrantsLocation) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDeleteStorageLensConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetAccessGrantsLocation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1698,16 +3117,16 @@ func (m *awsRestxml_serializeOpDeleteStorageLensConfiguration) HandleSerialize(c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteStorageLensConfigurationInput) + input, ok := in.Parameters.(*GetAccessGrantsLocationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelens/{ConfigId}") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance/location/{AccessGrantsLocationId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1720,7 +3139,7 @@ func (m *awsRestxml_serializeOpDeleteStorageLensConfiguration) HandleSerialize(c return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDeleteStorageLensConfigurationInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetAccessGrantsLocationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1731,36 +3150,36 @@ func (m *awsRestxml_serializeOpDeleteStorageLensConfiguration) HandleSerialize(c return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDeleteStorageLensConfigurationInput(v *DeleteStorageLensConfigurationInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetAccessGrantsLocationInput(v *GetAccessGrantsLocationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AccountId != nil && len(*v.AccountId) > 0 { - locationName := "X-Amz-Account-Id" - encoder.SetHeader(locationName).String(*v.AccountId) - } - - if v.ConfigId == nil || len(*v.ConfigId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigId must not be empty")} + if v.AccessGrantsLocationId == nil || len(*v.AccessGrantsLocationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AccessGrantsLocationId must not be empty")} } - if v.ConfigId != nil { - if err := encoder.SetURI("ConfigId").String(*v.ConfigId); err != nil { + if v.AccessGrantsLocationId != nil { + if err := encoder.SetURI("AccessGrantsLocationId").String(*v.AccessGrantsLocationId); err != nil { return err } } + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + return nil } -type awsRestxml_serializeOpDeleteStorageLensConfigurationTagging struct { +type awsRestxml_serializeOpGetAccessPoint struct { } -func (*awsRestxml_serializeOpDeleteStorageLensConfigurationTagging) ID() string { +func (*awsRestxml_serializeOpGetAccessPoint) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDeleteStorageLensConfigurationTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetAccessPoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1768,16 +3187,16 @@ func (m *awsRestxml_serializeOpDeleteStorageLensConfigurationTagging) HandleSeri return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteStorageLensConfigurationTaggingInput) + input, ok := in.Parameters.(*GetAccessPointInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelens/{ConfigId}/tagging") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1790,7 +3209,7 @@ func (m *awsRestxml_serializeOpDeleteStorageLensConfigurationTagging) HandleSeri return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDeleteStorageLensConfigurationTaggingInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetAccessPointInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1801,7 +3220,7 @@ func (m *awsRestxml_serializeOpDeleteStorageLensConfigurationTagging) HandleSeri return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDeleteStorageLensConfigurationTaggingInput(v *DeleteStorageLensConfigurationTaggingInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetAccessPointInput(v *GetAccessPointInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1811,11 +3230,11 @@ func awsRestxml_serializeOpHttpBindingsDeleteStorageLensConfigurationTaggingInpu encoder.SetHeader(locationName).String(*v.AccountId) } - if v.ConfigId == nil || len(*v.ConfigId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigId must not be empty")} + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } - if v.ConfigId != nil { - if err := encoder.SetURI("ConfigId").String(*v.ConfigId); err != nil { + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } @@ -1823,14 +3242,14 @@ func awsRestxml_serializeOpHttpBindingsDeleteStorageLensConfigurationTaggingInpu return nil } -type awsRestxml_serializeOpDeleteStorageLensGroup struct { +type awsRestxml_serializeOpGetAccessPointConfigurationForObjectLambda struct { } -func (*awsRestxml_serializeOpDeleteStorageLensGroup) ID() string { +func (*awsRestxml_serializeOpGetAccessPointConfigurationForObjectLambda) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDeleteStorageLensGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetAccessPointConfigurationForObjectLambda) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1838,16 +3257,16 @@ func (m *awsRestxml_serializeOpDeleteStorageLensGroup) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteStorageLensGroupInput) + input, ok := in.Parameters.(*GetAccessPointConfigurationForObjectLambdaInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelensgroup/{Name}") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}/configuration") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1860,7 +3279,7 @@ func (m *awsRestxml_serializeOpDeleteStorageLensGroup) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDeleteStorageLensGroupInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetAccessPointConfigurationForObjectLambdaInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1871,7 +3290,7 @@ func (m *awsRestxml_serializeOpDeleteStorageLensGroup) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDeleteStorageLensGroupInput(v *DeleteStorageLensGroupInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetAccessPointConfigurationForObjectLambdaInput(v *GetAccessPointConfigurationForObjectLambdaInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1893,14 +3312,14 @@ func awsRestxml_serializeOpHttpBindingsDeleteStorageLensGroupInput(v *DeleteStor return nil } -type awsRestxml_serializeOpDescribeJob struct { +type awsRestxml_serializeOpGetAccessPointForObjectLambda struct { } -func (*awsRestxml_serializeOpDescribeJob) ID() string { +func (*awsRestxml_serializeOpGetAccessPointForObjectLambda) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDescribeJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetAccessPointForObjectLambda) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1908,13 +3327,13 @@ func (m *awsRestxml_serializeOpDescribeJob) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeJobInput) + input, ok := in.Parameters.(*GetAccessPointForObjectLambdaInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/jobs/{JobId}") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -1930,7 +3349,7 @@ func (m *awsRestxml_serializeOpDescribeJob) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDescribeJobInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetAccessPointForObjectLambdaInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1941,7 +3360,7 @@ func (m *awsRestxml_serializeOpDescribeJob) HandleSerialize(ctx context.Context, return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDescribeJobInput(v *DescribeJobInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetAccessPointForObjectLambdaInput(v *GetAccessPointForObjectLambdaInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1951,11 +3370,11 @@ func awsRestxml_serializeOpHttpBindingsDescribeJobInput(v *DescribeJobInput, enc encoder.SetHeader(locationName).String(*v.AccountId) } - if v.JobId == nil || len(*v.JobId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member JobId must not be empty")} + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } - if v.JobId != nil { - if err := encoder.SetURI("JobId").String(*v.JobId); err != nil { + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } @@ -1963,14 +3382,14 @@ func awsRestxml_serializeOpHttpBindingsDescribeJobInput(v *DescribeJobInput, enc return nil } -type awsRestxml_serializeOpDescribeMultiRegionAccessPointOperation struct { +type awsRestxml_serializeOpGetAccessPointPolicy struct { } -func (*awsRestxml_serializeOpDescribeMultiRegionAccessPointOperation) ID() string { +func (*awsRestxml_serializeOpGetAccessPointPolicy) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpDescribeMultiRegionAccessPointOperation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetAccessPointPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1978,13 +3397,13 @@ func (m *awsRestxml_serializeOpDescribeMultiRegionAccessPointOperation) HandleSe return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeMultiRegionAccessPointOperationInput) + input, ok := in.Parameters.(*GetAccessPointPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/async-requests/mrap/{RequestTokenARN+}") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}/policy") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2000,7 +3419,7 @@ func (m *awsRestxml_serializeOpDescribeMultiRegionAccessPointOperation) HandleSe return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsDescribeMultiRegionAccessPointOperationInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2011,7 +3430,7 @@ func (m *awsRestxml_serializeOpDescribeMultiRegionAccessPointOperation) HandleSe return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsDescribeMultiRegionAccessPointOperationInput(v *DescribeMultiRegionAccessPointOperationInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyInput(v *GetAccessPointPolicyInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2021,11 +3440,11 @@ func awsRestxml_serializeOpHttpBindingsDescribeMultiRegionAccessPointOperationIn encoder.SetHeader(locationName).String(*v.AccountId) } - if v.RequestTokenARN == nil || len(*v.RequestTokenARN) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member RequestTokenARN must not be empty")} + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } - if v.RequestTokenARN != nil { - if err := encoder.SetURI("RequestTokenARN").String(*v.RequestTokenARN); err != nil { + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } @@ -2033,14 +3452,14 @@ func awsRestxml_serializeOpHttpBindingsDescribeMultiRegionAccessPointOperationIn return nil } -type awsRestxml_serializeOpGetAccessPoint struct { +type awsRestxml_serializeOpGetAccessPointPolicyForObjectLambda struct { } -func (*awsRestxml_serializeOpGetAccessPoint) ID() string { +func (*awsRestxml_serializeOpGetAccessPointPolicyForObjectLambda) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetAccessPoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetAccessPointPolicyForObjectLambda) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2048,13 +3467,13 @@ func (m *awsRestxml_serializeOpGetAccessPoint) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetAccessPointInput) + input, ok := in.Parameters.(*GetAccessPointPolicyForObjectLambdaInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}/policy") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2070,7 +3489,7 @@ func (m *awsRestxml_serializeOpGetAccessPoint) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetAccessPointInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyForObjectLambdaInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2081,7 +3500,7 @@ func (m *awsRestxml_serializeOpGetAccessPoint) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetAccessPointInput(v *GetAccessPointInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyForObjectLambdaInput(v *GetAccessPointPolicyForObjectLambdaInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2103,14 +3522,14 @@ func awsRestxml_serializeOpHttpBindingsGetAccessPointInput(v *GetAccessPointInpu return nil } -type awsRestxml_serializeOpGetAccessPointConfigurationForObjectLambda struct { +type awsRestxml_serializeOpGetAccessPointPolicyStatus struct { } -func (*awsRestxml_serializeOpGetAccessPointConfigurationForObjectLambda) ID() string { +func (*awsRestxml_serializeOpGetAccessPointPolicyStatus) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetAccessPointConfigurationForObjectLambda) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetAccessPointPolicyStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2118,13 +3537,13 @@ func (m *awsRestxml_serializeOpGetAccessPointConfigurationForObjectLambda) Handl return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetAccessPointConfigurationForObjectLambdaInput) + input, ok := in.Parameters.(*GetAccessPointPolicyStatusInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}/configuration") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}/policyStatus") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2140,7 +3559,7 @@ func (m *awsRestxml_serializeOpGetAccessPointConfigurationForObjectLambda) Handl return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetAccessPointConfigurationForObjectLambdaInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyStatusInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2151,7 +3570,7 @@ func (m *awsRestxml_serializeOpGetAccessPointConfigurationForObjectLambda) Handl return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetAccessPointConfigurationForObjectLambdaInput(v *GetAccessPointConfigurationForObjectLambdaInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyStatusInput(v *GetAccessPointPolicyStatusInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2173,14 +3592,14 @@ func awsRestxml_serializeOpHttpBindingsGetAccessPointConfigurationForObjectLambd return nil } -type awsRestxml_serializeOpGetAccessPointForObjectLambda struct { +type awsRestxml_serializeOpGetAccessPointPolicyStatusForObjectLambda struct { } -func (*awsRestxml_serializeOpGetAccessPointForObjectLambda) ID() string { +func (*awsRestxml_serializeOpGetAccessPointPolicyStatusForObjectLambda) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetAccessPointForObjectLambda) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetAccessPointPolicyStatusForObjectLambda) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2188,13 +3607,13 @@ func (m *awsRestxml_serializeOpGetAccessPointForObjectLambda) HandleSerialize(ct return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetAccessPointForObjectLambdaInput) + input, ok := in.Parameters.(*GetAccessPointPolicyStatusForObjectLambdaInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}/policyStatus") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2210,7 +3629,7 @@ func (m *awsRestxml_serializeOpGetAccessPointForObjectLambda) HandleSerialize(ct return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetAccessPointForObjectLambdaInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyStatusForObjectLambdaInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2221,7 +3640,7 @@ func (m *awsRestxml_serializeOpGetAccessPointForObjectLambda) HandleSerialize(ct return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetAccessPointForObjectLambdaInput(v *GetAccessPointForObjectLambdaInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyStatusForObjectLambdaInput(v *GetAccessPointPolicyStatusForObjectLambdaInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2243,14 +3662,14 @@ func awsRestxml_serializeOpHttpBindingsGetAccessPointForObjectLambdaInput(v *Get return nil } -type awsRestxml_serializeOpGetAccessPointPolicy struct { +type awsRestxml_serializeOpGetBucket struct { } -func (*awsRestxml_serializeOpGetAccessPointPolicy) ID() string { +func (*awsRestxml_serializeOpGetBucket) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetAccessPointPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2258,13 +3677,13 @@ func (m *awsRestxml_serializeOpGetAccessPointPolicy) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetAccessPointPolicyInput) + input, ok := in.Parameters.(*GetBucketInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}/policy") + opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2280,7 +3699,7 @@ func (m *awsRestxml_serializeOpGetAccessPointPolicy) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetBucketInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2291,7 +3710,7 @@ func (m *awsRestxml_serializeOpGetAccessPointPolicy) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyInput(v *GetAccessPointPolicyInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetBucketInput(v *GetBucketInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2301,11 +3720,11 @@ func awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyInput(v *GetAccessPoi encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + if v.Bucket == nil || len(*v.Bucket) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} } - if v.Name != nil { - if err := encoder.SetURI("Name").String(*v.Name); err != nil { + if v.Bucket != nil { + if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { return err } } @@ -2313,14 +3732,14 @@ func awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyInput(v *GetAccessPoi return nil } -type awsRestxml_serializeOpGetAccessPointPolicyForObjectLambda struct { +type awsRestxml_serializeOpGetBucketLifecycleConfiguration struct { } -func (*awsRestxml_serializeOpGetAccessPointPolicyForObjectLambda) ID() string { +func (*awsRestxml_serializeOpGetBucketLifecycleConfiguration) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetAccessPointPolicyForObjectLambda) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetBucketLifecycleConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2328,13 +3747,13 @@ func (m *awsRestxml_serializeOpGetAccessPointPolicyForObjectLambda) HandleSerial return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetAccessPointPolicyForObjectLambdaInput) + input, ok := in.Parameters.(*GetBucketLifecycleConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}/policy") + opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/lifecycleconfiguration") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2350,7 +3769,7 @@ func (m *awsRestxml_serializeOpGetAccessPointPolicyForObjectLambda) HandleSerial return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyForObjectLambdaInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetBucketLifecycleConfigurationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2361,7 +3780,7 @@ func (m *awsRestxml_serializeOpGetAccessPointPolicyForObjectLambda) HandleSerial return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyForObjectLambdaInput(v *GetAccessPointPolicyForObjectLambdaInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetBucketLifecycleConfigurationInput(v *GetBucketLifecycleConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2371,11 +3790,11 @@ func awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyForObjectLambdaInput( encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + if v.Bucket == nil || len(*v.Bucket) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} } - if v.Name != nil { - if err := encoder.SetURI("Name").String(*v.Name); err != nil { + if v.Bucket != nil { + if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { return err } } @@ -2383,14 +3802,14 @@ func awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyForObjectLambdaInput( return nil } -type awsRestxml_serializeOpGetAccessPointPolicyStatus struct { +type awsRestxml_serializeOpGetBucketPolicy struct { } -func (*awsRestxml_serializeOpGetAccessPointPolicyStatus) ID() string { +func (*awsRestxml_serializeOpGetBucketPolicy) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetAccessPointPolicyStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetBucketPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2398,13 +3817,13 @@ func (m *awsRestxml_serializeOpGetAccessPointPolicyStatus) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetAccessPointPolicyStatusInput) + input, ok := in.Parameters.(*GetBucketPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspoint/{Name}/policyStatus") + opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/policy") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2420,7 +3839,7 @@ func (m *awsRestxml_serializeOpGetAccessPointPolicyStatus) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyStatusInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetBucketPolicyInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2431,7 +3850,7 @@ func (m *awsRestxml_serializeOpGetAccessPointPolicyStatus) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyStatusInput(v *GetAccessPointPolicyStatusInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetBucketPolicyInput(v *GetBucketPolicyInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2441,11 +3860,11 @@ func awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyStatusInput(v *GetAcc encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + if v.Bucket == nil || len(*v.Bucket) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} } - if v.Name != nil { - if err := encoder.SetURI("Name").String(*v.Name); err != nil { + if v.Bucket != nil { + if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { return err } } @@ -2453,14 +3872,14 @@ func awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyStatusInput(v *GetAcc return nil } -type awsRestxml_serializeOpGetAccessPointPolicyStatusForObjectLambda struct { +type awsRestxml_serializeOpGetBucketReplication struct { } -func (*awsRestxml_serializeOpGetAccessPointPolicyStatusForObjectLambda) ID() string { +func (*awsRestxml_serializeOpGetBucketReplication) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetAccessPointPolicyStatusForObjectLambda) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetBucketReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2468,13 +3887,13 @@ func (m *awsRestxml_serializeOpGetAccessPointPolicyStatusForObjectLambda) Handle return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetAccessPointPolicyStatusForObjectLambdaInput) + input, ok := in.Parameters.(*GetBucketReplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/accesspointforobjectlambda/{Name}/policyStatus") + opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/replication") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2490,7 +3909,7 @@ func (m *awsRestxml_serializeOpGetAccessPointPolicyStatusForObjectLambda) Handle return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyStatusForObjectLambdaInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetBucketReplicationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2501,7 +3920,7 @@ func (m *awsRestxml_serializeOpGetAccessPointPolicyStatusForObjectLambda) Handle return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyStatusForObjectLambdaInput(v *GetAccessPointPolicyStatusForObjectLambdaInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetBucketReplicationInput(v *GetBucketReplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2511,11 +3930,11 @@ func awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyStatusForObjectLambda encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + if v.Bucket == nil || len(*v.Bucket) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} } - if v.Name != nil { - if err := encoder.SetURI("Name").String(*v.Name); err != nil { + if v.Bucket != nil { + if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { return err } } @@ -2523,14 +3942,14 @@ func awsRestxml_serializeOpHttpBindingsGetAccessPointPolicyStatusForObjectLambda return nil } -type awsRestxml_serializeOpGetBucket struct { +type awsRestxml_serializeOpGetBucketTagging struct { } -func (*awsRestxml_serializeOpGetBucket) ID() string { +func (*awsRestxml_serializeOpGetBucketTagging) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetBucketTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2538,13 +3957,13 @@ func (m *awsRestxml_serializeOpGetBucket) HandleSerialize(ctx context.Context, i return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetBucketInput) + input, ok := in.Parameters.(*GetBucketTaggingInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}") + opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/tagging") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2560,7 +3979,7 @@ func (m *awsRestxml_serializeOpGetBucket) HandleSerialize(ctx context.Context, i return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetBucketInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetBucketTaggingInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2571,7 +3990,7 @@ func (m *awsRestxml_serializeOpGetBucket) HandleSerialize(ctx context.Context, i return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetBucketInput(v *GetBucketInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetBucketTaggingInput(v *GetBucketTaggingInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2593,14 +4012,14 @@ func awsRestxml_serializeOpHttpBindingsGetBucketInput(v *GetBucketInput, encoder return nil } -type awsRestxml_serializeOpGetBucketLifecycleConfiguration struct { +type awsRestxml_serializeOpGetBucketVersioning struct { } -func (*awsRestxml_serializeOpGetBucketLifecycleConfiguration) ID() string { +func (*awsRestxml_serializeOpGetBucketVersioning) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetBucketLifecycleConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetBucketVersioning) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2608,13 +4027,13 @@ func (m *awsRestxml_serializeOpGetBucketLifecycleConfiguration) HandleSerialize( return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetBucketLifecycleConfigurationInput) + input, ok := in.Parameters.(*GetBucketVersioningInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/lifecycleconfiguration") + opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/versioning") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2630,7 +4049,7 @@ func (m *awsRestxml_serializeOpGetBucketLifecycleConfiguration) HandleSerialize( return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetBucketLifecycleConfigurationInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetBucketVersioningInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2641,7 +4060,7 @@ func (m *awsRestxml_serializeOpGetBucketLifecycleConfiguration) HandleSerialize( return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetBucketLifecycleConfigurationInput(v *GetBucketLifecycleConfigurationInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetBucketVersioningInput(v *GetBucketVersioningInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2663,14 +4082,14 @@ func awsRestxml_serializeOpHttpBindingsGetBucketLifecycleConfigurationInput(v *G return nil } -type awsRestxml_serializeOpGetBucketPolicy struct { +type awsRestxml_serializeOpGetDataAccess struct { } -func (*awsRestxml_serializeOpGetBucketPolicy) ID() string { +func (*awsRestxml_serializeOpGetDataAccess) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetBucketPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetDataAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2678,13 +4097,13 @@ func (m *awsRestxml_serializeOpGetBucketPolicy) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetBucketPolicyInput) + input, ok := in.Parameters.(*GetDataAccessInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/policy") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance/dataaccess") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2700,7 +4119,7 @@ func (m *awsRestxml_serializeOpGetBucketPolicy) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetBucketPolicyInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetDataAccessInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2711,7 +4130,7 @@ func (m *awsRestxml_serializeOpGetBucketPolicy) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetBucketPolicyInput(v *GetBucketPolicyInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetDataAccessInput(v *GetDataAccessInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2721,26 +4140,37 @@ func awsRestxml_serializeOpHttpBindingsGetBucketPolicyInput(v *GetBucketPolicyIn encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Bucket == nil || len(*v.Bucket) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} + if v.DurationSeconds != nil { + encoder.SetQuery("durationSeconds").Integer(*v.DurationSeconds) } - if v.Bucket != nil { - if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { - return err - } + + if len(v.Permission) > 0 { + encoder.SetQuery("permission").String(string(v.Permission)) + } + + if len(v.Privilege) > 0 { + encoder.SetQuery("privilege").String(string(v.Privilege)) + } + + if v.Target != nil { + encoder.SetQuery("target").String(*v.Target) + } + + if len(v.TargetType) > 0 { + encoder.SetQuery("targetType").String(string(v.TargetType)) } return nil } -type awsRestxml_serializeOpGetBucketReplication struct { +type awsRestxml_serializeOpGetJobTagging struct { } -func (*awsRestxml_serializeOpGetBucketReplication) ID() string { +func (*awsRestxml_serializeOpGetJobTagging) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetBucketReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetJobTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2748,13 +4178,13 @@ func (m *awsRestxml_serializeOpGetBucketReplication) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetBucketReplicationInput) + input, ok := in.Parameters.(*GetJobTaggingInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/replication") + opPath, opQuery := httpbinding.SplitURI("/v20180820/jobs/{JobId}/tagging") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2770,7 +4200,7 @@ func (m *awsRestxml_serializeOpGetBucketReplication) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetBucketReplicationInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetJobTaggingInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2781,7 +4211,7 @@ func (m *awsRestxml_serializeOpGetBucketReplication) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetBucketReplicationInput(v *GetBucketReplicationInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetJobTaggingInput(v *GetJobTaggingInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2791,11 +4221,11 @@ func awsRestxml_serializeOpHttpBindingsGetBucketReplicationInput(v *GetBucketRep encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Bucket == nil || len(*v.Bucket) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} + if v.JobId == nil || len(*v.JobId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member JobId must not be empty")} } - if v.Bucket != nil { - if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { + if v.JobId != nil { + if err := encoder.SetURI("JobId").String(*v.JobId); err != nil { return err } } @@ -2803,14 +4233,14 @@ func awsRestxml_serializeOpHttpBindingsGetBucketReplicationInput(v *GetBucketRep return nil } -type awsRestxml_serializeOpGetBucketTagging struct { +type awsRestxml_serializeOpGetMultiRegionAccessPoint struct { } -func (*awsRestxml_serializeOpGetBucketTagging) ID() string { +func (*awsRestxml_serializeOpGetMultiRegionAccessPoint) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetBucketTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetMultiRegionAccessPoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2818,13 +4248,13 @@ func (m *awsRestxml_serializeOpGetBucketTagging) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetBucketTaggingInput) + input, ok := in.Parameters.(*GetMultiRegionAccessPointInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/tagging") + opPath, opQuery := httpbinding.SplitURI("/v20180820/mrap/instances/{Name+}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2840,7 +4270,7 @@ func (m *awsRestxml_serializeOpGetBucketTagging) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetBucketTaggingInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2851,7 +4281,7 @@ func (m *awsRestxml_serializeOpGetBucketTagging) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetBucketTaggingInput(v *GetBucketTaggingInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointInput(v *GetMultiRegionAccessPointInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2861,11 +4291,11 @@ func awsRestxml_serializeOpHttpBindingsGetBucketTaggingInput(v *GetBucketTagging encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Bucket == nil || len(*v.Bucket) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } - if v.Bucket != nil { - if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } @@ -2873,14 +4303,14 @@ func awsRestxml_serializeOpHttpBindingsGetBucketTaggingInput(v *GetBucketTagging return nil } -type awsRestxml_serializeOpGetBucketVersioning struct { +type awsRestxml_serializeOpGetMultiRegionAccessPointPolicy struct { } -func (*awsRestxml_serializeOpGetBucketVersioning) ID() string { +func (*awsRestxml_serializeOpGetMultiRegionAccessPointPolicy) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetBucketVersioning) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetMultiRegionAccessPointPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2888,13 +4318,13 @@ func (m *awsRestxml_serializeOpGetBucketVersioning) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetBucketVersioningInput) + input, ok := in.Parameters.(*GetMultiRegionAccessPointPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/bucket/{Bucket}/versioning") + opPath, opQuery := httpbinding.SplitURI("/v20180820/mrap/instances/{Name+}/policy") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2910,7 +4340,7 @@ func (m *awsRestxml_serializeOpGetBucketVersioning) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetBucketVersioningInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointPolicyInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2921,7 +4351,7 @@ func (m *awsRestxml_serializeOpGetBucketVersioning) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetBucketVersioningInput(v *GetBucketVersioningInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointPolicyInput(v *GetMultiRegionAccessPointPolicyInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2931,11 +4361,11 @@ func awsRestxml_serializeOpHttpBindingsGetBucketVersioningInput(v *GetBucketVers encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Bucket == nil || len(*v.Bucket) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } - if v.Bucket != nil { - if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } @@ -2943,14 +4373,14 @@ func awsRestxml_serializeOpHttpBindingsGetBucketVersioningInput(v *GetBucketVers return nil } -type awsRestxml_serializeOpGetJobTagging struct { +type awsRestxml_serializeOpGetMultiRegionAccessPointPolicyStatus struct { } -func (*awsRestxml_serializeOpGetJobTagging) ID() string { +func (*awsRestxml_serializeOpGetMultiRegionAccessPointPolicyStatus) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetJobTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetMultiRegionAccessPointPolicyStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2958,13 +4388,13 @@ func (m *awsRestxml_serializeOpGetJobTagging) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetJobTaggingInput) + input, ok := in.Parameters.(*GetMultiRegionAccessPointPolicyStatusInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/jobs/{JobId}/tagging") + opPath, opQuery := httpbinding.SplitURI("/v20180820/mrap/instances/{Name+}/policystatus") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2980,7 +4410,7 @@ func (m *awsRestxml_serializeOpGetJobTagging) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetJobTaggingInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointPolicyStatusInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2991,7 +4421,7 @@ func (m *awsRestxml_serializeOpGetJobTagging) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetJobTaggingInput(v *GetJobTaggingInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointPolicyStatusInput(v *GetMultiRegionAccessPointPolicyStatusInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3001,11 +4431,11 @@ func awsRestxml_serializeOpHttpBindingsGetJobTaggingInput(v *GetJobTaggingInput, encoder.SetHeader(locationName).String(*v.AccountId) } - if v.JobId == nil || len(*v.JobId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member JobId must not be empty")} + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } - if v.JobId != nil { - if err := encoder.SetURI("JobId").String(*v.JobId); err != nil { + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } @@ -3013,14 +4443,14 @@ func awsRestxml_serializeOpHttpBindingsGetJobTaggingInput(v *GetJobTaggingInput, return nil } -type awsRestxml_serializeOpGetMultiRegionAccessPoint struct { +type awsRestxml_serializeOpGetMultiRegionAccessPointRoutes struct { } -func (*awsRestxml_serializeOpGetMultiRegionAccessPoint) ID() string { +func (*awsRestxml_serializeOpGetMultiRegionAccessPointRoutes) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetMultiRegionAccessPoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetMultiRegionAccessPointRoutes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3028,13 +4458,13 @@ func (m *awsRestxml_serializeOpGetMultiRegionAccessPoint) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetMultiRegionAccessPointInput) + input, ok := in.Parameters.(*GetMultiRegionAccessPointRoutesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/mrap/instances/{Name+}") + opPath, opQuery := httpbinding.SplitURI("/v20180820/mrap/instances/{Mrap+}/routes") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -3050,7 +4480,7 @@ func (m *awsRestxml_serializeOpGetMultiRegionAccessPoint) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointRoutesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3061,7 +4491,7 @@ func (m *awsRestxml_serializeOpGetMultiRegionAccessPoint) HandleSerialize(ctx co return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointInput(v *GetMultiRegionAccessPointInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointRoutesInput(v *GetMultiRegionAccessPointRoutesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3071,11 +4501,11 @@ func awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointInput(v *GetMult encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + if v.Mrap == nil || len(*v.Mrap) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Mrap must not be empty")} } - if v.Name != nil { - if err := encoder.SetURI("Name").String(*v.Name); err != nil { + if v.Mrap != nil { + if err := encoder.SetURI("Mrap").String(*v.Mrap); err != nil { return err } } @@ -3083,14 +4513,14 @@ func awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointInput(v *GetMult return nil } -type awsRestxml_serializeOpGetMultiRegionAccessPointPolicy struct { +type awsRestxml_serializeOpGetPublicAccessBlock struct { } -func (*awsRestxml_serializeOpGetMultiRegionAccessPointPolicy) ID() string { +func (*awsRestxml_serializeOpGetPublicAccessBlock) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetMultiRegionAccessPointPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetPublicAccessBlock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3098,13 +4528,13 @@ func (m *awsRestxml_serializeOpGetMultiRegionAccessPointPolicy) HandleSerialize( return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetMultiRegionAccessPointPolicyInput) + input, ok := in.Parameters.(*GetPublicAccessBlockInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/mrap/instances/{Name+}/policy") + opPath, opQuery := httpbinding.SplitURI("/v20180820/configuration/publicAccessBlock") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -3120,7 +4550,7 @@ func (m *awsRestxml_serializeOpGetMultiRegionAccessPointPolicy) HandleSerialize( return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointPolicyInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetPublicAccessBlockInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3131,7 +4561,7 @@ func (m *awsRestxml_serializeOpGetMultiRegionAccessPointPolicy) HandleSerialize( return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointPolicyInput(v *GetMultiRegionAccessPointPolicyInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetPublicAccessBlockInput(v *GetPublicAccessBlockInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3141,26 +4571,17 @@ func awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointPolicyInput(v *G encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} - } - if v.Name != nil { - if err := encoder.SetURI("Name").String(*v.Name); err != nil { - return err - } - } - return nil } -type awsRestxml_serializeOpGetMultiRegionAccessPointPolicyStatus struct { +type awsRestxml_serializeOpGetStorageLensConfiguration struct { } -func (*awsRestxml_serializeOpGetMultiRegionAccessPointPolicyStatus) ID() string { +func (*awsRestxml_serializeOpGetStorageLensConfiguration) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetMultiRegionAccessPointPolicyStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetStorageLensConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3168,13 +4589,13 @@ func (m *awsRestxml_serializeOpGetMultiRegionAccessPointPolicyStatus) HandleSeri return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetMultiRegionAccessPointPolicyStatusInput) + input, ok := in.Parameters.(*GetStorageLensConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/mrap/instances/{Name+}/policystatus") + opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelens/{ConfigId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -3190,7 +4611,7 @@ func (m *awsRestxml_serializeOpGetMultiRegionAccessPointPolicyStatus) HandleSeri return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointPolicyStatusInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetStorageLensConfigurationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3201,7 +4622,7 @@ func (m *awsRestxml_serializeOpGetMultiRegionAccessPointPolicyStatus) HandleSeri return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointPolicyStatusInput(v *GetMultiRegionAccessPointPolicyStatusInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetStorageLensConfigurationInput(v *GetStorageLensConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3211,11 +4632,11 @@ func awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointPolicyStatusInpu encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + if v.ConfigId == nil || len(*v.ConfigId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigId must not be empty")} } - if v.Name != nil { - if err := encoder.SetURI("Name").String(*v.Name); err != nil { + if v.ConfigId != nil { + if err := encoder.SetURI("ConfigId").String(*v.ConfigId); err != nil { return err } } @@ -3223,14 +4644,14 @@ func awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointPolicyStatusInpu return nil } -type awsRestxml_serializeOpGetMultiRegionAccessPointRoutes struct { +type awsRestxml_serializeOpGetStorageLensConfigurationTagging struct { } -func (*awsRestxml_serializeOpGetMultiRegionAccessPointRoutes) ID() string { +func (*awsRestxml_serializeOpGetStorageLensConfigurationTagging) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetMultiRegionAccessPointRoutes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetStorageLensConfigurationTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3238,13 +4659,13 @@ func (m *awsRestxml_serializeOpGetMultiRegionAccessPointRoutes) HandleSerialize( return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetMultiRegionAccessPointRoutesInput) + input, ok := in.Parameters.(*GetStorageLensConfigurationTaggingInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/mrap/instances/{Mrap+}/routes") + opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelens/{ConfigId}/tagging") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -3260,7 +4681,7 @@ func (m *awsRestxml_serializeOpGetMultiRegionAccessPointRoutes) HandleSerialize( return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointRoutesInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetStorageLensConfigurationTaggingInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3271,7 +4692,7 @@ func (m *awsRestxml_serializeOpGetMultiRegionAccessPointRoutes) HandleSerialize( return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointRoutesInput(v *GetMultiRegionAccessPointRoutesInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetStorageLensConfigurationTaggingInput(v *GetStorageLensConfigurationTaggingInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3281,11 +4702,11 @@ func awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointRoutesInput(v *G encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Mrap == nil || len(*v.Mrap) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Mrap must not be empty")} + if v.ConfigId == nil || len(*v.ConfigId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigId must not be empty")} } - if v.Mrap != nil { - if err := encoder.SetURI("Mrap").String(*v.Mrap); err != nil { + if v.ConfigId != nil { + if err := encoder.SetURI("ConfigId").String(*v.ConfigId); err != nil { return err } } @@ -3293,14 +4714,14 @@ func awsRestxml_serializeOpHttpBindingsGetMultiRegionAccessPointRoutesInput(v *G return nil } -type awsRestxml_serializeOpGetPublicAccessBlock struct { +type awsRestxml_serializeOpGetStorageLensGroup struct { } -func (*awsRestxml_serializeOpGetPublicAccessBlock) ID() string { +func (*awsRestxml_serializeOpGetStorageLensGroup) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetPublicAccessBlock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpGetStorageLensGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3308,13 +4729,13 @@ func (m *awsRestxml_serializeOpGetPublicAccessBlock) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetPublicAccessBlockInput) + input, ok := in.Parameters.(*GetStorageLensGroupInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/configuration/publicAccessBlock") + opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelensgroup/{Name}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -3330,7 +4751,7 @@ func (m *awsRestxml_serializeOpGetPublicAccessBlock) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetPublicAccessBlockInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsGetStorageLensGroupInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3341,7 +4762,7 @@ func (m *awsRestxml_serializeOpGetPublicAccessBlock) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetPublicAccessBlockInput(v *GetPublicAccessBlockInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsGetStorageLensGroupInput(v *GetStorageLensGroupInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3351,17 +4772,26 @@ func awsRestxml_serializeOpHttpBindingsGetPublicAccessBlockInput(v *GetPublicAcc encoder.SetHeader(locationName).String(*v.AccountId) } + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + return nil } -type awsRestxml_serializeOpGetStorageLensConfiguration struct { +type awsRestxml_serializeOpListAccessGrants struct { } -func (*awsRestxml_serializeOpGetStorageLensConfiguration) ID() string { +func (*awsRestxml_serializeOpListAccessGrants) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetStorageLensConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpListAccessGrants) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3369,13 +4799,13 @@ func (m *awsRestxml_serializeOpGetStorageLensConfiguration) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetStorageLensConfigurationInput) + input, ok := in.Parameters.(*ListAccessGrantsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelens/{ConfigId}") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance/grants") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -3391,7 +4821,7 @@ func (m *awsRestxml_serializeOpGetStorageLensConfiguration) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetStorageLensConfigurationInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsListAccessGrantsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3402,7 +4832,7 @@ func (m *awsRestxml_serializeOpGetStorageLensConfiguration) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetStorageLensConfigurationInput(v *GetStorageLensConfigurationInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsListAccessGrantsInput(v *ListAccessGrantsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3412,26 +4842,45 @@ func awsRestxml_serializeOpHttpBindingsGetStorageLensConfigurationInput(v *GetSt encoder.SetHeader(locationName).String(*v.AccountId) } - if v.ConfigId == nil || len(*v.ConfigId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigId must not be empty")} + if v.ApplicationArn != nil { + encoder.SetQuery("application_arn").String(*v.ApplicationArn) + } + + if v.GranteeIdentifier != nil { + encoder.SetQuery("granteeidentifier").String(*v.GranteeIdentifier) + } + + if len(v.GranteeType) > 0 { + encoder.SetQuery("granteetype").String(string(v.GranteeType)) + } + + if v.GrantScope != nil { + encoder.SetQuery("grantscope").String(*v.GrantScope) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) } - if v.ConfigId != nil { - if err := encoder.SetURI("ConfigId").String(*v.ConfigId); err != nil { - return err - } + + if len(v.Permission) > 0 { + encoder.SetQuery("permission").String(string(v.Permission)) } return nil } -type awsRestxml_serializeOpGetStorageLensConfigurationTagging struct { +type awsRestxml_serializeOpListAccessGrantsInstances struct { } -func (*awsRestxml_serializeOpGetStorageLensConfigurationTagging) ID() string { +func (*awsRestxml_serializeOpListAccessGrantsInstances) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetStorageLensConfigurationTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpListAccessGrantsInstances) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3439,13 +4888,13 @@ func (m *awsRestxml_serializeOpGetStorageLensConfigurationTagging) HandleSeriali return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetStorageLensConfigurationTaggingInput) + input, ok := in.Parameters.(*ListAccessGrantsInstancesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelens/{ConfigId}/tagging") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstances") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -3461,7 +4910,7 @@ func (m *awsRestxml_serializeOpGetStorageLensConfigurationTagging) HandleSeriali return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetStorageLensConfigurationTaggingInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsListAccessGrantsInstancesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3472,7 +4921,7 @@ func (m *awsRestxml_serializeOpGetStorageLensConfigurationTagging) HandleSeriali return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetStorageLensConfigurationTaggingInput(v *GetStorageLensConfigurationTaggingInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsListAccessGrantsInstancesInput(v *ListAccessGrantsInstancesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3482,26 +4931,25 @@ func awsRestxml_serializeOpHttpBindingsGetStorageLensConfigurationTaggingInput(v encoder.SetHeader(locationName).String(*v.AccountId) } - if v.ConfigId == nil || len(*v.ConfigId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigId must not be empty")} + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) } - if v.ConfigId != nil { - if err := encoder.SetURI("ConfigId").String(*v.ConfigId); err != nil { - return err - } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } -type awsRestxml_serializeOpGetStorageLensGroup struct { +type awsRestxml_serializeOpListAccessGrantsLocations struct { } -func (*awsRestxml_serializeOpGetStorageLensGroup) ID() string { +func (*awsRestxml_serializeOpListAccessGrantsLocations) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpGetStorageLensGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpListAccessGrantsLocations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3509,13 +4957,13 @@ func (m *awsRestxml_serializeOpGetStorageLensGroup) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetStorageLensGroupInput) + input, ok := in.Parameters.(*ListAccessGrantsLocationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v20180820/storagelensgroup/{Name}") + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance/locations") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -3531,7 +4979,7 @@ func (m *awsRestxml_serializeOpGetStorageLensGroup) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsGetStorageLensGroupInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsListAccessGrantsLocationsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3542,7 +4990,7 @@ func (m *awsRestxml_serializeOpGetStorageLensGroup) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsGetStorageLensGroupInput(v *GetStorageLensGroupInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsListAccessGrantsLocationsInput(v *ListAccessGrantsLocationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -3552,13 +5000,16 @@ func awsRestxml_serializeOpHttpBindingsGetStorageLensGroupInput(v *GetStorageLen encoder.SetHeader(locationName).String(*v.AccountId) } - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + if v.LocationScope != nil { + encoder.SetQuery("locationscope").String(*v.LocationScope) } - if v.Name != nil { - if err := encoder.SetURI("Name").String(*v.Name); err != nil { - return err - } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) } return nil @@ -4124,6 +5575,112 @@ func awsRestxml_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForRe return nil } +type awsRestxml_serializeOpPutAccessGrantsInstanceResourcePolicy struct { +} + +func (*awsRestxml_serializeOpPutAccessGrantsInstanceResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpPutAccessGrantsInstanceResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutAccessGrantsInstanceResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance/resourcepolicy") + 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 := awsRestxml_serializeOpHttpBindingsPutAccessGrantsInstanceResourcePolicyInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/xml") + + xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "PutAccessGrantsInstanceResourcePolicyRequest", + }, + Attr: rootAttr, + } + root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/")) + if err := awsRestxml_serializeOpDocumentPutAccessGrantsInstanceResourcePolicyInput(input, xmlEncoder.RootElement(root)); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsPutAccessGrantsInstanceResourcePolicyInput(v *PutAccessGrantsInstanceResourcePolicyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + return nil +} + +func awsRestxml_serializeOpDocumentPutAccessGrantsInstanceResourcePolicyInput(v *PutAccessGrantsInstanceResourcePolicyInput, value smithyxml.Value) error { + defer value.Close() + if v.Organization != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Organization", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.Organization) + } + if v.Policy != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Policy", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.Policy) + } + return nil +} + type awsRestxml_serializeOpPutAccessPointConfigurationForObjectLambda struct { } @@ -5740,6 +7297,110 @@ func awsRestxml_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, return nil } +type awsRestxml_serializeOpUpdateAccessGrantsLocation struct { +} + +func (*awsRestxml_serializeOpUpdateAccessGrantsLocation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpUpdateAccessGrantsLocation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateAccessGrantsLocationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20180820/accessgrantsinstance/location/{AccessGrantsLocationId}") + 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 := awsRestxml_serializeOpHttpBindingsUpdateAccessGrantsLocationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/xml") + + xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "UpdateAccessGrantsLocationRequest", + }, + Attr: rootAttr, + } + root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://awss3control.amazonaws.com/doc/2018-08-20/")) + if err := awsRestxml_serializeOpDocumentUpdateAccessGrantsLocationInput(input, xmlEncoder.RootElement(root)); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsUpdateAccessGrantsLocationInput(v *UpdateAccessGrantsLocationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccessGrantsLocationId == nil || len(*v.AccessGrantsLocationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AccessGrantsLocationId must not be empty")} + } + if v.AccessGrantsLocationId != nil { + if err := encoder.SetURI("AccessGrantsLocationId").String(*v.AccessGrantsLocationId); err != nil { + return err + } + } + + if v.AccountId != nil && len(*v.AccountId) > 0 { + locationName := "X-Amz-Account-Id" + encoder.SetHeader(locationName).String(*v.AccountId) + } + + return nil +} + +func awsRestxml_serializeOpDocumentUpdateAccessGrantsLocationInput(v *UpdateAccessGrantsLocationInput, value smithyxml.Value) error { + defer value.Close() + if v.IAMRoleArn != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "IAMRoleArn", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.IAMRoleArn) + } + return nil +} + type awsRestxml_serializeOpUpdateJobPriority struct { } @@ -6030,6 +7691,22 @@ func awsRestxml_serializeDocumentAccessControlTranslation(v *types.AccessControl return nil } +func awsRestxml_serializeDocumentAccessGrantsLocationConfiguration(v *types.AccessGrantsLocationConfiguration, value smithyxml.Value) error { + defer value.Close() + if v.S3SubPrefix != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "S3SubPrefix", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.S3SubPrefix) + } + return nil +} + func awsRestxml_serializeDocumentAccountLevel(v *types.AccountLevel, value smithyxml.Value) error { defer value.Close() if v.ActivityMetrics != nil { @@ -6584,6 +8261,33 @@ func awsRestxml_serializeDocumentGeneratedManifestEncryption(v *types.GeneratedM return nil } +func awsRestxml_serializeDocumentGrantee(v *types.Grantee, value smithyxml.Value) error { + defer value.Close() + if v.GranteeIdentifier != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "GranteeIdentifier", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.GranteeIdentifier) + } + if len(v.GranteeType) > 0 { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "GranteeType", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(string(v.GranteeType)) + } + return nil +} + func awsRestxml_serializeDocumentInclude(v *types.Include, value smithyxml.Value) error { defer value.Close() if v.Buckets != nil { diff --git a/service/s3control/types/enums.go b/service/s3control/types/enums.go index a25b6cb8eb4..44bcfc6a70d 100644 --- a/service/s3control/types/enums.go +++ b/service/s3control/types/enums.go @@ -188,6 +188,26 @@ func (GeneratedManifestFormat) Values() []GeneratedManifestFormat { } } +type GranteeType string + +// Enum values for GranteeType +const ( + GranteeTypeDirectoryUser GranteeType = "DIRECTORY_USER" + GranteeTypeDirectoryGroup GranteeType = "DIRECTORY_GROUP" + GranteeTypeIam GranteeType = "IAM" +) + +// Values returns all known values for GranteeType. 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 (GranteeType) Values() []GranteeType { + return []GranteeType{ + "DIRECTORY_USER", + "DIRECTORY_GROUP", + "IAM", + } +} + type JobManifestFieldName string // Enum values for JobManifestFieldName @@ -529,6 +549,44 @@ func (OwnerOverride) Values() []OwnerOverride { } } +type Permission string + +// Enum values for Permission +const ( + PermissionRead Permission = "READ" + PermissionWrite Permission = "WRITE" + PermissionReadwrite Permission = "READWRITE" +) + +// Values returns all known values for Permission. 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 (Permission) Values() []Permission { + return []Permission{ + "READ", + "WRITE", + "READWRITE", + } +} + +type Privilege string + +// Enum values for Privilege +const ( + PrivilegeMinimal Privilege = "Minimal" + PrivilegeDefault Privilege = "Default" +) + +// Values returns all known values for Privilege. 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 (Privilege) Values() []Privilege { + return []Privilege{ + "Minimal", + "Default", + } +} + type ReplicaModificationsStatus string // Enum values for ReplicaModificationsStatus @@ -839,6 +897,22 @@ func (S3Permission) Values() []S3Permission { } } +type S3PrefixType string + +// Enum values for S3PrefixType +const ( + S3PrefixTypeObject S3PrefixType = "Object" +) + +// Values returns all known values for S3PrefixType. 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 (S3PrefixType) Values() []S3PrefixType { + return []S3PrefixType{ + "Object", + } +} + type S3SSEAlgorithm string // Enum values for S3SSEAlgorithm diff --git a/service/s3control/types/types.go b/service/s3control/types/types.go index 05f13faf1df..eb436896388 100644 --- a/service/s3control/types/types.go +++ b/service/s3control/types/types.go @@ -29,6 +29,27 @@ type AccessControlTranslation struct { noSmithyDocumentSerde } +// The configuration options of the S3 Access Grants location. It contains the +// S3SubPrefix field. The grant scope, the data to which you are granting access, +// is the result of appending the Subprefix field to the scope of the registered +// location. +type AccessGrantsLocationConfiguration struct { + + // The S3SubPrefix is appended to the location scope creating the grant scope. Use + // this field to narrow the scope of the grant to a subset of the location scope. + // This field is required if the location scope is the default location s3:// + // because you cannot create a grant for all of your S3 data in the Region and must + // narrow the scope. For example, if the location scope is the default location + // s3:// , the S3SubPrefx can be a /*, so the full grant scope path would be + // s3:///* . Or the S3SubPrefx can be /* , so the full grant scope path would be or + // s3:///* . If the S3SubPrefix includes a prefix, append the wildcard character * + // after the prefix to indicate that you want to include all object key names in + // the bucket that start with that prefix. + S3SubPrefix *string + + noSmithyDocumentSerde +} + // An access point used to access a bucket. type AccessPoint struct { @@ -318,6 +339,29 @@ type CreateMultiRegionAccessPointInput struct { noSmithyDocumentSerde } +// The Amazon Web Services Security Token Service temporary credential that S3 +// Access Grants vends to grantees and client applications. +type Credentials struct { + + // The unique access key ID of the Amazon Web Services STS temporary credential + // that S3 Access Grants vends to grantees and client applications. + AccessKeyId *string + + // The expiration date and time of the temporary credential that S3 Access Grants + // vends to grantees and client applications. + Expiration *time.Time + + // The secret access key of the Amazon Web Services STS temporary credential that + // S3 Access Grants vends to grantees and client applications. + SecretAccessKey *string + + // The Amazon Web Services STS temporary credential that S3 Access Grants vends to + // grantees and client applications. + SessionToken *string + + noSmithyDocumentSerde +} + // Specifies whether S3 on Outposts replicates delete markers. If you specify a // Filter element in your replication configuration, you must also include a // DeleteMarkerReplication element. If your Filter includes a Tag element, the @@ -475,6 +519,36 @@ type GeneratedManifestEncryption struct { noSmithyDocumentSerde } +// The user, group, or role to which you are granting access. You can grant access +// to an IAM user or role. If you have added your corporate directory to Amazon Web +// Services IAM Identity Center and associated your Identity Center instance with +// your S3 Access Grants instance, the grantee can also be a corporate directory +// user or group. +type Grantee struct { + + // The unique identifier of the Grantee . If the grantee type is IAM , the + // identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the + // grantee type is a directory user or group, the identifier is 128-bit universally + // unique identifier (UUID) in the format a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 . + // You can obtain this UUID from your Amazon Web Services IAM Identity Center + // instance. + GranteeIdentifier *string + + // The type of the grantee to which access has been granted. It can be one of the + // following values: + // - IAM - An IAM user or role. + // - DIRECTORY_USER - Your corporate directory user. You can use this option if + // you have added your corporate identity directory to IAM Identity Center and + // associated the IAM Identity Center instance with your S3 Access Grants instance. + // + // - DIRECTORY_GROUP - Your corporate directory group. You can use this option if + // you have added your corporate identity directory to IAM Identity Center and + // associated the IAM Identity Center instance with your S3 Access Grants instance. + GranteeType GranteeType + + noSmithyDocumentSerde +} + // A container for what Amazon S3 Storage Lens configuration includes. type Include struct { @@ -976,6 +1050,109 @@ type LifecycleRuleFilter struct { noSmithyDocumentSerde } +// Information about the access grant. +type ListAccessGrantEntry struct { + + // The Amazon Resource Name (ARN) of the access grant. + AccessGrantArn *string + + // The ID of the access grant. S3 Access Grants auto-generates this ID when you + // create the access grant. + AccessGrantId *string + + // The configuration options of the grant location. The grant location is the S3 + // path to the data to which you are granting access. + AccessGrantsLocationConfiguration *AccessGrantsLocationConfiguration + + // The ID of the registered location to which you are granting access. S3 Access + // Grants assigns this ID when you register the location. S3 Access Grants assigns + // the ID default to the default location s3:// and assigns an auto-generated ID + // to other locations that you register. + AccessGrantsLocationId *string + + // The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center + // application associated with your Identity Center instance. If the grant includes + // an application ARN, the grantee can only access the S3 data through this + // application. + ApplicationArn *string + + // The date and time when you created the S3 Access Grants instance. + CreatedAt *time.Time + + // The S3 path of the data to which you are granting access. It is the result of + // appending the Subprefix to the location scope. + GrantScope *string + + // The user, group, or role to which you are granting access. You can grant access + // to an IAM user or role. If you have added your corporate directory to Amazon Web + // Services IAM Identity Center and associated your Identity Center instance with + // your S3 Access Grants instance, the grantee can also be a corporate directory + // user or group. + Grantee *Grantee + + // The type of access granted to your S3 data, which can be set to one of the + // following values: + // - READ – Grant read-only access to the S3 data. + // - WRITE – Grant write-only access to the S3 data. + // - READWRITE – Grant both read and write access to the S3 data. + Permission Permission + + noSmithyDocumentSerde +} + +// Information about the S3 Access Grants instance. +type ListAccessGrantsInstanceEntry struct { + + // The Amazon Resource Name (ARN) of the S3 Access Grants instance. + AccessGrantsInstanceArn *string + + // The ID of the S3 Access Grants instance. The ID is default . You can have one S3 + // Access Grants instance per Region per account. + AccessGrantsInstanceId *string + + // The date and time when you created the S3 Access Grants instance. + CreatedAt *time.Time + + // If you associated your S3 Access Grants instance with an Amazon Web Services + // IAM Identity Center instance, this field returns the Amazon Resource Name (ARN) + // of the IAM Identity Center instance application; a subresource of the original + // Identity Center instance. S3 Access Grants creates this Identity Center + // application for the specific S3 Access Grants instance. + IdentityCenterArn *string + + noSmithyDocumentSerde +} + +// A container for information about the registered location. +type ListAccessGrantsLocationsEntry struct { + + // The Amazon Resource Name (ARN) of the registered location. + AccessGrantsLocationArn *string + + // The ID of the registered location to which you are granting access. S3 Access + // Grants assigns this ID when you register the location. S3 Access Grants assigns + // the ID default to the default location s3:// and assigns an auto-generated ID + // to other locations that you register. + AccessGrantsLocationId *string + + // The date and time when you registered the location. + CreatedAt *time.Time + + // The Amazon Resource Name (ARN) of the IAM role for the registered location. S3 + // Access Grants assumes this role to manage access to the registered location. + IAMRoleArn *string + + // The S3 path to the location that you are registering. The location scope can be + // the default S3 location s3:// , the S3 path to a bucket s3:// , or the S3 path + // to a bucket and prefix s3:/// . A prefix in S3 is a string of characters at the + // beginning of an object key name used to organize the objects that you store in + // your S3 buckets. For example, object key names that start with the engineering/ + // prefix or object key names that start with the marketing/campaigns/ prefix. + LocationScope *string + + noSmithyDocumentSerde +} + // Part of ListStorageLensConfigurationResult . Each entry includes the description // of the S3 Storage Lens configuration, its home Region, whether it is enabled, // its Amazon Resource Name (ARN), and config ID. @@ -2442,19 +2619,22 @@ type StorageLensTag struct { // An Amazon Web Services resource tag that's associated with your S3 resource. // You can add tags to new objects when you upload them, or you can add object tags -// to existing objects. This data type is only supported for S3 Storage Lens groups (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-lens-groups.html) -// . +// to existing objects. This operation is only supported for S3 Storage Lens groups (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-lens-groups.html) +// and for S3 Access Grants (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-grants-tagging.html) +// . The tagged resource can be an S3 Storage Lens group or S3 Access Grants +// instance, registered location, or grant. type Tag struct { - // The tag key for your Amazon Web Services resource. A tag key can be up to 128 - // Unicode characters in length and is case-sensitive. System created tags that - // begin with aws: aren’t supported. + // The key of the key-value pair of a tag added to your Amazon Web Services + // resource. A tag key can be up to 128 Unicode characters in length and is + // case-sensitive. System created tags that begin with aws: aren’t supported. // // This member is required. Key *string - // The tag value for your Amazon Web Services resource. A tag value can be up to - // 256 Unicode characters in length and is case-sensitive. + // The value of the key-value pair of a tag added to your Amazon Web Services + // resource. A tag value can be up to 256 Unicode characters in length and is + // case-sensitive. // // This member is required. Value *string diff --git a/service/s3control/validators.go b/service/s3control/validators.go index e55edb8000b..37aec57a71f 100644 --- a/service/s3control/validators.go +++ b/service/s3control/validators.go @@ -10,6 +10,86 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpAssociateAccessGrantsIdentityCenter struct { +} + +func (*validateOpAssociateAccessGrantsIdentityCenter) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociateAccessGrantsIdentityCenter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociateAccessGrantsIdentityCenterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociateAccessGrantsIdentityCenterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateAccessGrant struct { +} + +func (*validateOpCreateAccessGrant) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAccessGrant) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAccessGrantInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAccessGrantInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateAccessGrantsInstance struct { +} + +func (*validateOpCreateAccessGrantsInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAccessGrantsInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAccessGrantsInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAccessGrantsInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateAccessGrantsLocation struct { +} + +func (*validateOpCreateAccessGrantsLocation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAccessGrantsLocation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAccessGrantsLocationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAccessGrantsLocationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateAccessPointForObjectLambda struct { } @@ -130,6 +210,86 @@ func (m *validateOpCreateStorageLensGroup) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpDeleteAccessGrant struct { +} + +func (*validateOpDeleteAccessGrant) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAccessGrant) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAccessGrantInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAccessGrantInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteAccessGrantsInstance struct { +} + +func (*validateOpDeleteAccessGrantsInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAccessGrantsInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAccessGrantsInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAccessGrantsInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteAccessGrantsInstanceResourcePolicy struct { +} + +func (*validateOpDeleteAccessGrantsInstanceResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAccessGrantsInstanceResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAccessGrantsInstanceResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAccessGrantsInstanceResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteAccessGrantsLocation struct { +} + +func (*validateOpDeleteAccessGrantsLocation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAccessGrantsLocation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAccessGrantsLocationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAccessGrantsLocationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteAccessPointForObjectLambda struct { } @@ -470,6 +630,126 @@ func (m *validateOpDescribeMultiRegionAccessPointOperation) HandleInitialize(ctx return next.HandleInitialize(ctx, in) } +type validateOpDissociateAccessGrantsIdentityCenter struct { +} + +func (*validateOpDissociateAccessGrantsIdentityCenter) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDissociateAccessGrantsIdentityCenter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DissociateAccessGrantsIdentityCenterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDissociateAccessGrantsIdentityCenterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetAccessGrant struct { +} + +func (*validateOpGetAccessGrant) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAccessGrant) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAccessGrantInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAccessGrantInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetAccessGrantsInstanceForPrefix struct { +} + +func (*validateOpGetAccessGrantsInstanceForPrefix) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAccessGrantsInstanceForPrefix) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAccessGrantsInstanceForPrefixInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAccessGrantsInstanceForPrefixInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetAccessGrantsInstance struct { +} + +func (*validateOpGetAccessGrantsInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAccessGrantsInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAccessGrantsInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAccessGrantsInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetAccessGrantsInstanceResourcePolicy struct { +} + +func (*validateOpGetAccessGrantsInstanceResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAccessGrantsInstanceResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAccessGrantsInstanceResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAccessGrantsInstanceResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetAccessGrantsLocation struct { +} + +func (*validateOpGetAccessGrantsLocation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAccessGrantsLocation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAccessGrantsLocationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAccessGrantsLocationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetAccessPointConfigurationForObjectLambda struct { } @@ -730,6 +1010,26 @@ func (m *validateOpGetBucketVersioning) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpGetDataAccess struct { +} + +func (*validateOpGetDataAccess) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDataAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDataAccessInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDataAccessInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetJobTagging struct { } @@ -910,6 +1210,66 @@ func (m *validateOpGetStorageLensGroup) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpListAccessGrants struct { +} + +func (*validateOpListAccessGrants) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAccessGrants) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAccessGrantsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAccessGrantsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListAccessGrantsInstances struct { +} + +func (*validateOpListAccessGrantsInstances) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAccessGrantsInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAccessGrantsInstancesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAccessGrantsInstancesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListAccessGrantsLocations struct { +} + +func (*validateOpListAccessGrantsLocations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAccessGrantsLocations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAccessGrantsLocationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAccessGrantsLocationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListAccessPointsForObjectLambda struct { } @@ -1070,6 +1430,26 @@ func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpPutAccessGrantsInstanceResourcePolicy struct { +} + +func (*validateOpPutAccessGrantsInstanceResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutAccessGrantsInstanceResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutAccessGrantsInstanceResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutAccessGrantsInstanceResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpPutAccessPointConfigurationForObjectLambda struct { } @@ -1390,6 +1770,26 @@ func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateAccessGrantsLocation struct { +} + +func (*validateOpUpdateAccessGrantsLocation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateAccessGrantsLocation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateAccessGrantsLocationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateAccessGrantsLocationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateJobPriority struct { } @@ -1450,6 +1850,22 @@ func (m *validateOpUpdateStorageLensGroup) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +func addOpAssociateAccessGrantsIdentityCenterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociateAccessGrantsIdentityCenter{}, middleware.After) +} + +func addOpCreateAccessGrantValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAccessGrant{}, middleware.After) +} + +func addOpCreateAccessGrantsInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAccessGrantsInstance{}, middleware.After) +} + +func addOpCreateAccessGrantsLocationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAccessGrantsLocation{}, middleware.After) +} + func addOpCreateAccessPointForObjectLambdaValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateAccessPointForObjectLambda{}, middleware.After) } @@ -1474,6 +1890,22 @@ func addOpCreateStorageLensGroupValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpCreateStorageLensGroup{}, middleware.After) } +func addOpDeleteAccessGrantValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAccessGrant{}, middleware.After) +} + +func addOpDeleteAccessGrantsInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAccessGrantsInstance{}, middleware.After) +} + +func addOpDeleteAccessGrantsInstanceResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAccessGrantsInstanceResourcePolicy{}, middleware.After) +} + +func addOpDeleteAccessGrantsLocationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAccessGrantsLocation{}, middleware.After) +} + func addOpDeleteAccessPointForObjectLambdaValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAccessPointForObjectLambda{}, middleware.After) } @@ -1542,6 +1974,30 @@ func addOpDescribeMultiRegionAccessPointOperationValidationMiddleware(stack *mid return stack.Initialize.Add(&validateOpDescribeMultiRegionAccessPointOperation{}, middleware.After) } +func addOpDissociateAccessGrantsIdentityCenterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDissociateAccessGrantsIdentityCenter{}, middleware.After) +} + +func addOpGetAccessGrantValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAccessGrant{}, middleware.After) +} + +func addOpGetAccessGrantsInstanceForPrefixValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAccessGrantsInstanceForPrefix{}, middleware.After) +} + +func addOpGetAccessGrantsInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAccessGrantsInstance{}, middleware.After) +} + +func addOpGetAccessGrantsInstanceResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAccessGrantsInstanceResourcePolicy{}, middleware.After) +} + +func addOpGetAccessGrantsLocationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAccessGrantsLocation{}, middleware.After) +} + func addOpGetAccessPointConfigurationForObjectLambdaValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAccessPointConfigurationForObjectLambda{}, middleware.After) } @@ -1594,6 +2050,10 @@ func addOpGetBucketVersioningValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpGetBucketVersioning{}, middleware.After) } +func addOpGetDataAccessValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDataAccess{}, middleware.After) +} + func addOpGetJobTaggingValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetJobTagging{}, middleware.After) } @@ -1630,6 +2090,18 @@ func addOpGetStorageLensGroupValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpGetStorageLensGroup{}, middleware.After) } +func addOpListAccessGrantsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAccessGrants{}, middleware.After) +} + +func addOpListAccessGrantsInstancesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAccessGrantsInstances{}, middleware.After) +} + +func addOpListAccessGrantsLocationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAccessGrantsLocations{}, middleware.After) +} + func addOpListAccessPointsForObjectLambdaValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAccessPointsForObjectLambda{}, middleware.After) } @@ -1662,6 +2134,10 @@ func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } +func addOpPutAccessGrantsInstanceResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutAccessGrantsInstanceResourcePolicy{}, middleware.After) +} + func addOpPutAccessPointConfigurationForObjectLambdaValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutAccessPointConfigurationForObjectLambda{}, middleware.After) } @@ -1726,6 +2202,10 @@ func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } +func addOpUpdateAccessGrantsLocationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateAccessGrantsLocation{}, middleware.After) +} + func addOpUpdateJobPriorityValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateJobPriority{}, middleware.After) } @@ -3047,12 +3527,91 @@ func validateTagging(v *types.Tagging) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "Tagging"} - if v.TagSet == nil { - invalidParams.Add(smithy.NewErrParamRequired("TagSet")) - } else if v.TagSet != nil { - if err := validateS3TagSet(v.TagSet); err != nil { - invalidParams.AddNested("TagSet", err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "Tagging"} + if v.TagSet == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagSet")) + } else if v.TagSet != nil { + if err := validateS3TagSet(v.TagSet); err != nil { + invalidParams.AddNested("TagSet", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTagList(v []types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagList"} + for i := range v { + if err := validateTag(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateVpcConfiguration(v *types.VpcConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VpcConfiguration"} + if v.VpcId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAssociateAccessGrantsIdentityCenterInput(v *AssociateAccessGrantsIdentityCenterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociateAccessGrantsIdentityCenterInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if v.IdentityCenterArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("IdentityCenterArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateAccessGrantInput(v *CreateAccessGrantInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateAccessGrantInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if v.AccessGrantsLocationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessGrantsLocationId")) + } + if v.Grantee == nil { + invalidParams.Add(smithy.NewErrParamRequired("Grantee")) + } + if len(v.Permission) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Permission")) + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { @@ -3062,14 +3621,17 @@ func validateTagging(v *types.Tagging) error { } } -func validateTagList(v []types.Tag) error { +func validateOpCreateAccessGrantsInstanceInput(v *CreateAccessGrantsInstanceInput) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "TagList"} - for i := range v { - if err := validateTag(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "CreateAccessGrantsInstanceInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { @@ -3079,13 +3641,24 @@ func validateTagList(v []types.Tag) error { } } -func validateVpcConfiguration(v *types.VpcConfiguration) error { +func validateOpCreateAccessGrantsLocationInput(v *CreateAccessGrantsLocationInput) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "VpcConfiguration"} - if v.VpcId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VpcId")) + invalidParams := smithy.InvalidParamsError{Context: "CreateAccessGrantsLocationInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if v.LocationScope == nil { + invalidParams.Add(smithy.NewErrParamRequired("LocationScope")) + } + if v.IAMRoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("IAMRoleArn")) + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -3265,6 +3838,72 @@ func validateOpCreateStorageLensGroupInput(v *CreateStorageLensGroupInput) error } } +func validateOpDeleteAccessGrantInput(v *DeleteAccessGrantInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAccessGrantInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if v.AccessGrantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessGrantId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAccessGrantsInstanceInput(v *DeleteAccessGrantsInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAccessGrantsInstanceInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAccessGrantsInstanceResourcePolicyInput(v *DeleteAccessGrantsInstanceResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAccessGrantsInstanceResourcePolicyInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAccessGrantsLocationInput(v *DeleteAccessGrantsLocationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAccessGrantsLocationInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if v.AccessGrantsLocationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessGrantsLocationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteAccessPointForObjectLambdaInput(v *DeleteAccessPointForObjectLambdaInput) error { if v == nil { return nil @@ -3575,6 +4214,105 @@ func validateOpDescribeMultiRegionAccessPointOperationInput(v *DescribeMultiRegi } } +func validateOpDissociateAccessGrantsIdentityCenterInput(v *DissociateAccessGrantsIdentityCenterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DissociateAccessGrantsIdentityCenterInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetAccessGrantInput(v *GetAccessGrantInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAccessGrantInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if v.AccessGrantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessGrantId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetAccessGrantsInstanceForPrefixInput(v *GetAccessGrantsInstanceForPrefixInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAccessGrantsInstanceForPrefixInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if v.S3Prefix == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3Prefix")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetAccessGrantsInstanceInput(v *GetAccessGrantsInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAccessGrantsInstanceInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetAccessGrantsInstanceResourcePolicyInput(v *GetAccessGrantsInstanceResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAccessGrantsInstanceResourcePolicyInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetAccessGrantsLocationInput(v *GetAccessGrantsLocationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAccessGrantsLocationInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if v.AccessGrantsLocationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessGrantsLocationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetAccessPointConfigurationForObjectLambdaInput(v *GetAccessPointConfigurationForObjectLambdaInput) error { if v == nil { return nil @@ -3809,6 +4547,27 @@ func validateOpGetBucketVersioningInput(v *GetBucketVersioningInput) error { } } +func validateOpGetDataAccessInput(v *GetDataAccessInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDataAccessInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if v.Target == nil { + invalidParams.Add(smithy.NewErrParamRequired("Target")) + } + if len(v.Permission) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Permission")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetJobTaggingInput(v *GetJobTaggingInput) error { if v == nil { return nil @@ -3968,6 +4727,51 @@ func validateOpGetStorageLensGroupInput(v *GetStorageLensGroupInput) error { } } +func validateOpListAccessGrantsInput(v *ListAccessGrantsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAccessGrantsInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListAccessGrantsInstancesInput(v *ListAccessGrantsInstancesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAccessGrantsInstancesInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListAccessGrantsLocationsInput(v *ListAccessGrantsLocationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAccessGrantsLocationsInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListAccessPointsForObjectLambdaInput(v *ListAccessPointsForObjectLambdaInput) error { if v == nil { return nil @@ -4091,6 +4895,24 @@ func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { } } +func validateOpPutAccessGrantsInstanceResourcePolicyInput(v *PutAccessGrantsInstanceResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutAccessGrantsInstanceResourcePolicyInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if v.Policy == nil { + invalidParams.Add(smithy.NewErrParamRequired("Policy")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpPutAccessPointConfigurationForObjectLambdaInput(v *PutAccessPointConfigurationForObjectLambdaInput) error { if v == nil { return nil @@ -4467,6 +5289,27 @@ func validateOpUntagResourceInput(v *UntagResourceInput) error { } } +func validateOpUpdateAccessGrantsLocationInput(v *UpdateAccessGrantsLocationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateAccessGrantsLocationInput"} + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if v.AccessGrantsLocationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessGrantsLocationId")) + } + if v.IAMRoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("IAMRoleArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateJobPriorityInput(v *UpdateJobPriorityInput) error { if v == nil { return nil diff --git a/service/secretsmanager/api_op_BatchGetSecretValue.go b/service/secretsmanager/api_op_BatchGetSecretValue.go new file mode 100644 index 00000000000..35dcda76fed --- /dev/null +++ b/service/secretsmanager/api_op_BatchGetSecretValue.go @@ -0,0 +1,267 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the contents of the encrypted fields SecretString or SecretBinary for +// up to 20 secrets. To retrieve a single secret, call GetSecretValue . To choose +// which secrets to retrieve, you can specify a list of secrets by name or ARN, or +// you can use filters. If Secrets Manager encounters errors such as +// AccessDeniedException while attempting to retrieve any of the secrets, you can +// see the errors in Errors in the response. Secrets Manager generates CloudTrail +// GetSecretValue log entries for each secret you request when you call this +// action. Do not include sensitive information in request parameters because it +// might be logged. For more information, see Logging Secrets Manager events with +// CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:BatchGetSecretValue , and you must have +// secretsmanager:GetSecretValue for each secret. If you use filters, you must also +// have secretsmanager:ListSecrets . If the secrets are encrypted using +// customer-managed keys instead of the Amazon Web Services managed key +// aws/secretsmanager , then you also need kms:Decrypt permissions for the keys. +// For more information, see IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . +func (c *Client) BatchGetSecretValue(ctx context.Context, params *BatchGetSecretValueInput, optFns ...func(*Options)) (*BatchGetSecretValueOutput, error) { + if params == nil { + params = &BatchGetSecretValueInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchGetSecretValue", params, optFns, c.addOperationBatchGetSecretValueMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchGetSecretValueOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchGetSecretValueInput struct { + + // The filters to choose which secrets to retrieve. You must include Filters or + // SecretIdList , but not both. + Filters []types.Filter + + // The number of results to include in the response. If there are more results + // available, in the response, Secrets Manager includes NextToken . To get the next + // results, call BatchGetSecretValue again with the value from NextToken . + MaxResults *int32 + + // A token that indicates where the output should continue from, if a previous + // call did not show all results. To get the next results, call BatchGetSecretValue + // again with this value. + NextToken *string + + // The ARN or names of the secrets to retrieve. You must include Filters or + // SecretIdList , but not both. + SecretIdList []string + + noSmithyDocumentSerde +} + +type BatchGetSecretValueOutput struct { + + // A list of errors Secrets Manager encountered while attempting to retrieve + // individual secrets. + Errors []types.APIErrorType + + // Secrets Manager includes this value if there's more output available than what + // is included in the current response. This can occur even when the response + // includes no values at all, such as when you ask for a filtered view of a long + // list. To get the next results, call BatchGetSecretValue again with this value. + NextToken *string + + // A list of secret values. + SecretValues []types.SecretValueEntry + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchGetSecretValueMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchGetSecretValue{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchGetSecretValue{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "BatchGetSecretValue"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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_opBatchGetSecretValue(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 +} + +// BatchGetSecretValueAPIClient is a client that implements the +// BatchGetSecretValue operation. +type BatchGetSecretValueAPIClient interface { + BatchGetSecretValue(context.Context, *BatchGetSecretValueInput, ...func(*Options)) (*BatchGetSecretValueOutput, error) +} + +var _ BatchGetSecretValueAPIClient = (*Client)(nil) + +// BatchGetSecretValuePaginatorOptions is the paginator options for +// BatchGetSecretValue +type BatchGetSecretValuePaginatorOptions struct { + // The number of results to include in the response. If there are more results + // available, in the response, Secrets Manager includes NextToken . To get the next + // results, call BatchGetSecretValue again with the value from NextToken . + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// BatchGetSecretValuePaginator is a paginator for BatchGetSecretValue +type BatchGetSecretValuePaginator struct { + options BatchGetSecretValuePaginatorOptions + client BatchGetSecretValueAPIClient + params *BatchGetSecretValueInput + nextToken *string + firstPage bool +} + +// NewBatchGetSecretValuePaginator returns a new BatchGetSecretValuePaginator +func NewBatchGetSecretValuePaginator(client BatchGetSecretValueAPIClient, params *BatchGetSecretValueInput, optFns ...func(*BatchGetSecretValuePaginatorOptions)) *BatchGetSecretValuePaginator { + if params == nil { + params = &BatchGetSecretValueInput{} + } + + options := BatchGetSecretValuePaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &BatchGetSecretValuePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *BatchGetSecretValuePaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next BatchGetSecretValue page. +func (p *BatchGetSecretValuePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*BatchGetSecretValueOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.BatchGetSecretValue(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opBatchGetSecretValue(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "BatchGetSecretValue", + } +} diff --git a/service/secretsmanager/api_op_GetSecretValue.go b/service/secretsmanager/api_op_GetSecretValue.go index 8a371f4e7fc..a8778ab3fe9 100644 --- a/service/secretsmanager/api_op_GetSecretValue.go +++ b/service/secretsmanager/api_op_GetSecretValue.go @@ -13,8 +13,9 @@ import ( ) // Retrieves the contents of the encrypted fields SecretString or SecretBinary -// from the specified version of a secret, whichever contains content. We recommend -// that you cache your secret values by using client-side caching. Caching secrets +// from the specified version of a secret, whichever contains content. To retrieve +// the values for a group of secrets, call BatchGetSecretValue . We recommend that +// you cache your secret values by using client-side caching. Caching secrets // improves speed and reduces your costs. For more information, see Cache secrets // for your applications (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieving-secrets.html) // . To retrieve the previous version of a secret, use VersionStage and specify diff --git a/service/secretsmanager/api_op_ListSecrets.go b/service/secretsmanager/api_op_ListSecrets.go index 8abf8a95825..3ae0e70b007 100644 --- a/service/secretsmanager/api_op_ListSecrets.go +++ b/service/secretsmanager/api_op_ListSecrets.go @@ -17,8 +17,8 @@ import ( // marked for deletion, use the Secrets Manager console. ListSecrets is eventually // consistent, however it might not reflect changes from the last five minutes. To // get the latest information for a specific secret, use DescribeSecret . To list -// the versions of a secret, use ListSecretVersionIds . To get the secret value -// from SecretString or SecretBinary , call GetSecretValue . For information about +// the versions of a secret, use ListSecretVersionIds . To retrieve the values for +// the secrets, call BatchGetSecretValue or GetSecretValue . For information about // finding secrets in the console, see Find secrets in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_search-secret.html) // . Secrets Manager generates a CloudTrail log entry when you call this action. Do // not include sensitive information in request parameters because it might be diff --git a/service/secretsmanager/deserializers.go b/service/secretsmanager/deserializers.go index 40edb2de5f7..5e0d8b27ba7 100644 --- a/service/secretsmanager/deserializers.go +++ b/service/secretsmanager/deserializers.go @@ -21,6 +21,132 @@ import ( "strings" ) +type awsAwsjson11_deserializeOpBatchGetSecretValue struct { +} + +func (*awsAwsjson11_deserializeOpBatchGetSecretValue) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpBatchGetSecretValue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorBatchGetSecretValue(response, &metadata) + } + output := &BatchGetSecretValueOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentBatchGetSecretValueOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorBatchGetSecretValue(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + 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("DecryptionFailure", errorCode): + return awsAwsjson11_deserializeErrorDecryptionFailure(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCancelRotateSecret struct { } @@ -3094,6 +3220,98 @@ func awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp return output } +func awsAwsjson11_deserializeDocumentAPIErrorListType(v *[]types.APIErrorType, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.APIErrorType + if *v == nil { + cv = []types.APIErrorType{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.APIErrorType + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAPIErrorType(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentAPIErrorType(v **types.APIErrorType, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.APIErrorType + if *v == nil { + sv = &types.APIErrorType{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = ptr.String(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "SecretId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretIdType to be of type string, got %T instead", value) + } + sv.SecretId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentDecryptionFailure(v **types.DecryptionFailure, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4037,6 +4255,141 @@ func awsAwsjson11_deserializeDocumentSecretListType(v *[]types.SecretListEntry, return nil } +func awsAwsjson11_deserializeDocumentSecretValueEntry(v **types.SecretValueEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SecretValueEntry + if *v == nil { + sv = &types.SecretValueEntry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "CreatedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedDateType to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "SecretBinary": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretBinaryType to be []byte, got %T instead", value) + } + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode SecretBinaryType, %w", err) + } + sv.SecretBinary = dv + } + + case "SecretString": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretStringType to be of type string, got %T instead", value) + } + sv.SecretString = ptr.String(jtv) + } + + case "VersionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) + } + sv.VersionId = ptr.String(jtv) + } + + case "VersionStages": + if err := awsAwsjson11_deserializeDocumentSecretVersionStagesType(&sv.VersionStages, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentSecretValuesType(v *[]types.SecretValueEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.SecretValueEntry + if *v == nil { + cv = []types.SecretValueEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SecretValueEntry + destAddr := &col + if err := awsAwsjson11_deserializeDocumentSecretValueEntry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentSecretVersionsListEntry(v **types.SecretVersionsListEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4389,6 +4742,56 @@ func awsAwsjson11_deserializeDocumentValidationErrorsType(v *[]types.ValidationE return nil } +func awsAwsjson11_deserializeOpDocumentBatchGetSecretValueOutput(v **BatchGetSecretValueOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *BatchGetSecretValueOutput + if *v == nil { + sv = &BatchGetSecretValueOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Errors": + if err := awsAwsjson11_deserializeDocumentAPIErrorListType(&sv.Errors, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextTokenType to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "SecretValues": + if err := awsAwsjson11_deserializeDocumentSecretValuesType(&sv.SecretValues, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCancelRotateSecretOutput(v **CancelRotateSecretOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/secretsmanager/generated.json b/service/secretsmanager/generated.json index 573c6b6aa2e..eba7c9236ad 100644 --- a/service/secretsmanager/generated.json +++ b/service/secretsmanager/generated.json @@ -9,6 +9,7 @@ "files": [ "api_client.go", "api_client_test.go", + "api_op_BatchGetSecretValue.go", "api_op_CancelRotateSecret.go", "api_op_CreateSecret.go", "api_op_DeleteResourcePolicy.go", diff --git a/service/secretsmanager/serializers.go b/service/secretsmanager/serializers.go index 90d09039d92..564feb18664 100644 --- a/service/secretsmanager/serializers.go +++ b/service/secretsmanager/serializers.go @@ -15,6 +15,61 @@ import ( "path" ) +type awsAwsjson11_serializeOpBatchGetSecretValue struct { +} + +func (*awsAwsjson11_serializeOpBatchGetSecretValue) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpBatchGetSecretValue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchGetSecretValueInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("secretsmanager.BatchGetSecretValue") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentBatchGetSecretValueInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpCancelRotateSecret struct { } @@ -1330,6 +1385,17 @@ func awsAwsjson11_serializeDocumentRotationRulesType(v *types.RotationRulesType, return nil } +func awsAwsjson11_serializeDocumentSecretIdListType(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentSecretVersionStagesType(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1382,6 +1448,37 @@ func awsAwsjson11_serializeDocumentTagListType(v []types.Tag, value smithyjson.V return nil } +func awsAwsjson11_serializeOpDocumentBatchGetSecretValueInput(v *BatchGetSecretValueInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsAwsjson11_serializeDocumentFiltersListType(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.SecretIdList != nil { + ok := object.Key("SecretIdList") + if err := awsAwsjson11_serializeDocumentSecretIdListType(v.SecretIdList, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCancelRotateSecretInput(v *CancelRotateSecretInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/secretsmanager/types/types.go b/service/secretsmanager/types/types.go index c346c679230..7d549c908f9 100644 --- a/service/secretsmanager/types/types.go +++ b/service/secretsmanager/types/types.go @@ -7,6 +7,25 @@ import ( "time" ) +// The error Secrets Manager encountered while retrieving an individual secret as +// part of BatchGetSecretValue . +type APIErrorType struct { + + // The error Secrets Manager encountered while retrieving an individual secret as + // part of BatchGetSecretValue , for example ResourceNotFoundException , + // InvalidParameterException , InvalidRequestException , DecryptionFailure , or + // AccessDeniedException . + ErrorCode *string + + // A message describing the error. + Message *string + + // The ARN or name of the secret. + SecretId *string + + noSmithyDocumentSerde +} + // Allows you to add filters when you use the search function in Secrets Manager. // For more information, see Find secrets in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_search-secret.html) // . @@ -155,10 +174,7 @@ type SecretListEntry struct { // successfully completed. This value is null if the secret hasn't ever rotated. LastRotatedDate *time.Time - // The friendly name of the secret. You can use forward slashes in the name to - // represent a path hierarchy. For example, /prod/databases/dbserver1 could - // represent the secret for a server named dbserver1 in the folder databases in - // the folder prod . + // The friendly name of the secret. Name *string // The next rotation is scheduled to occur on or before this date. If the secret @@ -199,6 +215,37 @@ type SecretListEntry struct { noSmithyDocumentSerde } +// A structure that contains the secret value and other details for a secret. +type SecretValueEntry struct { + + // The Amazon Resource Name (ARN) of the secret. + ARN *string + + // The date the secret was created. + CreatedDate *time.Time + + // The friendly name of the secret. + Name *string + + // The decrypted secret value, if the secret value was originally provided as + // binary data in the form of a byte array. The parameter represents the binary + // data as a base64-encoded (https://tools.ietf.org/html/rfc4648#section-4) string. + SecretBinary []byte + + // The decrypted secret value, if the secret value was originally provided as a + // string or through the Secrets Manager console. + SecretString *string + + // The unique version identifier of this version of the secret. + VersionId *string + + // A list of all of the staging labels currently attached to this version of the + // secret. + VersionStages []string + + noSmithyDocumentSerde +} + // A structure that contains information about one version of a secret. type SecretVersionsListEntry struct { diff --git a/service/securityhub/api_op_GetSecurityControlDefinition.go b/service/securityhub/api_op_GetSecurityControlDefinition.go new file mode 100644 index 00000000000..544540223c8 --- /dev/null +++ b/service/securityhub/api_op_GetSecurityControlDefinition.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package securityhub + +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/securityhub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the definition of a security control. The definition includes the +// control title, description, Region availability, parameter definitions, and +// other details. +func (c *Client) GetSecurityControlDefinition(ctx context.Context, params *GetSecurityControlDefinitionInput, optFns ...func(*Options)) (*GetSecurityControlDefinitionOutput, error) { + if params == nil { + params = &GetSecurityControlDefinitionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSecurityControlDefinition", params, optFns, c.addOperationGetSecurityControlDefinitionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSecurityControlDefinitionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSecurityControlDefinitionInput struct { + + // The ID of the security control to retrieve the definition for. This field + // doesn’t accept an Amazon Resource Name (ARN). + // + // This member is required. + SecurityControlId *string + + noSmithyDocumentSerde +} + +type GetSecurityControlDefinitionOutput struct { + + // Provides metadata for a security control, including its unique + // standard-agnostic identifier, title, description, severity, availability in + // Amazon Web Services Regions, and a link to remediation steps. + // + // This member is required. + SecurityControlDefinition *types.SecurityControlDefinition + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSecurityControlDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSecurityControlDefinition{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSecurityControlDefinition{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetSecurityControlDefinition"); 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 = addOpGetSecurityControlDefinitionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSecurityControlDefinition(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_opGetSecurityControlDefinition(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetSecurityControlDefinition", + } +} diff --git a/service/securityhub/api_op_UpdateSecurityControl.go b/service/securityhub/api_op_UpdateSecurityControl.go new file mode 100644 index 00000000000..83ec241ed4d --- /dev/null +++ b/service/securityhub/api_op_UpdateSecurityControl.go @@ -0,0 +1,143 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package securityhub + +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/securityhub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the properties of a security control. +func (c *Client) UpdateSecurityControl(ctx context.Context, params *UpdateSecurityControlInput, optFns ...func(*Options)) (*UpdateSecurityControlOutput, error) { + if params == nil { + params = &UpdateSecurityControlInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSecurityControl", params, optFns, c.addOperationUpdateSecurityControlMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSecurityControlOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSecurityControlInput struct { + + // An object that specifies which security control parameters to update. + // + // This member is required. + Parameters map[string]types.ParameterConfiguration + + // The Amazon Resource Name (ARN) or ID of the control to update. + // + // This member is required. + SecurityControlId *string + + // The most recent reason for updating the properties of the security control. + // This field accepts alphanumeric characters in addition to white spaces, dashes, + // and underscores. + LastUpdateReason *string + + noSmithyDocumentSerde +} + +type UpdateSecurityControlOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSecurityControlMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSecurityControl{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSecurityControl{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateSecurityControl"); 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 = addOpUpdateSecurityControlValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSecurityControl(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_opUpdateSecurityControl(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateSecurityControl", + } +} diff --git a/service/securityhub/deserializers.go b/service/securityhub/deserializers.go index 8788c4e87ab..4c96eed158b 100644 --- a/service/securityhub/deserializers.go +++ b/service/securityhub/deserializers.go @@ -7163,6 +7163,165 @@ func awsRestjson1_deserializeOpDocumentGetMembersOutput(v **GetMembersOutput, va return nil } +type awsRestjson1_deserializeOpGetSecurityControlDefinition struct { +} + +func (*awsRestjson1_deserializeOpGetSecurityControlDefinition) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSecurityControlDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetSecurityControlDefinition(response, &metadata) + } + output := &GetSecurityControlDefinitionOutput{} + 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_deserializeOpDocumentGetSecurityControlDefinitionOutput(&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_deserializeOpErrorGetSecurityControlDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("InvalidAccessException", errorCode): + return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetSecurityControlDefinitionOutput(v **GetSecurityControlDefinitionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetSecurityControlDefinitionOutput + if *v == nil { + sv = &GetSecurityControlDefinitionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SecurityControlDefinition": + if err := awsRestjson1_deserializeDocumentSecurityControlDefinition(&sv.SecurityControlDefinition, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpInviteMembers struct { } @@ -9539,6 +9698,104 @@ func awsRestjson1_deserializeOpErrorUpdateOrganizationConfiguration(response *sm } } +type awsRestjson1_deserializeOpUpdateSecurityControl struct { +} + +func (*awsRestjson1_deserializeOpUpdateSecurityControl) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateSecurityControl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateSecurityControl(response, &metadata) + } + output := &UpdateSecurityControlOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateSecurityControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("InvalidAccessException", errorCode): + return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpUpdateSecurityHubConfiguration struct { } @@ -9942,6 +10199,42 @@ func awsRestjson1_deserializeErrorResourceConflictException(response *smithyhttp return output } +func awsRestjson1_deserializeErrorResourceInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceInUseException{} + 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_deserializeDocumentResourceInUseException(&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 @@ -47491,6 +47784,16 @@ func awsRestjson1_deserializeDocumentAwsSecurityFindingFilters(v **types.AwsSecu return err } + case "ComplianceSecurityControlParametersName": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ComplianceSecurityControlParametersName, value); err != nil { + return err + } + + case "ComplianceSecurityControlParametersValue": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ComplianceSecurityControlParametersValue, value); err != nil { + return err + } + case "ComplianceStatus": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ComplianceStatus, value); err != nil { return err @@ -47946,6 +48249,16 @@ func awsRestjson1_deserializeDocumentAwsSecurityFindingFilters(v **types.AwsSecu return err } + case "VulnerabilitiesExploitAvailable": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.VulnerabilitiesExploitAvailable, value); err != nil { + return err + } + + case "VulnerabilitiesFixAvailable": + if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.VulnerabilitiesFixAvailable, value); err != nil { + return err + } + case "WorkflowState": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.WorkflowState, value); err != nil { return err @@ -51489,6 +51802,46 @@ func awsRestjson1_deserializeDocumentBatchUpdateFindingsUnprocessedFindingsList( return nil } +func awsRestjson1_deserializeDocumentBooleanConfigurationOptions(v **types.BooleanConfigurationOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BooleanConfigurationOptions + if *v == nil { + sv = &types.BooleanConfigurationOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DefaultValue": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.DefaultValue = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentBooleanFilter(v **types.BooleanFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -52140,6 +52493,11 @@ func awsRestjson1_deserializeDocumentCompliance(v **types.Compliance, value inte sv.SecurityControlId = ptr.String(jtv) } + case "SecurityControlParameters": + if err := awsRestjson1_deserializeDocumentSecurityControlParametersList(&sv.SecurityControlParameters, value); err != nil { + return err + } + case "Status": if value != nil { jtv, ok := value.(string) @@ -52163,6 +52521,116 @@ func awsRestjson1_deserializeDocumentCompliance(v **types.Compliance, value inte return nil } +func awsRestjson1_deserializeDocumentConfigurationOptions(v *types.ConfigurationOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.ConfigurationOptions +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "Boolean": + var mv types.BooleanConfigurationOptions + destAddr := &mv + if err := awsRestjson1_deserializeDocumentBooleanConfigurationOptions(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ConfigurationOptionsMemberBoolean{Value: mv} + break loop + + case "Double": + var mv types.DoubleConfigurationOptions + destAddr := &mv + if err := awsRestjson1_deserializeDocumentDoubleConfigurationOptions(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ConfigurationOptionsMemberDouble{Value: mv} + break loop + + case "Enum": + var mv types.EnumConfigurationOptions + destAddr := &mv + if err := awsRestjson1_deserializeDocumentEnumConfigurationOptions(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ConfigurationOptionsMemberEnum{Value: mv} + break loop + + case "EnumList": + var mv types.EnumListConfigurationOptions + destAddr := &mv + if err := awsRestjson1_deserializeDocumentEnumListConfigurationOptions(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ConfigurationOptionsMemberEnumList{Value: mv} + break loop + + case "Integer": + var mv types.IntegerConfigurationOptions + destAddr := &mv + if err := awsRestjson1_deserializeDocumentIntegerConfigurationOptions(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ConfigurationOptionsMemberInteger{Value: mv} + break loop + + case "IntegerList": + var mv types.IntegerListConfigurationOptions + destAddr := &mv + if err := awsRestjson1_deserializeDocumentIntegerListConfigurationOptions(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ConfigurationOptionsMemberIntegerList{Value: mv} + break loop + + case "String": + var mv types.StringConfigurationOptions + destAddr := &mv + if err := awsRestjson1_deserializeDocumentStringConfigurationOptions(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ConfigurationOptionsMemberString{Value: mv} + break loop + + case "StringList": + var mv types.StringListConfigurationOptions + destAddr := &mv + if err := awsRestjson1_deserializeDocumentStringListConfigurationOptions(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ConfigurationOptionsMemberStringList{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + func awsRestjson1_deserializeDocumentContainerDetails(v **types.ContainerDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -52452,6 +52920,42 @@ func awsRestjson1_deserializeDocumentCustomDataIdentifiersResult(v **types.Custo return nil } +func awsRestjson1_deserializeDocumentCustomizableProperties(v *[]types.SecurityControlProperty, 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.SecurityControlProperty + if *v == nil { + cv = []types.SecurityControlProperty{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SecurityControlProperty + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecurityControlProperty to be of type string, got %T instead", value) + } + col = types.SecurityControlProperty(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentCvss(v **types.Cvss, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -52827,6 +53331,238 @@ func awsRestjson1_deserializeDocumentDnsRequestAction(v **types.DnsRequestAction return nil } +func awsRestjson1_deserializeDocumentDoubleConfigurationOptions(v **types.DoubleConfigurationOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DoubleConfigurationOptions + if *v == nil { + sv = &types.DoubleConfigurationOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DefaultValue": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DefaultValue = 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.DefaultValue = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "Max": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Max = 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.Max = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "Min": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Min = 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.Min = 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_deserializeDocumentEnumConfigurationOptions(v **types.EnumConfigurationOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EnumConfigurationOptions + if *v == nil { + sv = &types.EnumConfigurationOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AllowedValues": + if err := awsRestjson1_deserializeDocumentStringList(&sv.AllowedValues, value); err != nil { + return err + } + + case "DefaultValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.DefaultValue = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEnumListConfigurationOptions(v **types.EnumListConfigurationOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EnumListConfigurationOptions + if *v == nil { + sv = &types.EnumListConfigurationOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AllowedValues": + if err := awsRestjson1_deserializeDocumentStringList(&sv.AllowedValues, value); err != nil { + return err + } + + case "DefaultValue": + if err := awsRestjson1_deserializeDocumentStringList(&sv.DefaultValue, value); err != nil { + return err + } + + case "MaxItems": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxItems = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentFieldMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -54247,6 +54983,76 @@ func awsRestjson1_deserializeDocumentInsightResultValueList(v *[]types.InsightRe return nil } +func awsRestjson1_deserializeDocumentIntegerConfigurationOptions(v **types.IntegerConfigurationOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.IntegerConfigurationOptions + if *v == nil { + sv = &types.IntegerConfigurationOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DefaultValue": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DefaultValue = ptr.Int32(int32(i64)) + } + + case "Max": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Max = ptr.Int32(int32(i64)) + } + + case "Min": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Min = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentIntegerList(v *[]int32, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -54287,6 +55093,81 @@ func awsRestjson1_deserializeDocumentIntegerList(v *[]int32, value interface{}) return nil } +func awsRestjson1_deserializeDocumentIntegerListConfigurationOptions(v **types.IntegerListConfigurationOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.IntegerListConfigurationOptions + if *v == nil { + sv = &types.IntegerListConfigurationOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DefaultValue": + if err := awsRestjson1_deserializeDocumentIntegerList(&sv.DefaultValue, value); err != nil { + return err + } + + case "Max": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Max = ptr.Int32(int32(i64)) + } + + case "MaxItems": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxItems = ptr.Int32(int32(i64)) + } + + case "Min": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Min = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentIntegrationTypeList(v *[]types.IntegrationType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -55912,6 +56793,40 @@ func awsRestjson1_deserializeDocumentNumberFilter(v **types.NumberFilter, value } } + case "Gt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Gt = 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.Gt = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + case "Gte": if value != nil { switch jtv := value.(type) { @@ -55946,6 +56861,40 @@ func awsRestjson1_deserializeDocumentNumberFilter(v **types.NumberFilter, value } } + case "Lt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Lt = 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.Lt = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + case "Lte": if value != nil { switch jtv := value.(type) { @@ -56167,6 +57116,309 @@ func awsRestjson1_deserializeDocumentPages(v *[]types.Page, value interface{}) e return nil } +func awsRestjson1_deserializeDocumentParameterConfiguration(v **types.ParameterConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ParameterConfiguration + if *v == nil { + sv = &types.ParameterConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Value": + if err := awsRestjson1_deserializeDocumentParameterValue(&sv.Value, value); err != nil { + return err + } + + case "ValueType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ParameterValueType to be of type string, got %T instead", value) + } + sv.ValueType = types.ParameterValueType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentParameterDefinition(v **types.ParameterDefinition, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ParameterDefinition + if *v == nil { + sv = &types.ParameterDefinition{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ConfigurationOptions": + if err := awsRestjson1_deserializeDocumentConfigurationOptions(&sv.ConfigurationOptions, value); err != nil { + return err + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentParameterDefinitions(v *map[string]types.ParameterDefinition, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.ParameterDefinition + if *v == nil { + mv = map[string]types.ParameterDefinition{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.ParameterDefinition + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentParameterDefinition(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentParameters(v *map[string]types.ParameterConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.ParameterConfiguration + if *v == nil { + mv = map[string]types.ParameterConfiguration{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.ParameterConfiguration + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentParameterConfiguration(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentParameterValue(v *types.ParameterValue, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.ParameterValue +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 Boolean to be of type *bool, got %T instead", value) + } + mv = jtv + } + uv = &types.ParameterValueMemberBoolean{Value: mv} + break loop + + case "Double": + var mv float64 + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + mv = 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) + + } + mv = f64 + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + uv = &types.ParameterValueMemberDouble{Value: mv} + break loop + + case "Enum": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.ParameterValueMemberEnum{Value: mv} + break loop + + case "EnumList": + var mv []string + if err := awsRestjson1_deserializeDocumentStringList(&mv, value); err != nil { + return err + } + uv = &types.ParameterValueMemberEnumList{Value: mv} + break loop + + case "Integer": + var mv int32 + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + mv = int32(i64) + } + uv = &types.ParameterValueMemberInteger{Value: mv} + break loop + + case "IntegerList": + var mv []int32 + if err := awsRestjson1_deserializeDocumentIntegerList(&mv, value); err != nil { + return err + } + uv = &types.ParameterValueMemberIntegerList{Value: mv} + break loop + + case "String": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.ParameterValueMemberString{Value: mv} + break loop + + case "StringList": + var mv []string + if err := awsRestjson1_deserializeDocumentStringList(&mv, value); err != nil { + return err + } + uv = &types.ParameterValueMemberStringList{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + func awsRestjson1_deserializeDocumentPatchSummary(v **types.PatchSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -57986,6 +59238,55 @@ func awsRestjson1_deserializeDocumentResourceDetails(v **types.ResourceDetails, return nil } +func awsRestjson1_deserializeDocumentResourceInUseException(v **types.ResourceInUseException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceInUseException + if *v == nil { + sv = &types.ResourceInUseException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentResourceList(v *[]types.Resource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -59685,6 +60986,20 @@ func awsRestjson1_deserializeDocumentSecurityControl(v **types.SecurityControl, sv.Description = ptr.String(jtv) } + case "LastUpdateReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AlphaNumericNonEmptyString to be of type string, got %T instead", value) + } + sv.LastUpdateReason = ptr.String(jtv) + } + + case "Parameters": + if err := awsRestjson1_deserializeDocumentParameters(&sv.Parameters, value); err != nil { + return err + } + case "RemediationUrl": if value != nil { jtv, ok := value.(string) @@ -59739,6 +61054,15 @@ func awsRestjson1_deserializeDocumentSecurityControl(v **types.SecurityControl, sv.Title = ptr.String(jtv) } + case "UpdateStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpdateStatus to be of type string, got %T instead", value) + } + sv.UpdateStatus = types.UpdateStatus(jtv) + } + default: _, _ = key, value @@ -59779,6 +61103,11 @@ func awsRestjson1_deserializeDocumentSecurityControlDefinition(v **types.Securit sv.CurrentRegionAvailability = types.RegionAvailabilityStatus(jtv) } + case "CustomizableProperties": + if err := awsRestjson1_deserializeDocumentCustomizableProperties(&sv.CustomizableProperties, value); err != nil { + return err + } + case "Description": if value != nil { jtv, ok := value.(string) @@ -59788,6 +61117,11 @@ func awsRestjson1_deserializeDocumentSecurityControlDefinition(v **types.Securit sv.Description = ptr.String(jtv) } + case "ParameterDefinitions": + if err := awsRestjson1_deserializeDocumentParameterDefinitions(&sv.ParameterDefinitions, value); err != nil { + return err + } + case "RemediationUrl": if value != nil { jtv, ok := value.(string) @@ -59867,6 +61201,85 @@ func awsRestjson1_deserializeDocumentSecurityControlDefinitions(v *[]types.Secur return nil } +func awsRestjson1_deserializeDocumentSecurityControlParameter(v **types.SecurityControlParameter, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SecurityControlParameter + if *v == nil { + sv = &types.SecurityControlParameter{} + } 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 NonEmptyString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Value": + if err := awsRestjson1_deserializeDocumentTypeList(&sv.Value, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSecurityControlParametersList(v *[]types.SecurityControlParameter, 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.SecurityControlParameter + if *v == nil { + cv = []types.SecurityControlParameter{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SecurityControlParameter + destAddr := &col + if err := awsRestjson1_deserializeDocumentSecurityControlParameter(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentSecurityControls(v *[]types.SecurityControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -61634,6 +63047,64 @@ func awsRestjson1_deserializeDocumentStatusReasonsList(v *[]types.StatusReason, return nil } +func awsRestjson1_deserializeDocumentStringConfigurationOptions(v **types.StringConfigurationOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.StringConfigurationOptions + if *v == nil { + sv = &types.StringConfigurationOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DefaultValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.DefaultValue = ptr.String(jtv) + } + + case "ExpressionDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ExpressionDescription = ptr.String(jtv) + } + + case "Re2Expression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Re2Expression = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentStringFilter(v **types.StringFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -61753,6 +63224,73 @@ func awsRestjson1_deserializeDocumentStringList(v *[]string, value interface{}) return nil } +func awsRestjson1_deserializeDocumentStringListConfigurationOptions(v **types.StringListConfigurationOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.StringListConfigurationOptions + if *v == nil { + sv = &types.StringListConfigurationOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DefaultValue": + if err := awsRestjson1_deserializeDocumentStringList(&sv.DefaultValue, value); err != nil { + return err + } + + case "ExpressionDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ExpressionDescription = ptr.String(jtv) + } + + case "MaxItems": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxItems = ptr.Int32(int32(i64)) + } + + case "Re2Expression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Re2Expression = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/securityhub/generated.json b/service/securityhub/generated.json index a5712e85ba1..595f7ee9d4a 100644 --- a/service/securityhub/generated.json +++ b/service/securityhub/generated.json @@ -57,6 +57,7 @@ "api_op_GetInvitationsCount.go", "api_op_GetMasterAccount.go", "api_op_GetMembers.go", + "api_op_GetSecurityControlDefinition.go", "api_op_InviteMembers.go", "api_op_ListAutomationRules.go", "api_op_ListEnabledProductsForImport.go", @@ -74,6 +75,7 @@ "api_op_UpdateFindings.go", "api_op_UpdateInsight.go", "api_op_UpdateOrganizationConfiguration.go", + "api_op_UpdateSecurityControl.go", "api_op_UpdateSecurityHubConfiguration.go", "api_op_UpdateStandardsControl.go", "auth.go", @@ -91,6 +93,7 @@ "types/enums.go", "types/errors.go", "types/types.go", + "types/types_exported_test.go", "validators.go" ], "go": "1.15", diff --git a/service/securityhub/serializers.go b/service/securityhub/serializers.go index 74c42af0950..edfa8a5c37d 100644 --- a/service/securityhub/serializers.go +++ b/service/securityhub/serializers.go @@ -3618,6 +3618,66 @@ func awsRestjson1_serializeOpDocumentGetMembersInput(v *GetMembersInput, value s return nil } +type awsRestjson1_serializeOpGetSecurityControlDefinition struct { +} + +func (*awsRestjson1_serializeOpGetSecurityControlDefinition) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSecurityControlDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSecurityControlDefinitionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/securityControl/definition") + 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_serializeOpHttpBindingsGetSecurityControlDefinitionInput(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_serializeOpHttpBindingsGetSecurityControlDefinitionInput(v *GetSecurityControlDefinitionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SecurityControlId != nil { + encoder.SetQuery("SecurityControlId").String(*v.SecurityControlId) + } + + return nil +} + type awsRestjson1_serializeOpInviteMembers struct { } @@ -4894,6 +4954,93 @@ func awsRestjson1_serializeOpDocumentUpdateOrganizationConfigurationInput(v *Upd return nil } +type awsRestjson1_serializeOpUpdateSecurityControl struct { +} + +func (*awsRestjson1_serializeOpUpdateSecurityControl) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateSecurityControl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateSecurityControlInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/securityControl/update") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateSecurityControlInput(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_serializeOpHttpBindingsUpdateSecurityControlInput(v *UpdateSecurityControlInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateSecurityControlInput(v *UpdateSecurityControlInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LastUpdateReason != nil { + ok := object.Key("LastUpdateReason") + ok.String(*v.LastUpdateReason) + } + + if v.Parameters != nil { + ok := object.Key("Parameters") + if err := awsRestjson1_serializeDocumentParameters(v.Parameters, ok); err != nil { + return err + } + } + + if v.SecurityControlId != nil { + ok := object.Key("SecurityControlId") + ok.String(*v.SecurityControlId) + } + + return nil +} + type awsRestjson1_serializeOpUpdateSecurityHubConfiguration struct { } @@ -22282,6 +22429,20 @@ func awsRestjson1_serializeDocumentAwsSecurityFindingFilters(v *types.AwsSecurit } } + if v.ComplianceSecurityControlParametersName != nil { + ok := object.Key("ComplianceSecurityControlParametersName") + if err := awsRestjson1_serializeDocumentStringFilterList(v.ComplianceSecurityControlParametersName, ok); err != nil { + return err + } + } + + if v.ComplianceSecurityControlParametersValue != nil { + ok := object.Key("ComplianceSecurityControlParametersValue") + if err := awsRestjson1_serializeDocumentStringFilterList(v.ComplianceSecurityControlParametersValue, ok); err != nil { + return err + } + } + if v.ComplianceStatus != nil { ok := object.Key("ComplianceStatus") if err := awsRestjson1_serializeDocumentStringFilterList(v.ComplianceStatus, ok); err != nil { @@ -22919,6 +23080,20 @@ func awsRestjson1_serializeDocumentAwsSecurityFindingFilters(v *types.AwsSecurit } } + if v.VulnerabilitiesExploitAvailable != nil { + ok := object.Key("VulnerabilitiesExploitAvailable") + if err := awsRestjson1_serializeDocumentStringFilterList(v.VulnerabilitiesExploitAvailable, ok); err != nil { + return err + } + } + + if v.VulnerabilitiesFixAvailable != nil { + ok := object.Key("VulnerabilitiesFixAvailable") + if err := awsRestjson1_serializeDocumentStringFilterList(v.VulnerabilitiesFixAvailable, ok); err != nil { + return err + } + } + if v.WorkflowState != nil { ok := object.Key("WorkflowState") if err := awsRestjson1_serializeDocumentStringFilterList(v.WorkflowState, ok); err != nil { @@ -24644,6 +24819,13 @@ func awsRestjson1_serializeDocumentCompliance(v *types.Compliance, value smithyj ok.String(*v.SecurityControlId) } + if v.SecurityControlParameters != nil { + ok := object.Key("SecurityControlParameters") + if err := awsRestjson1_serializeDocumentSecurityControlParametersList(v.SecurityControlParameters, ok); err != nil { + return err + } + } + if len(v.Status) > 0 { ok := object.Key("Status") ok.String(string(v.Status)) @@ -25745,6 +25927,24 @@ func awsRestjson1_serializeDocumentNumberFilter(v *types.NumberFilter, value smi } } + if v.Gt != nil { + ok := object.Key("Gt") + switch { + case math.IsNaN(*v.Gt): + ok.String("NaN") + + case math.IsInf(*v.Gt, 1): + ok.String("Infinity") + + case math.IsInf(*v.Gt, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.Gt) + + } + } + if v.Gte != nil { ok := object.Key("Gte") switch { @@ -25763,6 +25963,24 @@ func awsRestjson1_serializeDocumentNumberFilter(v *types.NumberFilter, value smi } } + if v.Lt != nil { + ok := object.Key("Lt") + switch { + case math.IsNaN(*v.Lt): + ok.String("NaN") + + case math.IsInf(*v.Lt, 1): + ok.String("Infinity") + + case math.IsInf(*v.Lt, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.Lt) + + } + } + if v.Lte != nil { ok := object.Key("Lte") switch { @@ -25878,6 +26096,102 @@ func awsRestjson1_serializeDocumentPages(v []types.Page, value smithyjson.Value) return nil } +func awsRestjson1_serializeDocumentParameterConfiguration(v *types.ParameterConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Value != nil { + ok := object.Key("Value") + if err := awsRestjson1_serializeDocumentParameterValue(v.Value, ok); err != nil { + return err + } + } + + if len(v.ValueType) > 0 { + ok := object.Key("ValueType") + ok.String(string(v.ValueType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentParameters(v map[string]types.ParameterConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + mapVar := v[key] + if err := awsRestjson1_serializeDocumentParameterConfiguration(&mapVar, om); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentParameterValue(v types.ParameterValue, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.ParameterValueMemberBoolean: + av := object.Key("Boolean") + av.Boolean(uv.Value) + + case *types.ParameterValueMemberDouble: + av := object.Key("Double") + switch { + case math.IsNaN(uv.Value): + av.String("NaN") + + case math.IsInf(uv.Value, 1): + av.String("Infinity") + + case math.IsInf(uv.Value, -1): + av.String("-Infinity") + + default: + av.Double(uv.Value) + + } + + case *types.ParameterValueMemberEnum: + av := object.Key("Enum") + av.String(uv.Value) + + case *types.ParameterValueMemberEnumList: + av := object.Key("EnumList") + if err := awsRestjson1_serializeDocumentStringList(uv.Value, av); err != nil { + return err + } + + case *types.ParameterValueMemberInteger: + av := object.Key("Integer") + av.Integer(uv.Value) + + case *types.ParameterValueMemberIntegerList: + av := object.Key("IntegerList") + if err := awsRestjson1_serializeDocumentIntegerList(uv.Value, av); err != nil { + return err + } + + case *types.ParameterValueMemberString: + av := object.Key("String") + av.String(uv.Value) + + case *types.ParameterValueMemberStringList: + av := object.Key("StringList") + if err := awsRestjson1_serializeDocumentStringList(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_serializeDocumentPatchSummary(v *types.PatchSummary, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -27656,6 +27970,38 @@ func awsRestjson1_serializeDocumentRuleGroupVariablesPortSetsDetails(v *types.Ru return nil } +func awsRestjson1_serializeDocumentSecurityControlParameter(v *types.SecurityControlParameter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.Value != nil { + ok := object.Key("Value") + if err := awsRestjson1_serializeDocumentTypeList(v.Value, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentSecurityControlParametersList(v []types.SecurityControlParameter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentSecurityControlParameter(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentSecurityGroups(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/securityhub/types/enums.go b/service/securityhub/types/enums.go index d42d1458caa..d57c4ed01c7 100644 --- a/service/securityhub/types/enums.go +++ b/service/securityhub/types/enums.go @@ -326,6 +326,24 @@ func (NetworkDirection) Values() []NetworkDirection { } } +type ParameterValueType string + +// Enum values for ParameterValueType +const ( + ParameterValueTypeDefault ParameterValueType = "DEFAULT" + ParameterValueTypeCustom ParameterValueType = "CUSTOM" +) + +// Values returns all known values for ParameterValueType. 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 (ParameterValueType) Values() []ParameterValueType { + return []ParameterValueType{ + "DEFAULT", + "CUSTOM", + } +} + type Partition string // Enum values for Partition @@ -400,6 +418,22 @@ func (RuleStatus) Values() []RuleStatus { } } +type SecurityControlProperty string + +// Enum values for SecurityControlProperty +const ( + SecurityControlPropertyParameters SecurityControlProperty = "Parameters" +) + +// Values returns all known values for SecurityControlProperty. 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 (SecurityControlProperty) Values() []SecurityControlProperty { + return []SecurityControlProperty{ + "Parameters", + } +} + type SeverityLabel string // Enum values for SeverityLabel @@ -617,6 +651,24 @@ func (UnprocessedErrorCode) Values() []UnprocessedErrorCode { } } +type UpdateStatus string + +// Enum values for UpdateStatus +const ( + UpdateStatusReady UpdateStatus = "READY" + UpdateStatusUpdating UpdateStatus = "UPDATING" +) + +// Values returns all known values for UpdateStatus. 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 (UpdateStatus) Values() []UpdateStatus { + return []UpdateStatus{ + "READY", + "UPDATING", + } +} + type VerificationState string // Enum values for VerificationState diff --git a/service/securityhub/types/errors.go b/service/securityhub/types/errors.go index a8d4cc36af1..5429c33f73d 100644 --- a/service/securityhub/types/errors.go +++ b/service/securityhub/types/errors.go @@ -178,6 +178,36 @@ func (e *ResourceConflictException) ErrorCode() string { } func (e *ResourceConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The request was rejected because it conflicts with the resource's availability. +// For example, you tried to update a security control that's currently in the +// UPDATING state. +type ResourceInUseException struct { + Message *string + + ErrorCodeOverride *string + + Code *string + + noSmithyDocumentSerde +} + +func (e *ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceInUseException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceInUseException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceInUseException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The request was rejected because we can't find the specified resource. type ResourceNotFoundException struct { Message *string diff --git a/service/securityhub/types/types.go b/service/securityhub/types/types.go index 949a8f2449d..e214d21da03 100644 --- a/service/securityhub/types/types.go +++ b/service/securityhub/types/types.go @@ -2514,8 +2514,8 @@ type AwsCloudFrontDistributionOriginGroups struct { } // A complex type that describes the Amazon S3 bucket, HTTP server (for example, a -// web server), AWS Elemental MediaStore, or other server from which CloudFront -// gets your files. +// web server), Elemental MediaStore, or other server from which CloudFront gets +// your files. type AwsCloudFrontDistributionOriginItem struct { // An origin that is not an Amazon S3 bucket, with one exception. If the Amazon S3 @@ -11253,10 +11253,9 @@ type AwsSecurityFinding struct { noSmithyDocumentSerde } -// A collection of attributes that are applied to all active Security -// Hub-aggregated findings and that result in a subset of findings that are -// included in this insight. You can filter by up to 10 finding attributes. For -// each attribute, you can provide up to 20 filter values. +// A collection of filters that are applied to all active findings aggregated by +// Security Hub. You can filter by up to ten finding attributes. For each +// attribute, you can provide up to 20 filter values. type AwsSecurityFindingFilters struct { // The Amazon Web Services account ID that a finding is generated in. @@ -11276,6 +11275,12 @@ type AwsSecurityFindingFilters struct { // typically consist of an Amazon Web Service and a number, such as APIGateway.5. ComplianceSecurityControlId []StringFilter + // The name of a security control parameter. + ComplianceSecurityControlParametersName []StringFilter + + // The current value of a security control parameter. + ComplianceSecurityControlParametersValue []StringFilter + // Exclusive to findings that are generated as the result of a check run against a // specific rule in a supported standard, such as CIS Amazon Web Services // Foundations. Contains security standard-related finding details. @@ -11626,6 +11631,16 @@ type AwsSecurityFindingFilters struct { // The veracity of a finding. VerificationState []StringFilter + // Indicates whether a software vulnerability in your environment has a known + // exploit. You can filter findings by this field only if you use Security Hub and + // Amazon Inspector. + VulnerabilitiesExploitAvailable []StringFilter + + // Indicates whether a vulnerability is fixed in a newer version of the affected + // software packages. You can filter findings by this field only if you use + // Security Hub and Amazon Inspector. + VulnerabilitiesFixAvailable []StringFilter + // The workflow state of a finding. Note that this field is deprecated. To search // for a finding based on its workflow status, use WorkflowStatus . WorkflowState []StringFilter @@ -12705,6 +12720,16 @@ type BatchUpdateFindingsUnprocessedFinding struct { noSmithyDocumentSerde } +// The options for customizing a security control parameter with a boolean. For a +// boolean parameter, the options are true and false . +type BooleanConfigurationOptions struct { + + // The Security Hub default value for a boolean parameter. + DefaultValue *bool + + noSmithyDocumentSerde +} + // Boolean filter for querying findings. type BooleanFilter struct { @@ -12853,6 +12878,9 @@ type Compliance struct { // typically consist of an Amazon Web Service and a number, such as APIGateway.5. SecurityControlId *string + // An object that includes security control parameter names and values. + SecurityControlParameters []SecurityControlParameter + // The result of a standards check. The valid values for Status are as follows. // - PASSED - Standards check passed for all evaluated resources. // - WARNING - Some information is missing or this check is not supported for @@ -12873,6 +12901,99 @@ type Compliance struct { noSmithyDocumentSerde } +// The options for customizing a security control parameter. +// +// The following types satisfy this interface: +// +// ConfigurationOptionsMemberBoolean +// ConfigurationOptionsMemberDouble +// ConfigurationOptionsMemberEnum +// ConfigurationOptionsMemberEnumList +// ConfigurationOptionsMemberInteger +// ConfigurationOptionsMemberIntegerList +// ConfigurationOptionsMemberString +// ConfigurationOptionsMemberStringList +type ConfigurationOptions interface { + isConfigurationOptions() +} + +// The options for customizing a security control parameter that is a boolean. For +// a boolean parameter, the options are true and false . +type ConfigurationOptionsMemberBoolean struct { + Value BooleanConfigurationOptions + + noSmithyDocumentSerde +} + +func (*ConfigurationOptionsMemberBoolean) isConfigurationOptions() {} + +// The options for customizing a security control parameter that is a double. +type ConfigurationOptionsMemberDouble struct { + Value DoubleConfigurationOptions + + noSmithyDocumentSerde +} + +func (*ConfigurationOptionsMemberDouble) isConfigurationOptions() {} + +// The options for customizing a security control parameter that is an enum. +type ConfigurationOptionsMemberEnum struct { + Value EnumConfigurationOptions + + noSmithyDocumentSerde +} + +func (*ConfigurationOptionsMemberEnum) isConfigurationOptions() {} + +// The options for customizing a security control parameter that is a list of +// enums. +type ConfigurationOptionsMemberEnumList struct { + Value EnumListConfigurationOptions + + noSmithyDocumentSerde +} + +func (*ConfigurationOptionsMemberEnumList) isConfigurationOptions() {} + +// The options for customizing a security control parameter that is an integer. +type ConfigurationOptionsMemberInteger struct { + Value IntegerConfigurationOptions + + noSmithyDocumentSerde +} + +func (*ConfigurationOptionsMemberInteger) isConfigurationOptions() {} + +// The options for customizing a security control parameter that is a list of +// integers. +type ConfigurationOptionsMemberIntegerList struct { + Value IntegerListConfigurationOptions + + noSmithyDocumentSerde +} + +func (*ConfigurationOptionsMemberIntegerList) isConfigurationOptions() {} + +// The options for customizing a security control parameter that is a string data +// type. +type ConfigurationOptionsMemberString struct { + Value StringConfigurationOptions + + noSmithyDocumentSerde +} + +func (*ConfigurationOptionsMemberString) isConfigurationOptions() {} + +// The options for customizing a security control parameter that is a list of +// strings. +type ConfigurationOptionsMemberStringList struct { + Value StringListConfigurationOptions + + noSmithyDocumentSerde +} + +func (*ConfigurationOptionsMemberStringList) isConfigurationOptions() {} + // Container details related to a finding. type ContainerDetails struct { @@ -13031,6 +13152,49 @@ type DnsRequestAction struct { noSmithyDocumentSerde } +// The options for customizing a security control parameter that is a double. +type DoubleConfigurationOptions struct { + + // The Security Hub default value for a control parameter that is a double. + DefaultValue *float64 + + // The maximum valid value for a control parameter that is a double. + Max *float64 + + // The minimum valid value for a control parameter that is a double. + Min *float64 + + noSmithyDocumentSerde +} + +// The options for customizing a security control parameter that is an enum. +type EnumConfigurationOptions struct { + + // The valid values for a control parameter that is an enum. + AllowedValues []string + + // The Security Hub default value for a control parameter that is an enum. + DefaultValue *string + + noSmithyDocumentSerde +} + +// The options for customizing a security control parameter that is a list of +// enums. +type EnumListConfigurationOptions struct { + + // The valid values for a control parameter that is a list of enums. + AllowedValues []string + + // The Security Hub default value for a control parameter that is a list of enums. + DefaultValue []string + + // The maximum number of list items that an enum list control parameter can accept. + MaxItems *int32 + + noSmithyDocumentSerde +} + // Provides information about the file paths that were affected by the threat. type FilePaths struct { @@ -13379,6 +13543,42 @@ type InsightResultValue struct { noSmithyDocumentSerde } +// The options for customizing a security control parameter that is an integer. +type IntegerConfigurationOptions struct { + + // The Security Hub default value for a control parameter that is an integer. + DefaultValue *int32 + + // The maximum valid value for a control parameter that is an integer. + Max *int32 + + // The minimum valid value for a control parameter that is an integer. + Min *int32 + + noSmithyDocumentSerde +} + +// The options for customizing a security control parameter that is a list of +// integers. +type IntegerListConfigurationOptions struct { + + // The Security Hub default value for a control parameter that is a list of + // integers. + DefaultValue []int32 + + // The maximum valid value for a control parameter that is a list of integers. + Max *int32 + + // The maximum number of list items that an interger list control parameter can + // accept. + MaxItems *int32 + + // The minimum valid value for a control parameter that is a list of integers. + Min *int32 + + noSmithyDocumentSerde +} + // Details about an invitation. type Invitation struct { @@ -13755,10 +13955,18 @@ type NumberFilter struct { // findings. Eq *float64 + // The greater-than condition to be applied to a single field when querying for + // findings. + Gt *float64 + // The greater-than-equal condition to be applied to a single field when querying // for findings. Gte *float64 + // The less-than condition to be applied to a single field when querying for + // findings. + Lt *float64 + // The less-than-equal condition to be applied to a single field when querying for // findings. Lte *float64 @@ -13808,6 +14016,129 @@ type Page struct { noSmithyDocumentSerde } +// An object that provides the current value of a security control parameter and +// identifies whether it has been customized. +type ParameterConfiguration struct { + + // Identifies whether a control parameter uses a custom user-defined value or the + // Security Hub default value. + // + // This member is required. + ValueType ParameterValueType + + // The current value of a control parameter. + Value ParameterValue + + noSmithyDocumentSerde +} + +// An object that describes a security control parameter and the options for +// customizing it. +type ParameterDefinition struct { + + // The options for customizing a control parameter. Customization options vary + // based on the data type of the parameter. + // + // This member is required. + ConfigurationOptions ConfigurationOptions + + // Description of a control parameter. + // + // This member is required. + Description *string + + noSmithyDocumentSerde +} + +// An object that includes the data type of a security control parameter and its +// current value. +// +// The following types satisfy this interface: +// +// ParameterValueMemberBoolean +// ParameterValueMemberDouble +// ParameterValueMemberEnum +// ParameterValueMemberEnumList +// ParameterValueMemberInteger +// ParameterValueMemberIntegerList +// ParameterValueMemberString +// ParameterValueMemberStringList +type ParameterValue interface { + isParameterValue() +} + +// A control parameter that is a boolean. +type ParameterValueMemberBoolean struct { + Value bool + + noSmithyDocumentSerde +} + +func (*ParameterValueMemberBoolean) isParameterValue() {} + +// A control parameter that is a double. +type ParameterValueMemberDouble struct { + Value float64 + + noSmithyDocumentSerde +} + +func (*ParameterValueMemberDouble) isParameterValue() {} + +// A control parameter that is an enum. +type ParameterValueMemberEnum struct { + Value string + + noSmithyDocumentSerde +} + +func (*ParameterValueMemberEnum) isParameterValue() {} + +// A control parameter that is a list of enums. +type ParameterValueMemberEnumList struct { + Value []string + + noSmithyDocumentSerde +} + +func (*ParameterValueMemberEnumList) isParameterValue() {} + +// A control parameter that is an integer. +type ParameterValueMemberInteger struct { + Value int32 + + noSmithyDocumentSerde +} + +func (*ParameterValueMemberInteger) isParameterValue() {} + +// A control parameter that is a list of integers. +type ParameterValueMemberIntegerList struct { + Value []int32 + + noSmithyDocumentSerde +} + +func (*ParameterValueMemberIntegerList) isParameterValue() {} + +// A control parameter that is a string. +type ParameterValueMemberString struct { + Value string + + noSmithyDocumentSerde +} + +func (*ParameterValueMemberString) isParameterValue() {} + +// A control parameter that is a list of strings. +type ParameterValueMemberStringList struct { + Value []string + + noSmithyDocumentSerde +} + +func (*ParameterValueMemberStringList) isParameterValue() {} + // Provides an overview of the patch compliance status for an instance against a // selected compliance standard. type PatchSummary struct { @@ -14854,6 +15185,24 @@ type SecurityControl struct { // This member is required. Title *string + // The most recent reason for updating the customizable properties of a security + // control. This differs from the UpdateReason field of the + // BatchUpdateStandardsControlAssociations (https://docs.aws.amazon.com/securityhub/1.0/APIReference/API_BatchUpdateStandardsControlAssociations.html) + // API, which tracks the reason for updating the enablement status of a control. + // This field accepts alphanumeric characters in addition to white spaces, dashes, + // and underscores. + LastUpdateReason *string + + // An object that identifies the name of a control parameter, its current value, + // and whether it has been customized. + Parameters map[string]ParameterConfiguration + + // Identifies whether customizable properties of a security control are reflected + // in Security Hub findings. A status of READY indicates findings include the + // current parameter values. A status of UPDATING indicates that all findings may + // not include the current parameter values. + UpdateStatus UpdateStatus + noSmithyDocumentSerde } @@ -14904,6 +15253,28 @@ type SecurityControlDefinition struct { // This member is required. Title *string + // Security control properties that you can customize. Currently, only parameter + // customization is supported for select controls. An empty array is returned for + // controls that don’t support custom properties. + CustomizableProperties []SecurityControlProperty + + // An object that provides a security control parameter name, description, and the + // options for customizing it. This object is excluded for a control that doesn't + // support custom parameters. + ParameterDefinitions map[string]ParameterDefinition + + noSmithyDocumentSerde +} + +// A parameter that a security control accepts. +type SecurityControlParameter struct { + + // The name of a + Name *string + + // The current value of a control parameter. + Value []string + noSmithyDocumentSerde } @@ -14964,10 +15335,9 @@ type Severity struct { // - 90–100 - CRITICAL Label SeverityLabel - // Deprecated. The normalized severity of a finding. This attribute is being - // deprecated. Instead of providing Normalized , provide Label . If you provide - // Label and do not provide Normalized , then Normalized is set automatically as - // follows. + // Deprecated. The normalized severity of a finding. Instead of providing + // Normalized , provide Label . If you provide Label and do not provide Normalized + // , then Normalized is set automatically as follows. // - INFORMATIONAL - 0 // - LOW - 1 // - MEDIUM - 40 @@ -14978,9 +15348,9 @@ type Severity struct { // The native severity from the finding product that generated the finding. Original *string - // Deprecated. This attribute is being deprecated. Instead of providing Product , - // provide Original . The native severity as defined by the Amazon Web Services - // service or integrated partner product that generated the finding. + // Deprecated. This attribute isn't included in findings. Instead of providing + // Product , provide Original . The native severity as defined by the Amazon Web + // Services service or integrated partner product that generated the finding. Product *float64 noSmithyDocumentSerde @@ -15411,6 +15781,22 @@ type StatusReason struct { noSmithyDocumentSerde } +// The options for customizing a security control parameter that is a string. +type StringConfigurationOptions struct { + + // The Security Hub default value for a control parameter that is a string. + DefaultValue *string + + // The description of the RE2 regular expression. + ExpressionDescription *string + + // An RE2 regular expression that Security Hub uses to validate a user-provided + // control parameter string. + Re2Expression *string + + noSmithyDocumentSerde +} + // A string filter for filtering Security Hub findings. type StringFilter struct { @@ -15476,6 +15862,28 @@ type StringFilter struct { noSmithyDocumentSerde } +// The options for customizing a security control parameter that is a list of +// strings. +type StringListConfigurationOptions struct { + + // The Security Hub default value for a control parameter that is a list of + // strings. + DefaultValue []string + + // The description of the RE2 regular expression. + ExpressionDescription *string + + // The maximum number of list items that a string list control parameter can + // accept. + MaxItems *int32 + + // An RE2 regular expression that Security Hub uses to validate a user-provided + // list of strings for a control parameter. + Re2Expression *string + + noSmithyDocumentSerde +} + // Provides information about the threat detected in a security finding and the // file paths that were affected by the threat. type Threat struct { @@ -15892,3 +16300,15 @@ type WorkflowUpdate 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) isConfigurationOptions() {} +func (*UnknownUnionMember) isParameterValue() {} diff --git a/service/securityhub/types/types_exported_test.go b/service/securityhub/types/types_exported_test.go new file mode 100644 index 00000000000..580c9b5a4fd --- /dev/null +++ b/service/securityhub/types/types_exported_test.go @@ -0,0 +1,98 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/securityhub/types" +) + +func ExampleConfigurationOptions_outputUsage() { + var union types.ConfigurationOptions + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ConfigurationOptionsMemberBoolean: + _ = v.Value // Value is types.BooleanConfigurationOptions + + case *types.ConfigurationOptionsMemberDouble: + _ = v.Value // Value is types.DoubleConfigurationOptions + + case *types.ConfigurationOptionsMemberEnum: + _ = v.Value // Value is types.EnumConfigurationOptions + + case *types.ConfigurationOptionsMemberEnumList: + _ = v.Value // Value is types.EnumListConfigurationOptions + + case *types.ConfigurationOptionsMemberInteger: + _ = v.Value // Value is types.IntegerConfigurationOptions + + case *types.ConfigurationOptionsMemberIntegerList: + _ = v.Value // Value is types.IntegerListConfigurationOptions + + case *types.ConfigurationOptionsMemberString: + _ = v.Value // Value is types.StringConfigurationOptions + + case *types.ConfigurationOptionsMemberStringList: + _ = v.Value // Value is types.StringListConfigurationOptions + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.IntegerConfigurationOptions +var _ *types.StringConfigurationOptions +var _ *types.StringListConfigurationOptions +var _ *types.DoubleConfigurationOptions +var _ *types.IntegerListConfigurationOptions +var _ *types.BooleanConfigurationOptions +var _ *types.EnumConfigurationOptions +var _ *types.EnumListConfigurationOptions + +func ExampleParameterValue_outputUsage() { + var union types.ParameterValue + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ParameterValueMemberBoolean: + _ = v.Value // Value is bool + + case *types.ParameterValueMemberDouble: + _ = v.Value // Value is float64 + + case *types.ParameterValueMemberEnum: + _ = v.Value // Value is string + + case *types.ParameterValueMemberEnumList: + _ = v.Value // Value is []string + + case *types.ParameterValueMemberInteger: + _ = v.Value // Value is int32 + + case *types.ParameterValueMemberIntegerList: + _ = v.Value // Value is []int32 + + case *types.ParameterValueMemberString: + _ = v.Value // Value is string + + case *types.ParameterValueMemberStringList: + _ = 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 +var _ []string +var _ *int32 +var _ *bool +var _ *float64 +var _ []int32 diff --git a/service/securityhub/validators.go b/service/securityhub/validators.go index c6764807bbf..a8f32660fcd 100644 --- a/service/securityhub/validators.go +++ b/service/securityhub/validators.go @@ -670,6 +670,26 @@ func (m *validateOpGetMembers) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpGetSecurityControlDefinition struct { +} + +func (*validateOpGetSecurityControlDefinition) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSecurityControlDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSecurityControlDefinitionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSecurityControlDefinitionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpInviteMembers struct { } @@ -870,6 +890,26 @@ func (m *validateOpUpdateOrganizationConfiguration) HandleInitialize(ctx context return next.HandleInitialize(ctx, in) } +type validateOpUpdateSecurityControl struct { +} + +func (*validateOpUpdateSecurityControl) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSecurityControl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSecurityControlInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSecurityControlInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateStandardsControl struct { } @@ -1022,6 +1062,10 @@ func addOpGetMembersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetMembers{}, middleware.After) } +func addOpGetSecurityControlDefinitionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSecurityControlDefinition{}, middleware.After) +} + func addOpInviteMembersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpInviteMembers{}, middleware.After) } @@ -1062,6 +1106,10 @@ func addOpUpdateOrganizationConfigurationValidationMiddleware(stack *middleware. return stack.Initialize.Add(&validateOpUpdateOrganizationConfiguration{}, middleware.After) } +func addOpUpdateSecurityControlValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSecurityControl{}, middleware.After) +} + func addOpUpdateStandardsControlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateStandardsControl{}, middleware.After) } @@ -1392,6 +1440,39 @@ func validateNoteUpdate(v *types.NoteUpdate) error { } } +func validateParameterConfiguration(v *types.ParameterConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ParameterConfiguration"} + if len(v.ValueType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ValueType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateParameters(v map[string]types.ParameterConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Parameters"} + for key := range v { + value := v[key] + if err := validateParameterConfiguration(&value); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validatePatchSummary(v *types.PatchSummary) error { if v == nil { return nil @@ -2274,6 +2355,21 @@ func validateOpGetMembersInput(v *GetMembersInput) error { } } +func validateOpGetSecurityControlDefinitionInput(v *GetSecurityControlDefinitionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSecurityControlDefinitionInput"} + if v.SecurityControlId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecurityControlId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpInviteMembersInput(v *InviteMembersInput) error { if v == nil { return nil @@ -2438,6 +2534,28 @@ func validateOpUpdateOrganizationConfigurationInput(v *UpdateOrganizationConfigu } } +func validateOpUpdateSecurityControlInput(v *UpdateSecurityControlInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSecurityControlInput"} + if v.SecurityControlId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecurityControlId")) + } + if v.Parameters == nil { + invalidParams.Add(smithy.NewErrParamRequired("Parameters")) + } else if v.Parameters != nil { + if err := validateParameters(v.Parameters); err != nil { + invalidParams.AddNested("Parameters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateStandardsControlInput(v *UpdateStandardsControlInput) error { if v == nil { return nil diff --git a/service/sfn/api_op_DescribeExecution.go b/service/sfn/api_op_DescribeExecution.go index fd45cf978f7..596a7ec4421 100644 --- a/service/sfn/api_op_DescribeExecution.go +++ b/service/sfn/api_op_DescribeExecution.go @@ -108,8 +108,8 @@ type DescribeExecutionOutput struct { OutputDetails *types.CloudWatchEventsExecutionDataDetails // The number of times you've redriven an execution. If you have not yet redriven - // an execution, the redriveCount is 0. This count is not updated for redrives - // that failed to start or are pending to be redriven. + // an execution, the redriveCount is 0. This count is only updated if you + // successfully redrive an execution. RedriveCount *int32 // The date the execution was last redriven. If you have not yet redriven an diff --git a/service/sfn/api_op_DescribeMapRun.go b/service/sfn/api_op_DescribeMapRun.go index 62186fc1efd..435f0ee2666 100644 --- a/service/sfn/api_op_DescribeMapRun.go +++ b/service/sfn/api_op_DescribeMapRun.go @@ -97,8 +97,8 @@ type DescribeMapRunOutput struct { ToleratedFailurePercentage float32 // The number of times you've redriven a Map Run. If you have not yet redriven a - // Map Run, the redriveCount is 0. This count is not updated for redrives that - // failed to start or are pending to be redriven. + // Map Run, the redriveCount is 0. This count is only updated if you successfully + // redrive a Map Run. RedriveCount *int32 // The date a Map Run was last redriven. If you have not yet redriven a Map Run, diff --git a/service/sfn/api_op_RedriveExecution.go b/service/sfn/api_op_RedriveExecution.go index d0e22e0728a..c18adcc178b 100644 --- a/service/sfn/api_op_RedriveExecution.go +++ b/service/sfn/api_op_RedriveExecution.go @@ -24,14 +24,14 @@ import ( // or Parallel (https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-parallel-state.html) // state, RedriveExecution API action reschedules and redrives only the iterations // and branches that failed or aborted. To redrive a workflow that includes a -// Distributed Map state with failed child workflow executions, you must redrive -// the parent workflow (https://docs.aws.amazon.com/step-functions/latest/dg/use-dist-map-orchestrate-large-scale-parallel-workloads.html#dist-map-orchestrate-parallel-workloads-key-terms) -// . The parent workflow redrives all the unsuccessful states, including -// Distributed Map. This API action is not supported by EXPRESS state machines. -// However, you can restart the unsuccessful executions of Express child workflows -// in a Distributed Map by redriving its Map Run. When you redrive a Map Run, the -// Express child workflows are rerun using the StartExecution API action. For more -// information, see Redriving Map Runs (https://docs.aws.amazon.com/step-functions/latest/dg/redrive-map-run.html) +// Distributed Map state whose Map Run failed, you must redrive the parent workflow (https://docs.aws.amazon.com/step-functions/latest/dg/use-dist-map-orchestrate-large-scale-parallel-workloads.html#dist-map-orchestrate-parallel-workloads-key-terms) +// . The parent workflow redrives all the unsuccessful states, including a failed +// Map Run. If a Map Run was not started in the original execution attempt, the +// redriven parent workflow starts the Map Run. This API action is not supported by +// EXPRESS state machines. However, you can restart the unsuccessful executions of +// Express child workflows in a Distributed Map by redriving its Map Run. When you +// redrive a Map Run, the Express child workflows are rerun using the +// StartExecution API action. For more information, see Redriving Map Runs (https://docs.aws.amazon.com/step-functions/latest/dg/redrive-map-run.html) // . You can redrive executions if your original execution meets the following // conditions: // - The execution status isn't SUCCEEDED . @@ -72,7 +72,9 @@ type RedriveExecutionInput struct { // A unique, case-sensitive identifier that you provide to ensure the idempotency // of the request. If you don’t specify a client token, the Amazon Web Services SDK // automatically generates a client token and uses it for the request to ensure - // idempotency. The API uses one of the last 10 client tokens provided. + // idempotency. The API will return idempotent responses for the last 10 client + // tokens used to successfully redrive the execution. These client tokens are valid + // for up to 15 minutes after they are first used. ClientToken *string noSmithyDocumentSerde diff --git a/service/sfn/api_op_TestState.go b/service/sfn/api_op_TestState.go new file mode 100644 index 00000000000..eaa3f84e4b0 --- /dev/null +++ b/service/sfn/api_op_TestState.go @@ -0,0 +1,252 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sfn + +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/sfn/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Accepts the definition of a single state and executes it. You can test a state +// without creating a state machine or updating an existing state machine. Using +// this API, you can test the following: +// - A state's input and output processing (https://docs.aws.amazon.com/step-functions/latest/dg/test-state-isolation.html#test-state-input-output-dataflow) +// data flow +// - An Amazon Web Services service integration (https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-services.html) +// request and response +// - An HTTP Task (https://docs.aws.amazon.com/step-functions/latest/dg/connect-third-party-apis.html) +// request and response +// +// You can call this API on only one state at a time. The states that you can test +// include the following: +// - All Task types (https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html#task-types) +// except Activity (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-activities.html) +// - Pass (https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-pass-state.html) +// - Wait (https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-wait-state.html) +// - Choice (https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-choice-state.html) +// - Succeed (https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-succeed-state.html) +// - Fail (https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-fail-state.html) +// +// The TestState API assumes an IAM role which must contain the required IAM +// permissions for the resources your state is accessing. For information about the +// permissions a state might need, see IAM permissions to test a state (https://docs.aws.amazon.com/step-functions/latest/dg/test-state-isolation.html#test-state-permissions) +// . The TestState API can run for up to five minutes. If the execution of a state +// exceeds this duration, it fails with the States.Timeout error. TestState +// doesn't support Activity tasks (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-activities.html) +// , .sync or .waitForTaskToken service integration patterns (https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html) +// , Parallel (https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-parallel-state.html) +// , or Map (https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-map-state.html) +// states. +func (c *Client) TestState(ctx context.Context, params *TestStateInput, optFns ...func(*Options)) (*TestStateOutput, error) { + if params == nil { + params = &TestStateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TestState", params, optFns, c.addOperationTestStateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TestStateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TestStateInput struct { + + // The Amazon States Language (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html) + // (ASL) definition of the state. + // + // This member is required. + Definition *string + + // The Amazon Resource Name (ARN) of the execution role with the required IAM + // permissions for the state. + // + // This member is required. + RoleArn *string + + // A string that contains the JSON input data for the state. + Input *string + + // Determines the values to return when a state is tested. You can specify one of + // the following types: + // - INFO : Shows the final state output. By default, Step Functions sets + // inspectionLevel to INFO if you don't specify a level. + // - DEBUG : Shows the final state output along with the input and output data + // processing result. + // - TRACE : Shows the HTTP request and response for an HTTP Task. This level + // also shows the final state output along with the input and output data + // processing result. + // Each of these levels also provide information about the status of the state + // execution and the next state to transition to. + InspectionLevel types.InspectionLevel + + // Specifies whether or not to include secret information in the test result. For + // HTTP Tasks, a secret includes the data that an EventBridge connection adds to + // modify the HTTP request headers, query parameters, and body. Step Functions + // doesn't omit any information included in the state definition or the HTTP + // response. If you set revealSecrets to true , you must make sure that the IAM + // user that calls the TestState API has permission for the states:RevealSecrets + // action. For an example of IAM policy that sets the states:RevealSecrets + // permission, see IAM permissions to test a state (https://docs.aws.amazon.com/step-functions/latest/dg/test-state-isolation.html#test-state-permissions) + // . Without this permission, Step Functions throws an access denied error. By + // default, revealSecrets is set to false . + RevealSecrets bool + + noSmithyDocumentSerde +} + +type TestStateOutput struct { + + // A detailed explanation of the cause for the error when the execution of a state + // fails. + Cause *string + + // The error returned when the execution of a state fails. + Error *string + + // Returns additional details about the state's execution, including its input and + // output data processing flow, and HTTP request and response information. The + // inspectionLevel request parameter specifies which details are returned. + InspectionData *types.InspectionData + + // The name of the next state to transition to. If you haven't defined a next + // state in your definition or if the execution of the state fails, this field + // doesn't contain a value. + NextState *string + + // The JSON output data of the state. Length constraints apply to the payload + // size, and are expressed as bytes in UTF-8 encoding. + Output *string + + // The execution status of the state. + Status types.TestExecutionStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTestStateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpTestState{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpTestState{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "TestState"); 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 = addEndpointPrefix_opTestStateMiddleware(stack); err != nil { + return err + } + if err = addOpTestStateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTestState(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 endpointPrefix_opTestStateMiddleware struct { +} + +func (*endpointPrefix_opTestStateMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opTestStateMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "sync-" + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opTestStateMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opTestStateMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opTestState(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "TestState", + } +} diff --git a/service/sfn/deserializers.go b/service/sfn/deserializers.go index 2907075aab5..0e4aeaefb06 100644 --- a/service/sfn/deserializers.go +++ b/service/sfn/deserializers.go @@ -3704,6 +3704,126 @@ func awsAwsjson10_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } +type awsAwsjson10_deserializeOpTestState struct { +} + +func (*awsAwsjson10_deserializeOpTestState) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpTestState) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorTestState(response, &metadata) + } + output := &TestStateOutput{} + 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_deserializeOpDocumentTestStateOutput(&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_deserializeOpErrorTestState(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InvalidArn", errorCode): + return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody) + + case strings.EqualFold("InvalidDefinition", errorCode): + return awsAwsjson10_deserializeErrorInvalidDefinition(response, errorBody) + + case strings.EqualFold("InvalidExecutionInput", errorCode): + return awsAwsjson10_deserializeErrorInvalidExecutionInput(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpUntagResource struct { } @@ -4180,6 +4300,9 @@ func awsAwsjson10_deserializeOpErrorUpdateStateMachineAlias(response *smithyhttp case strings.EqualFold("ResourceNotFound", errorCode): return awsAwsjson10_deserializeErrorResourceNotFound(response, errorBody) + case strings.EqualFold("StateMachineDeleting", errorCode): + return awsAwsjson10_deserializeErrorStateMachineDeleting(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) @@ -6887,6 +7010,253 @@ func awsAwsjson10_deserializeDocumentHistoryEventList(v *[]types.HistoryEvent, v return nil } +func awsAwsjson10_deserializeDocumentInspectionData(v **types.InspectionData, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InspectionData + if *v == nil { + sv = &types.InspectionData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "afterInputPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value) + } + sv.AfterInputPath = ptr.String(jtv) + } + + case "afterParameters": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value) + } + sv.AfterParameters = ptr.String(jtv) + } + + case "afterResultPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value) + } + sv.AfterResultPath = ptr.String(jtv) + } + + case "afterResultSelector": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value) + } + sv.AfterResultSelector = ptr.String(jtv) + } + + case "input": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value) + } + sv.Input = ptr.String(jtv) + } + + case "request": + if err := awsAwsjson10_deserializeDocumentInspectionDataRequest(&sv.Request, value); err != nil { + return err + } + + case "response": + if err := awsAwsjson10_deserializeDocumentInspectionDataResponse(&sv.Response, value); err != nil { + return err + } + + case "result": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value) + } + sv.Result = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentInspectionDataRequest(v **types.InspectionDataRequest, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InspectionDataRequest + if *v == nil { + sv = &types.InspectionDataRequest{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "body": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HTTPBody to be of type string, got %T instead", value) + } + sv.Body = ptr.String(jtv) + } + + case "headers": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HTTPHeaders to be of type string, got %T instead", value) + } + sv.Headers = ptr.String(jtv) + } + + case "method": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HTTPMethod to be of type string, got %T instead", value) + } + sv.Method = ptr.String(jtv) + } + + case "protocol": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HTTPProtocol to be of type string, got %T instead", value) + } + sv.Protocol = 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentInspectionDataResponse(v **types.InspectionDataResponse, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InspectionDataResponse + if *v == nil { + sv = &types.InspectionDataResponse{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "body": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HTTPBody to be of type string, got %T instead", value) + } + sv.Body = ptr.String(jtv) + } + + case "headers": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HTTPHeaders to be of type string, got %T instead", value) + } + sv.Headers = ptr.String(jtv) + } + + case "protocol": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HTTPProtocol to be of type string, got %T instead", value) + } + sv.Protocol = ptr.String(jtv) + } + + case "statusCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HTTPStatusCode to be of type string, got %T instead", value) + } + sv.StatusCode = ptr.String(jtv) + } + + case "statusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HTTPStatusMessage to be of type string, got %T instead", value) + } + sv.StatusMessage = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentInvalidArn(v **types.InvalidArn, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12048,6 +12418,87 @@ func awsAwsjson10_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, return nil } +func awsAwsjson10_deserializeOpDocumentTestStateOutput(v **TestStateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *TestStateOutput + if *v == nil { + sv = &TestStateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "cause": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveCause to be of type string, got %T instead", value) + } + sv.Cause = ptr.String(jtv) + } + + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value) + } + sv.Error = ptr.String(jtv) + } + + case "inspectionData": + if err := awsAwsjson10_deserializeDocumentInspectionData(&sv.InspectionData, value); err != nil { + return err + } + + case "nextState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StateName to be of type string, got %T instead", value) + } + sv.NextState = ptr.String(jtv) + } + + case "output": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveData to be of type string, got %T instead", value) + } + sv.Output = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TestExecutionStatus to be of type string, got %T instead", value) + } + sv.Status = types.TestExecutionStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/sfn/generated.json b/service/sfn/generated.json index b90eecf26cb..86f0bdcb1b4 100644 --- a/service/sfn/generated.json +++ b/service/sfn/generated.json @@ -40,6 +40,7 @@ "api_op_StartSyncExecution.go", "api_op_StopExecution.go", "api_op_TagResource.go", + "api_op_TestState.go", "api_op_UntagResource.go", "api_op_UpdateMapRun.go", "api_op_UpdateStateMachine.go", diff --git a/service/sfn/serializers.go b/service/sfn/serializers.go index 1194d206958..a625c55dd44 100644 --- a/service/sfn/serializers.go +++ b/service/sfn/serializers.go @@ -1721,6 +1721,61 @@ func (m *awsAwsjson10_serializeOpTagResource) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpTestState struct { +} + +func (*awsAwsjson10_serializeOpTestState) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpTestState) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TestStateInput) + _ = 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("AWSStepFunctions.TestState") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentTestStateInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpUntagResource struct { } @@ -2690,6 +2745,38 @@ func awsAwsjson10_serializeOpDocumentTagResourceInput(v *TagResourceInput, value return nil } +func awsAwsjson10_serializeOpDocumentTestStateInput(v *TestStateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Definition != nil { + ok := object.Key("definition") + ok.String(*v.Definition) + } + + if v.Input != nil { + ok := object.Key("input") + ok.String(*v.Input) + } + + if len(v.InspectionLevel) > 0 { + ok := object.Key("inspectionLevel") + ok.String(string(v.InspectionLevel)) + } + + if v.RevealSecrets { + ok := object.Key("revealSecrets") + ok.Boolean(v.RevealSecrets) + } + + if v.RoleArn != nil { + ok := object.Key("roleArn") + ok.String(*v.RoleArn) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/sfn/types/enums.go b/service/sfn/types/enums.go index bf3d0d4692f..9fa8ace4e80 100644 --- a/service/sfn/types/enums.go +++ b/service/sfn/types/enums.go @@ -202,6 +202,26 @@ func (HistoryEventType) Values() []HistoryEventType { } } +type InspectionLevel string + +// Enum values for InspectionLevel +const ( + InspectionLevelInfo InspectionLevel = "INFO" + InspectionLevelDebug InspectionLevel = "DEBUG" + InspectionLevelTrace InspectionLevel = "TRACE" +) + +// Values returns all known values for InspectionLevel. 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 (InspectionLevel) Values() []InspectionLevel { + return []InspectionLevel{ + "INFO", + "DEBUG", + "TRACE", + } +} + type LogLevel string // Enum values for LogLevel @@ -302,6 +322,28 @@ func (SyncExecutionStatus) Values() []SyncExecutionStatus { } } +type TestExecutionStatus string + +// Enum values for TestExecutionStatus +const ( + TestExecutionStatusSucceeded TestExecutionStatus = "SUCCEEDED" + TestExecutionStatusFailed TestExecutionStatus = "FAILED" + TestExecutionStatusRetriable TestExecutionStatus = "RETRIABLE" + TestExecutionStatusCaughtError TestExecutionStatus = "CAUGHT_ERROR" +) + +// Values returns all known values for TestExecutionStatus. 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 (TestExecutionStatus) Values() []TestExecutionStatus { + return []TestExecutionStatus{ + "SUCCEEDED", + "FAILED", + "RETRIABLE", + "CAUGHT_ERROR", + } +} + type ValidationExceptionReason string // Enum values for ValidationExceptionReason diff --git a/service/sfn/types/types.go b/service/sfn/types/types.go index b26b2393381..b462a8c3f27 100644 --- a/service/sfn/types/types.go +++ b/service/sfn/types/types.go @@ -222,8 +222,8 @@ type ExecutionListItem struct { MapRunArn *string // The number of times you've redriven an execution. If you have not yet redriven - // an execution, the redriveCount is 0. This count is not updated for redrives - // that failed to start or are pending to be redriven. + // an execution, the redriveCount is 0. This count is only updated when you + // successfully redrive an execution. RedriveCount *int32 // The date the execution was last redriven. @@ -456,6 +456,87 @@ type HistoryEventExecutionDataDetails struct { noSmithyDocumentSerde } +// Contains additional details about the state's execution, including its input +// and output data processing flow, and HTTP request and response information. +type InspectionData struct { + + // The input after Step Functions applies the InputPath (https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-inputpath) + // filter. + AfterInputPath *string + + // The effective input after Step Functions applies the Parameters (https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-parameters) + // filter. + AfterParameters *string + + // The effective result combined with the raw state input after Step Functions + // applies the ResultPath (https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultpath.html) + // filter. + AfterResultPath *string + + // The effective result after Step Functions applies the ResultSelector (https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-resultselector) + // filter. + AfterResultSelector *string + + // The raw state input. + Input *string + + // The raw HTTP request that is sent when you test an HTTP Task. + Request *InspectionDataRequest + + // The raw HTTP response that is returned when you test an HTTP Task. + Response *InspectionDataResponse + + // The state's raw result. + Result *string + + noSmithyDocumentSerde +} + +// Contains additional details about the state's execution, including its input +// and output data processing flow, and HTTP request information. +type InspectionDataRequest struct { + + // The request body for the HTTP request. + Body *string + + // The request headers associated with the HTTP request. + Headers *string + + // The HTTP method used for the HTTP request. + Method *string + + // The protocol used to make the HTTP request. + Protocol *string + + // The API endpoint used for the HTTP request. + Url *string + + noSmithyDocumentSerde +} + +// Contains additional details about the state's execution, including its input +// and output data processing flow, and HTTP response information. The +// inspectionLevel request parameter specifies which details are returned. +type InspectionDataResponse struct { + + // The HTTP response returned. + Body *string + + // The response headers associated with the HTTP response. + Headers *string + + // The protocol used to return the HTTP response. + Protocol *string + + // The HTTP response status code for the HTTP response. + StatusCode *string + + // The message associated with the HTTP status code. + StatusMessage *string + + noSmithyDocumentSerde +} + // Contains details about a Lambda function that failed during an execution. type LambdaFunctionFailedEventDetails struct { @@ -638,10 +719,9 @@ type MapRunExecutionCounts struct { Total int64 // The number of FAILED , ABORTED , or TIMED_OUT child workflow executions that - // cannot be redriven because their execution status is terminal. For example, if - // your execution event history contains 25,000 entries, or the - // toleratedFailureCount or toleratedFailurePercentage for the Distributed Map has - // exceeded. + // cannot be redriven because their execution status is terminal. For example, + // child workflows with an execution status of FAILED , ABORTED , or TIMED_OUT and + // a redriveStatus of NOT_REDRIVABLE . FailuresNotRedrivable *int64 // The number of unsuccessful child workflow executions currently waiting to be @@ -721,9 +801,8 @@ type MapRunItemCounts struct { // The number of FAILED , ABORTED , or TIMED_OUT items in child workflow // executions that cannot be redriven because the execution status of those child - // workflows is terminal. For example, if your execution event history contains - // 25,000 entries, or the toleratedFailureCount or toleratedFailurePercentage for - // the Distributed Map has exceeded. + // workflows is terminal. For example, child workflows with an execution status of + // FAILED , ABORTED , or TIMED_OUT and a redriveStatus of NOT_REDRIVABLE . FailuresNotRedrivable *int64 // The number of unsuccessful items in child workflow executions currently waiting diff --git a/service/sfn/validators.go b/service/sfn/validators.go index 8e7d0d5a944..9a7306d4f2b 100644 --- a/service/sfn/validators.go +++ b/service/sfn/validators.go @@ -570,6 +570,26 @@ func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpTestState struct { +} + +func (*validateOpTestState) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTestState) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TestStateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTestStateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUntagResource struct { } @@ -762,6 +782,10 @@ func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } +func addOpTestStateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTestState{}, middleware.After) +} + func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } @@ -1249,6 +1273,24 @@ func validateOpTagResourceInput(v *TagResourceInput) error { } } +func validateOpTestStateInput(v *TestStateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TestStateInput"} + if v.Definition == nil { + invalidParams.Add(smithy.NewErrParamRequired("Definition")) + } + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUntagResourceInput(v *UntagResourceInput) error { if v == nil { return nil diff --git a/service/transcribe/deserializers.go b/service/transcribe/deserializers.go index 70432329817..5b85545f99b 100644 --- a/service/transcribe/deserializers.go +++ b/service/transcribe/deserializers.go @@ -5092,6 +5092,11 @@ func awsAwsjson11_deserializeDocumentCallAnalyticsJobSettings(v **types.CallAnal return err } + case "Summarization": + if err := awsAwsjson11_deserializeDocumentSummarization(&sv.Summarization, value); err != nil { + return err + } + case "VocabularyFilterMethod": if value != nil { jtv, ok := value.(string) @@ -7518,6 +7523,46 @@ func awsAwsjson11_deserializeDocumentSubtitlesOutput(v **types.SubtitlesOutput, return nil } +func awsAwsjson11_deserializeDocumentSummarization(v **types.Summarization, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Summarization + if *v == nil { + sv = &types.Summarization{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "GenerateAbstractiveSummary": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.GenerateAbstractiveSummary = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/transcribe/endpoints.go b/service/transcribe/endpoints.go index 4d51f19a6bf..8b57b310855 100644 --- a/service/transcribe/endpoints.go +++ b/service/transcribe/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://fips.transcribe.") @@ -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://fips.transcribe.") diff --git a/service/transcribe/serializers.go b/service/transcribe/serializers.go index e636eec3e31..14799d18a00 100644 --- a/service/transcribe/serializers.go +++ b/service/transcribe/serializers.go @@ -2216,6 +2216,13 @@ func awsAwsjson11_serializeDocumentCallAnalyticsJobSettings(v *types.CallAnalyti } } + if v.Summarization != nil { + ok := object.Key("Summarization") + if err := awsAwsjson11_serializeDocumentSummarization(v.Summarization, ok); err != nil { + return err + } + } + if len(v.VocabularyFilterMethod) > 0 { ok := object.Key("VocabularyFilterMethod") ok.String(string(v.VocabularyFilterMethod)) @@ -2756,6 +2763,18 @@ func awsAwsjson11_serializeDocumentSubtitles(v *types.Subtitles, value smithyjso return nil } +func awsAwsjson11_serializeDocumentSummarization(v *types.Summarization, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.GenerateAbstractiveSummary != nil { + ok := object.Key("GenerateAbstractiveSummary") + ok.Boolean(*v.GenerateAbstractiveSummary) + } + + return nil +} + func awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/transcribe/types/enums.go b/service/transcribe/types/enums.go index 06926492397..c8c1902a7c5 100644 --- a/service/transcribe/types/enums.go +++ b/service/transcribe/types/enums.go @@ -92,45 +92,109 @@ type LanguageCode string // Enum values for LanguageCode const ( - LanguageCodeAfZa LanguageCode = "af-ZA" - LanguageCodeArAe LanguageCode = "ar-AE" - LanguageCodeArSa LanguageCode = "ar-SA" - LanguageCodeDaDk LanguageCode = "da-DK" - LanguageCodeDeCh LanguageCode = "de-CH" - LanguageCodeDeDe LanguageCode = "de-DE" - LanguageCodeEnAb LanguageCode = "en-AB" - LanguageCodeEnAu LanguageCode = "en-AU" - LanguageCodeEnGb LanguageCode = "en-GB" - LanguageCodeEnIe LanguageCode = "en-IE" - LanguageCodeEnIn LanguageCode = "en-IN" - LanguageCodeEnUs LanguageCode = "en-US" - LanguageCodeEnWl LanguageCode = "en-WL" - LanguageCodeEsEs LanguageCode = "es-ES" - LanguageCodeEsUs LanguageCode = "es-US" - LanguageCodeFaIr LanguageCode = "fa-IR" - LanguageCodeFrCa LanguageCode = "fr-CA" - LanguageCodeFrFr LanguageCode = "fr-FR" - LanguageCodeHeIl LanguageCode = "he-IL" - LanguageCodeHiIn LanguageCode = "hi-IN" - LanguageCodeIdId LanguageCode = "id-ID" - LanguageCodeItIt LanguageCode = "it-IT" - LanguageCodeJaJp LanguageCode = "ja-JP" - LanguageCodeKoKr LanguageCode = "ko-KR" - LanguageCodeMsMy LanguageCode = "ms-MY" - LanguageCodeNlNl LanguageCode = "nl-NL" - LanguageCodePtBr LanguageCode = "pt-BR" - LanguageCodePtPt LanguageCode = "pt-PT" - LanguageCodeRuRu LanguageCode = "ru-RU" - LanguageCodeTaIn LanguageCode = "ta-IN" - LanguageCodeTeIn LanguageCode = "te-IN" - LanguageCodeTrTr LanguageCode = "tr-TR" - LanguageCodeZhCn LanguageCode = "zh-CN" - LanguageCodeZhTw LanguageCode = "zh-TW" - LanguageCodeThTh LanguageCode = "th-TH" - LanguageCodeEnZa LanguageCode = "en-ZA" - LanguageCodeEnNz LanguageCode = "en-NZ" - LanguageCodeViVn LanguageCode = "vi-VN" - LanguageCodeSvSe LanguageCode = "sv-SE" + LanguageCodeAfZa LanguageCode = "af-ZA" + LanguageCodeArAe LanguageCode = "ar-AE" + LanguageCodeArSa LanguageCode = "ar-SA" + LanguageCodeDaDk LanguageCode = "da-DK" + LanguageCodeDeCh LanguageCode = "de-CH" + LanguageCodeDeDe LanguageCode = "de-DE" + LanguageCodeEnAb LanguageCode = "en-AB" + LanguageCodeEnAu LanguageCode = "en-AU" + LanguageCodeEnGb LanguageCode = "en-GB" + LanguageCodeEnIe LanguageCode = "en-IE" + LanguageCodeEnIn LanguageCode = "en-IN" + LanguageCodeEnUs LanguageCode = "en-US" + LanguageCodeEnWl LanguageCode = "en-WL" + LanguageCodeEsEs LanguageCode = "es-ES" + LanguageCodeEsUs LanguageCode = "es-US" + LanguageCodeFaIr LanguageCode = "fa-IR" + LanguageCodeFrCa LanguageCode = "fr-CA" + LanguageCodeFrFr LanguageCode = "fr-FR" + LanguageCodeHeIl LanguageCode = "he-IL" + LanguageCodeHiIn LanguageCode = "hi-IN" + LanguageCodeIdId LanguageCode = "id-ID" + LanguageCodeItIt LanguageCode = "it-IT" + LanguageCodeJaJp LanguageCode = "ja-JP" + LanguageCodeKoKr LanguageCode = "ko-KR" + LanguageCodeMsMy LanguageCode = "ms-MY" + LanguageCodeNlNl LanguageCode = "nl-NL" + LanguageCodePtBr LanguageCode = "pt-BR" + LanguageCodePtPt LanguageCode = "pt-PT" + LanguageCodeRuRu LanguageCode = "ru-RU" + LanguageCodeTaIn LanguageCode = "ta-IN" + LanguageCodeTeIn LanguageCode = "te-IN" + LanguageCodeTrTr LanguageCode = "tr-TR" + LanguageCodeZhCn LanguageCode = "zh-CN" + LanguageCodeZhTw LanguageCode = "zh-TW" + LanguageCodeThTh LanguageCode = "th-TH" + LanguageCodeEnZa LanguageCode = "en-ZA" + LanguageCodeEnNz LanguageCode = "en-NZ" + LanguageCodeViVn LanguageCode = "vi-VN" + LanguageCodeSvSe LanguageCode = "sv-SE" + LanguageCodeAbGe LanguageCode = "ab-GE" + LanguageCodeAstEs LanguageCode = "ast-ES" + LanguageCodeAzAz LanguageCode = "az-AZ" + LanguageCodeBaRu LanguageCode = "ba-RU" + LanguageCodeBeBy LanguageCode = "be-BY" + LanguageCodeBgBg LanguageCode = "bg-BG" + LanguageCodeBnIn LanguageCode = "bn-IN" + LanguageCodeBsBa LanguageCode = "bs-BA" + LanguageCodeCaEs LanguageCode = "ca-ES" + LanguageCodeCkbIq LanguageCode = "ckb-IQ" + LanguageCodeCkbIr LanguageCode = "ckb-IR" + LanguageCodeCsCz LanguageCode = "cs-CZ" + LanguageCodeCyWl LanguageCode = "cy-WL" + LanguageCodeElGr LanguageCode = "el-GR" + LanguageCodeEtEt LanguageCode = "et-ET" + LanguageCodeEuEs LanguageCode = "eu-ES" + LanguageCodeFiFi LanguageCode = "fi-FI" + LanguageCodeGlEs LanguageCode = "gl-ES" + LanguageCodeGuIn LanguageCode = "gu-IN" + LanguageCodeHaNg LanguageCode = "ha-NG" + LanguageCodeHrHr LanguageCode = "hr-HR" + LanguageCodeHuHu LanguageCode = "hu-HU" + LanguageCodeHyAm LanguageCode = "hy-AM" + LanguageCodeIsIs LanguageCode = "is-IS" + LanguageCodeKaGe LanguageCode = "ka-GE" + LanguageCodeKabDz LanguageCode = "kab-DZ" + LanguageCodeKkKz LanguageCode = "kk-KZ" + LanguageCodeKnIn LanguageCode = "kn-IN" + LanguageCodeKyKg LanguageCode = "ky-KG" + LanguageCodeLgIn LanguageCode = "lg-IN" + LanguageCodeLtLt LanguageCode = "lt-LT" + LanguageCodeLvLv LanguageCode = "lv-LV" + LanguageCodeMhrRu LanguageCode = "mhr-RU" + LanguageCodeMiNz LanguageCode = "mi-NZ" + LanguageCodeMkMk LanguageCode = "mk-MK" + LanguageCodeMlIn LanguageCode = "ml-IN" + LanguageCodeMnMn LanguageCode = "mn-MN" + LanguageCodeMrIn LanguageCode = "mr-IN" + LanguageCodeMtMt LanguageCode = "mt-MT" + LanguageCodeNoNo LanguageCode = "no-NO" + LanguageCodeOrIn LanguageCode = "or-IN" + LanguageCodePaIn LanguageCode = "pa-IN" + LanguageCodePlPl LanguageCode = "pl-PL" + LanguageCodePsAf LanguageCode = "ps-AF" + LanguageCodeRoRo LanguageCode = "ro-RO" + LanguageCodeRwRw LanguageCode = "rw-RW" + LanguageCodeSiLk LanguageCode = "si-LK" + LanguageCodeSkSk LanguageCode = "sk-SK" + LanguageCodeSlSi LanguageCode = "sl-SI" + LanguageCodeSoSo LanguageCode = "so-SO" + LanguageCodeSrRs LanguageCode = "sr-RS" + LanguageCodeSuId LanguageCode = "su-ID" + LanguageCodeSwBi LanguageCode = "sw-BI" + LanguageCodeSwKe LanguageCode = "sw-KE" + LanguageCodeSwRw LanguageCode = "sw-RW" + LanguageCodeSwTz LanguageCode = "sw-TZ" + LanguageCodeSwUg LanguageCode = "sw-UG" + LanguageCodeTlPh LanguageCode = "tl-PH" + LanguageCodeTtRu LanguageCode = "tt-RU" + LanguageCodeUgCn LanguageCode = "ug-CN" + LanguageCodeUkUa LanguageCode = "uk-UA" + LanguageCodeUzUz LanguageCode = "uz-UZ" + LanguageCodeWoSn LanguageCode = "wo-SN" + LanguageCodeZuZa LanguageCode = "zu-ZA" ) // Values returns all known values for LanguageCode. Note that this can be @@ -177,6 +241,70 @@ func (LanguageCode) Values() []LanguageCode { "en-NZ", "vi-VN", "sv-SE", + "ab-GE", + "ast-ES", + "az-AZ", + "ba-RU", + "be-BY", + "bg-BG", + "bn-IN", + "bs-BA", + "ca-ES", + "ckb-IQ", + "ckb-IR", + "cs-CZ", + "cy-WL", + "el-GR", + "et-ET", + "eu-ES", + "fi-FI", + "gl-ES", + "gu-IN", + "ha-NG", + "hr-HR", + "hu-HU", + "hy-AM", + "is-IS", + "ka-GE", + "kab-DZ", + "kk-KZ", + "kn-IN", + "ky-KG", + "lg-IN", + "lt-LT", + "lv-LV", + "mhr-RU", + "mi-NZ", + "mk-MK", + "ml-IN", + "mn-MN", + "mr-IN", + "mt-MT", + "no-NO", + "or-IN", + "pa-IN", + "pl-PL", + "ps-AF", + "ro-RO", + "rw-RW", + "si-LK", + "sk-SK", + "sl-SI", + "so-SO", + "sr-RS", + "su-ID", + "sw-BI", + "sw-KE", + "sw-RW", + "sw-TZ", + "sw-UG", + "tl-PH", + "tt-RU", + "ug-CN", + "uk-UA", + "uz-UZ", + "wo-SN", + "zu-ZA", } } diff --git a/service/transcribe/types/types.go b/service/transcribe/types/types.go index ddaa6ac25f0..4865f7068bb 100644 --- a/service/transcribe/types/types.go +++ b/service/transcribe/types/types.go @@ -205,6 +205,10 @@ type CallAnalyticsJobSettings struct { // must be encoded at a sample rate of 16,000 Hz or higher. LanguageOptions []LanguageCode + // Contains GenerateAbstractiveSummary , which is a required parameter if you want + // to enable Generative call summarization in your Call Analytics request. + Summarization *Summarization + // Specify how you want your custom vocabulary filter applied to your transcript. // To replace words with *** , choose mask . To delete words, choose remove . To // flag words without changing them, choose tag . @@ -1137,6 +1141,22 @@ type SubtitlesOutput struct { noSmithyDocumentSerde } +// Contains GenerateAbstractiveSummary , which is a required parameter if you want +// to enable Generative call summarization in your Call Analytics request. +type Summarization struct { + + // Enables Generative call summarization in your Call Analytics request Generative + // call summarization provides a summary of the transcript including important + // components discussed in the conversation. For more information, see Enabling + // generative call summarization (https://docs.aws.amazon.com/transcribe/latest/dg/tca-enable-summarization.html) + // . + // + // This member is required. + GenerateAbstractiveSummary *bool + + noSmithyDocumentSerde +} + // Adds metadata, in the form of a key:value pair, to the specified resource. For // example, you could add the tag Department:Sales to a resource to indicate that // it pertains to your organization's sales department. You can also use tags for diff --git a/service/transcribe/validators.go b/service/transcribe/validators.go index 8318c701497..d8cfb150d58 100644 --- a/service/transcribe/validators.go +++ b/service/transcribe/validators.go @@ -764,6 +764,11 @@ func validateCallAnalyticsJobSettings(v *types.CallAnalyticsJobSettings) error { invalidParams.AddNested("ContentRedaction", err.(smithy.InvalidParamsError)) } } + if v.Summarization != nil { + if err := validateSummarization(v.Summarization); err != nil { + invalidParams.AddNested("Summarization", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -863,6 +868,21 @@ func validateSentimentFilter(v *types.SentimentFilter) error { } } +func validateSummarization(v *types.Summarization) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Summarization"} + if v.GenerateAbstractiveSummary == nil { + invalidParams.Add(smithy.NewErrParamRequired("GenerateAbstractiveSummary")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTag(v *types.Tag) error { if v == nil { return nil diff --git a/service/workspaces/api_op_ModifyWorkspaceProperties.go b/service/workspaces/api_op_ModifyWorkspaceProperties.go index dbe32a6c9b0..ed256754889 100644 --- a/service/workspaces/api_op_ModifyWorkspaceProperties.go +++ b/service/workspaces/api_op_ModifyWorkspaceProperties.go @@ -40,9 +40,10 @@ type ModifyWorkspacePropertiesInput struct { // This member is required. WorkspaceId *string + // Indicates the data replication status. + DataReplication types.DataReplication + // The properties of the WorkSpace. - // - // This member is required. WorkspaceProperties *types.WorkspaceProperties noSmithyDocumentSerde diff --git a/service/workspaces/deserializers.go b/service/workspaces/deserializers.go index 8de44b4e0f4..3be7075e151 100644 --- a/service/workspaces/deserializers.go +++ b/service/workspaces/deserializers.go @@ -10639,6 +10639,62 @@ func awsAwsjson11_deserializeDocumentConnectionAliasPermissions(v *[]types.Conne return nil } +func awsAwsjson11_deserializeDocumentDataReplicationSettings(v **types.DataReplicationSettings, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DataReplicationSettings + if *v == nil { + sv = &types.DataReplicationSettings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DataReplication": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DataReplication to be of type string, got %T instead", value) + } + sv.DataReplication = types.DataReplication(jtv) + } + + case "RecoverySnapshotTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.RecoverySnapshotTime = 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 awsAwsjson11_deserializeDocumentDedicatedTenancyCidrRangeList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13058,6 +13114,15 @@ func awsAwsjson11_deserializeDocumentStandbyWorkspace(v **types.StandbyWorkspace for key, value := range shape { switch key { + case "DataReplication": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DataReplication to be of type string, got %T instead", value) + } + sv.DataReplication = types.DataReplication(jtv) + } + case "DirectoryId": if value != nil { jtv, ok := value.(string) @@ -13099,6 +13164,105 @@ func awsAwsjson11_deserializeDocumentStandbyWorkspace(v **types.StandbyWorkspace return nil } +func awsAwsjson11_deserializeDocumentStandbyWorkspacesProperties(v **types.StandbyWorkspacesProperties, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.StandbyWorkspacesProperties + if *v == nil { + sv = &types.StandbyWorkspacesProperties{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DataReplication": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DataReplication to be of type string, got %T instead", value) + } + sv.DataReplication = types.DataReplication(jtv) + } + + case "RecoverySnapshotTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.RecoverySnapshotTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "StandbyWorkspaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkspaceId to be of type string, got %T instead", value) + } + sv.StandbyWorkspaceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentStandbyWorkspacesPropertiesList(v *[]types.StandbyWorkspacesProperties, 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.StandbyWorkspacesProperties + if *v == nil { + cv = []types.StandbyWorkspacesProperties{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.StandbyWorkspacesProperties + destAddr := &col + if err := awsAwsjson11_deserializeDocumentStandbyWorkspacesProperties(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentSubnetIds(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13427,6 +13591,11 @@ func awsAwsjson11_deserializeDocumentWorkspace(v **types.Workspace, value interf sv.ComputerName = ptr.String(jtv) } + case "DataReplicationSettings": + if err := awsAwsjson11_deserializeDocumentDataReplicationSettings(&sv.DataReplicationSettings, value); err != nil { + return err + } + case "DirectoryId": if value != nil { jtv, ok := value.(string) @@ -13482,6 +13651,11 @@ func awsAwsjson11_deserializeDocumentWorkspace(v **types.Workspace, value interf sv.RootVolumeEncryptionEnabled = ptr.Bool(jtv) } + case "StandbyWorkspacesProperties": + if err := awsAwsjson11_deserializeDocumentStandbyWorkspacesPropertiesList(&sv.StandbyWorkspacesProperties, value); err != nil { + return err + } + case "State": if value != nil { jtv, ok := value.(string) diff --git a/service/workspaces/serializers.go b/service/workspaces/serializers.go index 122f903cd78..77c0fed3d09 100644 --- a/service/workspaces/serializers.go +++ b/service/workspaces/serializers.go @@ -4507,6 +4507,11 @@ func awsAwsjson11_serializeDocumentStandbyWorkspace(v *types.StandbyWorkspace, v object := value.Object() defer object.Close() + if len(v.DataReplication) > 0 { + ok := object.Key("DataReplication") + ok.String(string(v.DataReplication)) + } + if v.DirectoryId != nil { ok := object.Key("DirectoryId") ok.String(*v.DirectoryId) @@ -6178,6 +6183,11 @@ func awsAwsjson11_serializeOpDocumentModifyWorkspacePropertiesInput(v *ModifyWor object := value.Object() defer object.Close() + if len(v.DataReplication) > 0 { + ok := object.Key("DataReplication") + ok.String(string(v.DataReplication)) + } + if v.WorkspaceId != nil { ok := object.Key("WorkspaceId") ok.String(*v.WorkspaceId) diff --git a/service/workspaces/types/enums.go b/service/workspaces/types/enums.go index a5285d4ce50..3ecd15403c6 100644 --- a/service/workspaces/types/enums.go +++ b/service/workspaces/types/enums.go @@ -291,6 +291,24 @@ func (ConnectionState) Values() []ConnectionState { } } +type DataReplication string + +// Enum values for DataReplication +const ( + DataReplicationNoReplication DataReplication = "NO_REPLICATION" + DataReplicationPrimaryAsSource DataReplication = "PRIMARY_AS_SOURCE" +) + +// Values returns all known values for DataReplication. 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 (DataReplication) Values() []DataReplication { + return []DataReplication{ + "NO_REPLICATION", + "PRIMARY_AS_SOURCE", + } +} + type DedicatedTenancyModificationStateEnum string // Enum values for DedicatedTenancyModificationStateEnum diff --git a/service/workspaces/types/types.go b/service/workspaces/types/types.go index 8cbeea2253f..906088e0899 100644 --- a/service/workspaces/types/types.go +++ b/service/workspaces/types/types.go @@ -243,6 +243,20 @@ type ConnectionAliasPermission struct { noSmithyDocumentSerde } +// Describes the data replication settings. +type DataReplicationSettings struct { + + // Indicates whether data replication is enabled, and if enabled, the type of data + // replication. + DataReplication DataReplication + + // The date and time at which the last successful snapshot was taken of the + // primary WorkSpace used for replicating data. + RecoverySnapshotTime *time.Time + + noSmithyDocumentSerde +} + // Returns default client branding attributes that were imported. These attributes // display on the client login screen. Client branding attributes are public // facing. Ensure that you don't include sensitive information. @@ -756,6 +770,10 @@ type StandbyWorkspace struct { // This member is required. PrimaryWorkspaceId *string + // Indicates whether data replication is enabled, and if enabled, the type of data + // replication. + DataReplication DataReplication + // The tags associated with the standby WorkSpace. Tags []Tag @@ -765,6 +783,23 @@ type StandbyWorkspace struct { noSmithyDocumentSerde } +// Describes the properties of the related standby WorkSpaces. +type StandbyWorkspacesProperties struct { + + // Indicates whether data replication is enabled, and if enabled, the type of data + // replication. + DataReplication DataReplication + + // The date and time at which the last successful snapshot was taken of the + // primary WorkSpace used for replicating data. + RecoverySnapshotTime *time.Time + + // The identifier of the standby WorkSpace + StandbyWorkspaceId *string + + noSmithyDocumentSerde +} + // Information used to start a WorkSpace. type StartRequest struct { @@ -844,6 +879,9 @@ type Workspace struct { // . ComputerName *string + // Indicates the settings of the data replication. + DataReplicationSettings *DataReplicationSettings + // The identifier of the Directory Service directory for the WorkSpace. DirectoryId *string @@ -866,6 +904,9 @@ type Workspace struct { // Indicates whether the data stored on the root volume is encrypted. RootVolumeEncryptionEnabled *bool + // The properties of the standby WorkSpace + StandbyWorkspacesProperties []StandbyWorkspacesProperties + // The operational state of the WorkSpace. After a WorkSpace is terminated, the // TERMINATED state is returned only briefly before the WorkSpace directory // metadata is cleaned up, so this state is rarely returned. To confirm that a diff --git a/service/workspaces/validators.go b/service/workspaces/validators.go index 38a177afc18..6bfe5d3400f 100644 --- a/service/workspaces/validators.go +++ b/service/workspaces/validators.go @@ -2529,9 +2529,6 @@ func validateOpModifyWorkspacePropertiesInput(v *ModifyWorkspacePropertiesInput) if v.WorkspaceId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkspaceId")) } - if v.WorkspaceProperties == nil { - invalidParams.Add(smithy.NewErrParamRequired("WorkspaceProperties")) - } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/workspacesthinclient/LICENSE.txt b/service/workspacesthinclient/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/workspacesthinclient/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/workspacesthinclient/api_client.go b/service/workspacesthinclient/api_client.go new file mode 100644 index 00000000000..531d7693076 --- /dev/null +++ b/service/workspacesthinclient/api_client.go @@ -0,0 +1,471 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +import ( + "context" + cryptorand "crypto/rand" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyrand "github.com/aws/smithy-go/rand" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "time" +) + +const ServiceID = "WorkSpaces Thin Client" +const ServiceAPIVersion = "2023-08-22" + +// Client provides the API client to make operations call for Amazon WorkSpaces +// Thin Client. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveIdempotencyTokenProvider(&options) + + resolveEndpointResolverV2(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + 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, "workspacesthinclient", 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 resolveIdempotencyTokenProvider(o *Options) { + if o.IdempotencyTokenProvider != nil { + return + } + o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +// IdempotencyTokenProvider interface for providing idempotency token +type IdempotencyTokenProvider interface { + GetIdempotencyToken() (string, error) +} + +func 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/workspacesthinclient/api_client_test.go b/service/workspacesthinclient/api_client_test.go new file mode 100644 index 00000000000..3160938df0c --- /dev/null +++ b/service/workspacesthinclient/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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/workspacesthinclient/api_op_CreateEnvironment.go b/service/workspacesthinclient/api_op_CreateEnvironment.go new file mode 100644 index 00000000000..088e2bcb739 --- /dev/null +++ b/service/workspacesthinclient/api_op_CreateEnvironment.go @@ -0,0 +1,241 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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/workspacesthinclient/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an environment for your thin client devices. +func (c *Client) CreateEnvironment(ctx context.Context, params *CreateEnvironmentInput, optFns ...func(*Options)) (*CreateEnvironmentOutput, error) { + if params == nil { + params = &CreateEnvironmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateEnvironment", params, optFns, c.addOperationCreateEnvironmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateEnvironmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateEnvironmentInput struct { + + // The Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, + // WorkSpaces Web, or AppStream 2.0. + // + // This member is required. + DesktopArn *string + + // Specifies a unique, case-sensitive identifier that you provide to ensure the + // idempotency of the request. This lets you safely retry the request without + // accidentally performing the same operation a second time. Passing the same value + // to a later call to an operation requires that you also pass the same value for + // all other parameters. We recommend that you use a UUID type of value (https://wikipedia.org/wiki/Universally_unique_identifier) + // . If you don't provide this value, then Amazon Web Services generates a random + // one for you. If you retry the operation with the same ClientToken , but with + // different parameters, the retry fails with an IdempotentParameterMismatch error. + ClientToken *string + + // The ID of the software set to apply. + DesiredSoftwareSetId *string + + // The URL for the identity provider login (only for environments that use + // AppStream 2.0). + DesktopEndpoint *string + + // The Amazon Resource Name (ARN) of the Key Management Service key to use to + // encrypt the environment. + KmsKeyArn *string + + // A specification for a time window to apply software updates. + MaintenanceWindow *types.MaintenanceWindow + + // The name for the environment. + Name *string + + // An option to define which software updates to apply. + SoftwareSetUpdateMode types.SoftwareSetUpdateMode + + // An option to define if software updates should be applied within a maintenance + // window. + SoftwareSetUpdateSchedule types.SoftwareSetUpdateSchedule + + // A map of the key-value pairs of the tag or tags to assign to the resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateEnvironmentOutput struct { + + // Describes an environment. + Environment *types.EnvironmentSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateEnvironment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateEnvironment{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateEnvironment"); 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 = addEndpointPrefix_opCreateEnvironmentMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateEnvironmentMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateEnvironmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEnvironment(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 endpointPrefix_opCreateEnvironmentMiddleware struct { +} + +func (*endpointPrefix_opCreateEnvironmentMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opCreateEnvironmentMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opCreateEnvironmentMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opCreateEnvironmentMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +type idempotencyToken_initializeOpCreateEnvironment struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateEnvironment) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateEnvironment) 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.(*CreateEnvironmentInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateEnvironmentInput ") + } + + 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_opCreateEnvironmentMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateEnvironment{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateEnvironment", + } +} diff --git a/service/workspacesthinclient/api_op_DeleteDevice.go b/service/workspacesthinclient/api_op_DeleteDevice.go new file mode 100644 index 00000000000..3209d87bb4c --- /dev/null +++ b/service/workspacesthinclient/api_op_DeleteDevice.go @@ -0,0 +1,208 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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 thin client device. +func (c *Client) DeleteDevice(ctx context.Context, params *DeleteDeviceInput, optFns ...func(*Options)) (*DeleteDeviceOutput, error) { + if params == nil { + params = &DeleteDeviceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDevice", params, optFns, c.addOperationDeleteDeviceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDeviceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDeviceInput struct { + + // The ID of the device to delete. + // + // This member is required. + Id *string + + // Specifies a unique, case-sensitive identifier that you provide to ensure the + // idempotency of the request. This lets you safely retry the request without + // accidentally performing the same operation a second time. Passing the same value + // to a later call to an operation requires that you also pass the same value for + // all other parameters. We recommend that you use a UUID type of value (https://wikipedia.org/wiki/Universally_unique_identifier) + // . If you don't provide this value, then Amazon Web Services generates a random + // one for you. If you retry the operation with the same ClientToken , but with + // different parameters, the retry fails with an IdempotentParameterMismatch error. + ClientToken *string + + noSmithyDocumentSerde +} + +type DeleteDeviceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteDevice{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteDevice{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDevice"); 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 = addEndpointPrefix_opDeleteDeviceMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opDeleteDeviceMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteDeviceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDevice(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 endpointPrefix_opDeleteDeviceMiddleware struct { +} + +func (*endpointPrefix_opDeleteDeviceMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteDeviceMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opDeleteDeviceMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opDeleteDeviceMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +type idempotencyToken_initializeOpDeleteDevice struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteDevice) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteDevice) 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.(*DeleteDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteDeviceInput ") + } + + 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_opDeleteDeviceMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteDevice{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteDevice(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDevice", + } +} diff --git a/service/workspacesthinclient/api_op_DeleteEnvironment.go b/service/workspacesthinclient/api_op_DeleteEnvironment.go new file mode 100644 index 00000000000..dd6619acade --- /dev/null +++ b/service/workspacesthinclient/api_op_DeleteEnvironment.go @@ -0,0 +1,208 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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 environment. +func (c *Client) DeleteEnvironment(ctx context.Context, params *DeleteEnvironmentInput, optFns ...func(*Options)) (*DeleteEnvironmentOutput, error) { + if params == nil { + params = &DeleteEnvironmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteEnvironment", params, optFns, c.addOperationDeleteEnvironmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteEnvironmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteEnvironmentInput struct { + + // The ID of the environment to delete. + // + // This member is required. + Id *string + + // Specifies a unique, case-sensitive identifier that you provide to ensure the + // idempotency of the request. This lets you safely retry the request without + // accidentally performing the same operation a second time. Passing the same value + // to a later call to an operation requires that you also pass the same value for + // all other parameters. We recommend that you use a UUID type of value (https://wikipedia.org/wiki/Universally_unique_identifier) + // . If you don't provide this value, then Amazon Web Services generates a random + // one for you. If you retry the operation with the same ClientToken , but with + // different parameters, the retry fails with an IdempotentParameterMismatch error. + ClientToken *string + + noSmithyDocumentSerde +} + +type DeleteEnvironmentOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteEnvironment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteEnvironment{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteEnvironment"); 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 = addEndpointPrefix_opDeleteEnvironmentMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opDeleteEnvironmentMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteEnvironmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteEnvironment(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 endpointPrefix_opDeleteEnvironmentMiddleware struct { +} + +func (*endpointPrefix_opDeleteEnvironmentMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteEnvironmentMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opDeleteEnvironmentMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opDeleteEnvironmentMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +type idempotencyToken_initializeOpDeleteEnvironment struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteEnvironment) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteEnvironment) 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.(*DeleteEnvironmentInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteEnvironmentInput ") + } + + 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_opDeleteEnvironmentMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteEnvironment{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteEnvironment", + } +} diff --git a/service/workspacesthinclient/api_op_DeregisterDevice.go b/service/workspacesthinclient/api_op_DeregisterDevice.go new file mode 100644 index 00000000000..7bbb64d3bbe --- /dev/null +++ b/service/workspacesthinclient/api_op_DeregisterDevice.go @@ -0,0 +1,212 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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/workspacesthinclient/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deregisters a thin client device. +func (c *Client) DeregisterDevice(ctx context.Context, params *DeregisterDeviceInput, optFns ...func(*Options)) (*DeregisterDeviceOutput, error) { + if params == nil { + params = &DeregisterDeviceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeregisterDevice", params, optFns, c.addOperationDeregisterDeviceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeregisterDeviceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeregisterDeviceInput struct { + + // The ID of the device to deregister. + // + // This member is required. + Id *string + + // Specifies a unique, case-sensitive identifier that you provide to ensure the + // idempotency of the request. This lets you safely retry the request without + // accidentally performing the same operation a second time. Passing the same value + // to a later call to an operation requires that you also pass the same value for + // all other parameters. We recommend that you use a UUID type of value (https://wikipedia.org/wiki/Universally_unique_identifier) + // . If you don't provide this value, then Amazon Web Services generates a random + // one for you. If you retry the operation with the same ClientToken , but with + // different parameters, the retry fails with an IdempotentParameterMismatch error. + ClientToken *string + + // The desired new status for the device. + TargetDeviceStatus types.TargetDeviceStatus + + noSmithyDocumentSerde +} + +type DeregisterDeviceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeregisterDeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeregisterDevice{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeregisterDevice{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeregisterDevice"); 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 = addEndpointPrefix_opDeregisterDeviceMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opDeregisterDeviceMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeregisterDeviceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterDevice(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 endpointPrefix_opDeregisterDeviceMiddleware struct { +} + +func (*endpointPrefix_opDeregisterDeviceMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeregisterDeviceMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opDeregisterDeviceMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opDeregisterDeviceMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +type idempotencyToken_initializeOpDeregisterDevice struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeregisterDevice) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeregisterDevice) 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.(*DeregisterDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeregisterDeviceInput ") + } + + 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_opDeregisterDeviceMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeregisterDevice{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeregisterDevice(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeregisterDevice", + } +} diff --git a/service/workspacesthinclient/api_op_GetDevice.go b/service/workspacesthinclient/api_op_GetDevice.go new file mode 100644 index 00000000000..23ac5f96dea --- /dev/null +++ b/service/workspacesthinclient/api_op_GetDevice.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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/workspacesthinclient/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information for a thin client device. +func (c *Client) GetDevice(ctx context.Context, params *GetDeviceInput, optFns ...func(*Options)) (*GetDeviceOutput, error) { + if params == nil { + params = &GetDeviceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDevice", params, optFns, c.addOperationGetDeviceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDeviceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDeviceInput struct { + + // The ID of the device for which to return information. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type GetDeviceOutput struct { + + // Describes an device. + Device *types.Device + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetDeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDevice{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDevice{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetDevice"); 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 = addEndpointPrefix_opGetDeviceMiddleware(stack); err != nil { + return err + } + if err = addOpGetDeviceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDevice(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 endpointPrefix_opGetDeviceMiddleware struct { +} + +func (*endpointPrefix_opGetDeviceMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetDeviceMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opGetDeviceMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opGetDeviceMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opGetDevice(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetDevice", + } +} diff --git a/service/workspacesthinclient/api_op_GetEnvironment.go b/service/workspacesthinclient/api_op_GetEnvironment.go new file mode 100644 index 00000000000..c76aa33b643 --- /dev/null +++ b/service/workspacesthinclient/api_op_GetEnvironment.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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/workspacesthinclient/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information for an environment. +func (c *Client) GetEnvironment(ctx context.Context, params *GetEnvironmentInput, optFns ...func(*Options)) (*GetEnvironmentOutput, error) { + if params == nil { + params = &GetEnvironmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetEnvironment", params, optFns, c.addOperationGetEnvironmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetEnvironmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetEnvironmentInput struct { + + // The ID of the environment for which to return information. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type GetEnvironmentOutput struct { + + // Describes an environment. + Environment *types.Environment + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetEnvironment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetEnvironment{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetEnvironment"); 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 = addEndpointPrefix_opGetEnvironmentMiddleware(stack); err != nil { + return err + } + if err = addOpGetEnvironmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEnvironment(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 endpointPrefix_opGetEnvironmentMiddleware struct { +} + +func (*endpointPrefix_opGetEnvironmentMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetEnvironmentMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opGetEnvironmentMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opGetEnvironmentMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opGetEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetEnvironment", + } +} diff --git a/service/workspacesthinclient/api_op_GetSoftwareSet.go b/service/workspacesthinclient/api_op_GetSoftwareSet.go new file mode 100644 index 00000000000..42e126d6958 --- /dev/null +++ b/service/workspacesthinclient/api_op_GetSoftwareSet.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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/workspacesthinclient/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information for a software set. +func (c *Client) GetSoftwareSet(ctx context.Context, params *GetSoftwareSetInput, optFns ...func(*Options)) (*GetSoftwareSetOutput, error) { + if params == nil { + params = &GetSoftwareSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSoftwareSet", params, optFns, c.addOperationGetSoftwareSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSoftwareSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSoftwareSetInput struct { + + // The ID of the software set for which to return information. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type GetSoftwareSetOutput struct { + + // Describes a software set. + SoftwareSet *types.SoftwareSet + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSoftwareSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSoftwareSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSoftwareSet{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetSoftwareSet"); 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 = addEndpointPrefix_opGetSoftwareSetMiddleware(stack); err != nil { + return err + } + if err = addOpGetSoftwareSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSoftwareSet(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 endpointPrefix_opGetSoftwareSetMiddleware struct { +} + +func (*endpointPrefix_opGetSoftwareSetMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetSoftwareSetMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opGetSoftwareSetMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opGetSoftwareSetMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opGetSoftwareSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetSoftwareSet", + } +} diff --git a/service/workspacesthinclient/api_op_ListDevices.go b/service/workspacesthinclient/api_op_ListDevices.go new file mode 100644 index 00000000000..946c5687cc3 --- /dev/null +++ b/service/workspacesthinclient/api_op_ListDevices.go @@ -0,0 +1,269 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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/workspacesthinclient/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of thin client devices. +func (c *Client) ListDevices(ctx context.Context, params *ListDevicesInput, optFns ...func(*Options)) (*ListDevicesOutput, error) { + if params == nil { + params = &ListDevicesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDevices", params, optFns, c.addOperationListDevicesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDevicesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDevicesInput struct { + + // The maximum number of results that are returned per call. You can use nextToken + // to obtain further pages of results. This is only an upper limit. The actual + // number of results returned per call might be fewer than the specified maximum. + MaxResults *int32 + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. Using an expired + // pagination token will return an HTTP 400 InvalidToken error. + NextToken *string + + noSmithyDocumentSerde +} + +type ListDevicesOutput struct { + + // Describes devices. + Devices []types.DeviceSummary + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. Using an expired + // pagination token will return an HTTP 400 InvalidToken error. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListDevicesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListDevices{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDevices{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListDevices"); 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 = addEndpointPrefix_opListDevicesMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDevices(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 endpointPrefix_opListDevicesMiddleware struct { +} + +func (*endpointPrefix_opListDevicesMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListDevicesMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opListDevicesMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opListDevicesMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +// ListDevicesAPIClient is a client that implements the ListDevices operation. +type ListDevicesAPIClient interface { + ListDevices(context.Context, *ListDevicesInput, ...func(*Options)) (*ListDevicesOutput, error) +} + +var _ ListDevicesAPIClient = (*Client)(nil) + +// ListDevicesPaginatorOptions is the paginator options for ListDevices +type ListDevicesPaginatorOptions struct { + // The maximum number of results that are returned per call. You can use nextToken + // to obtain further pages of results. This is only an upper limit. The actual + // number of results returned per call might be fewer than the specified maximum. + 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 +} + +// ListDevicesPaginator is a paginator for ListDevices +type ListDevicesPaginator struct { + options ListDevicesPaginatorOptions + client ListDevicesAPIClient + params *ListDevicesInput + nextToken *string + firstPage bool +} + +// NewListDevicesPaginator returns a new ListDevicesPaginator +func NewListDevicesPaginator(client ListDevicesAPIClient, params *ListDevicesInput, optFns ...func(*ListDevicesPaginatorOptions)) *ListDevicesPaginator { + if params == nil { + params = &ListDevicesInput{} + } + + options := ListDevicesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDevicesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListDevices page. +func (p *ListDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDevicesOutput, 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.ListDevices(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_opListDevices(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListDevices", + } +} diff --git a/service/workspacesthinclient/api_op_ListEnvironments.go b/service/workspacesthinclient/api_op_ListEnvironments.go new file mode 100644 index 00000000000..2f730260dde --- /dev/null +++ b/service/workspacesthinclient/api_op_ListEnvironments.go @@ -0,0 +1,270 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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/workspacesthinclient/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of environments. +func (c *Client) ListEnvironments(ctx context.Context, params *ListEnvironmentsInput, optFns ...func(*Options)) (*ListEnvironmentsOutput, error) { + if params == nil { + params = &ListEnvironmentsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListEnvironments", params, optFns, c.addOperationListEnvironmentsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListEnvironmentsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListEnvironmentsInput struct { + + // The maximum number of results that are returned per call. You can use nextToken + // to obtain further pages of results. This is only an upper limit. The actual + // number of results returned per call might be fewer than the specified maximum. + MaxResults *int32 + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. Using an expired + // pagination token will return an HTTP 400 InvalidToken error. + NextToken *string + + noSmithyDocumentSerde +} + +type ListEnvironmentsOutput struct { + + // Describes environments. + Environments []types.EnvironmentSummary + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. Using an expired + // pagination token will return an HTTP 400 InvalidToken error. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListEnvironmentsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListEnvironments{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListEnvironments{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListEnvironments"); 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 = addEndpointPrefix_opListEnvironmentsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListEnvironments(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 endpointPrefix_opListEnvironmentsMiddleware struct { +} + +func (*endpointPrefix_opListEnvironmentsMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListEnvironmentsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opListEnvironmentsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opListEnvironmentsMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +// ListEnvironmentsAPIClient is a client that implements the ListEnvironments +// operation. +type ListEnvironmentsAPIClient interface { + ListEnvironments(context.Context, *ListEnvironmentsInput, ...func(*Options)) (*ListEnvironmentsOutput, error) +} + +var _ ListEnvironmentsAPIClient = (*Client)(nil) + +// ListEnvironmentsPaginatorOptions is the paginator options for ListEnvironments +type ListEnvironmentsPaginatorOptions struct { + // The maximum number of results that are returned per call. You can use nextToken + // to obtain further pages of results. This is only an upper limit. The actual + // number of results returned per call might be fewer than the specified maximum. + 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 +} + +// ListEnvironmentsPaginator is a paginator for ListEnvironments +type ListEnvironmentsPaginator struct { + options ListEnvironmentsPaginatorOptions + client ListEnvironmentsAPIClient + params *ListEnvironmentsInput + nextToken *string + firstPage bool +} + +// NewListEnvironmentsPaginator returns a new ListEnvironmentsPaginator +func NewListEnvironmentsPaginator(client ListEnvironmentsAPIClient, params *ListEnvironmentsInput, optFns ...func(*ListEnvironmentsPaginatorOptions)) *ListEnvironmentsPaginator { + if params == nil { + params = &ListEnvironmentsInput{} + } + + options := ListEnvironmentsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListEnvironmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEnvironmentsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListEnvironments page. +func (p *ListEnvironmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEnvironmentsOutput, 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.ListEnvironments(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_opListEnvironments(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListEnvironments", + } +} diff --git a/service/workspacesthinclient/api_op_ListSoftwareSets.go b/service/workspacesthinclient/api_op_ListSoftwareSets.go new file mode 100644 index 00000000000..b0040104e65 --- /dev/null +++ b/service/workspacesthinclient/api_op_ListSoftwareSets.go @@ -0,0 +1,270 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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/workspacesthinclient/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of software sets. +func (c *Client) ListSoftwareSets(ctx context.Context, params *ListSoftwareSetsInput, optFns ...func(*Options)) (*ListSoftwareSetsOutput, error) { + if params == nil { + params = &ListSoftwareSetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSoftwareSets", params, optFns, c.addOperationListSoftwareSetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSoftwareSetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSoftwareSetsInput struct { + + // The maximum number of results that are returned per call. You can use nextToken + // to obtain further pages of results. This is only an upper limit. The actual + // number of results returned per call might be fewer than the specified maximum. + MaxResults *int32 + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. Using an expired + // pagination token will return an HTTP 400 InvalidToken error. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSoftwareSetsOutput struct { + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. Using an expired + // pagination token will return an HTTP 400 InvalidToken error. + NextToken *string + + // Describes software sets. + SoftwareSets []types.SoftwareSetSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSoftwareSetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSoftwareSets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSoftwareSets{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListSoftwareSets"); 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 = addEndpointPrefix_opListSoftwareSetsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSoftwareSets(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 endpointPrefix_opListSoftwareSetsMiddleware struct { +} + +func (*endpointPrefix_opListSoftwareSetsMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListSoftwareSetsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opListSoftwareSetsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opListSoftwareSetsMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +// ListSoftwareSetsAPIClient is a client that implements the ListSoftwareSets +// operation. +type ListSoftwareSetsAPIClient interface { + ListSoftwareSets(context.Context, *ListSoftwareSetsInput, ...func(*Options)) (*ListSoftwareSetsOutput, error) +} + +var _ ListSoftwareSetsAPIClient = (*Client)(nil) + +// ListSoftwareSetsPaginatorOptions is the paginator options for ListSoftwareSets +type ListSoftwareSetsPaginatorOptions struct { + // The maximum number of results that are returned per call. You can use nextToken + // to obtain further pages of results. This is only an upper limit. The actual + // number of results returned per call might be fewer than the specified maximum. + 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 +} + +// ListSoftwareSetsPaginator is a paginator for ListSoftwareSets +type ListSoftwareSetsPaginator struct { + options ListSoftwareSetsPaginatorOptions + client ListSoftwareSetsAPIClient + params *ListSoftwareSetsInput + nextToken *string + firstPage bool +} + +// NewListSoftwareSetsPaginator returns a new ListSoftwareSetsPaginator +func NewListSoftwareSetsPaginator(client ListSoftwareSetsAPIClient, params *ListSoftwareSetsInput, optFns ...func(*ListSoftwareSetsPaginatorOptions)) *ListSoftwareSetsPaginator { + if params == nil { + params = &ListSoftwareSetsInput{} + } + + options := ListSoftwareSetsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSoftwareSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSoftwareSetsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSoftwareSets page. +func (p *ListSoftwareSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSoftwareSetsOutput, 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.ListSoftwareSets(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_opListSoftwareSets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListSoftwareSets", + } +} diff --git a/service/workspacesthinclient/api_op_ListTagsForResource.go b/service/workspacesthinclient/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..de64826f562 --- /dev/null +++ b/service/workspacesthinclient/api_op_ListTagsForResource.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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" +) + +// Returns a list of tags for a resource. +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The Amazon Resource Name (ARN) of the resource for which you want to retrieve + // tags. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // A map of the key-value pairs for the tag or tags assigned to the specified + // resource. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = addEndpointPrefix_opListTagsForResourceMiddleware(stack); err != nil { + return err + } + if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { + return err + } + if err = 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 endpointPrefix_opListTagsForResourceMiddleware struct { +} + +func (*endpointPrefix_opListTagsForResourceMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListTagsForResourceMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opListTagsForResourceMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opListTagsForResourceMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListTagsForResource", + } +} diff --git a/service/workspacesthinclient/api_op_TagResource.go b/service/workspacesthinclient/api_op_TagResource.go new file mode 100644 index 00000000000..16cbde0147e --- /dev/null +++ b/service/workspacesthinclient/api_op_TagResource.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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" +) + +// Assigns one or more tags (key-value pairs) to the specified resource. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The Amazon Resource Name (ARN) of the resource that you want to tag. + // + // This member is required. + ResourceArn *string + + // A map of the key-value pairs of the tag or tags to assign to the resource. + // + // This member is required. + Tags map[string]string + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = addEndpointPrefix_opTagResourceMiddleware(stack); err != nil { + return err + } + if err = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = 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 endpointPrefix_opTagResourceMiddleware struct { +} + +func (*endpointPrefix_opTagResourceMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opTagResourceMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opTagResourceMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opTagResourceMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "TagResource", + } +} diff --git a/service/workspacesthinclient/api_op_UntagResource.go b/service/workspacesthinclient/api_op_UntagResource.go new file mode 100644 index 00000000000..2c7ac47b384 --- /dev/null +++ b/service/workspacesthinclient/api_op_UntagResource.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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" +) + +// Removes a tag or tags from a resource. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The Amazon Resource Name (ARN) of the resource that you want to untag. + // + // This member is required. + ResourceArn *string + + // The keys of the key-value pairs for the tag or tags you want to remove from the + // specified resource. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = addEndpointPrefix_opUntagResourceMiddleware(stack); err != nil { + return err + } + if err = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = 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 endpointPrefix_opUntagResourceMiddleware struct { +} + +func (*endpointPrefix_opUntagResourceMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opUntagResourceMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opUntagResourceMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opUntagResourceMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UntagResource", + } +} diff --git a/service/workspacesthinclient/api_op_UpdateDevice.go b/service/workspacesthinclient/api_op_UpdateDevice.go new file mode 100644 index 00000000000..516429a792e --- /dev/null +++ b/service/workspacesthinclient/api_op_UpdateDevice.go @@ -0,0 +1,181 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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/workspacesthinclient/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a thin client device. +func (c *Client) UpdateDevice(ctx context.Context, params *UpdateDeviceInput, optFns ...func(*Options)) (*UpdateDeviceOutput, error) { + if params == nil { + params = &UpdateDeviceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateDevice", params, optFns, c.addOperationUpdateDeviceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateDeviceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateDeviceInput struct { + + // The ID of the device to update. + // + // This member is required. + Id *string + + // The ID of the software set to apply. + DesiredSoftwareSetId *string + + // The Amazon Resource Name (ARN) of the Key Management Service key to use for the + // update. + KmsKeyArn *string + + // The name of the device to update. + Name *string + + // An option to define if software updates should be applied within a maintenance + // window. + SoftwareSetUpdateSchedule types.SoftwareSetUpdateSchedule + + noSmithyDocumentSerde +} + +type UpdateDeviceOutput struct { + + // Describes a device. + Device *types.DeviceSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateDeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDevice{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDevice{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateDevice"); 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 = addEndpointPrefix_opUpdateDeviceMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateDeviceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDevice(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 endpointPrefix_opUpdateDeviceMiddleware struct { +} + +func (*endpointPrefix_opUpdateDeviceMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opUpdateDeviceMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opUpdateDeviceMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opUpdateDeviceMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opUpdateDevice(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateDevice", + } +} diff --git a/service/workspacesthinclient/api_op_UpdateEnvironment.go b/service/workspacesthinclient/api_op_UpdateEnvironment.go new file mode 100644 index 00000000000..563ab599622 --- /dev/null +++ b/service/workspacesthinclient/api_op_UpdateEnvironment.go @@ -0,0 +1,191 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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/workspacesthinclient/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates an environment. +func (c *Client) UpdateEnvironment(ctx context.Context, params *UpdateEnvironmentInput, optFns ...func(*Options)) (*UpdateEnvironmentOutput, error) { + if params == nil { + params = &UpdateEnvironmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateEnvironment", params, optFns, c.addOperationUpdateEnvironmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateEnvironmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateEnvironmentInput struct { + + // The ID of the environment to update. + // + // This member is required. + Id *string + + // The ID of the software set to apply. + DesiredSoftwareSetId *string + + // The Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, + // WorkSpaces Web, or AppStream 2.0. + DesktopArn *string + + // The URL for the identity provider login (only for environments that use + // AppStream 2.0). + DesktopEndpoint *string + + // A specification for a time window to apply software updates. + MaintenanceWindow *types.MaintenanceWindow + + // The name of the environment to update. + Name *string + + // An option to define which software updates to apply. + SoftwareSetUpdateMode types.SoftwareSetUpdateMode + + // An option to define if software updates should be applied within a maintenance + // window. + SoftwareSetUpdateSchedule types.SoftwareSetUpdateSchedule + + noSmithyDocumentSerde +} + +type UpdateEnvironmentOutput struct { + + // Describes an environment. + Environment *types.EnvironmentSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateEnvironment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateEnvironment{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateEnvironment"); 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 = addEndpointPrefix_opUpdateEnvironmentMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateEnvironmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateEnvironment(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 endpointPrefix_opUpdateEnvironmentMiddleware struct { +} + +func (*endpointPrefix_opUpdateEnvironmentMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opUpdateEnvironmentMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opUpdateEnvironmentMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opUpdateEnvironmentMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opUpdateEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateEnvironment", + } +} diff --git a/service/workspacesthinclient/api_op_UpdateSoftwareSet.go b/service/workspacesthinclient/api_op_UpdateSoftwareSet.go new file mode 100644 index 00000000000..7258edc971a --- /dev/null +++ b/service/workspacesthinclient/api_op_UpdateSoftwareSet.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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/workspacesthinclient/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a software set. +func (c *Client) UpdateSoftwareSet(ctx context.Context, params *UpdateSoftwareSetInput, optFns ...func(*Options)) (*UpdateSoftwareSetOutput, error) { + if params == nil { + params = &UpdateSoftwareSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSoftwareSet", params, optFns, c.addOperationUpdateSoftwareSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSoftwareSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSoftwareSetInput struct { + + // The ID of the software set to update. + // + // This member is required. + Id *string + + // An option to define if the software set has been validated. + // + // This member is required. + ValidationStatus types.SoftwareSetValidationStatus + + noSmithyDocumentSerde +} + +type UpdateSoftwareSetOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSoftwareSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSoftwareSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSoftwareSet{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateSoftwareSet"); 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 = addEndpointPrefix_opUpdateSoftwareSetMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateSoftwareSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSoftwareSet(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 endpointPrefix_opUpdateSoftwareSetMiddleware struct { +} + +func (*endpointPrefix_opUpdateSoftwareSetMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opUpdateSoftwareSetMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(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) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opUpdateSoftwareSetMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opUpdateSoftwareSetMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opUpdateSoftwareSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateSoftwareSet", + } +} diff --git a/service/workspacesthinclient/auth.go b/service/workspacesthinclient/auth.go new file mode 100644 index 00000000000..75bcb587e8e --- /dev/null +++ b/service/workspacesthinclient/auth.go @@ -0,0 +1,256 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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, "thinclient") + 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/workspacesthinclient/deserializers.go b/service/workspacesthinclient/deserializers.go new file mode 100644 index 00000000000..e412f2ee878 --- /dev/null +++ b/service/workspacesthinclient/deserializers.go @@ -0,0 +1,4532 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/workspacesthinclient/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" + "strconv" + "strings" +) + +type awsRestjson1_deserializeOpCreateEnvironment struct { +} + +func (*awsRestjson1_deserializeOpCreateEnvironment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateEnvironment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreateEnvironment(response, &metadata) + } + output := &CreateEnvironmentOutput{} + 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_deserializeOpDocumentCreateEnvironmentOutput(&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_deserializeOpErrorCreateEnvironment(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateEnvironmentOutput(v **CreateEnvironmentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateEnvironmentOutput + if *v == nil { + sv = &CreateEnvironmentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "environment": + if err := awsRestjson1_deserializeDocumentEnvironmentSummary(&sv.Environment, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteDevice struct { +} + +func (*awsRestjson1_deserializeOpDeleteDevice) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteDevice) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteDevice(response, &metadata) + } + output := &DeleteDeviceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteDevice(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDeleteEnvironment struct { +} + +func (*awsRestjson1_deserializeOpDeleteEnvironment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteEnvironment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteEnvironment(response, &metadata) + } + output := &DeleteEnvironmentOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteEnvironment(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDeregisterDevice struct { +} + +func (*awsRestjson1_deserializeOpDeregisterDevice) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeregisterDevice) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeregisterDevice(response, &metadata) + } + output := &DeregisterDeviceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeregisterDevice(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpGetDevice struct { +} + +func (*awsRestjson1_deserializeOpGetDevice) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetDevice) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetDevice(response, &metadata) + } + output := &GetDeviceOutput{} + 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_deserializeOpDocumentGetDeviceOutput(&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_deserializeOpErrorGetDevice(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentGetDeviceOutput(v **GetDeviceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetDeviceOutput + if *v == nil { + sv = &GetDeviceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "device": + if err := awsRestjson1_deserializeDocumentDevice(&sv.Device, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetEnvironment struct { +} + +func (*awsRestjson1_deserializeOpGetEnvironment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetEnvironment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetEnvironment(response, &metadata) + } + output := &GetEnvironmentOutput{} + 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_deserializeOpDocumentGetEnvironmentOutput(&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_deserializeOpErrorGetEnvironment(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentGetEnvironmentOutput(v **GetEnvironmentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetEnvironmentOutput + if *v == nil { + sv = &GetEnvironmentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "environment": + if err := awsRestjson1_deserializeDocumentEnvironment(&sv.Environment, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSoftwareSet struct { +} + +func (*awsRestjson1_deserializeOpGetSoftwareSet) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSoftwareSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetSoftwareSet(response, &metadata) + } + output := &GetSoftwareSetOutput{} + 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_deserializeOpDocumentGetSoftwareSetOutput(&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_deserializeOpErrorGetSoftwareSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentGetSoftwareSetOutput(v **GetSoftwareSetOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetSoftwareSetOutput + if *v == nil { + sv = &GetSoftwareSetOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "softwareSet": + if err := awsRestjson1_deserializeDocumentSoftwareSet(&sv.SoftwareSet, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListDevices struct { +} + +func (*awsRestjson1_deserializeOpListDevices) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListDevices) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListDevices(response, &metadata) + } + output := &ListDevicesOutput{} + 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_deserializeOpDocumentListDevicesOutput(&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_deserializeOpErrorListDevices(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentListDevicesOutput(v **ListDevicesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListDevicesOutput + if *v == nil { + sv = &ListDevicesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "devices": + if err := awsRestjson1_deserializeDocumentDeviceList(&sv.Devices, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListEnvironments struct { +} + +func (*awsRestjson1_deserializeOpListEnvironments) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListEnvironments) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListEnvironments(response, &metadata) + } + output := &ListEnvironmentsOutput{} + 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_deserializeOpDocumentListEnvironmentsOutput(&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_deserializeOpErrorListEnvironments(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentListEnvironmentsOutput(v **ListEnvironmentsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListEnvironmentsOutput + if *v == nil { + sv = &ListEnvironmentsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "environments": + if err := awsRestjson1_deserializeDocumentEnvironmentList(&sv.Environments, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSoftwareSets struct { +} + +func (*awsRestjson1_deserializeOpListSoftwareSets) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSoftwareSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListSoftwareSets(response, &metadata) + } + output := &ListSoftwareSetsOutput{} + 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_deserializeOpDocumentListSoftwareSetsOutput(&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_deserializeOpErrorListSoftwareSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentListSoftwareSetsOutput(v **ListSoftwareSetsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListSoftwareSetsOutput + if *v == nil { + sv = &ListSoftwareSetsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "softwareSets": + if err := awsRestjson1_deserializeDocumentSoftwareSetList(&sv.SoftwareSets, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + 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("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(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_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_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + 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("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(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_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("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(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_deserializeOpUpdateDevice struct { +} + +func (*awsRestjson1_deserializeOpUpdateDevice) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateDevice) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateDevice(response, &metadata) + } + output := &UpdateDeviceOutput{} + 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_deserializeOpDocumentUpdateDeviceOutput(&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_deserializeOpErrorUpdateDevice(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentUpdateDeviceOutput(v **UpdateDeviceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateDeviceOutput + if *v == nil { + sv = &UpdateDeviceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "device": + if err := awsRestjson1_deserializeDocumentDeviceSummary(&sv.Device, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateEnvironment struct { +} + +func (*awsRestjson1_deserializeOpUpdateEnvironment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateEnvironment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateEnvironment(response, &metadata) + } + output := &UpdateEnvironmentOutput{} + 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_deserializeOpDocumentUpdateEnvironmentOutput(&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_deserializeOpErrorUpdateEnvironment(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpDocumentUpdateEnvironmentOutput(v **UpdateEnvironmentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateEnvironmentOutput + if *v == nil { + sv = &UpdateEnvironmentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "environment": + if err := awsRestjson1_deserializeDocumentEnvironmentSummary(&sv.Environment, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateSoftwareSet struct { +} + +func (*awsRestjson1_deserializeOpUpdateSoftwareSet) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateSoftwareSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateSoftwareSet(response, &metadata) + } + output := &UpdateSoftwareSetOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateSoftwareSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsInternalServiceException(v *types.InternalServiceException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + 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) + + if err := awsRestjson1_deserializeOpHttpBindingsInternalServerException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorInternalServiceException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServiceException{} + 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_deserializeDocumentInternalServiceException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + if err := awsRestjson1_deserializeOpHttpBindingsInternalServiceException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + 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_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + 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 ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDayOfWeekList(v *[]types.DayOfWeek, 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.DayOfWeek + if *v == nil { + cv = []types.DayOfWeek{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DayOfWeek + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DayOfWeek to be of type string, got %T instead", value) + } + col = types.DayOfWeek(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentDevice(v **types.Device, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Device + if *v == nil { + sv = &types.Device{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "currentSoftwareSetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetId to be of type string, got %T instead", value) + } + sv.CurrentSoftwareSetId = ptr.String(jtv) + } + + case "currentSoftwareSetVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CurrentSoftwareSetVersion = ptr.String(jtv) + } + + case "desiredSoftwareSetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetId to be of type string, got %T instead", value) + } + sv.DesiredSoftwareSetId = ptr.String(jtv) + } + + case "environmentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EnvironmentId to be of type string, got %T instead", value) + } + sv.EnvironmentId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeviceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + 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) + } + + case "lastConnectedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastConnectedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "lastPostureAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastPostureAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "model": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Model = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeviceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "pendingSoftwareSetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetId to be of type string, got %T instead", value) + } + sv.PendingSoftwareSetId = ptr.String(jtv) + } + + case "pendingSoftwareSetVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PendingSoftwareSetVersion = ptr.String(jtv) + } + + case "serialNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SerialNumber = ptr.String(jtv) + } + + case "softwareSetComplianceStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeviceSoftwareSetComplianceStatus to be of type string, got %T instead", value) + } + sv.SoftwareSetComplianceStatus = types.DeviceSoftwareSetComplianceStatus(jtv) + } + + case "softwareSetUpdateSchedule": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetUpdateSchedule to be of type string, got %T instead", value) + } + sv.SoftwareSetUpdateSchedule = types.SoftwareSetUpdateSchedule(jtv) + } + + case "softwareSetUpdateStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetUpdateStatus to be of type string, got %T instead", value) + } + sv.SoftwareSetUpdateStatus = types.SoftwareSetUpdateStatus(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeviceStatus to be of type string, got %T instead", value) + } + sv.Status = types.DeviceStatus(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentEmbeddedTag(&sv.Tags, value); err != nil { + return err + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDeviceList(v *[]types.DeviceSummary, 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.DeviceSummary + if *v == nil { + cv = []types.DeviceSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DeviceSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentDeviceSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentDeviceSummary(v **types.DeviceSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DeviceSummary + if *v == nil { + sv = &types.DeviceSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "currentSoftwareSetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetId to be of type string, got %T instead", value) + } + sv.CurrentSoftwareSetId = ptr.String(jtv) + } + + case "desiredSoftwareSetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetId to be of type string, got %T instead", value) + } + sv.DesiredSoftwareSetId = ptr.String(jtv) + } + + case "environmentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EnvironmentId to be of type string, got %T instead", value) + } + sv.EnvironmentId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeviceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastConnectedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastConnectedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "lastPostureAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastPostureAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "model": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Model = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeviceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "pendingSoftwareSetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetId to be of type string, got %T instead", value) + } + sv.PendingSoftwareSetId = ptr.String(jtv) + } + + case "serialNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SerialNumber = ptr.String(jtv) + } + + case "softwareSetUpdateSchedule": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetUpdateSchedule to be of type string, got %T instead", value) + } + sv.SoftwareSetUpdateSchedule = types.SoftwareSetUpdateSchedule(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeviceStatus to be of type string, got %T instead", value) + } + sv.Status = types.DeviceStatus(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentEmbeddedTag(&sv.Tags, value); err != nil { + return err + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEmbeddedTag(v **types.EmbeddedTag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EmbeddedTag + if *v == nil { + sv = &types.EmbeddedTag{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "internalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InternalId = ptr.String(jtv) + } + + case "resourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEnvironment(v **types.Environment, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Environment + if *v == nil { + sv = &types.Environment{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "activationCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ActivationCode to be of type string, got %T instead", value) + } + sv.ActivationCode = ptr.String(jtv) + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "desiredSoftwareSetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetId to be of type string, got %T instead", value) + } + sv.DesiredSoftwareSetId = ptr.String(jtv) + } + + case "desktopArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.DesktopArn = ptr.String(jtv) + } + + case "desktopEndpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DesktopEndpoint to be of type string, got %T instead", value) + } + sv.DesktopEndpoint = ptr.String(jtv) + } + + case "desktopType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DesktopType to be of type string, got %T instead", value) + } + sv.DesktopType = types.DesktopType(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EnvironmentId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + 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) + } + + case "maintenanceWindow": + if err := awsRestjson1_deserializeDocumentMaintenanceWindow(&sv.MaintenanceWindow, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EnvironmentName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "pendingSoftwareSetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetId to be of type string, got %T instead", value) + } + sv.PendingSoftwareSetId = ptr.String(jtv) + } + + case "pendingSoftwareSetVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PendingSoftwareSetVersion = ptr.String(jtv) + } + + case "registeredDevicesCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RegisteredDevicesCount = ptr.Int32(int32(i64)) + } + + case "softwareSetComplianceStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EnvironmentSoftwareSetComplianceStatus to be of type string, got %T instead", value) + } + sv.SoftwareSetComplianceStatus = types.EnvironmentSoftwareSetComplianceStatus(jtv) + } + + case "softwareSetUpdateMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetUpdateMode to be of type string, got %T instead", value) + } + sv.SoftwareSetUpdateMode = types.SoftwareSetUpdateMode(jtv) + } + + case "softwareSetUpdateSchedule": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetUpdateSchedule to be of type string, got %T instead", value) + } + sv.SoftwareSetUpdateSchedule = types.SoftwareSetUpdateSchedule(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentEmbeddedTag(&sv.Tags, value); err != nil { + return err + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEnvironmentList(v *[]types.EnvironmentSummary, 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.EnvironmentSummary + if *v == nil { + cv = []types.EnvironmentSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EnvironmentSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentEnvironmentSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentEnvironmentSummary(v **types.EnvironmentSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EnvironmentSummary + if *v == nil { + sv = &types.EnvironmentSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "activationCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ActivationCode to be of type string, got %T instead", value) + } + sv.ActivationCode = ptr.String(jtv) + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "desiredSoftwareSetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetId to be of type string, got %T instead", value) + } + sv.DesiredSoftwareSetId = ptr.String(jtv) + } + + case "desktopArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.DesktopArn = ptr.String(jtv) + } + + case "desktopEndpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DesktopEndpoint to be of type string, got %T instead", value) + } + sv.DesktopEndpoint = ptr.String(jtv) + } + + case "desktopType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DesktopType to be of type string, got %T instead", value) + } + sv.DesktopType = types.DesktopType(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EnvironmentId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "maintenanceWindow": + if err := awsRestjson1_deserializeDocumentMaintenanceWindow(&sv.MaintenanceWindow, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EnvironmentName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "pendingSoftwareSetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetId to be of type string, got %T instead", value) + } + sv.PendingSoftwareSetId = ptr.String(jtv) + } + + case "softwareSetUpdateMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetUpdateMode to be of type string, got %T instead", value) + } + sv.SoftwareSetUpdateMode = types.SoftwareSetUpdateMode(jtv) + } + + case "softwareSetUpdateSchedule": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetUpdateSchedule to be of type string, got %T instead", value) + } + sv.SoftwareSetUpdateSchedule = types.SoftwareSetUpdateSchedule(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentEmbeddedTag(&sv.Tags, value); err != nil { + return err + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func 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 ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "retryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RetryAfterSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServiceException(v **types.InternalServiceException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServiceException + if *v == nil { + sv = &types.InternalServiceException{} + } 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) + } + + case "retryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RetryAfterSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMaintenanceWindow(v **types.MaintenanceWindow, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.MaintenanceWindow + if *v == nil { + sv = &types.MaintenanceWindow{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "applyTimeOf": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplyTimeOf to be of type string, got %T instead", value) + } + sv.ApplyTimeOf = types.ApplyTimeOf(jtv) + } + + case "daysOfTheWeek": + if err := awsRestjson1_deserializeDocumentDayOfWeekList(&sv.DaysOfTheWeek, value); err != nil { + return err + } + + case "endTimeHour": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Hour to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.EndTimeHour = ptr.Int32(int32(i64)) + } + + case "endTimeMinute": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Minute to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.EndTimeMinute = ptr.Int32(int32(i64)) + } + + case "startTimeHour": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Hour to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.StartTimeHour = ptr.Int32(int32(i64)) + } + + case "startTimeMinute": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Minute to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.StartTimeMinute = ptr.Int32(int32(i64)) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MaintenanceWindowType to be of type string, got %T instead", value) + } + sv.Type = types.MaintenanceWindowType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuotaCode to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceCode to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSoftware(v **types.Software, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Software + if *v == nil { + sv = &types.Software{} + } 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 "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSoftwareList(v *[]types.Software, 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.Software + if *v == nil { + cv = []types.Software{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Software + destAddr := &col + if err := awsRestjson1_deserializeDocumentSoftware(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSoftwareSet(v **types.SoftwareSet, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SoftwareSet + if *v == nil { + sv = &types.SoftwareSet{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "releasedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ReleasedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "software": + if err := awsRestjson1_deserializeDocumentSoftwareList(&sv.Software, value); err != nil { + return err + } + + case "supportedUntil": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SupportedUntil = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "validationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetValidationStatus to be of type string, got %T instead", value) + } + sv.ValidationStatus = types.SoftwareSetValidationStatus(jtv) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSoftwareSetList(v *[]types.SoftwareSetSummary, 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.SoftwareSetSummary + if *v == nil { + cv = []types.SoftwareSetSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SoftwareSetSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentSoftwareSetSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSoftwareSetSummary(v **types.SoftwareSetSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SoftwareSetSummary + if *v == nil { + sv = &types.SoftwareSetSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "releasedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ReleasedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "supportedUntil": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SupportedUntil = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "validationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SoftwareSetValidationStatus to be of type string, got %T instead", value) + } + sv.ValidationStatus = types.SoftwareSetValidationStatus(jtv) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTagsMap(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 ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuotaCode to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "retryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RetryAfterSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = ptr.Int32(int32(i64)) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceCode to be of type string, got %T instead", value) + } + sv.ServiceCode = 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 "fieldList": + if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.FieldList, value); err != nil { + return err + } + + 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) + } + + case "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.ValidationExceptionReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationExceptionField + if *v == nil { + sv = &types.ValidationExceptionField{} + } 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) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, 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.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} diff --git a/service/workspacesthinclient/doc.go b/service/workspacesthinclient/doc.go new file mode 100644 index 00000000000..3256a5f9de8 --- /dev/null +++ b/service/workspacesthinclient/doc.go @@ -0,0 +1,21 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package workspacesthinclient provides the API client, operations, and parameter +// types for Amazon WorkSpaces Thin Client. +// +// Amazon WorkSpaces Thin Client is a affordable device built to work with Amazon +// Web Services End User Computing (EUC) virtual desktops to provide users with a +// complete cloud desktop solution. WorkSpaces Thin Client is a compact device +// designed to connect up to two monitors and USB devices like a keyboard, mouse, +// headset, and webcam. To maximize endpoint security, WorkSpaces Thin Client +// devices do not allow local data storage or installation of unapproved +// applications. The WorkSpaces Thin Client device ships preloaded with device +// management software. You can use these APIs to complete WorkSpaces Thin Client +// tasks, such as creating environments or viewing devices. For more information +// about WorkSpaces Thin Client, including the required permissions to use the +// service, see the Amazon WorkSpaces Thin Client Administrator Guide (https://docs.aws.amazon.com/workspaces-thin-client/latest/ag/) +// . For more information about using the Command Line Interface (CLI) to manage +// your WorkSpaces Thin Client resources, see the WorkSpaces Thin Client section +// of the CLI Reference (https://docs.aws.amazon.com/cli/latest/reference/workspaces-thin-client/index.html) +// . +package workspacesthinclient diff --git a/service/workspacesthinclient/endpoints.go b/service/workspacesthinclient/endpoints.go new file mode 100644 index 00000000000..a96c5898160 --- /dev/null +++ b/service/workspacesthinclient/endpoints.go @@ -0,0 +1,509 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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/workspacesthinclient/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 = "thinclient" + } + 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_WORKSPACES_THIN_CLIENT") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "WorkSpaces Thin Client", 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://thinclient-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://thinclient-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://thinclient.") + 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://thinclient.") + 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/workspacesthinclient/endpoints_config_test.go b/service/workspacesthinclient/endpoints_config_test.go new file mode 100644 index 00000000000..dbcc7ed8a34 --- /dev/null +++ b/service/workspacesthinclient/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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-workspaces-thin-client.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-workspaces-thin-client.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-workspaces-thin-client.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-workspaces-thin-client.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-workspaces-thin-client.dev", + expectURL: aws.String("https://env-workspaces-thin-client.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-workspaces-thin-client.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-workspaces-thin-client.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-workspaces-thin-client.dev", + expectURL: aws.String("http://config-workspaces-thin-client.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-workspaces-thin-client.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-workspaces-thin-client.dev", + clientEndpoint: aws.String("https://client-workspaces-thin-client.dev"), + expectURL: aws.String("https://client-workspaces-thin-client.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_WORKSPACES_THIN_CLIENT", 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/workspacesthinclient/endpoints_test.go b/service/workspacesthinclient/endpoints_test.go new file mode 100644 index 00000000000..51503d404f3 --- /dev/null +++ b/service/workspacesthinclient/endpoints_test.go @@ -0,0 +1,856 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +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://thinclient-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://thinclient-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://thinclient.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://thinclient.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://thinclient-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://thinclient-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://thinclient.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://thinclient.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://thinclient-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://thinclient-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://thinclient.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://thinclient.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://thinclient-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://thinclient.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://thinclient-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://thinclient.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/workspacesthinclient/generated.json b/service/workspacesthinclient/generated.json new file mode 100644 index 00000000000..3716d0f4552 --- /dev/null +++ b/service/workspacesthinclient/generated.json @@ -0,0 +1,48 @@ +{ + "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_CreateEnvironment.go", + "api_op_DeleteDevice.go", + "api_op_DeleteEnvironment.go", + "api_op_DeregisterDevice.go", + "api_op_GetDevice.go", + "api_op_GetEnvironment.go", + "api_op_GetSoftwareSet.go", + "api_op_ListDevices.go", + "api_op_ListEnvironments.go", + "api_op_ListSoftwareSets.go", + "api_op_ListTagsForResource.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateDevice.go", + "api_op_UpdateEnvironment.go", + "api_op_UpdateSoftwareSet.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/workspacesthinclient", + "unstable": false +} diff --git a/service/workspacesthinclient/go.mod b/service/workspacesthinclient/go.mod new file mode 100644 index 00000000000..7c324c8792f --- /dev/null +++ b/service/workspacesthinclient/go.mod @@ -0,0 +1,17 @@ +module github.com/aws/aws-sdk-go-v2/service/workspacesthinclient + +go 1.19 + +require ( + github.com/aws/aws-sdk-go-v2 v1.23.1 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4 + 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/workspacesthinclient/go.sum b/service/workspacesthinclient/go.sum new file mode 100644 index 00000000000..42e4fc806b4 --- /dev/null +++ b/service/workspacesthinclient/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/workspacesthinclient/go_module_metadata.go b/service/workspacesthinclient/go_module_metadata.go new file mode 100644 index 00000000000..05656ac2c99 --- /dev/null +++ b/service/workspacesthinclient/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package workspacesthinclient + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/workspacesthinclient/internal/endpoints/endpoints.go b/service/workspacesthinclient/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..97f5c6bc454 --- /dev/null +++ b/service/workspacesthinclient/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 WorkSpaces Thin Client 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: "thinclient.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "thinclient-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "thinclient-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "thinclient.{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: "thinclient.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "thinclient-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "thinclient-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "thinclient.{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: "thinclient-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "thinclient.{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: "thinclient-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "thinclient.{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: "thinclient-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "thinclient.{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: "thinclient-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "thinclient.{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: "thinclient.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "thinclient-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "thinclient-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "thinclient.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/workspacesthinclient/internal/endpoints/endpoints_test.go b/service/workspacesthinclient/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/workspacesthinclient/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/workspacesthinclient/options.go b/service/workspacesthinclient/options.go new file mode 100644 index 00000000000..5de8f7f6a0e --- /dev/null +++ b/service/workspacesthinclient/options.go @@ -0,0 +1,223 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom + // endpoint, set the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // Provides idempotency tokens values that will be automatically populated into + // idempotent API operations. + IdempotencyTokenProvider IdempotencyTokenProvider + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. 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/workspacesthinclient/protocol_test.go b/service/workspacesthinclient/protocol_test.go new file mode 100644 index 00000000000..fbfea124c80 --- /dev/null +++ b/service/workspacesthinclient/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient diff --git a/service/workspacesthinclient/serializers.go b/service/workspacesthinclient/serializers.go new file mode 100644 index 00000000000..89a694466fb --- /dev/null +++ b/service/workspacesthinclient/serializers.go @@ -0,0 +1,1360 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/workspacesthinclient/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpCreateEnvironment struct { +} + +func (*awsRestjson1_serializeOpCreateEnvironment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateEnvironment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateEnvironmentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/environments") + 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_serializeOpDocumentCreateEnvironmentInput(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_serializeOpHttpBindingsCreateEnvironmentInput(v *CreateEnvironmentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateEnvironmentInput(v *CreateEnvironmentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.DesiredSoftwareSetId != nil { + ok := object.Key("desiredSoftwareSetId") + ok.String(*v.DesiredSoftwareSetId) + } + + if v.DesktopArn != nil { + ok := object.Key("desktopArn") + ok.String(*v.DesktopArn) + } + + if v.DesktopEndpoint != nil { + ok := object.Key("desktopEndpoint") + ok.String(*v.DesktopEndpoint) + } + + if v.KmsKeyArn != nil { + ok := object.Key("kmsKeyArn") + ok.String(*v.KmsKeyArn) + } + + if v.MaintenanceWindow != nil { + ok := object.Key("maintenanceWindow") + if err := awsRestjson1_serializeDocumentMaintenanceWindow(v.MaintenanceWindow, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if len(v.SoftwareSetUpdateMode) > 0 { + ok := object.Key("softwareSetUpdateMode") + ok.String(string(v.SoftwareSetUpdateMode)) + } + + if len(v.SoftwareSetUpdateSchedule) > 0 { + ok := object.Key("softwareSetUpdateSchedule") + ok.String(string(v.SoftwareSetUpdateSchedule)) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteDevice struct { +} + +func (*awsRestjson1_serializeOpDeleteDevice) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteDevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDeviceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/devices/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteDeviceInput(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_serializeOpHttpBindingsDeleteDeviceInput(v *DeleteDeviceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ClientToken != nil { + encoder.SetQuery("clientToken").String(*v.ClientToken) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteEnvironment struct { +} + +func (*awsRestjson1_serializeOpDeleteEnvironment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteEnvironment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteEnvironmentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/environments/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteEnvironmentInput(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_serializeOpHttpBindingsDeleteEnvironmentInput(v *DeleteEnvironmentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ClientToken != nil { + encoder.SetQuery("clientToken").String(*v.ClientToken) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeregisterDevice struct { +} + +func (*awsRestjson1_serializeOpDeregisterDevice) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeregisterDevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeregisterDeviceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/deregister-device/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeregisterDeviceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDeregisterDeviceInput(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_serializeOpHttpBindingsDeregisterDeviceInput(v *DeregisterDeviceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeregisterDeviceInput(v *DeregisterDeviceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if len(v.TargetDeviceStatus) > 0 { + ok := object.Key("targetDeviceStatus") + ok.String(string(v.TargetDeviceStatus)) + } + + return nil +} + +type awsRestjson1_serializeOpGetDevice struct { +} + +func (*awsRestjson1_serializeOpGetDevice) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetDevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDeviceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/devices/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetDeviceInput(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_serializeOpHttpBindingsGetDeviceInput(v *GetDeviceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetEnvironment struct { +} + +func (*awsRestjson1_serializeOpGetEnvironment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetEnvironment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetEnvironmentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/environments/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetEnvironmentInput(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_serializeOpHttpBindingsGetEnvironmentInput(v *GetEnvironmentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSoftwareSet struct { +} + +func (*awsRestjson1_serializeOpGetSoftwareSet) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSoftwareSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSoftwareSetInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/softwaresets/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSoftwareSetInput(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_serializeOpHttpBindingsGetSoftwareSetInput(v *GetSoftwareSetInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListDevices struct { +} + +func (*awsRestjson1_serializeOpListDevices) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListDevices) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListDevicesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/devices") + 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_serializeOpHttpBindingsListDevicesInput(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_serializeOpHttpBindingsListDevicesInput(v *ListDevicesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListEnvironments struct { +} + +func (*awsRestjson1_serializeOpListEnvironments) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListEnvironments) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListEnvironmentsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/environments") + 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_serializeOpHttpBindingsListEnvironmentsInput(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_serializeOpHttpBindingsListEnvironmentsInput(v *ListEnvironmentsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListSoftwareSets struct { +} + +func (*awsRestjson1_serializeOpListSoftwareSets) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSoftwareSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListSoftwareSetsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/softwaresets") + 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_serializeOpHttpBindingsListSoftwareSetsInput(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_serializeOpHttpBindingsListSoftwareSetsInput(v *ListSoftwareSetsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_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 { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateDevice struct { +} + +func (*awsRestjson1_serializeOpUpdateDevice) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateDevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateDeviceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/devices/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateDeviceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateDeviceInput(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_serializeOpHttpBindingsUpdateDeviceInput(v *UpdateDeviceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateDeviceInput(v *UpdateDeviceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DesiredSoftwareSetId != nil { + ok := object.Key("desiredSoftwareSetId") + ok.String(*v.DesiredSoftwareSetId) + } + + if v.KmsKeyArn != nil { + ok := object.Key("kmsKeyArn") + ok.String(*v.KmsKeyArn) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if len(v.SoftwareSetUpdateSchedule) > 0 { + ok := object.Key("softwareSetUpdateSchedule") + ok.String(string(v.SoftwareSetUpdateSchedule)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateEnvironment struct { +} + +func (*awsRestjson1_serializeOpUpdateEnvironment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateEnvironment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateEnvironmentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/environments/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateEnvironmentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateEnvironmentInput(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_serializeOpHttpBindingsUpdateEnvironmentInput(v *UpdateEnvironmentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateEnvironmentInput(v *UpdateEnvironmentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DesiredSoftwareSetId != nil { + ok := object.Key("desiredSoftwareSetId") + ok.String(*v.DesiredSoftwareSetId) + } + + if v.DesktopArn != nil { + ok := object.Key("desktopArn") + ok.String(*v.DesktopArn) + } + + if v.DesktopEndpoint != nil { + ok := object.Key("desktopEndpoint") + ok.String(*v.DesktopEndpoint) + } + + if v.MaintenanceWindow != nil { + ok := object.Key("maintenanceWindow") + if err := awsRestjson1_serializeDocumentMaintenanceWindow(v.MaintenanceWindow, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if len(v.SoftwareSetUpdateMode) > 0 { + ok := object.Key("softwareSetUpdateMode") + ok.String(string(v.SoftwareSetUpdateMode)) + } + + if len(v.SoftwareSetUpdateSchedule) > 0 { + ok := object.Key("softwareSetUpdateSchedule") + ok.String(string(v.SoftwareSetUpdateSchedule)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateSoftwareSet struct { +} + +func (*awsRestjson1_serializeOpUpdateSoftwareSet) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateSoftwareSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateSoftwareSetInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/softwaresets/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateSoftwareSetInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateSoftwareSetInput(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_serializeOpHttpBindingsUpdateSoftwareSetInput(v *UpdateSoftwareSetInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateSoftwareSetInput(v *UpdateSoftwareSetInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.ValidationStatus) > 0 { + ok := object.Key("validationStatus") + ok.String(string(v.ValidationStatus)) + } + + return nil +} + +func awsRestjson1_serializeDocumentDayOfWeekList(v []types.DayOfWeek, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentMaintenanceWindow(v *types.MaintenanceWindow, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.ApplyTimeOf) > 0 { + ok := object.Key("applyTimeOf") + ok.String(string(v.ApplyTimeOf)) + } + + if v.DaysOfTheWeek != nil { + ok := object.Key("daysOfTheWeek") + if err := awsRestjson1_serializeDocumentDayOfWeekList(v.DaysOfTheWeek, ok); err != nil { + return err + } + } + + if v.EndTimeHour != nil { + ok := object.Key("endTimeHour") + ok.Integer(*v.EndTimeHour) + } + + if v.EndTimeMinute != nil { + ok := object.Key("endTimeMinute") + ok.Integer(*v.EndTimeMinute) + } + + if v.StartTimeHour != nil { + ok := object.Key("startTimeHour") + ok.Integer(*v.StartTimeHour) + } + + if v.StartTimeMinute != nil { + ok := object.Key("startTimeMinute") + ok.Integer(*v.StartTimeMinute) + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentTagsMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} diff --git a/service/workspacesthinclient/types/enums.go b/service/workspacesthinclient/types/enums.go new file mode 100644 index 00000000000..97420859dd1 --- /dev/null +++ b/service/workspacesthinclient/types/enums.go @@ -0,0 +1,265 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type ApplyTimeOf string + +// Enum values for ApplyTimeOf +const ( + ApplyTimeOfUtc ApplyTimeOf = "UTC" + ApplyTimeOfDevice ApplyTimeOf = "DEVICE" +) + +// Values returns all known values for ApplyTimeOf. 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 (ApplyTimeOf) Values() []ApplyTimeOf { + return []ApplyTimeOf{ + "UTC", + "DEVICE", + } +} + +type DayOfWeek string + +// Enum values for DayOfWeek +const ( + DayOfWeekMonday DayOfWeek = "MONDAY" + DayOfWeekTuesday DayOfWeek = "TUESDAY" + DayOfWeekWednesday DayOfWeek = "WEDNESDAY" + DayOfWeekThursday DayOfWeek = "THURSDAY" + DayOfWeekFriday DayOfWeek = "FRIDAY" + DayOfWeekSaturday DayOfWeek = "SATURDAY" + DayOfWeekSunday DayOfWeek = "SUNDAY" +) + +// Values returns all known values for DayOfWeek. Note that this can be expanded +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. +func (DayOfWeek) Values() []DayOfWeek { + return []DayOfWeek{ + "MONDAY", + "TUESDAY", + "WEDNESDAY", + "THURSDAY", + "FRIDAY", + "SATURDAY", + "SUNDAY", + } +} + +type DesktopType string + +// Enum values for DesktopType +const ( + DesktopTypeWorkspaces DesktopType = "workspaces" + DesktopTypeAppstream DesktopType = "appstream" + DesktopTypeWorkspacesWeb DesktopType = "workspaces-web" +) + +// Values returns all known values for DesktopType. 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 (DesktopType) Values() []DesktopType { + return []DesktopType{ + "workspaces", + "appstream", + "workspaces-web", + } +} + +type DeviceSoftwareSetComplianceStatus string + +// Enum values for DeviceSoftwareSetComplianceStatus +const ( + DeviceSoftwareSetComplianceStatusNone DeviceSoftwareSetComplianceStatus = "NONE" + DeviceSoftwareSetComplianceStatusCompliant DeviceSoftwareSetComplianceStatus = "COMPLIANT" + DeviceSoftwareSetComplianceStatusNotCompliant DeviceSoftwareSetComplianceStatus = "NOT_COMPLIANT" +) + +// Values returns all known values for DeviceSoftwareSetComplianceStatus. 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 (DeviceSoftwareSetComplianceStatus) Values() []DeviceSoftwareSetComplianceStatus { + return []DeviceSoftwareSetComplianceStatus{ + "NONE", + "COMPLIANT", + "NOT_COMPLIANT", + } +} + +type DeviceStatus string + +// Enum values for DeviceStatus +const ( + DeviceStatusRegistered DeviceStatus = "REGISTERED" + DeviceStatusDeregistering DeviceStatus = "DEREGISTERING" + DeviceStatusDeregistered DeviceStatus = "DEREGISTERED" + DeviceStatusArchived DeviceStatus = "ARCHIVED" +) + +// Values returns all known values for DeviceStatus. 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 (DeviceStatus) Values() []DeviceStatus { + return []DeviceStatus{ + "REGISTERED", + "DEREGISTERING", + "DEREGISTERED", + "ARCHIVED", + } +} + +type EnvironmentSoftwareSetComplianceStatus string + +// Enum values for EnvironmentSoftwareSetComplianceStatus +const ( + EnvironmentSoftwareSetComplianceStatusNoRegisteredDevices EnvironmentSoftwareSetComplianceStatus = "NO_REGISTERED_DEVICES" + EnvironmentSoftwareSetComplianceStatusCompliant EnvironmentSoftwareSetComplianceStatus = "COMPLIANT" + EnvironmentSoftwareSetComplianceStatusNotCompliant EnvironmentSoftwareSetComplianceStatus = "NOT_COMPLIANT" +) + +// Values returns all known values for EnvironmentSoftwareSetComplianceStatus. +// 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 (EnvironmentSoftwareSetComplianceStatus) Values() []EnvironmentSoftwareSetComplianceStatus { + return []EnvironmentSoftwareSetComplianceStatus{ + "NO_REGISTERED_DEVICES", + "COMPLIANT", + "NOT_COMPLIANT", + } +} + +type MaintenanceWindowType string + +// Enum values for MaintenanceWindowType +const ( + MaintenanceWindowTypeSystem MaintenanceWindowType = "SYSTEM" + MaintenanceWindowTypeCustom MaintenanceWindowType = "CUSTOM" +) + +// Values returns all known values for MaintenanceWindowType. 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 (MaintenanceWindowType) Values() []MaintenanceWindowType { + return []MaintenanceWindowType{ + "SYSTEM", + "CUSTOM", + } +} + +type SoftwareSetUpdateMode string + +// Enum values for SoftwareSetUpdateMode +const ( + SoftwareSetUpdateModeUseLatest SoftwareSetUpdateMode = "USE_LATEST" + SoftwareSetUpdateModeUseDesired SoftwareSetUpdateMode = "USE_DESIRED" +) + +// Values returns all known values for SoftwareSetUpdateMode. 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 (SoftwareSetUpdateMode) Values() []SoftwareSetUpdateMode { + return []SoftwareSetUpdateMode{ + "USE_LATEST", + "USE_DESIRED", + } +} + +type SoftwareSetUpdateSchedule string + +// Enum values for SoftwareSetUpdateSchedule +const ( + SoftwareSetUpdateScheduleUseMaintenanceWindow SoftwareSetUpdateSchedule = "USE_MAINTENANCE_WINDOW" + SoftwareSetUpdateScheduleApplyImmediately SoftwareSetUpdateSchedule = "APPLY_IMMEDIATELY" +) + +// Values returns all known values for SoftwareSetUpdateSchedule. 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 (SoftwareSetUpdateSchedule) Values() []SoftwareSetUpdateSchedule { + return []SoftwareSetUpdateSchedule{ + "USE_MAINTENANCE_WINDOW", + "APPLY_IMMEDIATELY", + } +} + +type SoftwareSetUpdateStatus string + +// Enum values for SoftwareSetUpdateStatus +const ( + SoftwareSetUpdateStatusAvailable SoftwareSetUpdateStatus = "AVAILABLE" + SoftwareSetUpdateStatusInProgress SoftwareSetUpdateStatus = "IN_PROGRESS" + SoftwareSetUpdateStatusUpToDate SoftwareSetUpdateStatus = "UP_TO_DATE" +) + +// Values returns all known values for SoftwareSetUpdateStatus. 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 (SoftwareSetUpdateStatus) Values() []SoftwareSetUpdateStatus { + return []SoftwareSetUpdateStatus{ + "AVAILABLE", + "IN_PROGRESS", + "UP_TO_DATE", + } +} + +type SoftwareSetValidationStatus string + +// Enum values for SoftwareSetValidationStatus +const ( + SoftwareSetValidationStatusValidated SoftwareSetValidationStatus = "VALIDATED" + SoftwareSetValidationStatusNotValidated SoftwareSetValidationStatus = "NOT_VALIDATED" +) + +// Values returns all known values for SoftwareSetValidationStatus. 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 (SoftwareSetValidationStatus) Values() []SoftwareSetValidationStatus { + return []SoftwareSetValidationStatus{ + "VALIDATED", + "NOT_VALIDATED", + } +} + +type TargetDeviceStatus string + +// Enum values for TargetDeviceStatus +const ( + TargetDeviceStatusDeregistered TargetDeviceStatus = "DEREGISTERED" + TargetDeviceStatusArchived TargetDeviceStatus = "ARCHIVED" +) + +// Values returns all known values for TargetDeviceStatus. 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 (TargetDeviceStatus) Values() []TargetDeviceStatus { + return []TargetDeviceStatus{ + "DEREGISTERED", + "ARCHIVED", + } +} + +type ValidationExceptionReason string + +// Enum values for ValidationExceptionReason +const ( + ValidationExceptionReasonUnknownOperation ValidationExceptionReason = "unknownOperation" + ValidationExceptionReasonCannotParse ValidationExceptionReason = "cannotParse" + ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "fieldValidationFailed" + ValidationExceptionReasonOther ValidationExceptionReason = "other" +) + +// Values returns all known values for ValidationExceptionReason. 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 (ValidationExceptionReason) Values() []ValidationExceptionReason { + return []ValidationExceptionReason{ + "unknownOperation", + "cannotParse", + "fieldValidationFailed", + "other", + } +} diff --git a/service/workspacesthinclient/types/errors.go b/service/workspacesthinclient/types/errors.go new file mode 100644 index 00000000000..1a3ed18941f --- /dev/null +++ b/service/workspacesthinclient/types/errors.go @@ -0,0 +1,240 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// You do not have sufficient access to perform this action. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The requested operation would cause a conflict with the current state of a +// service resource associated with the request. Resolve the conflict before +// retrying this request. +type ConflictException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType *string + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConflictException" + } + return *e.ErrorCodeOverride +} +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The server encountered an internal error and is unable to complete the request. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + RetryAfterSeconds *int32 + + 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 } + +// Request processing failed due to some unknown error, exception, or failure. +type InternalServiceException struct { + Message *string + + ErrorCodeOverride *string + + RetryAfterSeconds *int32 + + noSmithyDocumentSerde +} + +func (e *InternalServiceException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServiceException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServiceException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServiceException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServiceException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The resource specified in the request was not found. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType *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 } + +// Your request exceeds a service quota. +type ServiceQuotaExceededException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType *string + ServiceCode *string + QuotaCode *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceQuotaExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied due to request throttling. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + ServiceCode *string + QuotaCode *string + RetryAfterSeconds *int32 + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The input fails to satisfy the specified constraints. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + Reason ValidationExceptionReason + FieldList []ValidationExceptionField + + 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/workspacesthinclient/types/types.go b/service/workspacesthinclient/types/types.go new file mode 100644 index 00000000000..76ca51834a2 --- /dev/null +++ b/service/workspacesthinclient/types/types.go @@ -0,0 +1,378 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// Describes a thin client device. +type Device struct { + + // The Amazon Resource Name (ARN) of the device. + Arn *string + + // The timestamp of when the device was created. + CreatedAt *time.Time + + // The ID of the software set currently installed on the device. + CurrentSoftwareSetId *string + + // The version of the software set currently installed on the device. + CurrentSoftwareSetVersion *string + + // The ID of the software set which the device has been set to. + DesiredSoftwareSetId *string + + // The ID of the environment the device is associated with. + EnvironmentId *string + + // The ID of the device. + Id *string + + // The Amazon Resource Name (ARN) of the Key Management Service key used to + // encrypt the device. + KmsKeyArn *string + + // The timestamp of the most recent session on the device. + LastConnectedAt *time.Time + + // The timestamp of the most recent check-in of the device. + LastPostureAt *time.Time + + // The model number of the device. + Model *string + + // The name of the device. + Name *string + + // The ID of the software set that is pending to be installed on the device. + PendingSoftwareSetId *string + + // The version of the software set that is pending to be installed on the device. + PendingSoftwareSetVersion *string + + // The hardware serial number of the device. + SerialNumber *string + + // Describes if the software currently installed on the device is a supported + // version. + SoftwareSetComplianceStatus DeviceSoftwareSetComplianceStatus + + // An option to define if software updates should be applied within a maintenance + // window. + SoftwareSetUpdateSchedule SoftwareSetUpdateSchedule + + // Describes if the device has a supported version of software installed. + SoftwareSetUpdateStatus SoftwareSetUpdateStatus + + // The status of the device. + Status DeviceStatus + + // The tag keys and optional values for the resource. + Tags *EmbeddedTag + + // The timestamp of when the device was updated. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// Describes a thin client device. +type DeviceSummary struct { + + // The Amazon Resource Name (ARN) of the device. + Arn *string + + // The timestamp of when the device was created. + CreatedAt *time.Time + + // The ID of the software set currently installed on the device. + CurrentSoftwareSetId *string + + // The ID of the software set which the device has been set to. + DesiredSoftwareSetId *string + + // The ID of the environment the device is associated with. + EnvironmentId *string + + // The ID of the device. + Id *string + + // The timestamp of the most recent session on the device. + LastConnectedAt *time.Time + + // The timestamp of the most recent check-in of the device. + LastPostureAt *time.Time + + // The model number of the device. + Model *string + + // The name of the device. + Name *string + + // The ID of the software set that is pending to be installed on the device. + PendingSoftwareSetId *string + + // The hardware serial number of the device. + SerialNumber *string + + // An option to define if software updates should be applied within a maintenance + // window. + SoftwareSetUpdateSchedule SoftwareSetUpdateSchedule + + // The status of the device. + Status DeviceStatus + + // The tag keys and optional values for the resource. + Tags *EmbeddedTag + + // The timestamp of when the device was updated. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// The resource and internal ID of a resource to tag. +type EmbeddedTag struct { + + // The internal ID of a resource to tag. + InternalId *string + + // The Amazon Resource Name (ARN) of a resource to tag. + ResourceArn *string + + noSmithyDocumentSerde +} + +// Describes an environment. +type Environment struct { + + // The activation code to register a device to the environment. + ActivationCode *string + + // The Amazon Resource Name (ARN) of the environment. + Arn *string + + // The timestamp of when the environment was created. + CreatedAt *time.Time + + // The ID of the software set to apply. + DesiredSoftwareSetId *string + + // The Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, + // WorkSpaces Web, or AppStream 2.0. + DesktopArn *string + + // The URL for the identity provider login (only for environments that use + // AppStream 2.0). + DesktopEndpoint *string + + // The type of streaming desktop for the environment. + DesktopType DesktopType + + // The ID of the environment. + Id *string + + // The Amazon Resource Name (ARN) of the Key Management Service key used to + // encrypt the environment. + KmsKeyArn *string + + // A specification for a time window to apply software updates. + MaintenanceWindow *MaintenanceWindow + + // The name of the environment. + Name *string + + // The ID of the software set that is pending to be installed. + PendingSoftwareSetId *string + + // The version of the software set that is pending to be installed. + PendingSoftwareSetVersion *string + + // The number of devices registered to the environment. + RegisteredDevicesCount *int32 + + // Describes if the software currently installed on all devices in the environment + // is a supported version. + SoftwareSetComplianceStatus EnvironmentSoftwareSetComplianceStatus + + // An option to define which software updates to apply. + SoftwareSetUpdateMode SoftwareSetUpdateMode + + // An option to define if software updates should be applied within a maintenance + // window. + SoftwareSetUpdateSchedule SoftwareSetUpdateSchedule + + // The tag keys and optional values for the resource. + Tags *EmbeddedTag + + // The timestamp of when the device was updated. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// Describes an environment. +type EnvironmentSummary struct { + + // The activation code to register a device to the environment. + ActivationCode *string + + // The Amazon Resource Name (ARN) of the environment. + Arn *string + + // The timestamp of when the environment was created. + CreatedAt *time.Time + + // The ID of the software set to apply. + DesiredSoftwareSetId *string + + // The Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, + // WorkSpaces Web, or AppStream 2.0. + DesktopArn *string + + // The URL for the identity provider login (only for environments that use + // AppStream 2.0). + DesktopEndpoint *string + + // The type of streaming desktop for the environment. + DesktopType DesktopType + + // The ID of the environment. + Id *string + + // A specification for a time window to apply software updates. + MaintenanceWindow *MaintenanceWindow + + // The name of the environment. + Name *string + + // The ID of the software set that is pending to be installed. + PendingSoftwareSetId *string + + // An option to define which software updates to apply. + SoftwareSetUpdateMode SoftwareSetUpdateMode + + // An option to define if software updates should be applied within a maintenance + // window. + SoftwareSetUpdateSchedule SoftwareSetUpdateSchedule + + // The tag keys and optional values for the resource. + Tags *EmbeddedTag + + // The timestamp of when the device was updated. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// Describes the maintenance window for a thin client device. +type MaintenanceWindow struct { + + // The option to set the maintenance window during the device local time or + // Universal Coordinated Time (UTC). + ApplyTimeOf ApplyTimeOf + + // The days of the week during which the maintenance window is open. + DaysOfTheWeek []DayOfWeek + + // The hour for the maintenance window end ( 00 - 23 ). + EndTimeHour *int32 + + // The minutes for the maintenance window end ( 00 - 59 ). + EndTimeMinute *int32 + + // The hour for the maintenance window start ( 00 - 23 ). + StartTimeHour *int32 + + // The minutes past the hour for the maintenance window start ( 00 - 59 ). + StartTimeMinute *int32 + + // An option to select the default or custom maintenance window. + Type MaintenanceWindowType + + noSmithyDocumentSerde +} + +// Describes software. +type Software struct { + + // The name of the software component. + Name *string + + // The version of the software component. + Version *string + + noSmithyDocumentSerde +} + +// Describes a software set. +type SoftwareSet struct { + + // The Amazon Resource Name (ARN) of the software set. + Arn *string + + // The ID of the software set. + Id *string + + // The timestamp of when the software set was released. + ReleasedAt *time.Time + + // A list of the software components in the software set. + Software []Software + + // The timestamp of the end of support for the software set. + SupportedUntil *time.Time + + // An option to define if the software set has been validated. + ValidationStatus SoftwareSetValidationStatus + + // The version of the software set. + Version *string + + noSmithyDocumentSerde +} + +// Describes a software set. +type SoftwareSetSummary struct { + + // The Amazon Resource Name (ARN) of the software set. + Arn *string + + // The ID of the software set. + Id *string + + // The timestamp of when the software set was released. + ReleasedAt *time.Time + + // The timestamp of the end of support for the software set. + SupportedUntil *time.Time + + // An option to define if the software set has been validated. + ValidationStatus SoftwareSetValidationStatus + + // The version of the software set. + Version *string + + noSmithyDocumentSerde +} + +// Describes a validation exception. +type ValidationExceptionField struct { + + // A message that describes the reason for the exception. + // + // This member is required. + Message *string + + // The name of the exception. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/workspacesthinclient/validators.go b/service/workspacesthinclient/validators.go new file mode 100644 index 00000000000..8bcd0a48d7c --- /dev/null +++ b/service/workspacesthinclient/validators.go @@ -0,0 +1,526 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCreateEnvironment struct { +} + +func (*validateOpCreateEnvironment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateEnvironmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateEnvironmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDevice struct { +} + +func (*validateOpDeleteDevice) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDeviceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteEnvironment struct { +} + +func (*validateOpDeleteEnvironment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteEnvironmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteEnvironmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeregisterDevice struct { +} + +func (*validateOpDeregisterDevice) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeregisterDevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeregisterDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeregisterDeviceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetDevice struct { +} + +func (*validateOpGetDevice) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDeviceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetEnvironment struct { +} + +func (*validateOpGetEnvironment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetEnvironmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetEnvironmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSoftwareSet struct { +} + +func (*validateOpGetSoftwareSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSoftwareSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSoftwareSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSoftwareSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateDevice struct { +} + +func (*validateOpUpdateDevice) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateDevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateDeviceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateEnvironment struct { +} + +func (*validateOpUpdateEnvironment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateEnvironmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateEnvironmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSoftwareSet struct { +} + +func (*validateOpUpdateSoftwareSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSoftwareSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSoftwareSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSoftwareSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateEnvironmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateEnvironment{}, middleware.After) +} + +func addOpDeleteDeviceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDevice{}, middleware.After) +} + +func addOpDeleteEnvironmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteEnvironment{}, middleware.After) +} + +func addOpDeregisterDeviceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeregisterDevice{}, middleware.After) +} + +func addOpGetDeviceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDevice{}, middleware.After) +} + +func addOpGetEnvironmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetEnvironment{}, middleware.After) +} + +func addOpGetSoftwareSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSoftwareSet{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + +func addOpUpdateDeviceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateDevice{}, middleware.After) +} + +func addOpUpdateEnvironmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateEnvironment{}, middleware.After) +} + +func addOpUpdateSoftwareSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSoftwareSet{}, middleware.After) +} + +func validateOpCreateEnvironmentInput(v *CreateEnvironmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateEnvironmentInput"} + if v.DesktopArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DesktopArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDeviceInput(v *DeleteDeviceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDeviceInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteEnvironmentInput(v *DeleteEnvironmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteEnvironmentInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeregisterDeviceInput(v *DeregisterDeviceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeregisterDeviceInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetDeviceInput(v *GetDeviceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDeviceInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetEnvironmentInput(v *GetEnvironmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetEnvironmentInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSoftwareSetInput(v *GetSoftwareSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSoftwareSetInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateDeviceInput(v *UpdateDeviceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateDeviceInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateEnvironmentInput(v *UpdateEnvironmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateEnvironmentInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateSoftwareSetInput(v *UpdateSoftwareSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSoftwareSetInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if len(v.ValidationStatus) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ValidationStatus")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +}