From f58e0598c55064b716781fe2d4605d681676b178 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Thu, 25 Jul 2024 19:46:21 +0000 Subject: [PATCH] Regenerated Clients --- .../2c517e46c60340618419bee40db5d380.json | 8 + .../48e080da6ffc442bbd812dd75ac83806.json | 8 + .../5dfd46d39e274964aaba8fa0739024e8.json | 8 + .../6d8d83975c33415e9e32d8193316fff0.json | 8 + .../821a553f3bc94a3db3330a79ddbff239.json | 8 + .../833f26a729da4e94a8848701aa262048.json | 8 + .../963a4da9b776416298b817a1544190a2.json | 8 + .../bced18c67f7944b0bad5803734cd05fb.json | 8 + .../c899ccf9bf544c11a862dea97bc123ff.json | 8 + .../cbecf8c2ee7a487381d8cb2df3ea8858.json | 8 + .../dab1c15806a04eabac310c73752441ad.json | 8 + .../fa67fec470f5412f873f1ca3ec5f3d19.json | 8 + .../attributevalue/go_module_metadata.go | 2 +- service/applicationautoscaling/types/enums.go | 54 +- .../applicationsignals/api_op_GetService.go | 21 + .../api_op_ListServiceDependencies.go | 10 + .../api_op_ListServiceDependents.go | 10 + .../api_op_ListServiceOperations.go | 10 + .../applicationsignals/api_op_ListServices.go | 10 + service/applicationsignals/deserializers.go | 42 + service/applicationsignals/doc.go | 7 +- service/applicationsignals/types/types.go | 11 + service/bedrockruntime/api_op_Converse.go | 9 +- .../bedrockruntime/api_op_ConverseStream.go | 6 + .../api_op_InvokeModelWithResponseStream.go | 3 +- service/bedrockruntime/deserializers.go | 129 ++ service/bedrockruntime/types/errors.go | 37 +- service/codecommit/api_op_CreateRepository.go | 2 +- .../api_op_UpdateRepositoryEncryptionKey.go | 2 +- service/codecommit/deserializers.go | 78 ++ service/codecommit/types/errors.go | 26 + .../api_op_GetEnvironmentCredentials.go | 157 +++ service/datazone/deserializers.go | 197 +++ service/datazone/generated.json | 1 + service/datazone/serializers.go | 74 ++ .../api_op_GetEnvironmentCredentials.go.snap | 36 + service/datazone/snapshot_test.go | 24 + service/datazone/validators.go | 42 + service/ec2/types/enums.go | 2 - service/ec2/types/types.go | 102 +- .../ecr/api_op_CreatePullThroughCacheRule.go | 3 - ...api_op_CreateRepositoryCreationTemplate.go | 199 +++ ...api_op_DeleteRepositoryCreationTemplate.go | 146 +++ service/ecr/api_op_DescribeRegistry.go | 2 +- ..._op_DescribeRepositoryCreationTemplates.go | 275 ++++ service/ecr/api_op_GetRegistryPolicy.go | 2 +- ...api_op_GetRegistryScanningConfiguration.go | 2 +- service/ecr/api_op_PutRegistryPolicy.go | 2 +- .../ecr/api_op_PutReplicationConfiguration.go | 2 + ...api_op_UpdateRepositoryCreationTemplate.go | 188 +++ service/ecr/deserializers.go | 1110 ++++++++++++++++- service/ecr/generated.json | 4 + service/ecr/serializers.go | 411 ++++++ ...p_CreateRepositoryCreationTemplate.go.snap | 36 + ...p_DeleteRepositoryCreationTemplate.go.snap | 36 + ...escribeRepositoryCreationTemplates.go.snap | 35 + ...p_UpdateRepositoryCreationTemplate.go.snap | 36 + service/ecr/snapshot_test.go | 96 ++ service/ecr/types/enums.go | 19 + service/ecr/types/errors.go | 54 + service/ecr/types/types.go | 88 +- service/ecr/validators.go | 155 +++ service/eks/api_op_CreateCluster.go | 4 + service/eks/api_op_UpdateClusterConfig.go | 5 + service/eks/deserializers.go | 45 + service/eks/serializers.go | 26 + service/eks/types/enums.go | 23 + service/eks/types/types.go | 48 + ...pi_op_DeleteSharedTrustStoreAssociation.go | 142 +++ .../api_op_DescribeTargetHealth.go | 2 +- .../api_op_DescribeTrustStoreRevocations.go | 4 +- .../api_op_DescribeTrustStores.go | 2 +- .../api_op_GetResourcePolicy.go | 141 +++ .../api_op_ModifyTrustStore.go | 2 +- .../api_op_SetIpAddressType.go | 5 + .../elasticloadbalancingv2/deserializers.go | 631 +++++++++- service/elasticloadbalancingv2/generated.json | 2 + service/elasticloadbalancingv2/serializers.go | 162 +++ ..._DeleteSharedTrustStoreAssociation.go.snap | 36 + .../snapshot/api_op_GetResourcePolicy.go.snap | 36 + .../elasticloadbalancingv2/snapshot_test.go | 48 + service/elasticloadbalancingv2/types/enums.go | 20 + .../elasticloadbalancingv2/types/errors.go | 82 ++ service/elasticloadbalancingv2/types/types.go | 3 + service/elasticloadbalancingv2/validators.go | 81 ++ service/internal/integrationtest/go.mod | 1 - ...api_op_CreateTLSInspectionConfiguration.go | 16 +- service/networkfirewall/types/enums.go | 2 + service/networkfirewall/types/types.go | 47 +- service/outposts/deserializers.go | 13 + service/outposts/types/types.go | 3 + service/sfn/api_op_CreateActivity.go | 3 + service/sfn/api_op_CreateStateMachine.go | 19 +- service/sfn/api_op_DescribeActivity.go | 4 + service/sfn/api_op_DescribeExecution.go | 6 + service/sfn/api_op_DescribeStateMachine.go | 17 + ...api_op_DescribeStateMachineForExecution.go | 9 + service/sfn/api_op_SendTaskFailure.go | 7 + service/sfn/api_op_StartSyncExecution.go | 6 + service/sfn/api_op_StopExecution.go | 7 + service/sfn/api_op_UpdateStateMachine.go | 12 +- service/sfn/deserializers.go | 581 +++++++++ service/sfn/doc.go | 4 +- service/sfn/serializers.go | 63 + service/sfn/types/enums.go | 63 + service/sfn/types/errors.go | 138 ++ service/sfn/types/types.go | 37 + service/sfn/validators.go | 30 + 108 files changed, 6594 insertions(+), 145 deletions(-) create mode 100644 .changelog/2c517e46c60340618419bee40db5d380.json create mode 100644 .changelog/48e080da6ffc442bbd812dd75ac83806.json create mode 100644 .changelog/5dfd46d39e274964aaba8fa0739024e8.json create mode 100644 .changelog/6d8d83975c33415e9e32d8193316fff0.json create mode 100644 .changelog/821a553f3bc94a3db3330a79ddbff239.json create mode 100644 .changelog/833f26a729da4e94a8848701aa262048.json create mode 100644 .changelog/963a4da9b776416298b817a1544190a2.json create mode 100644 .changelog/bced18c67f7944b0bad5803734cd05fb.json create mode 100644 .changelog/c899ccf9bf544c11a862dea97bc123ff.json create mode 100644 .changelog/cbecf8c2ee7a487381d8cb2df3ea8858.json create mode 100644 .changelog/dab1c15806a04eabac310c73752441ad.json create mode 100644 .changelog/fa67fec470f5412f873f1ca3ec5f3d19.json create mode 100644 service/datazone/api_op_GetEnvironmentCredentials.go create mode 100644 service/datazone/snapshot/api_op_GetEnvironmentCredentials.go.snap create mode 100644 service/ecr/api_op_CreateRepositoryCreationTemplate.go create mode 100644 service/ecr/api_op_DeleteRepositoryCreationTemplate.go create mode 100644 service/ecr/api_op_DescribeRepositoryCreationTemplates.go create mode 100644 service/ecr/api_op_UpdateRepositoryCreationTemplate.go create mode 100644 service/ecr/snapshot/api_op_CreateRepositoryCreationTemplate.go.snap create mode 100644 service/ecr/snapshot/api_op_DeleteRepositoryCreationTemplate.go.snap create mode 100644 service/ecr/snapshot/api_op_DescribeRepositoryCreationTemplates.go.snap create mode 100644 service/ecr/snapshot/api_op_UpdateRepositoryCreationTemplate.go.snap create mode 100644 service/elasticloadbalancingv2/api_op_DeleteSharedTrustStoreAssociation.go create mode 100644 service/elasticloadbalancingv2/api_op_GetResourcePolicy.go create mode 100644 service/elasticloadbalancingv2/snapshot/api_op_DeleteSharedTrustStoreAssociation.go.snap create mode 100644 service/elasticloadbalancingv2/snapshot/api_op_GetResourcePolicy.go.snap diff --git a/.changelog/2c517e46c60340618419bee40db5d380.json b/.changelog/2c517e46c60340618419bee40db5d380.json new file mode 100644 index 00000000000..153e1c7d911 --- /dev/null +++ b/.changelog/2c517e46c60340618419bee40db5d380.json @@ -0,0 +1,8 @@ +{ + "id": "2c517e46-c603-4061-8419-bee40db5d380", + "type": "feature", + "description": "EC2 Fleet now supports using custom identifiers to reference Amazon Machine Images (AMI) in launch requests that are configured to choose from a diversified list of instance types.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/48e080da6ffc442bbd812dd75ac83806.json b/.changelog/48e080da6ffc442bbd812dd75ac83806.json new file mode 100644 index 00000000000..e9509f89727 --- /dev/null +++ b/.changelog/48e080da6ffc442bbd812dd75ac83806.json @@ -0,0 +1,8 @@ +{ + "id": "48e080da-6ffc-442b-bd81-2dd75ac83806", + "type": "feature", + "description": "API and documentation updates for Amazon ECR, adding support for creating, updating, describing and deleting ECR Repository Creation Template.", + "modules": [ + "service/ecr" + ] +} \ No newline at end of file diff --git a/.changelog/5dfd46d39e274964aaba8fa0739024e8.json b/.changelog/5dfd46d39e274964aaba8fa0739024e8.json new file mode 100644 index 00000000000..e7471845c15 --- /dev/null +++ b/.changelog/5dfd46d39e274964aaba8fa0739024e8.json @@ -0,0 +1,8 @@ +{ + "id": "5dfd46d3-9e27-4964-aaba-8fa0739024e8", + "type": "feature", + "description": "Adding default vCPU information to GetOutpostSupportedInstanceTypes and GetOutpostInstanceTypes responses", + "modules": [ + "service/outposts" + ] +} \ No newline at end of file diff --git a/.changelog/6d8d83975c33415e9e32d8193316fff0.json b/.changelog/6d8d83975c33415e9e32d8193316fff0.json new file mode 100644 index 00000000000..98b6b86ce9e --- /dev/null +++ b/.changelog/6d8d83975c33415e9e32d8193316fff0.json @@ -0,0 +1,8 @@ +{ + "id": "6d8d8397-5c33-415e-9e32-d8193316fff0", + "type": "feature", + "description": "Provides ServiceUnavailableException error message", + "modules": [ + "service/bedrockruntime" + ] +} \ No newline at end of file diff --git a/.changelog/821a553f3bc94a3db3330a79ddbff239.json b/.changelog/821a553f3bc94a3db3330a79ddbff239.json new file mode 100644 index 00000000000..56fc867e96b --- /dev/null +++ b/.changelog/821a553f3bc94a3db3330a79ddbff239.json @@ -0,0 +1,8 @@ +{ + "id": "821a553f-3bc9-4a3d-b333-0a79ddbff239", + "type": "feature", + "description": "CreateRepository API now throws OperationNotAllowedException when the account has been restricted from creating a repository.", + "modules": [ + "service/codecommit" + ] +} \ No newline at end of file diff --git a/.changelog/833f26a729da4e94a8848701aa262048.json b/.changelog/833f26a729da4e94a8848701aa262048.json new file mode 100644 index 00000000000..60cf85033fe --- /dev/null +++ b/.changelog/833f26a729da4e94a8848701aa262048.json @@ -0,0 +1,8 @@ +{ + "id": "833f26a7-29da-4e94-a884-8701aa262048", + "type": "feature", + "description": "You can now log events that are related to TLS inspection, in addition to the existing alert and flow logging.", + "modules": [ + "service/networkfirewall" + ] +} \ No newline at end of file diff --git a/.changelog/963a4da9b776416298b817a1544190a2.json b/.changelog/963a4da9b776416298b817a1544190a2.json new file mode 100644 index 00000000000..632a1fccdb2 --- /dev/null +++ b/.changelog/963a4da9b776416298b817a1544190a2.json @@ -0,0 +1,8 @@ +{ + "id": "963a4da9-b776-4162-98b8-17a1544190a2", + "type": "feature", + "description": "Application Auto Scaling is now more responsive to the changes in demand of your SageMaker Inference endpoints. To get started, create or update a Target Tracking policy based on High Resolution CloudWatch metrics.", + "modules": [ + "service/applicationautoscaling" + ] +} \ No newline at end of file diff --git a/.changelog/bced18c67f7944b0bad5803734cd05fb.json b/.changelog/bced18c67f7944b0bad5803734cd05fb.json new file mode 100644 index 00000000000..efaab5fe1ae --- /dev/null +++ b/.changelog/bced18c67f7944b0bad5803734cd05fb.json @@ -0,0 +1,8 @@ +{ + "id": "bced18c6-7f79-44b0-bad5-803734cd05fb", + "type": "feature", + "description": "This release adds support for sharing trust stores across accounts and organizations through integration with AWS Resource Access Manager.", + "modules": [ + "service/elasticloadbalancingv2" + ] +} \ No newline at end of file diff --git a/.changelog/c899ccf9bf544c11a862dea97bc123ff.json b/.changelog/c899ccf9bf544c11a862dea97bc123ff.json new file mode 100644 index 00000000000..f1729de6d45 --- /dev/null +++ b/.changelog/c899ccf9bf544c11a862dea97bc123ff.json @@ -0,0 +1,8 @@ +{ + "id": "c899ccf9-bf54-4c11-a862-dea97bc123ff", + "type": "feature", + "description": "This release adds support for EKS cluster to manage extended support.", + "modules": [ + "service/eks" + ] +} \ No newline at end of file diff --git a/.changelog/cbecf8c2ee7a487381d8cb2df3ea8858.json b/.changelog/cbecf8c2ee7a487381d8cb2df3ea8858.json new file mode 100644 index 00000000000..703abd52c07 --- /dev/null +++ b/.changelog/cbecf8c2ee7a487381d8cb2df3ea8858.json @@ -0,0 +1,8 @@ +{ + "id": "cbecf8c2-ee7a-4873-81d8-cb2df3ea8858", + "type": "feature", + "description": "CloudWatch Application Signals now supports application logs correlation with traces and operational health metrics of applications running on EC2 instances. Users can view the most relevant telemetry to troubleshoot application health anomalies such as spikes in latency, errors, and availability.", + "modules": [ + "service/applicationsignals" + ] +} \ No newline at end of file diff --git a/.changelog/dab1c15806a04eabac310c73752441ad.json b/.changelog/dab1c15806a04eabac310c73752441ad.json new file mode 100644 index 00000000000..4015dea76e4 --- /dev/null +++ b/.changelog/dab1c15806a04eabac310c73752441ad.json @@ -0,0 +1,8 @@ +{ + "id": "dab1c158-06a0-4eab-ac31-0c73752441ad", + "type": "feature", + "description": "Introduces GetEnvironmentCredentials operation to SDK", + "modules": [ + "service/datazone" + ] +} \ No newline at end of file diff --git a/.changelog/fa67fec470f5412f873f1ca3ec5f3d19.json b/.changelog/fa67fec470f5412f873f1ca3ec5f3d19.json new file mode 100644 index 00000000000..254af978f98 --- /dev/null +++ b/.changelog/fa67fec470f5412f873f1ca3ec5f3d19.json @@ -0,0 +1,8 @@ +{ + "id": "fa67fec4-70f5-412f-873f-1ca3ec5f3d19", + "type": "feature", + "description": "This release adds support to customer managed KMS key encryption in AWS Step Functions.", + "modules": [ + "service/sfn" + ] +} \ No newline at end of file diff --git a/feature/dynamodbstreams/attributevalue/go_module_metadata.go b/feature/dynamodbstreams/attributevalue/go_module_metadata.go index fd012916dd1..505e79ec5c4 100644 --- a/feature/dynamodbstreams/attributevalue/go_module_metadata.go +++ b/feature/dynamodbstreams/attributevalue/go_module_metadata.go @@ -3,4 +3,4 @@ package attributevalue // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.13.51" +const goModuleVersion = "1.14.10" diff --git a/service/applicationautoscaling/types/enums.go b/service/applicationautoscaling/types/enums.go index ec5711d56dd..2533a25bef0 100644 --- a/service/applicationautoscaling/types/enums.go +++ b/service/applicationautoscaling/types/enums.go @@ -73,31 +73,33 @@ type MetricType string // Enum values for MetricType const ( - MetricTypeDynamoDBReadCapacityUtilization MetricType = "DynamoDBReadCapacityUtilization" - MetricTypeDynamoDBWriteCapacityUtilization MetricType = "DynamoDBWriteCapacityUtilization" - MetricTypeALBRequestCountPerTarget MetricType = "ALBRequestCountPerTarget" - MetricTypeRDSReaderAverageCPUUtilization MetricType = "RDSReaderAverageCPUUtilization" - MetricTypeRDSReaderAverageDatabaseConnections MetricType = "RDSReaderAverageDatabaseConnections" - MetricTypeEC2SpotFleetRequestAverageCPUUtilization MetricType = "EC2SpotFleetRequestAverageCPUUtilization" - MetricTypeEC2SpotFleetRequestAverageNetworkIn MetricType = "EC2SpotFleetRequestAverageNetworkIn" - MetricTypeEC2SpotFleetRequestAverageNetworkOut MetricType = "EC2SpotFleetRequestAverageNetworkOut" - MetricTypeSageMakerVariantInvocationsPerInstance MetricType = "SageMakerVariantInvocationsPerInstance" - MetricTypeECSServiceAverageCPUUtilization MetricType = "ECSServiceAverageCPUUtilization" - MetricTypeECSServiceAverageMemoryUtilization MetricType = "ECSServiceAverageMemoryUtilization" - MetricTypeAppStreamAverageCapacityUtilization MetricType = "AppStreamAverageCapacityUtilization" - MetricTypeComprehendInferenceUtilization MetricType = "ComprehendInferenceUtilization" - MetricTypeLambdaProvisionedConcurrencyUtilization MetricType = "LambdaProvisionedConcurrencyUtilization" - MetricTypeCassandraReadCapacityUtilization MetricType = "CassandraReadCapacityUtilization" - MetricTypeCassandraWriteCapacityUtilization MetricType = "CassandraWriteCapacityUtilization" - MetricTypeKafkaBrokerStorageUtilization MetricType = "KafkaBrokerStorageUtilization" - MetricTypeElastiCachePrimaryEngineCPUUtilization MetricType = "ElastiCachePrimaryEngineCPUUtilization" - MetricTypeElastiCacheReplicaEngineCPUUtilization MetricType = "ElastiCacheReplicaEngineCPUUtilization" - MetricTypeElastiCacheDatabaseMemoryUsageCountedForEvictPercentage MetricType = "ElastiCacheDatabaseMemoryUsageCountedForEvictPercentage" - MetricTypeNeptuneReaderAverageCPUUtilization MetricType = "NeptuneReaderAverageCPUUtilization" - MetricTypeSageMakerVariantProvisionedConcurrencyUtilization MetricType = "SageMakerVariantProvisionedConcurrencyUtilization" - MetricTypeElastiCacheDatabaseCapacityUsageCountedForEvictPercentage MetricType = "ElastiCacheDatabaseCapacityUsageCountedForEvictPercentage" - MetricTypeSageMakerInferenceComponentInvocationsPerCopy MetricType = "SageMakerInferenceComponentInvocationsPerCopy" - MetricTypeWorkSpacesAverageUserSessionsCapacityUtilization MetricType = "WorkSpacesAverageUserSessionsCapacityUtilization" + MetricTypeDynamoDBReadCapacityUtilization MetricType = "DynamoDBReadCapacityUtilization" + MetricTypeDynamoDBWriteCapacityUtilization MetricType = "DynamoDBWriteCapacityUtilization" + MetricTypeALBRequestCountPerTarget MetricType = "ALBRequestCountPerTarget" + MetricTypeRDSReaderAverageCPUUtilization MetricType = "RDSReaderAverageCPUUtilization" + MetricTypeRDSReaderAverageDatabaseConnections MetricType = "RDSReaderAverageDatabaseConnections" + MetricTypeEC2SpotFleetRequestAverageCPUUtilization MetricType = "EC2SpotFleetRequestAverageCPUUtilization" + MetricTypeEC2SpotFleetRequestAverageNetworkIn MetricType = "EC2SpotFleetRequestAverageNetworkIn" + MetricTypeEC2SpotFleetRequestAverageNetworkOut MetricType = "EC2SpotFleetRequestAverageNetworkOut" + MetricTypeSageMakerVariantInvocationsPerInstance MetricType = "SageMakerVariantInvocationsPerInstance" + MetricTypeECSServiceAverageCPUUtilization MetricType = "ECSServiceAverageCPUUtilization" + MetricTypeECSServiceAverageMemoryUtilization MetricType = "ECSServiceAverageMemoryUtilization" + MetricTypeAppStreamAverageCapacityUtilization MetricType = "AppStreamAverageCapacityUtilization" + MetricTypeComprehendInferenceUtilization MetricType = "ComprehendInferenceUtilization" + MetricTypeLambdaProvisionedConcurrencyUtilization MetricType = "LambdaProvisionedConcurrencyUtilization" + MetricTypeCassandraReadCapacityUtilization MetricType = "CassandraReadCapacityUtilization" + MetricTypeCassandraWriteCapacityUtilization MetricType = "CassandraWriteCapacityUtilization" + MetricTypeKafkaBrokerStorageUtilization MetricType = "KafkaBrokerStorageUtilization" + MetricTypeElastiCachePrimaryEngineCPUUtilization MetricType = "ElastiCachePrimaryEngineCPUUtilization" + MetricTypeElastiCacheReplicaEngineCPUUtilization MetricType = "ElastiCacheReplicaEngineCPUUtilization" + MetricTypeElastiCacheDatabaseMemoryUsageCountedForEvictPercentage MetricType = "ElastiCacheDatabaseMemoryUsageCountedForEvictPercentage" + MetricTypeNeptuneReaderAverageCPUUtilization MetricType = "NeptuneReaderAverageCPUUtilization" + MetricTypeSageMakerVariantProvisionedConcurrencyUtilization MetricType = "SageMakerVariantProvisionedConcurrencyUtilization" + MetricTypeElastiCacheDatabaseCapacityUsageCountedForEvictPercentage MetricType = "ElastiCacheDatabaseCapacityUsageCountedForEvictPercentage" + MetricTypeSageMakerInferenceComponentInvocationsPerCopy MetricType = "SageMakerInferenceComponentInvocationsPerCopy" + MetricTypeWorkSpacesAverageUserSessionsCapacityUtilization MetricType = "WorkSpacesAverageUserSessionsCapacityUtilization" + MetricTypeSageMakerInferenceComponentConcurrentRequestsPerCopyHighResolution MetricType = "SageMakerInferenceComponentConcurrentRequestsPerCopyHighResolution" + MetricTypeSageMakerVariantConcurrentRequestsPerModelHighResolution MetricType = "SageMakerVariantConcurrentRequestsPerModelHighResolution" ) // Values returns all known values for MetricType. Note that this can be expanded @@ -131,6 +133,8 @@ func (MetricType) Values() []MetricType { "ElastiCacheDatabaseCapacityUsageCountedForEvictPercentage", "SageMakerInferenceComponentInvocationsPerCopy", "WorkSpacesAverageUserSessionsCapacityUtilization", + "SageMakerInferenceComponentConcurrentRequestsPerCopyHighResolution", + "SageMakerVariantConcurrentRequestsPerModelHighResolution", } } diff --git a/service/applicationsignals/api_op_GetService.go b/service/applicationsignals/api_op_GetService.go index 74bda004930..a1d7e8445b3 100644 --- a/service/applicationsignals/api_op_GetService.go +++ b/service/applicationsignals/api_op_GetService.go @@ -34,6 +34,8 @@ type GetServiceInput struct { // HTTP Query API, it is formatted as be epoch time in seconds. For example: // 1698778057 // + // Your requested start time will be rounded to the nearest hour. + // // This member is required. EndTime *time.Time @@ -63,6 +65,8 @@ type GetServiceInput struct { // HTTP Query API, it is formatted as be epoch time in seconds. For example: // 1698778057 // + // Your requested start time will be rounded to the nearest hour. + // // This member is required. StartTime *time.Time @@ -74,6 +78,9 @@ type GetServiceOutput struct { // The end time of the data included in the response. In a raw HTTP Query API, it // is formatted as be epoch time in seconds. For example: 1698778057 . // + // This displays the time that Application Signals used for the request. It might + // not match your request exactly, because it was rounded to the nearest hour. + // // This member is required. EndTime *time.Time @@ -85,9 +92,23 @@ type GetServiceOutput struct { // The start time of the data included in the response. In a raw HTTP Query API, // it is formatted as be epoch time in seconds. For example: 1698778057 . // + // This displays the time that Application Signals used for the request. It might + // not match your request exactly, because it was rounded to the nearest hour. + // // This member is required. StartTime *time.Time + // An array of string-to-string maps that each contain information about one log + // group associated with this service. Each string-to-string map includes the + // following fields: + // + // - "Type": "AWS::Resource" + // + // - "ResourceType": "AWS::Logs::LogGroup" + // + // - "Identifier": "name-of-log-group" + LogGroupReferences []map[string]string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/applicationsignals/api_op_ListServiceDependencies.go b/service/applicationsignals/api_op_ListServiceDependencies.go index b0839d5586d..beb72d316f8 100644 --- a/service/applicationsignals/api_op_ListServiceDependencies.go +++ b/service/applicationsignals/api_op_ListServiceDependencies.go @@ -37,6 +37,8 @@ type ListServiceDependenciesInput struct { // HTTP Query API, it is formatted as be epoch time in seconds. For example: // 1698778057 // + // Your requested end time will be rounded to the nearest hour. + // // This member is required. EndTime *time.Time @@ -66,6 +68,8 @@ type ListServiceDependenciesInput struct { // HTTP Query API, it is formatted as be epoch time in seconds. For example: // 1698778057 // + // Your requested start time will be rounded to the nearest hour. + // // This member is required. StartTime *time.Time @@ -86,6 +90,9 @@ type ListServiceDependenciesOutput struct { // in a raw HTTP Query API, it is formatted as be epoch time in seconds. For // example: 1698778057 // + // This displays the time that Application Signals used for the request. It might + // not match your request exactly, because it was rounded to the nearest hour. + // // This member is required. EndTime *time.Time @@ -99,6 +106,9 @@ type ListServiceDependenciesOutput struct { // used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For // example: 1698778057 // + // This displays the time that Application Signals used for the request. It might + // not match your request exactly, because it was rounded to the nearest hour. + // // This member is required. StartTime *time.Time diff --git a/service/applicationsignals/api_op_ListServiceDependents.go b/service/applicationsignals/api_op_ListServiceDependents.go index d6ef9f2d73a..6b29a1b310f 100644 --- a/service/applicationsignals/api_op_ListServiceDependents.go +++ b/service/applicationsignals/api_op_ListServiceDependents.go @@ -36,6 +36,8 @@ type ListServiceDependentsInput struct { // HTTP Query API, it is formatted as be epoch time in seconds. For example: // 1698778057 // + // Your requested start time will be rounded to the nearest hour. + // // This member is required. EndTime *time.Time @@ -65,6 +67,8 @@ type ListServiceDependentsInput struct { // HTTP Query API, it is formatted as be epoch time in seconds. For example: // 1698778057 // + // Your requested start time will be rounded to the nearest hour. + // // This member is required. StartTime *time.Time @@ -85,6 +89,9 @@ type ListServiceDependentsOutput struct { // in a raw HTTP Query API, it is formatted as be epoch time in seconds. For // example: 1698778057 // + // This displays the time that Application Signals used for the request. It might + // not match your request exactly, because it was rounded to the nearest hour. + // // This member is required. EndTime *time.Time @@ -98,6 +105,9 @@ type ListServiceDependentsOutput struct { // used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For // example: 1698778057 // + // This displays the time that Application Signals used for the request. It might + // not match your request exactly, because it was rounded to the nearest hour. + // // This member is required. StartTime *time.Time diff --git a/service/applicationsignals/api_op_ListServiceOperations.go b/service/applicationsignals/api_op_ListServiceOperations.go index 1a9e9af123e..207c4508146 100644 --- a/service/applicationsignals/api_op_ListServiceOperations.go +++ b/service/applicationsignals/api_op_ListServiceOperations.go @@ -36,6 +36,8 @@ type ListServiceOperationsInput struct { // HTTP Query API, it is formatted as be epoch time in seconds. For example: // 1698778057 // + // Your requested end time will be rounded to the nearest hour. + // // This member is required. EndTime *time.Time @@ -65,6 +67,8 @@ type ListServiceOperationsInput struct { // HTTP Query API, it is formatted as be epoch time in seconds. For example: // 1698778057 // + // Your requested start time will be rounded to the nearest hour. + // // This member is required. StartTime *time.Time @@ -85,6 +89,9 @@ type ListServiceOperationsOutput struct { // in a raw HTTP Query API, it is formatted as be epoch time in seconds. For // example: 1698778057 // + // This displays the time that Application Signals used for the request. It might + // not match your request exactly, because it was rounded to the nearest hour. + // // This member is required. EndTime *time.Time @@ -98,6 +105,9 @@ type ListServiceOperationsOutput struct { // used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For // example: 1698778057 // + // This displays the time that Application Signals used for the request. It might + // not match your request exactly, because it was rounded to the nearest hour. + // // This member is required. StartTime *time.Time diff --git a/service/applicationsignals/api_op_ListServices.go b/service/applicationsignals/api_op_ListServices.go index 198f1e3fd45..0f8f4033828 100644 --- a/service/applicationsignals/api_op_ListServices.go +++ b/service/applicationsignals/api_op_ListServices.go @@ -37,6 +37,8 @@ type ListServicesInput struct { // HTTP Query API, it is formatted as be epoch time in seconds. For example: // 1698778057 // + // Your requested start time will be rounded to the nearest hour. + // // This member is required. EndTime *time.Time @@ -44,6 +46,8 @@ type ListServicesInput struct { // HTTP Query API, it is formatted as be epoch time in seconds. For example: // 1698778057 // + // Your requested start time will be rounded to the nearest hour. + // // This member is required. StartTime *time.Time @@ -64,6 +68,9 @@ type ListServicesOutput struct { // in a raw HTTP Query API, it is formatted as be epoch time in seconds. For // example: 1698778057 // + // This displays the time that Application Signals used for the request. It might + // not match your request exactly, because it was rounded to the nearest hour. + // // This member is required. EndTime *time.Time @@ -79,6 +86,9 @@ type ListServicesOutput struct { // used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For // example: 1698778057 // + // This displays the time that Application Signals used for the request. It might + // not match your request exactly, because it was rounded to the nearest hour. + // // This member is required. StartTime *time.Time diff --git a/service/applicationsignals/deserializers.go b/service/applicationsignals/deserializers.go index 681549edd70..cf2e9be2009 100644 --- a/service/applicationsignals/deserializers.go +++ b/service/applicationsignals/deserializers.go @@ -600,6 +600,11 @@ func awsRestjson1_deserializeOpDocumentGetServiceOutput(v **GetServiceOutput, va } } + case "LogGroupReferences": + if err := awsRestjson1_deserializeDocumentLogGroupReferences(&sv.LogGroupReferences, value); err != nil { + return err + } + case "Service": if err := awsRestjson1_deserializeDocumentService(&sv.Service, value); err != nil { return err @@ -2979,6 +2984,38 @@ loop: return nil } +func awsRestjson1_deserializeDocumentLogGroupReferences(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.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []map[string]string + if *v == nil { + cv = []map[string]string{} + } else { + cv = *v + } + + for _, value := range shape { + var col map[string]string + if err := awsRestjson1_deserializeDocumentAttributes(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentMetric(v **types.Metric, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3468,6 +3505,11 @@ func awsRestjson1_deserializeDocumentService(v **types.Service, value interface{ return err } + case "LogGroupReferences": + if err := awsRestjson1_deserializeDocumentLogGroupReferences(&sv.LogGroupReferences, value); err != nil { + return err + } + case "MetricReferences": if err := awsRestjson1_deserializeDocumentMetricReferences(&sv.MetricReferences, value); err != nil { return err diff --git a/service/applicationsignals/doc.go b/service/applicationsignals/doc.go index 4011c100acc..c5b9c8db49b 100644 --- a/service/applicationsignals/doc.go +++ b/service/applicationsignals/doc.go @@ -3,9 +3,6 @@ // Package applicationsignals provides the API client, operations, and parameter // types for Amazon CloudWatch Application Signals. // -// This is a Preview release of the Application Signals API Reference. Operations -// and parameters are subject to change before the general availability release. -// // Use CloudWatch Application Signals for comprehensive observability of your // cloud-based applications. It enables real-time service health dashboards and // helps you track long-term performance trends against your business goals. The @@ -25,4 +22,8 @@ // - See a map of your application topology that Application Signals // automatically discovers, that gives you a visual representation of your // applications, dependencies, and their connectivity. +// +// Application Signals works with CloudWatch RUM, CloudWatch Synthetics canaries, +// and Amazon Web Services Service Catalog AppRegistry, to display your client +// pages, Synthetics canaries, and application names within dashboards and maps. package applicationsignals diff --git a/service/applicationsignals/types/types.go b/service/applicationsignals/types/types.go index 8f81392241d..92188c5c4f1 100644 --- a/service/applicationsignals/types/types.go +++ b/service/applicationsignals/types/types.go @@ -407,6 +407,17 @@ type Service struct { // collected or specifies what was used for the source of telemetry data. AttributeMaps []map[string]string + // An array of string-to-string maps that each contain information about one log + // group associated with this service. Each string-to-string map includes the + // following fields: + // + // - "Type": "AWS::Resource" + // + // - "ResourceType": "AWS::Logs::LogGroup" + // + // - "Identifier": "name-of-log-group" + LogGroupReferences []map[string]string + noSmithyDocumentSerde } diff --git a/service/bedrockruntime/api_op_Converse.go b/service/bedrockruntime/api_op_Converse.go index 8fd99a61839..11d86df134f 100644 --- a/service/bedrockruntime/api_op_Converse.go +++ b/service/bedrockruntime/api_op_Converse.go @@ -14,9 +14,12 @@ import ( // Sends messages to the specified Amazon Bedrock model. Converse provides a // consistent interface that works with all models that support messages. This -// allows you to write code once and use it with different models. Should a model -// have unique inference parameters, you can also pass those unique parameters to -// the model. +// allows you to write code once and use it with different models. If a model has +// unique inference parameters, you can also pass those unique parameters to the +// model. +// +// Amazon Bedrock doesn't store any text, images, or documents that you provide as +// content. The data is only used to generate the response. // // For information about the Converse API, see Use the Converse API in the Amazon // Bedrock User Guide. To use a guardrail, see Use a guardrail with the Converse diff --git a/service/bedrockruntime/api_op_ConverseStream.go b/service/bedrockruntime/api_op_ConverseStream.go index 29d768d1d38..5db400ac46e 100644 --- a/service/bedrockruntime/api_op_ConverseStream.go +++ b/service/bedrockruntime/api_op_ConverseStream.go @@ -22,6 +22,12 @@ import ( // To find out if a model supports streaming, call [GetFoundationModel] and check the // responseStreamingSupported field in the response. // +// The CLI doesn't support streaming operations in Amazon Bedrock, including +// ConverseStream . +// +// Amazon Bedrock doesn't store any text, images, or documents that you provide as +// content. The data is only used to generate the response. +// // For information about the Converse API, see Use the Converse API in the Amazon // Bedrock User Guide. To use a guardrail, see Use a guardrail with the Converse // API in the Amazon Bedrock User Guide. To use a tool with a model, see Tool use diff --git a/service/bedrockruntime/api_op_InvokeModelWithResponseStream.go b/service/bedrockruntime/api_op_InvokeModelWithResponseStream.go index 6bcf89da430..c11b757cfc5 100644 --- a/service/bedrockruntime/api_op_InvokeModelWithResponseStream.go +++ b/service/bedrockruntime/api_op_InvokeModelWithResponseStream.go @@ -19,7 +19,8 @@ import ( // To see if a model supports streaming, call [GetFoundationModel] and check the // responseStreamingSupported field in the response. // -// The CLI doesn't support InvokeModelWithResponseStream . +// The CLI doesn't support streaming operations in Amazon Bedrock, including +// InvokeModelWithResponseStream . // // For example code, see Invoke model with streaming code example in the Amazon // Bedrock User Guide. diff --git a/service/bedrockruntime/deserializers.go b/service/bedrockruntime/deserializers.go index ee9f7cb9abd..58aee20672b 100644 --- a/service/bedrockruntime/deserializers.go +++ b/service/bedrockruntime/deserializers.go @@ -331,6 +331,9 @@ func awsRestjson1_deserializeOpErrorConverse(response *smithyhttp.Response, meta 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) @@ -500,6 +503,9 @@ func awsRestjson1_deserializeOpErrorConverseStream(response *smithyhttp.Response 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) @@ -617,6 +623,9 @@ func awsRestjson1_deserializeOpErrorInvokeModel(response *smithyhttp.Response, m case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -766,6 +775,9 @@ func awsRestjson1_deserializeOpErrorInvokeModelWithResponseStream(response *smit case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -841,6 +853,9 @@ func awsRestjson1_deserializeEventStreamExceptionResponseStream(msg *eventstream case strings.EqualFold("modelTimeoutException", exceptionType.String()): return awsRestjson1_deserializeEventMessageExceptionModelTimeoutException(msg) + case strings.EqualFold("serviceUnavailableException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionServiceUnavailableException(msg) + case strings.EqualFold("throttlingException", exceptionType.String()): return awsRestjson1_deserializeEventMessageExceptionThrottlingException(msg) @@ -1090,6 +1105,41 @@ func awsRestjson1_deserializeEventMessageExceptionModelTimeoutException(msg *eve return v } +func awsRestjson1_deserializeEventMessageExceptionServiceUnavailableException(msg *eventstream.Message) error { + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot 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 := &types.ServiceUnavailableException{} + if err := awsRestjson1_deserializeDocumentServiceUnavailableException(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + } + return v +} + func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1276,6 +1326,46 @@ func awsRestjson1_deserializeDocumentPayloadPart(v **types.PayloadPart, value in 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 NonBlankString to be of type string, got %T instead", value) + } + sv.Message = 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) @@ -1440,6 +1530,9 @@ func awsRestjson1_deserializeEventStreamExceptionConverseStreamOutput(msg *event case strings.EqualFold("modelStreamErrorException", exceptionType.String()): return awsRestjson1_deserializeEventMessageExceptionModelStreamErrorException(msg) + case strings.EqualFold("serviceUnavailableException", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionServiceUnavailableException(msg) + case strings.EqualFold("throttlingException", exceptionType.String()): return awsRestjson1_deserializeEventMessageExceptionThrottlingException(msg) @@ -3738,6 +3831,42 @@ func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithy 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 diff --git a/service/bedrockruntime/types/errors.go b/service/bedrockruntime/types/errors.go index 4d79556951f..c4ac6e9eead 100644 --- a/service/bedrockruntime/types/errors.go +++ b/service/bedrockruntime/types/errors.go @@ -197,7 +197,10 @@ func (e *ResourceNotFoundException) ErrorCode() string { } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The number of requests exceeds the service quota. Resubmit your request later. +// Your request exceeds the service quota for your account. You can view your +// quotas at [Viewing service quotas]. You can resubmit your request later. +// +// [Viewing service quotas]: https://docs.aws.amazon.com/servicequotas/latest/userguide/gs-request-quota.html type ServiceQuotaExceededException struct { Message *string @@ -223,7 +226,37 @@ func (e *ServiceQuotaExceededException) ErrorCode() string { } func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The number of requests exceeds the limit. Resubmit your request later. +// The service isn't currently available. Try again later. +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 } + +// Your request was throttled because of service-wide limitations. Resubmit your +// request later or in a different region. You can also purchase [Provisioned Throughput]to increase the +// rate or number of tokens you can process. +// +// [Provisioned Throughput]: https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html type ThrottlingException struct { Message *string diff --git a/service/codecommit/api_op_CreateRepository.go b/service/codecommit/api_op_CreateRepository.go index 933896c7886..bd77646afe7 100644 --- a/service/codecommit/api_op_CreateRepository.go +++ b/service/codecommit/api_op_CreateRepository.go @@ -51,7 +51,7 @@ type CreateRepositoryInput struct { // If no key is specified, the default aws/codecommit Amazon Web Services managed // key is used. // - // [KeyId]: https://docs.aws.amazon.com/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId + // [KeyId]: https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId KmsKeyId *string // A comment or description about the new repository. diff --git a/service/codecommit/api_op_UpdateRepositoryEncryptionKey.go b/service/codecommit/api_op_UpdateRepositoryEncryptionKey.go index 833f70aebae..1949de1cf7f 100644 --- a/service/codecommit/api_op_UpdateRepositoryEncryptionKey.go +++ b/service/codecommit/api_op_UpdateRepositoryEncryptionKey.go @@ -34,7 +34,7 @@ type UpdateRepositoryEncryptionKeyInput struct { // information about acceptable values for keyID, see [KeyId]in the Decrypt API // description in the Key Management Service API Reference. // - // [KeyId]: https://docs.aws.amazon.com/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId + // [KeyId]: https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId // // This member is required. KmsKeyId *string diff --git a/service/codecommit/deserializers.go b/service/codecommit/deserializers.go index 58f1468263b..df3008fcd63 100644 --- a/service/codecommit/deserializers.go +++ b/service/codecommit/deserializers.go @@ -1767,6 +1767,9 @@ func awsAwsjson11_deserializeOpErrorCreateRepository(response *smithyhttp.Respon case strings.EqualFold("InvalidTagsMapException", errorCode): return awsAwsjson11_deserializeErrorInvalidTagsMapException(response, errorBody) + case strings.EqualFold("OperationNotAllowedException", errorCode): + return awsAwsjson11_deserializeErrorOperationNotAllowedException(response, errorBody) + case strings.EqualFold("RepositoryLimitExceededException", errorCode): return awsAwsjson11_deserializeErrorRepositoryLimitExceededException(response, errorBody) @@ -16160,6 +16163,41 @@ func awsAwsjson11_deserializeErrorNumberOfRuleTemplatesExceededException(respons return output } +func awsAwsjson11_deserializeErrorOperationNotAllowedException(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.OperationNotAllowedException{} + err := awsAwsjson11_deserializeDocumentOperationNotAllowedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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_deserializeErrorOverrideAlreadySetException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -26534,6 +26572,46 @@ func awsAwsjson11_deserializeDocumentObjectTypes(v **types.ObjectTypes, value in return nil } +func awsAwsjson11_deserializeDocumentOperationNotAllowedException(v **types.OperationNotAllowedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.OperationNotAllowedException + if *v == nil { + sv = &types.OperationNotAllowedException{} + } 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 Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentOriginApprovalRuleTemplate(v **types.OriginApprovalRuleTemplate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/codecommit/types/errors.go b/service/codecommit/types/errors.go index 0812364427b..6a188864d15 100644 --- a/service/codecommit/types/errors.go +++ b/service/codecommit/types/errors.go @@ -3867,6 +3867,32 @@ func (e *NumberOfRuleTemplatesExceededException) ErrorFault() smithy.ErrorFault return smithy.FaultClient } +// The requested action is not allowed. +type OperationNotAllowedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *OperationNotAllowedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *OperationNotAllowedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *OperationNotAllowedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "OperationNotAllowedException" + } + return *e.ErrorCodeOverride +} +func (e *OperationNotAllowedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The pull request has already had its approval rules set to override. type OverrideAlreadySetException struct { Message *string diff --git a/service/datazone/api_op_GetEnvironmentCredentials.go b/service/datazone/api_op_GetEnvironmentCredentials.go new file mode 100644 index 00000000000..e8f9eec71e7 --- /dev/null +++ b/service/datazone/api_op_GetEnvironmentCredentials.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package datazone + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Gets the credentials of an environment in Amazon DataZone. +func (c *Client) GetEnvironmentCredentials(ctx context.Context, params *GetEnvironmentCredentialsInput, optFns ...func(*Options)) (*GetEnvironmentCredentialsOutput, error) { + if params == nil { + params = &GetEnvironmentCredentialsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetEnvironmentCredentials", params, optFns, c.addOperationGetEnvironmentCredentialsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetEnvironmentCredentialsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetEnvironmentCredentialsInput struct { + + // The ID of the Amazon DataZone domain in which this environment and its + // credentials exist. + // + // This member is required. + DomainIdentifier *string + + // The ID of the environment whose credentials this operation gets. + // + // This member is required. + EnvironmentIdentifier *string + + noSmithyDocumentSerde +} + +type GetEnvironmentCredentialsOutput struct { + + // The access key ID of the environment. + AccessKeyId *string + + // The expiration timestamp of the environment credentials. + Expiration *time.Time + + // The secret access key of the environment credentials. + SecretAccessKey *string + + // The session token of the environment credentials. + SessionToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetEnvironmentCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetEnvironmentCredentials{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetEnvironmentCredentials{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetEnvironmentCredentials"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetEnvironmentCredentialsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEnvironmentCredentials(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetEnvironmentCredentials(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetEnvironmentCredentials", + } +} diff --git a/service/datazone/deserializers.go b/service/datazone/deserializers.go index 8abba75aa98..33d4be38e9e 100644 --- a/service/datazone/deserializers.go +++ b/service/datazone/deserializers.go @@ -11233,6 +11233,203 @@ func awsRestjson1_deserializeOpDocumentGetEnvironmentBlueprintConfigurationOutpu return nil } +type awsRestjson1_deserializeOpGetEnvironmentCredentials struct { +} + +func (*awsRestjson1_deserializeOpGetEnvironmentCredentials) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetEnvironmentCredentials) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetEnvironmentCredentials(response, &metadata) + } + output := &GetEnvironmentCredentialsOutput{} + 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_deserializeOpDocumentGetEnvironmentCredentialsOutput(&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_deserializeOpErrorGetEnvironmentCredentials(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetEnvironmentCredentialsOutput(v **GetEnvironmentCredentialsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetEnvironmentCredentialsOutput + if *v == nil { + sv = &GetEnvironmentCredentialsOutput{} + } 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 { + 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.Expiration = ptr.Time(t) + } + + 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 +} + type awsRestjson1_deserializeOpGetEnvironmentProfile struct { } diff --git a/service/datazone/generated.json b/service/datazone/generated.json index 73e1229f3b3..ed3829d709c 100644 --- a/service/datazone/generated.json +++ b/service/datazone/generated.json @@ -63,6 +63,7 @@ "api_op_GetEnvironmentAction.go", "api_op_GetEnvironmentBlueprint.go", "api_op_GetEnvironmentBlueprintConfiguration.go", + "api_op_GetEnvironmentCredentials.go", "api_op_GetEnvironmentProfile.go", "api_op_GetFormType.go", "api_op_GetGlossary.go", diff --git a/service/datazone/serializers.go b/service/datazone/serializers.go index 37f1b5f6e03..ad79b1e2139 100644 --- a/service/datazone/serializers.go +++ b/service/datazone/serializers.go @@ -5095,6 +5095,80 @@ func awsRestjson1_serializeOpHttpBindingsGetEnvironmentBlueprintConfigurationInp return nil } +type awsRestjson1_serializeOpGetEnvironmentCredentials struct { +} + +func (*awsRestjson1_serializeOpGetEnvironmentCredentials) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetEnvironmentCredentials) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetEnvironmentCredentialsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/domains/{domainIdentifier}/environments/{environmentIdentifier}/credentials") + 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_serializeOpHttpBindingsGetEnvironmentCredentialsInput(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_serializeOpHttpBindingsGetEnvironmentCredentialsInput(v *GetEnvironmentCredentialsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainIdentifier == nil || len(*v.DomainIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainIdentifier must not be empty")} + } + if v.DomainIdentifier != nil { + if err := encoder.SetURI("domainIdentifier").String(*v.DomainIdentifier); err != nil { + return err + } + } + + if v.EnvironmentIdentifier == nil || len(*v.EnvironmentIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member environmentIdentifier must not be empty")} + } + if v.EnvironmentIdentifier != nil { + if err := encoder.SetURI("environmentIdentifier").String(*v.EnvironmentIdentifier); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpGetEnvironmentProfile struct { } diff --git a/service/datazone/snapshot/api_op_GetEnvironmentCredentials.go.snap b/service/datazone/snapshot/api_op_GetEnvironmentCredentials.go.snap new file mode 100644 index 00000000000..422348855ee --- /dev/null +++ b/service/datazone/snapshot/api_op_GetEnvironmentCredentials.go.snap @@ -0,0 +1,36 @@ +GetEnvironmentCredentials + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/datazone/snapshot_test.go b/service/datazone/snapshot_test.go index 5f01c8f160e..e2559af0e17 100644 --- a/service/datazone/snapshot_test.go +++ b/service/datazone/snapshot_test.go @@ -722,6 +722,18 @@ func TestCheckSnapshot_GetEnvironmentBlueprintConfiguration(t *testing.T) { } } +func TestCheckSnapshot_GetEnvironmentCredentials(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetEnvironmentCredentials(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetEnvironmentCredentials") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetEnvironmentProfile(t *testing.T) { svc := New(Options{}) _, err := svc.GetEnvironmentProfile(context.Background(), nil, func(o *Options) { @@ -2185,6 +2197,18 @@ func TestUpdateSnapshot_GetEnvironmentBlueprintConfiguration(t *testing.T) { } } +func TestUpdateSnapshot_GetEnvironmentCredentials(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetEnvironmentCredentials(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetEnvironmentCredentials") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetEnvironmentProfile(t *testing.T) { svc := New(Options{}) _, err := svc.GetEnvironmentProfile(context.Background(), nil, func(o *Options) { diff --git a/service/datazone/validators.go b/service/datazone/validators.go index 734b60d8cc3..0fdd1559e1e 100644 --- a/service/datazone/validators.go +++ b/service/datazone/validators.go @@ -1090,6 +1090,26 @@ func (m *validateOpGetEnvironmentBlueprint) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpGetEnvironmentCredentials struct { +} + +func (*validateOpGetEnvironmentCredentials) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetEnvironmentCredentials) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetEnvironmentCredentialsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetEnvironmentCredentialsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetEnvironment struct { } @@ -2646,6 +2666,10 @@ func addOpGetEnvironmentBlueprintValidationMiddleware(stack *middleware.Stack) e return stack.Initialize.Add(&validateOpGetEnvironmentBlueprint{}, middleware.After) } +func addOpGetEnvironmentCredentialsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetEnvironmentCredentials{}, middleware.After) +} + func addOpGetEnvironmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetEnvironment{}, middleware.After) } @@ -5085,6 +5109,24 @@ func validateOpGetEnvironmentBlueprintInput(v *GetEnvironmentBlueprintInput) err } } +func validateOpGetEnvironmentCredentialsInput(v *GetEnvironmentCredentialsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetEnvironmentCredentialsInput"} + if v.DomainIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainIdentifier")) + } + if v.EnvironmentIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("EnvironmentIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetEnvironmentInput(v *GetEnvironmentInput) error { if v == nil { return nil diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index 232fff4df3b..1033ea33e96 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -7043,7 +7043,6 @@ const ( ResourceTypeVerifiedAccessTrustProvider ResourceType = "verified-access-trust-provider" ResourceTypeVpnConnectionDeviceType ResourceType = "vpn-connection-device-type" ResourceTypeVpcBlockPublicAccessExclusion ResourceType = "vpc-block-public-access-exclusion" - ResourceTypeVpcEncryptionControl ResourceType = "vpc-encryption-control" ResourceTypeIpamResourceDiscovery ResourceType = "ipam-resource-discovery" ResourceTypeIpamResourceDiscoveryAssociation ResourceType = "ipam-resource-discovery-association" ResourceTypeInstanceConnectEndpoint ResourceType = "instance-connect-endpoint" @@ -7139,7 +7138,6 @@ func (ResourceType) Values() []ResourceType { "verified-access-trust-provider", "vpn-connection-device-type", "vpc-block-public-access-exclusion", - "vpc-encryption-control", "ipam-resource-discovery", "ipam-resource-discovery-association", "instance-connect-endpoint", diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index 4f3bdc14249..82862107be4 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -4701,9 +4701,38 @@ type FleetLaunchTemplateOverrides struct { // The Availability Zone in which to launch the instances. AvailabilityZone *string - // The ID of the AMI. An AMI is required to launch an instance. This parameter is - // only available for fleets of type instant . For fleets of type maintain and - // request , you must specify the AMI ID in the launch template. + // The ID of the AMI in the format ami-17characters00000 . + // + // Alternatively, you can specify a Systems Manager parameter, using one of the + // following formats. The Systems Manager parameter will resolve to an AMI ID on + // launch. + // + // To reference a public parameter: + // + // - resolve:ssm:public-parameter + // + // To reference a parameter stored in the same account: + // + // - resolve:ssm:parameter-name + // + // - resolve:ssm:parameter-name:version-number + // + // - resolve:ssm:parameter-name:label + // + // To reference a parameter shared from another Amazon Web Services account: + // + // - resolve:ssm:parameter-ARN + // + // - resolve:ssm:parameter-ARN:version-number + // + // - resolve:ssm:parameter-ARN:label + // + // For more information, see [Use a Systems Manager parameter instead of an AMI ID] in the Amazon EC2 User Guide. + // + // This parameter is only available for fleets of type instant . For fleets of type + // maintain and request , you must specify the AMI ID in the launch template. + // + // [Use a Systems Manager parameter instead of an AMI ID]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-launch-template.html#use-an-ssm-parameter-instead-of-an-ami-id ImageId *string // The attributes for the instance types. When you specify instance attributes, @@ -4774,9 +4803,38 @@ type FleetLaunchTemplateOverridesRequest struct { // The Availability Zone in which to launch the instances. AvailabilityZone *string - // The ID of the AMI. An AMI is required to launch an instance. This parameter is - // only available for fleets of type instant . For fleets of type maintain and - // request , you must specify the AMI ID in the launch template. + // The ID of the AMI in the format ami-17characters00000 . + // + // Alternatively, you can specify a Systems Manager parameter, using one of the + // following formats. The Systems Manager parameter will resolve to an AMI ID on + // launch. + // + // To reference a public parameter: + // + // - resolve:ssm:public-parameter + // + // To reference a parameter stored in the same account: + // + // - resolve:ssm:parameter-name + // + // - resolve:ssm:parameter-name:version-number + // + // - resolve:ssm:parameter-name:label + // + // To reference a parameter shared from another Amazon Web Services account: + // + // - resolve:ssm:parameter-ARN + // + // - resolve:ssm:parameter-ARN:version-number + // + // - resolve:ssm:parameter-ARN:label + // + // For more information, see [Use a Systems Manager parameter instead of an AMI ID] in the Amazon EC2 User Guide. + // + // This parameter is only available for fleets of type instant . For fleets of type + // maintain and request , you must specify the AMI ID in the launch template. + // + // [Use a Systems Manager parameter instead of an AMI ID]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-launch-template.html#use-an-ssm-parameter-instead-of-an-ami-id ImageId *string // The attributes for the instance types. When you specify instance attributes, @@ -13681,12 +13739,17 @@ type RequestLaunchTemplateData struct { // The name or Amazon Resource Name (ARN) of an IAM instance profile. IamInstanceProfile *LaunchTemplateIamInstanceProfileSpecificationRequest - // The ID of the AMI. Alternatively, you can specify a Systems Manager parameter, - // which will resolve to an AMI ID on launch. + // The ID of the AMI in the format ami-17characters00000 . // - // Valid formats: + // Alternatively, you can specify a Systems Manager parameter, using one of the + // following formats. The Systems Manager parameter will resolve to an AMI ID on + // launch. // - // - ami-17characters00000 + // To reference a public parameter: + // + // - resolve:ssm:public-parameter + // + // To reference a parameter stored in the same account: // // - resolve:ssm:parameter-name // @@ -13694,14 +13757,25 @@ type RequestLaunchTemplateData struct { // // - resolve:ssm:parameter-name:label // - // - resolve:ssm:public-parameter + // To reference a parameter shared from another Amazon Web Services account: // - // Currently, EC2 Fleet and Spot Fleet do not support specifying a Systems Manager - // parameter. If the launch template will be used by an EC2 Fleet or Spot Fleet, - // you must specify the AMI ID. + // - resolve:ssm:parameter-ARN + // + // - resolve:ssm:parameter-ARN:version-number + // + // - resolve:ssm:parameter-ARN:label // // For more information, see [Use a Systems Manager parameter instead of an AMI ID] in the Amazon EC2 User Guide. // + // If the launch template will be used for an EC2 Fleet or Spot Fleet, note the + // following: + // + // - Only EC2 Fleets of type instant support specifying a Systems Manager + // parameter. + // + // - For EC2 Fleets of type maintain or request , or for Spot Fleets, you must + // specify the AMI ID. + // // [Use a Systems Manager parameter instead of an AMI ID]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-launch-template.html#use-an-ssm-parameter-instead-of-an-ami-id ImageId *string diff --git a/service/ecr/api_op_CreatePullThroughCacheRule.go b/service/ecr/api_op_CreatePullThroughCacheRule.go index 3fe0410484e..fe51119cc08 100644 --- a/service/ecr/api_op_CreatePullThroughCacheRule.go +++ b/service/ecr/api_op_CreatePullThroughCacheRule.go @@ -57,9 +57,6 @@ type CreatePullThroughCacheRuleInput struct { // - Microsoft Azure Container Registry ( azure-container-registry ) - // .azurecr.io // - // - GitLab Container Registry ( gitlab-container-registry ) - - // registry.gitlab.com - // // This member is required. UpstreamRegistryUrl *string diff --git a/service/ecr/api_op_CreateRepositoryCreationTemplate.go b/service/ecr/api_op_CreateRepositoryCreationTemplate.go new file mode 100644 index 00000000000..b5d432fcf5d --- /dev/null +++ b/service/ecr/api_op_CreateRepositoryCreationTemplate.go @@ -0,0 +1,199 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ecr + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ecr/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a repository creation template. This template is used to define the +// settings for repositories created by Amazon ECR on your behalf. For example, +// repositories created through pull through cache actions. For more information, +// see [Private repository creation templates]in the Amazon Elastic Container Registry User Guide. +// +// [Private repository creation templates]: https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-creation-templates.html +func (c *Client) CreateRepositoryCreationTemplate(ctx context.Context, params *CreateRepositoryCreationTemplateInput, optFns ...func(*Options)) (*CreateRepositoryCreationTemplateOutput, error) { + if params == nil { + params = &CreateRepositoryCreationTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateRepositoryCreationTemplate", params, optFns, c.addOperationCreateRepositoryCreationTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateRepositoryCreationTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateRepositoryCreationTemplateInput struct { + + // A list of enumerable strings representing the Amazon ECR repository creation + // scenarios that this template will apply towards. The two supported scenarios are + // PULL_THROUGH_CACHE and REPLICATION + // + // This member is required. + AppliedFor []types.RCTAppliedFor + + // The repository namespace prefix to associate with the template. All + // repositories created using this namespace prefix will have the settings defined + // in this template applied. For example, a prefix of prod would apply to all + // repositories beginning with prod/ . Similarly, a prefix of prod/team would + // apply to all repositories beginning with prod/team/ . + // + // To apply a template to all repositories in your registry that don't have an + // associated creation template, you can use ROOT as the prefix. + // + // There is always an assumed / applied to the end of the prefix. If you specify + // ecr-public as the prefix, Amazon ECR treats that as ecr-public/ . When using a + // pull through cache rule, the repository prefix you specify during rule creation + // is what you should specify as your repository creation template prefix as well. + // + // This member is required. + Prefix *string + + // The ARN of the role to be assumed by Amazon ECR. This role must be in the same + // account as the registry that you are configuring. + CustomRoleArn *string + + // A description for the repository creation template. + Description *string + + // The encryption configuration to use for repositories created using the template. + EncryptionConfiguration *types.EncryptionConfigurationForRepositoryCreationTemplate + + // The tag mutability setting for the repository. If this parameter is omitted, + // the default setting of MUTABLE will be used which will allow image tags to be + // overwritten. If IMMUTABLE is specified, all image tags within the repository + // will be immutable which will prevent them from being overwritten. + ImageTagMutability types.ImageTagMutability + + // The lifecycle policy to use for repositories created using the template. + LifecyclePolicy *string + + // The repository policy to apply to repositories created using the template. A + // repository policy is a permissions policy associated with a repository to + // control access permissions. + RepositoryPolicy *string + + // The metadata to apply to the repository to help you categorize and organize. + // Each tag consists of a key and an optional value, both of which you define. Tag + // keys can have a maximum character length of 128 characters, and tag values can + // have a maximum length of 256 characters. + ResourceTags []types.Tag + + noSmithyDocumentSerde +} + +type CreateRepositoryCreationTemplateOutput struct { + + // The registry ID associated with the request. + RegistryId *string + + // The details of the repository creation template associated with the request. + RepositoryCreationTemplate *types.RepositoryCreationTemplate + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateRepositoryCreationTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateRepositoryCreationTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateRepositoryCreationTemplate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateRepositoryCreationTemplate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateRepositoryCreationTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRepositoryCreationTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateRepositoryCreationTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateRepositoryCreationTemplate", + } +} diff --git a/service/ecr/api_op_DeleteRepositoryCreationTemplate.go b/service/ecr/api_op_DeleteRepositoryCreationTemplate.go new file mode 100644 index 00000000000..ce31696db47 --- /dev/null +++ b/service/ecr/api_op_DeleteRepositoryCreationTemplate.go @@ -0,0 +1,146 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ecr + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ecr/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a repository creation template. +func (c *Client) DeleteRepositoryCreationTemplate(ctx context.Context, params *DeleteRepositoryCreationTemplateInput, optFns ...func(*Options)) (*DeleteRepositoryCreationTemplateOutput, error) { + if params == nil { + params = &DeleteRepositoryCreationTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteRepositoryCreationTemplate", params, optFns, c.addOperationDeleteRepositoryCreationTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteRepositoryCreationTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteRepositoryCreationTemplateInput struct { + + // The repository namespace prefix associated with the repository creation + // template. + // + // This member is required. + Prefix *string + + noSmithyDocumentSerde +} + +type DeleteRepositoryCreationTemplateOutput struct { + + // The registry ID associated with the request. + RegistryId *string + + // The details of the repository creation template that was deleted. + RepositoryCreationTemplate *types.RepositoryCreationTemplate + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteRepositoryCreationTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteRepositoryCreationTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteRepositoryCreationTemplate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteRepositoryCreationTemplate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteRepositoryCreationTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRepositoryCreationTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteRepositoryCreationTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteRepositoryCreationTemplate", + } +} diff --git a/service/ecr/api_op_DescribeRegistry.go b/service/ecr/api_op_DescribeRegistry.go index 88c0baa5ed6..81987e18b38 100644 --- a/service/ecr/api_op_DescribeRegistry.go +++ b/service/ecr/api_op_DescribeRegistry.go @@ -34,7 +34,7 @@ type DescribeRegistryInput struct { type DescribeRegistryOutput struct { - // The ID of the registry. + // The registry ID associated with the request. RegistryId *string // The replication configuration for the registry. diff --git a/service/ecr/api_op_DescribeRepositoryCreationTemplates.go b/service/ecr/api_op_DescribeRepositoryCreationTemplates.go new file mode 100644 index 00000000000..e289ba1c04f --- /dev/null +++ b/service/ecr/api_op_DescribeRepositoryCreationTemplates.go @@ -0,0 +1,275 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ecr + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ecr/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns details about the repository creation templates in a registry. The +// prefixes request parameter can be used to return the details for a specific +// repository creation template. +func (c *Client) DescribeRepositoryCreationTemplates(ctx context.Context, params *DescribeRepositoryCreationTemplatesInput, optFns ...func(*Options)) (*DescribeRepositoryCreationTemplatesOutput, error) { + if params == nil { + params = &DescribeRepositoryCreationTemplatesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeRepositoryCreationTemplates", params, optFns, c.addOperationDescribeRepositoryCreationTemplatesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeRepositoryCreationTemplatesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeRepositoryCreationTemplatesInput struct { + + // The maximum number of repository results returned by + // DescribeRepositoryCreationTemplatesRequest in paginated output. When this + // parameter is used, DescribeRepositoryCreationTemplatesRequest only returns + // maxResults results in a single page along with a nextToken response element. + // The remaining results of the initial request can be seen by sending another + // DescribeRepositoryCreationTemplatesRequest request with the returned nextToken + // value. This value can be between 1 and 1000. If this parameter is not used, then + // DescribeRepositoryCreationTemplatesRequest returns up to 100 results and a + // nextToken value, if applicable. + MaxResults *int32 + + // The nextToken value returned from a previous paginated + // DescribeRepositoryCreationTemplates 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 value is null + // when there are no more results to return. + // + // This token should be treated as an opaque identifier that is only used to + // retrieve the next items in a list and not for other programmatic purposes. + NextToken *string + + // The repository namespace prefixes associated with the repository creation + // templates to describe. If this value is not specified, all repository creation + // templates are returned. + Prefixes []string + + noSmithyDocumentSerde +} + +type DescribeRepositoryCreationTemplatesOutput struct { + + // The nextToken value to include in a future DescribeRepositoryCreationTemplates + // request. When the results of a DescribeRepositoryCreationTemplates request + // exceed maxResults , this value can be used to retrieve the next page of results. + // This value is null when there are no more results to return. + NextToken *string + + // The registry ID associated with the request. + RegistryId *string + + // The details of the repository creation templates. + RepositoryCreationTemplates []types.RepositoryCreationTemplate + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeRepositoryCreationTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeRepositoryCreationTemplates{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeRepositoryCreationTemplates{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeRepositoryCreationTemplates"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRepositoryCreationTemplates(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// DescribeRepositoryCreationTemplatesPaginatorOptions is the paginator options +// for DescribeRepositoryCreationTemplates +type DescribeRepositoryCreationTemplatesPaginatorOptions struct { + // The maximum number of repository results returned by + // DescribeRepositoryCreationTemplatesRequest in paginated output. When this + // parameter is used, DescribeRepositoryCreationTemplatesRequest only returns + // maxResults results in a single page along with a nextToken response element. + // The remaining results of the initial request can be seen by sending another + // DescribeRepositoryCreationTemplatesRequest request with the returned nextToken + // value. This value can be between 1 and 1000. If this parameter is not used, then + // DescribeRepositoryCreationTemplatesRequest 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 +} + +// DescribeRepositoryCreationTemplatesPaginator is a paginator for +// DescribeRepositoryCreationTemplates +type DescribeRepositoryCreationTemplatesPaginator struct { + options DescribeRepositoryCreationTemplatesPaginatorOptions + client DescribeRepositoryCreationTemplatesAPIClient + params *DescribeRepositoryCreationTemplatesInput + nextToken *string + firstPage bool +} + +// NewDescribeRepositoryCreationTemplatesPaginator returns a new +// DescribeRepositoryCreationTemplatesPaginator +func NewDescribeRepositoryCreationTemplatesPaginator(client DescribeRepositoryCreationTemplatesAPIClient, params *DescribeRepositoryCreationTemplatesInput, optFns ...func(*DescribeRepositoryCreationTemplatesPaginatorOptions)) *DescribeRepositoryCreationTemplatesPaginator { + if params == nil { + params = &DescribeRepositoryCreationTemplatesInput{} + } + + options := DescribeRepositoryCreationTemplatesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeRepositoryCreationTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeRepositoryCreationTemplatesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeRepositoryCreationTemplates page. +func (p *DescribeRepositoryCreationTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRepositoryCreationTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeRepositoryCreationTemplates(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 +} + +// DescribeRepositoryCreationTemplatesAPIClient is a client that implements the +// DescribeRepositoryCreationTemplates operation. +type DescribeRepositoryCreationTemplatesAPIClient interface { + DescribeRepositoryCreationTemplates(context.Context, *DescribeRepositoryCreationTemplatesInput, ...func(*Options)) (*DescribeRepositoryCreationTemplatesOutput, error) +} + +var _ DescribeRepositoryCreationTemplatesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeRepositoryCreationTemplates(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeRepositoryCreationTemplates", + } +} diff --git a/service/ecr/api_op_GetRegistryPolicy.go b/service/ecr/api_op_GetRegistryPolicy.go index 1fdbfd743db..467c684a036 100644 --- a/service/ecr/api_op_GetRegistryPolicy.go +++ b/service/ecr/api_op_GetRegistryPolicy.go @@ -35,7 +35,7 @@ type GetRegistryPolicyOutput struct { // The JSON text of the permissions policy for a registry. PolicyText *string - // The ID of the registry. + // The registry ID associated with the request. RegistryId *string // Metadata pertaining to the operation's result. diff --git a/service/ecr/api_op_GetRegistryScanningConfiguration.go b/service/ecr/api_op_GetRegistryScanningConfiguration.go index 743da7f8daf..cf5db624222 100644 --- a/service/ecr/api_op_GetRegistryScanningConfiguration.go +++ b/service/ecr/api_op_GetRegistryScanningConfiguration.go @@ -33,7 +33,7 @@ type GetRegistryScanningConfigurationInput struct { type GetRegistryScanningConfigurationOutput struct { - // The ID of the registry. + // The registry ID associated with the request. RegistryId *string // The scanning configuration for the registry. diff --git a/service/ecr/api_op_PutRegistryPolicy.go b/service/ecr/api_op_PutRegistryPolicy.go index 9cd55177cf6..8d98f1794dc 100644 --- a/service/ecr/api_op_PutRegistryPolicy.go +++ b/service/ecr/api_op_PutRegistryPolicy.go @@ -51,7 +51,7 @@ type PutRegistryPolicyOutput struct { // The JSON policy text for your registry. PolicyText *string - // The registry ID. + // The registry ID associated with the request. RegistryId *string // Metadata pertaining to the operation's result. diff --git a/service/ecr/api_op_PutReplicationConfiguration.go b/service/ecr/api_op_PutReplicationConfiguration.go index ecf1447268b..9313077aadf 100644 --- a/service/ecr/api_op_PutReplicationConfiguration.go +++ b/service/ecr/api_op_PutReplicationConfiguration.go @@ -16,11 +16,13 @@ import ( // action. The first time the PutReplicationConfiguration API is called, a // service-linked IAM role is created in your account for the replication process. // For more information, see [Using service-linked roles for Amazon ECR]in the Amazon Elastic Container Registry User Guide. +// For more information on the custom role for replication, see [Creating an IAM role for replication]. // // When configuring cross-account replication, the destination account must grant // the source account permission to replicate. This permission is controlled using // a registry permissions policy. For more information, see PutRegistryPolicy. // +// [Creating an IAM role for replication]: https://docs.aws.amazon.com/AmazonECR/latest/userguide/replication-creation-templates.html#roles-creatingrole-user-console // [Using service-linked roles for Amazon ECR]: https://docs.aws.amazon.com/AmazonECR/latest/userguide/using-service-linked-roles.html func (c *Client) PutReplicationConfiguration(ctx context.Context, params *PutReplicationConfigurationInput, optFns ...func(*Options)) (*PutReplicationConfigurationOutput, error) { if params == nil { diff --git a/service/ecr/api_op_UpdateRepositoryCreationTemplate.go b/service/ecr/api_op_UpdateRepositoryCreationTemplate.go new file mode 100644 index 00000000000..92360bf09ac --- /dev/null +++ b/service/ecr/api_op_UpdateRepositoryCreationTemplate.go @@ -0,0 +1,188 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ecr + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ecr/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates an existing repository creation template. +func (c *Client) UpdateRepositoryCreationTemplate(ctx context.Context, params *UpdateRepositoryCreationTemplateInput, optFns ...func(*Options)) (*UpdateRepositoryCreationTemplateOutput, error) { + if params == nil { + params = &UpdateRepositoryCreationTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateRepositoryCreationTemplate", params, optFns, c.addOperationUpdateRepositoryCreationTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateRepositoryCreationTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateRepositoryCreationTemplateInput struct { + + // The repository namespace prefix that matches an existing repository creation + // template in the registry. All repositories created using this namespace prefix + // will have the settings defined in this template applied. For example, a prefix + // of prod would apply to all repositories beginning with prod/ . This includes a + // repository named prod/team1 as well as a repository named prod/repository1 . + // + // To apply a template to all repositories in your registry that don't have an + // associated creation template, you can use ROOT as the prefix. + // + // This member is required. + Prefix *string + + // Updates the list of enumerable strings representing the Amazon ECR repository + // creation scenarios that this template will apply towards. The two supported + // scenarios are PULL_THROUGH_CACHE and REPLICATION + AppliedFor []types.RCTAppliedFor + + // The ARN of the role to be assumed by Amazon ECR. This role must be in the same + // account as the registry that you are configuring. + CustomRoleArn *string + + // A description for the repository creation template. + Description *string + + // The encryption configuration to associate with the repository creation template. + EncryptionConfiguration *types.EncryptionConfigurationForRepositoryCreationTemplate + + // Updates the tag mutability setting for the repository. If this parameter is + // omitted, the default setting of MUTABLE will be used which will allow image + // tags to be overwritten. If IMMUTABLE is specified, all image tags within the + // repository will be immutable which will prevent them from being overwritten. + ImageTagMutability types.ImageTagMutability + + // Updates the lifecycle policy associated with the specified repository creation + // template. + LifecyclePolicy *string + + // Updates the repository policy created using the template. A repository policy + // is a permissions policy associated with a repository to control access + // permissions. + RepositoryPolicy *string + + // The metadata to apply to the repository to help you categorize and organize. + // Each tag consists of a key and an optional value, both of which you define. Tag + // keys can have a maximum character length of 128 characters, and tag values can + // have a maximum length of 256 characters. + ResourceTags []types.Tag + + noSmithyDocumentSerde +} + +type UpdateRepositoryCreationTemplateOutput struct { + + // The registry ID associated with the request. + RegistryId *string + + // The details of the repository creation template associated with the request. + RepositoryCreationTemplate *types.RepositoryCreationTemplate + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateRepositoryCreationTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateRepositoryCreationTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateRepositoryCreationTemplate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateRepositoryCreationTemplate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateRepositoryCreationTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRepositoryCreationTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateRepositoryCreationTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateRepositoryCreationTemplate", + } +} diff --git a/service/ecr/deserializers.go b/service/ecr/deserializers.go index 82cd45867fa..6383d4ce6ba 100644 --- a/service/ecr/deserializers.go +++ b/service/ecr/deserializers.go @@ -877,6 +877,125 @@ func awsAwsjson11_deserializeOpErrorCreateRepository(response *smithyhttp.Respon } } +type awsAwsjson11_deserializeOpCreateRepositoryCreationTemplate struct { +} + +func (*awsAwsjson11_deserializeOpCreateRepositoryCreationTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateRepositoryCreationTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateRepositoryCreationTemplate(response, &metadata) + } + output := &CreateRepositoryCreationTemplateOutput{} + 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_deserializeOpDocumentCreateRepositoryCreationTemplateOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorCreateRepositoryCreationTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsAwsjson11_deserializeErrorServerException(response, errorBody) + + case strings.EqualFold("TemplateAlreadyExistsException", errorCode): + return awsAwsjson11_deserializeErrorTemplateAlreadyExistsException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDeleteLifecyclePolicy struct { } @@ -1347,6 +1466,122 @@ func awsAwsjson11_deserializeOpErrorDeleteRepository(response *smithyhttp.Respon } } +type awsAwsjson11_deserializeOpDeleteRepositoryCreationTemplate struct { +} + +func (*awsAwsjson11_deserializeOpDeleteRepositoryCreationTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteRepositoryCreationTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteRepositoryCreationTemplate(response, &metadata) + } + output := &DeleteRepositoryCreationTemplateOutput{} + 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_deserializeOpDocumentDeleteRepositoryCreationTemplateOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorDeleteRepositoryCreationTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsAwsjson11_deserializeErrorServerException(response, errorBody) + + case strings.EqualFold("TemplateNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorTemplateNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDeleteRepositoryPolicy struct { } @@ -2162,6 +2397,119 @@ func awsAwsjson11_deserializeOpErrorDescribeRepositories(response *smithyhttp.Re } } +type awsAwsjson11_deserializeOpDescribeRepositoryCreationTemplates struct { +} + +func (*awsAwsjson11_deserializeOpDescribeRepositoryCreationTemplates) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDescribeRepositoryCreationTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDescribeRepositoryCreationTemplates(response, &metadata) + } + output := &DescribeRepositoryCreationTemplatesOutput{} + 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_deserializeOpDocumentDescribeRepositoryCreationTemplatesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorDescribeRepositoryCreationTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsAwsjson11_deserializeErrorServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpGetAuthorizationToken struct { } @@ -4860,6 +5208,122 @@ func awsAwsjson11_deserializeOpErrorUpdatePullThroughCacheRule(response *smithyh } } +type awsAwsjson11_deserializeOpUpdateRepositoryCreationTemplate struct { +} + +func (*awsAwsjson11_deserializeOpUpdateRepositoryCreationTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateRepositoryCreationTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateRepositoryCreationTemplate(response, &metadata) + } + output := &UpdateRepositoryCreationTemplateOutput{} + 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_deserializeOpDocumentUpdateRepositoryCreationTemplateOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorUpdateRepositoryCreationTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsAwsjson11_deserializeErrorServerException(response, errorBody) + + case strings.EqualFold("TemplateNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorTemplateNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpUploadLayerPart struct { } @@ -5801,7 +6265,77 @@ func awsAwsjson11_deserializeErrorPullThroughCacheRuleNotFoundException(response return output } -func awsAwsjson11_deserializeErrorReferencedImagesNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorReferencedImagesNotFoundException(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.ReferencedImagesNotFoundException{} + err := awsAwsjson11_deserializeDocumentReferencedImagesNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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_deserializeErrorRegistryPolicyNotFoundException(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.RegistryPolicyNotFoundException{} + err := awsAwsjson11_deserializeDocumentRegistryPolicyNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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_deserializeErrorRepositoryAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -5819,8 +6353,8 @@ func awsAwsjson11_deserializeErrorReferencedImagesNotFoundException(response *sm return err } - output := &types.ReferencedImagesNotFoundException{} - err := awsAwsjson11_deserializeDocumentReferencedImagesNotFoundException(&output, shape) + output := &types.RepositoryAlreadyExistsException{} + err := awsAwsjson11_deserializeDocumentRepositoryAlreadyExistsException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -5836,7 +6370,7 @@ func awsAwsjson11_deserializeErrorReferencedImagesNotFoundException(response *sm return output } -func awsAwsjson11_deserializeErrorRegistryPolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorRepositoryNotEmptyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -5854,8 +6388,8 @@ func awsAwsjson11_deserializeErrorRegistryPolicyNotFoundException(response *smit return err } - output := &types.RegistryPolicyNotFoundException{} - err := awsAwsjson11_deserializeDocumentRegistryPolicyNotFoundException(&output, shape) + output := &types.RepositoryNotEmptyException{} + err := awsAwsjson11_deserializeDocumentRepositoryNotEmptyException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -5871,7 +6405,7 @@ func awsAwsjson11_deserializeErrorRegistryPolicyNotFoundException(response *smit return output } -func awsAwsjson11_deserializeErrorRepositoryAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorRepositoryNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -5889,8 +6423,8 @@ func awsAwsjson11_deserializeErrorRepositoryAlreadyExistsException(response *smi return err } - output := &types.RepositoryAlreadyExistsException{} - err := awsAwsjson11_deserializeDocumentRepositoryAlreadyExistsException(&output, shape) + output := &types.RepositoryNotFoundException{} + err := awsAwsjson11_deserializeDocumentRepositoryNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -5906,7 +6440,7 @@ func awsAwsjson11_deserializeErrorRepositoryAlreadyExistsException(response *smi return output } -func awsAwsjson11_deserializeErrorRepositoryNotEmptyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorRepositoryPolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -5924,8 +6458,8 @@ func awsAwsjson11_deserializeErrorRepositoryNotEmptyException(response *smithyht return err } - output := &types.RepositoryNotEmptyException{} - err := awsAwsjson11_deserializeDocumentRepositoryNotEmptyException(&output, shape) + output := &types.RepositoryPolicyNotFoundException{} + err := awsAwsjson11_deserializeDocumentRepositoryPolicyNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -5941,7 +6475,7 @@ func awsAwsjson11_deserializeErrorRepositoryNotEmptyException(response *smithyht return output } -func awsAwsjson11_deserializeErrorRepositoryNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorScanNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -5959,8 +6493,8 @@ func awsAwsjson11_deserializeErrorRepositoryNotFoundException(response *smithyht return err } - output := &types.RepositoryNotFoundException{} - err := awsAwsjson11_deserializeDocumentRepositoryNotFoundException(&output, shape) + output := &types.ScanNotFoundException{} + err := awsAwsjson11_deserializeDocumentScanNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -5976,7 +6510,7 @@ func awsAwsjson11_deserializeErrorRepositoryNotFoundException(response *smithyht return output } -func awsAwsjson11_deserializeErrorRepositoryPolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorSecretNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -5994,8 +6528,8 @@ func awsAwsjson11_deserializeErrorRepositoryPolicyNotFoundException(response *sm return err } - output := &types.RepositoryPolicyNotFoundException{} - err := awsAwsjson11_deserializeDocumentRepositoryPolicyNotFoundException(&output, shape) + output := &types.SecretNotFoundException{} + err := awsAwsjson11_deserializeDocumentSecretNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6011,7 +6545,7 @@ func awsAwsjson11_deserializeErrorRepositoryPolicyNotFoundException(response *sm return output } -func awsAwsjson11_deserializeErrorScanNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6029,8 +6563,8 @@ func awsAwsjson11_deserializeErrorScanNotFoundException(response *smithyhttp.Res return err } - output := &types.ScanNotFoundException{} - err := awsAwsjson11_deserializeDocumentScanNotFoundException(&output, shape) + output := &types.ServerException{} + err := awsAwsjson11_deserializeDocumentServerException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6046,7 +6580,7 @@ func awsAwsjson11_deserializeErrorScanNotFoundException(response *smithyhttp.Res return output } -func awsAwsjson11_deserializeErrorSecretNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorTemplateAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6064,8 +6598,8 @@ func awsAwsjson11_deserializeErrorSecretNotFoundException(response *smithyhttp.R return err } - output := &types.SecretNotFoundException{} - err := awsAwsjson11_deserializeDocumentSecretNotFoundException(&output, shape) + output := &types.TemplateAlreadyExistsException{} + err := awsAwsjson11_deserializeDocumentTemplateAlreadyExistsException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6081,7 +6615,7 @@ func awsAwsjson11_deserializeErrorSecretNotFoundException(response *smithyhttp.R return output } -func awsAwsjson11_deserializeErrorServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorTemplateNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6099,8 +6633,8 @@ func awsAwsjson11_deserializeErrorServerException(response *smithyhttp.Response, return err } - output := &types.ServerException{} - err := awsAwsjson11_deserializeDocumentServerException(&output, shape) + output := &types.TemplateNotFoundException{} + err := awsAwsjson11_deserializeDocumentTemplateNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -7114,6 +7648,55 @@ func awsAwsjson11_deserializeDocumentEncryptionConfiguration(v **types.Encryptio return nil } +func awsAwsjson11_deserializeDocumentEncryptionConfigurationForRepositoryCreationTemplate(v **types.EncryptionConfigurationForRepositoryCreationTemplate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EncryptionConfigurationForRepositoryCreationTemplate + if *v == nil { + sv = &types.EncryptionConfigurationForRepositoryCreationTemplate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "encryptionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EncryptionType to be of type string, got %T instead", value) + } + sv.EncryptionType = types.EncryptionType(jtv) + } + + case "kmsKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyForRepositoryCreationTemplate to be of type string, got %T instead", value) + } + sv.KmsKey = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentEnhancedImageScanFinding(v **types.EnhancedImageScanFinding, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9809,6 +10392,42 @@ func awsAwsjson11_deserializeDocumentPullThroughCacheRuleNotFoundException(v **t return nil } +func awsAwsjson11_deserializeDocumentRCTAppliedForList(v *[]types.RCTAppliedFor, 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.RCTAppliedFor + if *v == nil { + cv = []types.RCTAppliedFor{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RCTAppliedFor + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RCTAppliedFor to be of type string, got %T instead", value) + } + col = types.RCTAppliedFor(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentRecommendation(v **types.Recommendation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10502,7 +11121,173 @@ func awsAwsjson11_deserializeDocumentRepositoryAlreadyExistsException(v **types. } } - *v = sv + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRepositoryCreationTemplate(v **types.RepositoryCreationTemplate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RepositoryCreationTemplate + if *v == nil { + sv = &types.RepositoryCreationTemplate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "appliedFor": + if err := awsAwsjson11_deserializeDocumentRCTAppliedForList(&sv.AppliedFor, 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 Date to be a JSON Number, got %T instead", value) + + } + } + + case "customRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomRoleArn to be of type string, got %T instead", value) + } + sv.CustomRoleArn = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RepositoryTemplateDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "encryptionConfiguration": + if err := awsAwsjson11_deserializeDocumentEncryptionConfigurationForRepositoryCreationTemplate(&sv.EncryptionConfiguration, value); err != nil { + return err + } + + case "imageTagMutability": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageTagMutability to be of type string, got %T instead", value) + } + sv.ImageTagMutability = types.ImageTagMutability(jtv) + } + + case "lifecyclePolicy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LifecyclePolicyTextForRepositoryCreationTemplate to be of type string, got %T instead", value) + } + sv.LifecyclePolicy = ptr.String(jtv) + } + + case "prefix": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Prefix to be of type string, got %T instead", value) + } + sv.Prefix = ptr.String(jtv) + } + + case "repositoryPolicy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RepositoryPolicyText to be of type string, got %T instead", value) + } + sv.RepositoryPolicy = ptr.String(jtv) + } + + case "resourceTags": + if err := awsAwsjson11_deserializeDocumentTagList(&sv.ResourceTags, 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 Date to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRepositoryCreationTemplateList(v *[]types.RepositoryCreationTemplate, 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.RepositoryCreationTemplate + if *v == nil { + cv = []types.RepositoryCreationTemplate{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RepositoryCreationTemplate + destAddr := &col + if err := awsAwsjson11_deserializeDocumentRepositoryCreationTemplate(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv return nil } @@ -11428,6 +12213,86 @@ func awsAwsjson11_deserializeDocumentTags(v *map[string]string, value interface{ return nil } +func awsAwsjson11_deserializeDocumentTemplateAlreadyExistsException(v **types.TemplateAlreadyExistsException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TemplateAlreadyExistsException + if *v == nil { + sv = &types.TemplateAlreadyExistsException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentTemplateNotFoundException(v **types.TemplateNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TemplateNotFoundException + if *v == nil { + sv = &types.TemplateNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12252,6 +13117,51 @@ func awsAwsjson11_deserializeOpDocumentCreatePullThroughCacheRuleOutput(v **Crea return nil } +func awsAwsjson11_deserializeOpDocumentCreateRepositoryCreationTemplateOutput(v **CreateRepositoryCreationTemplateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateRepositoryCreationTemplateOutput + if *v == nil { + sv = &CreateRepositoryCreationTemplateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "registryId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value) + } + sv.RegistryId = ptr.String(jtv) + } + + case "repositoryCreationTemplate": + if err := awsAwsjson11_deserializeDocumentRepositoryCreationTemplate(&sv.RepositoryCreationTemplate, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCreateRepositoryOutput(v **CreateRepositoryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12494,6 +13404,51 @@ func awsAwsjson11_deserializeOpDocumentDeleteRegistryPolicyOutput(v **DeleteRegi return nil } +func awsAwsjson11_deserializeOpDocumentDeleteRepositoryCreationTemplateOutput(v **DeleteRepositoryCreationTemplateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteRepositoryCreationTemplateOutput + if *v == nil { + sv = &DeleteRepositoryCreationTemplateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "registryId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value) + } + sv.RegistryId = ptr.String(jtv) + } + + case "repositoryCreationTemplate": + if err := awsAwsjson11_deserializeDocumentRepositoryCreationTemplate(&sv.RepositoryCreationTemplate, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDeleteRepositoryOutput(v **DeleteRepositoryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12891,6 +13846,60 @@ func awsAwsjson11_deserializeOpDocumentDescribeRepositoriesOutput(v **DescribeRe return nil } +func awsAwsjson11_deserializeOpDocumentDescribeRepositoryCreationTemplatesOutput(v **DescribeRepositoryCreationTemplatesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeRepositoryCreationTemplatesOutput + if *v == nil { + sv = &DescribeRepositoryCreationTemplatesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "registryId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value) + } + sv.RegistryId = ptr.String(jtv) + } + + case "repositoryCreationTemplates": + if err := awsAwsjson11_deserializeDocumentRepositoryCreationTemplateList(&sv.RepositoryCreationTemplates, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentGetAuthorizationTokenOutput(v **GetAuthorizationTokenOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14069,6 +15078,51 @@ func awsAwsjson11_deserializeOpDocumentUpdatePullThroughCacheRuleOutput(v **Upda return nil } +func awsAwsjson11_deserializeOpDocumentUpdateRepositoryCreationTemplateOutput(v **UpdateRepositoryCreationTemplateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateRepositoryCreationTemplateOutput + if *v == nil { + sv = &UpdateRepositoryCreationTemplateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "registryId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value) + } + sv.RegistryId = ptr.String(jtv) + } + + case "repositoryCreationTemplate": + if err := awsAwsjson11_deserializeDocumentRepositoryCreationTemplate(&sv.RepositoryCreationTemplate, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUploadLayerPartOutput(v **UploadLayerPartOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ecr/generated.json b/service/ecr/generated.json index 2e7e94262bf..3059a5eab59 100644 --- a/service/ecr/generated.json +++ b/service/ecr/generated.json @@ -16,10 +16,12 @@ "api_op_CompleteLayerUpload.go", "api_op_CreatePullThroughCacheRule.go", "api_op_CreateRepository.go", + "api_op_CreateRepositoryCreationTemplate.go", "api_op_DeleteLifecyclePolicy.go", "api_op_DeletePullThroughCacheRule.go", "api_op_DeleteRegistryPolicy.go", "api_op_DeleteRepository.go", + "api_op_DeleteRepositoryCreationTemplate.go", "api_op_DeleteRepositoryPolicy.go", "api_op_DescribeImageReplicationStatus.go", "api_op_DescribeImageScanFindings.go", @@ -27,6 +29,7 @@ "api_op_DescribePullThroughCacheRules.go", "api_op_DescribeRegistry.go", "api_op_DescribeRepositories.go", + "api_op_DescribeRepositoryCreationTemplates.go", "api_op_GetAuthorizationToken.go", "api_op_GetDownloadUrlForLayer.go", "api_op_GetLifecyclePolicy.go", @@ -50,6 +53,7 @@ "api_op_TagResource.go", "api_op_UntagResource.go", "api_op_UpdatePullThroughCacheRule.go", + "api_op_UpdateRepositoryCreationTemplate.go", "api_op_UploadLayerPart.go", "api_op_ValidatePullThroughCacheRule.go", "auth.go", diff --git a/service/ecr/serializers.go b/service/ecr/serializers.go index fbeb274d4e0..143c9e7e922 100644 --- a/service/ecr/serializers.go +++ b/service/ecr/serializers.go @@ -400,6 +400,61 @@ func (m *awsAwsjson11_serializeOpCreateRepository) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpCreateRepositoryCreationTemplate struct { +} + +func (*awsAwsjson11_serializeOpCreateRepositoryCreationTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateRepositoryCreationTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateRepositoryCreationTemplateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonEC2ContainerRegistry_V20150921.CreateRepositoryCreationTemplate") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateRepositoryCreationTemplateInput(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_serializeOpDeleteLifecyclePolicy struct { } @@ -620,6 +675,61 @@ func (m *awsAwsjson11_serializeOpDeleteRepository) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteRepositoryCreationTemplate struct { +} + +func (*awsAwsjson11_serializeOpDeleteRepositoryCreationTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteRepositoryCreationTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteRepositoryCreationTemplateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonEC2ContainerRegistry_V20150921.DeleteRepositoryCreationTemplate") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteRepositoryCreationTemplateInput(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_serializeOpDeleteRepositoryPolicy struct { } @@ -1005,6 +1115,61 @@ func (m *awsAwsjson11_serializeOpDescribeRepositories) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDescribeRepositoryCreationTemplates struct { +} + +func (*awsAwsjson11_serializeOpDescribeRepositoryCreationTemplates) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeRepositoryCreationTemplates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeRepositoryCreationTemplatesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonEC2ContainerRegistry_V20150921.DescribeRepositoryCreationTemplates") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeRepositoryCreationTemplatesInput(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_serializeOpGetAuthorizationToken struct { } @@ -2270,6 +2435,61 @@ func (m *awsAwsjson11_serializeOpUpdatePullThroughCacheRule) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpUpdateRepositoryCreationTemplate struct { +} + +func (*awsAwsjson11_serializeOpUpdateRepositoryCreationTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateRepositoryCreationTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateRepositoryCreationTemplateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonEC2ContainerRegistry_V20150921.UpdateRepositoryCreationTemplate") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateRepositoryCreationTemplateInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpUploadLayerPart struct { } @@ -2419,6 +2639,23 @@ func awsAwsjson11_serializeDocumentEncryptionConfiguration(v *types.EncryptionCo return nil } +func awsAwsjson11_serializeDocumentEncryptionConfigurationForRepositoryCreationTemplate(v *types.EncryptionConfigurationForRepositoryCreationTemplate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.EncryptionType) > 0 { + ok := object.Key("encryptionType") + ok.String(string(v.EncryptionType)) + } + + if v.KmsKey != nil { + ok := object.Key("kmsKey") + ok.String(*v.KmsKey) + } + + return nil +} + func awsAwsjson11_serializeDocumentGetAuthorizationTokenRegistryIdList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -2518,6 +2755,17 @@ func awsAwsjson11_serializeDocumentMediaTypeList(v []string, value smithyjson.Va return nil } +func awsAwsjson11_serializeDocumentPrefixList(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_serializeDocumentPullThroughCacheRuleRepositoryPrefixList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -2529,6 +2777,17 @@ func awsAwsjson11_serializeDocumentPullThroughCacheRuleRepositoryPrefixList(v [] return nil } +func awsAwsjson11_serializeDocumentRCTAppliedForList(v []types.RCTAppliedFor, 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_serializeDocumentRegistryScanningRule(v *types.RegistryScanningRule, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2916,6 +3175,64 @@ func awsAwsjson11_serializeOpDocumentCreatePullThroughCacheRuleInput(v *CreatePu return nil } +func awsAwsjson11_serializeOpDocumentCreateRepositoryCreationTemplateInput(v *CreateRepositoryCreationTemplateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppliedFor != nil { + ok := object.Key("appliedFor") + if err := awsAwsjson11_serializeDocumentRCTAppliedForList(v.AppliedFor, ok); err != nil { + return err + } + } + + if v.CustomRoleArn != nil { + ok := object.Key("customRoleArn") + ok.String(*v.CustomRoleArn) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.EncryptionConfiguration != nil { + ok := object.Key("encryptionConfiguration") + if err := awsAwsjson11_serializeDocumentEncryptionConfigurationForRepositoryCreationTemplate(v.EncryptionConfiguration, ok); err != nil { + return err + } + } + + if len(v.ImageTagMutability) > 0 { + ok := object.Key("imageTagMutability") + ok.String(string(v.ImageTagMutability)) + } + + if v.LifecyclePolicy != nil { + ok := object.Key("lifecyclePolicy") + ok.String(*v.LifecyclePolicy) + } + + if v.Prefix != nil { + ok := object.Key("prefix") + ok.String(*v.Prefix) + } + + if v.RepositoryPolicy != nil { + ok := object.Key("repositoryPolicy") + ok.String(*v.RepositoryPolicy) + } + + if v.ResourceTags != nil { + ok := object.Key("resourceTags") + if err := awsAwsjson11_serializeDocumentTagList(v.ResourceTags, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCreateRepositoryInput(v *CreateRepositoryInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3000,6 +3317,18 @@ func awsAwsjson11_serializeOpDocumentDeleteRegistryPolicyInput(v *DeleteRegistry return nil } +func awsAwsjson11_serializeOpDocumentDeleteRepositoryCreationTemplateInput(v *DeleteRepositoryCreationTemplateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Prefix != nil { + ok := object.Key("prefix") + ok.String(*v.Prefix) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteRepositoryInput(v *DeleteRepositoryInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3203,6 +3532,30 @@ func awsAwsjson11_serializeOpDocumentDescribeRepositoriesInput(v *DescribeReposi return nil } +func awsAwsjson11_serializeOpDocumentDescribeRepositoryCreationTemplatesInput(v *DescribeRepositoryCreationTemplatesInput, 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.Prefixes != nil { + ok := object.Key("prefixes") + if err := awsAwsjson11_serializeDocumentPrefixList(v.Prefixes, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetAuthorizationTokenInput(v *GetAuthorizationTokenInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3674,6 +4027,64 @@ func awsAwsjson11_serializeOpDocumentUpdatePullThroughCacheRuleInput(v *UpdatePu return nil } +func awsAwsjson11_serializeOpDocumentUpdateRepositoryCreationTemplateInput(v *UpdateRepositoryCreationTemplateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppliedFor != nil { + ok := object.Key("appliedFor") + if err := awsAwsjson11_serializeDocumentRCTAppliedForList(v.AppliedFor, ok); err != nil { + return err + } + } + + if v.CustomRoleArn != nil { + ok := object.Key("customRoleArn") + ok.String(*v.CustomRoleArn) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.EncryptionConfiguration != nil { + ok := object.Key("encryptionConfiguration") + if err := awsAwsjson11_serializeDocumentEncryptionConfigurationForRepositoryCreationTemplate(v.EncryptionConfiguration, ok); err != nil { + return err + } + } + + if len(v.ImageTagMutability) > 0 { + ok := object.Key("imageTagMutability") + ok.String(string(v.ImageTagMutability)) + } + + if v.LifecyclePolicy != nil { + ok := object.Key("lifecyclePolicy") + ok.String(*v.LifecyclePolicy) + } + + if v.Prefix != nil { + ok := object.Key("prefix") + ok.String(*v.Prefix) + } + + if v.RepositoryPolicy != nil { + ok := object.Key("repositoryPolicy") + ok.String(*v.RepositoryPolicy) + } + + if v.ResourceTags != nil { + ok := object.Key("resourceTags") + if err := awsAwsjson11_serializeDocumentTagList(v.ResourceTags, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUploadLayerPartInput(v *UploadLayerPartInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/ecr/snapshot/api_op_CreateRepositoryCreationTemplate.go.snap b/service/ecr/snapshot/api_op_CreateRepositoryCreationTemplate.go.snap new file mode 100644 index 00000000000..2bd14355a91 --- /dev/null +++ b/service/ecr/snapshot/api_op_CreateRepositoryCreationTemplate.go.snap @@ -0,0 +1,36 @@ +CreateRepositoryCreationTemplate + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ecr/snapshot/api_op_DeleteRepositoryCreationTemplate.go.snap b/service/ecr/snapshot/api_op_DeleteRepositoryCreationTemplate.go.snap new file mode 100644 index 00000000000..e033bad2ac2 --- /dev/null +++ b/service/ecr/snapshot/api_op_DeleteRepositoryCreationTemplate.go.snap @@ -0,0 +1,36 @@ +DeleteRepositoryCreationTemplate + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ecr/snapshot/api_op_DescribeRepositoryCreationTemplates.go.snap b/service/ecr/snapshot/api_op_DescribeRepositoryCreationTemplates.go.snap new file mode 100644 index 00000000000..46bbec1f846 --- /dev/null +++ b/service/ecr/snapshot/api_op_DescribeRepositoryCreationTemplates.go.snap @@ -0,0 +1,35 @@ +DescribeRepositoryCreationTemplates + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ecr/snapshot/api_op_UpdateRepositoryCreationTemplate.go.snap b/service/ecr/snapshot/api_op_UpdateRepositoryCreationTemplate.go.snap new file mode 100644 index 00000000000..7d6d274a77a --- /dev/null +++ b/service/ecr/snapshot/api_op_UpdateRepositoryCreationTemplate.go.snap @@ -0,0 +1,36 @@ +UpdateRepositoryCreationTemplate + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ecr/snapshot_test.go b/service/ecr/snapshot_test.go index 9506427f2ab..5c8b6ed7159 100644 --- a/service/ecr/snapshot_test.go +++ b/service/ecr/snapshot_test.go @@ -146,6 +146,18 @@ func TestCheckSnapshot_CreateRepository(t *testing.T) { } } +func TestCheckSnapshot_CreateRepositoryCreationTemplate(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateRepositoryCreationTemplate(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateRepositoryCreationTemplate") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteLifecyclePolicy(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteLifecyclePolicy(context.Background(), nil, func(o *Options) { @@ -194,6 +206,18 @@ func TestCheckSnapshot_DeleteRepository(t *testing.T) { } } +func TestCheckSnapshot_DeleteRepositoryCreationTemplate(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteRepositoryCreationTemplate(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteRepositoryCreationTemplate") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteRepositoryPolicy(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteRepositoryPolicy(context.Background(), nil, func(o *Options) { @@ -278,6 +302,18 @@ func TestCheckSnapshot_DescribeRepositories(t *testing.T) { } } +func TestCheckSnapshot_DescribeRepositoryCreationTemplates(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeRepositoryCreationTemplates(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DescribeRepositoryCreationTemplates") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetAuthorizationToken(t *testing.T) { svc := New(Options{}) _, err := svc.GetAuthorizationToken(context.Background(), nil, func(o *Options) { @@ -554,6 +590,18 @@ func TestCheckSnapshot_UpdatePullThroughCacheRule(t *testing.T) { } } +func TestCheckSnapshot_UpdateRepositoryCreationTemplate(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateRepositoryCreationTemplate(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateRepositoryCreationTemplate") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UploadLayerPart(t *testing.T) { svc := New(Options{}) _, err := svc.UploadLayerPart(context.Background(), nil, func(o *Options) { @@ -661,6 +709,18 @@ func TestUpdateSnapshot_CreateRepository(t *testing.T) { } } +func TestUpdateSnapshot_CreateRepositoryCreationTemplate(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateRepositoryCreationTemplate(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateRepositoryCreationTemplate") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteLifecyclePolicy(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteLifecyclePolicy(context.Background(), nil, func(o *Options) { @@ -709,6 +769,18 @@ func TestUpdateSnapshot_DeleteRepository(t *testing.T) { } } +func TestUpdateSnapshot_DeleteRepositoryCreationTemplate(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteRepositoryCreationTemplate(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteRepositoryCreationTemplate") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteRepositoryPolicy(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteRepositoryPolicy(context.Background(), nil, func(o *Options) { @@ -793,6 +865,18 @@ func TestUpdateSnapshot_DescribeRepositories(t *testing.T) { } } +func TestUpdateSnapshot_DescribeRepositoryCreationTemplates(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeRepositoryCreationTemplates(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DescribeRepositoryCreationTemplates") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetAuthorizationToken(t *testing.T) { svc := New(Options{}) _, err := svc.GetAuthorizationToken(context.Background(), nil, func(o *Options) { @@ -1069,6 +1153,18 @@ func TestUpdateSnapshot_UpdatePullThroughCacheRule(t *testing.T) { } } +func TestUpdateSnapshot_UpdateRepositoryCreationTemplate(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateRepositoryCreationTemplate(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateRepositoryCreationTemplate") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UploadLayerPart(t *testing.T) { svc := New(Options{}) _, err := svc.UploadLayerPart(context.Background(), nil, func(o *Options) { diff --git a/service/ecr/types/enums.go b/service/ecr/types/enums.go index 78d66141a12..d771c3094f7 100644 --- a/service/ecr/types/enums.go +++ b/service/ecr/types/enums.go @@ -181,6 +181,25 @@ func (LifecyclePolicyPreviewStatus) Values() []LifecyclePolicyPreviewStatus { } } +type RCTAppliedFor string + +// Enum values for RCTAppliedFor +const ( + RCTAppliedForReplication RCTAppliedFor = "REPLICATION" + RCTAppliedForPullThroughCache RCTAppliedFor = "PULL_THROUGH_CACHE" +) + +// Values returns all known values for RCTAppliedFor. 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 (RCTAppliedFor) Values() []RCTAppliedFor { + return []RCTAppliedFor{ + "REPLICATION", + "PULL_THROUGH_CACHE", + } +} + type ReplicationStatus string // Enum values for ReplicationStatus diff --git a/service/ecr/types/errors.go b/service/ecr/types/errors.go index 9ad9ce33104..9e1f90cf5f0 100644 --- a/service/ecr/types/errors.go +++ b/service/ecr/types/errors.go @@ -799,6 +799,60 @@ func (e *ServerException) ErrorCode() string { } func (e *ServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } +// The repository creation template already exists. Specify a unique prefix and +// try again. +type TemplateAlreadyExistsException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TemplateAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TemplateAlreadyExistsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TemplateAlreadyExistsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TemplateAlreadyExistsException" + } + return *e.ErrorCodeOverride +} +func (e *TemplateAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified repository creation template can't be found. Verify the registry +// ID and prefix and try again. +type TemplateNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TemplateNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TemplateNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TemplateNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TemplateNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *TemplateNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The list of tags on the repository is over the limit. The maximum number of // tags that can be applied to a repository is 50. type TooManyTagsException struct { diff --git a/service/ecr/types/types.go b/service/ecr/types/types.go index a85a62b8899..b135866d5a6 100644 --- a/service/ecr/types/types.go +++ b/service/ecr/types/types.go @@ -139,7 +139,7 @@ type DescribeImagesFilter struct { // // By default, when no encryption configuration is set or the AES256 encryption // type is used, Amazon ECR uses server-side encryption with Amazon S3-managed -// encryption keys which encrypts your data at rest using an AES-256 encryption +// encryption keys which encrypts your data at rest using an AES256 encryption // algorithm. This does not require any action on your part. // // For more control over the encryption of the contents of your repository, you @@ -161,7 +161,7 @@ type EncryptionConfiguration struct { // // If you use the AES256 encryption type, Amazon ECR uses server-side encryption // with Amazon S3-managed encryption keys which encrypts the images in the - // repository using an AES-256 encryption algorithm. For more information, see [Protecting data using server-side encryption with Amazon S3-managed encryption keys (SSE-S3)]in + // repository using an AES256 encryption algorithm. For more information, see [Protecting data using server-side encryption with Amazon S3-managed encryption keys (SSE-S3)]in // the Amazon Simple Storage Service Console Developer Guide. // // [Protecting data using server-side encryption with Amazon S3-managed encryption keys (SSE-S3)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html @@ -179,6 +179,38 @@ type EncryptionConfiguration struct { noSmithyDocumentSerde } +// The encryption configuration to associate with the repository creation template. +type EncryptionConfigurationForRepositoryCreationTemplate struct { + + // The encryption type to use. + // + // If you use the KMS encryption type, the contents of the repository will be + // encrypted using server-side encryption with Key Management Service key stored in + // KMS. When you use KMS to encrypt your data, you can either use the default + // Amazon Web Services managed KMS key for Amazon ECR, or specify your own KMS key, + // which you already created. For more information, see [Protecting data using server-side encryption with an KMS key stored in Key Management Service (SSE-KMS)]in the Amazon Simple + // Storage Service Console Developer Guide. + // + // If you use the AES256 encryption type, Amazon ECR uses server-side encryption + // with Amazon S3-managed encryption keys which encrypts the images in the + // repository using an AES256 encryption algorithm. For more information, see [Protecting data using server-side encryption with Amazon S3-managed encryption keys (SSE-S3)]in + // the Amazon Simple Storage Service Console Developer Guide. + // + // [Protecting data using server-side encryption with Amazon S3-managed encryption keys (SSE-S3)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html + // [Protecting data using server-side encryption with an KMS key stored in Key Management Service (SSE-KMS)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html + // + // This member is required. + EncryptionType EncryptionType + + // If you use the KMS encryption type, specify the KMS key to use for encryption. + // The full ARN of the KMS key must be specified. The key must exist in the same + // Region as the repository. If no key is specified, the default Amazon Web + // Services managed KMS key for Amazon ECR will be used. + KmsKey *string + + noSmithyDocumentSerde +} + // The details of an enhanced image scan. This is returned when enhanced scanning // is enabled for your private registry. type EnhancedImageScanFinding struct { @@ -740,6 +772,58 @@ type Repository struct { noSmithyDocumentSerde } +// The details of the repository creation template associated with the request. +type RepositoryCreationTemplate struct { + + // A list of enumerable Strings representing the repository creation scenarios + // that this template will apply towards. The two supported scenarios are + // PULL_THROUGH_CACHE and REPLICATION + AppliedFor []RCTAppliedFor + + // The date and time, in JavaScript date format, when the repository creation + // template was created. + CreatedAt *time.Time + + // The ARN of the role to be assumed by Amazon ECR. + CustomRoleArn *string + + // The description associated with the repository creation template. + Description *string + + // The encryption configuration associated with the repository creation template. + EncryptionConfiguration *EncryptionConfigurationForRepositoryCreationTemplate + + // The tag mutability setting for the repository. If this parameter is omitted, + // the default setting of MUTABLE will be used which will allow image tags to be + // overwritten. If IMMUTABLE is specified, all image tags within the repository + // will be immutable which will prevent them from being overwritten. + ImageTagMutability ImageTagMutability + + // The lifecycle policy to use for repositories created using the template. + LifecyclePolicy *string + + // The repository namespace prefix associated with the repository creation + // template. + Prefix *string + + // he repository policy to apply to repositories created using the template. A + // repository policy is a permissions policy associated with a repository to + // control access permissions. + RepositoryPolicy *string + + // The metadata to apply to the repository to help you categorize and organize. + // Each tag consists of a key and an optional value, both of which you define. Tag + // keys can have a maximum character length of 128 characters, and tag values can + // have a maximum length of 256 characters. + ResourceTags []Tag + + // The date and time, in JavaScript date format, when the repository creation + // template was last updated. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + // The filter settings used with image replication. Specifying a repository filter // to a replication rule provides a method for controlling which repositories in a // private registry are replicated. If no filters are added, the contents of all diff --git a/service/ecr/validators.go b/service/ecr/validators.go index d9889a1148b..a5ddd9b596a 100644 --- a/service/ecr/validators.go +++ b/service/ecr/validators.go @@ -130,6 +130,26 @@ func (m *validateOpCreatePullThroughCacheRule) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpCreateRepositoryCreationTemplate struct { +} + +func (*validateOpCreateRepositoryCreationTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateRepositoryCreationTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateRepositoryCreationTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateRepositoryCreationTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateRepository struct { } @@ -190,6 +210,26 @@ func (m *validateOpDeletePullThroughCacheRule) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpDeleteRepositoryCreationTemplate struct { +} + +func (*validateOpDeleteRepositoryCreationTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteRepositoryCreationTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteRepositoryCreationTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteRepositoryCreationTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteRepository struct { } @@ -690,6 +730,26 @@ func (m *validateOpUpdatePullThroughCacheRule) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpUpdateRepositoryCreationTemplate struct { +} + +func (*validateOpUpdateRepositoryCreationTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateRepositoryCreationTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateRepositoryCreationTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateRepositoryCreationTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUploadLayerPart struct { } @@ -754,6 +814,10 @@ func addOpCreatePullThroughCacheRuleValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpCreatePullThroughCacheRule{}, middleware.After) } +func addOpCreateRepositoryCreationTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateRepositoryCreationTemplate{}, middleware.After) +} + func addOpCreateRepositoryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateRepository{}, middleware.After) } @@ -766,6 +830,10 @@ func addOpDeletePullThroughCacheRuleValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpDeletePullThroughCacheRule{}, middleware.After) } +func addOpDeleteRepositoryCreationTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteRepositoryCreationTemplate{}, middleware.After) +} + func addOpDeleteRepositoryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteRepository{}, middleware.After) } @@ -866,6 +934,10 @@ func addOpUpdatePullThroughCacheRuleValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpUpdatePullThroughCacheRule{}, middleware.After) } +func addOpUpdateRepositoryCreationTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateRepositoryCreationTemplate{}, middleware.After) +} + func addOpUploadLayerPartValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUploadLayerPart{}, middleware.After) } @@ -889,6 +961,21 @@ func validateEncryptionConfiguration(v *types.EncryptionConfiguration) error { } } +func validateEncryptionConfigurationForRepositoryCreationTemplate(v *types.EncryptionConfigurationForRepositoryCreationTemplate) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EncryptionConfigurationForRepositoryCreationTemplate"} + if len(v.EncryptionType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("EncryptionType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateRegistryScanningRule(v *types.RegistryScanningRule) error { if v == nil { return nil @@ -1236,6 +1323,34 @@ func validateOpCreatePullThroughCacheRuleInput(v *CreatePullThroughCacheRuleInpu } } +func validateOpCreateRepositoryCreationTemplateInput(v *CreateRepositoryCreationTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateRepositoryCreationTemplateInput"} + if v.Prefix == nil { + invalidParams.Add(smithy.NewErrParamRequired("Prefix")) + } + if v.EncryptionConfiguration != nil { + if err := validateEncryptionConfigurationForRepositoryCreationTemplate(v.EncryptionConfiguration); err != nil { + invalidParams.AddNested("EncryptionConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.ResourceTags != nil { + if err := validateTagList(v.ResourceTags); err != nil { + invalidParams.AddNested("ResourceTags", err.(smithy.InvalidParamsError)) + } + } + if v.AppliedFor == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppliedFor")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateRepositoryInput(v *CreateRepositoryInput) error { if v == nil { return nil @@ -1291,6 +1406,21 @@ func validateOpDeletePullThroughCacheRuleInput(v *DeletePullThroughCacheRuleInpu } } +func validateOpDeleteRepositoryCreationTemplateInput(v *DeleteRepositoryCreationTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteRepositoryCreationTemplateInput"} + if v.Prefix == nil { + invalidParams.Add(smithy.NewErrParamRequired("Prefix")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteRepositoryInput(v *DeleteRepositoryInput) error { if v == nil { return nil @@ -1712,6 +1842,31 @@ func validateOpUpdatePullThroughCacheRuleInput(v *UpdatePullThroughCacheRuleInpu } } +func validateOpUpdateRepositoryCreationTemplateInput(v *UpdateRepositoryCreationTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateRepositoryCreationTemplateInput"} + if v.Prefix == nil { + invalidParams.Add(smithy.NewErrParamRequired("Prefix")) + } + if v.EncryptionConfiguration != nil { + if err := validateEncryptionConfigurationForRepositoryCreationTemplate(v.EncryptionConfiguration); err != nil { + invalidParams.AddNested("EncryptionConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.ResourceTags != nil { + if err := validateTagList(v.ResourceTags); err != nil { + invalidParams.AddNested("ResourceTags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUploadLayerPartInput(v *UploadLayerPartInput) error { if v == nil { return nil diff --git a/service/eks/api_op_CreateCluster.go b/service/eks/api_op_CreateCluster.go index 496ccbea478..96f004a84b7 100644 --- a/service/eks/api_op_CreateCluster.go +++ b/service/eks/api_op_CreateCluster.go @@ -141,6 +141,10 @@ type CreateClusterInput struct { // other cluster or Amazon Web Services resources. Tags map[string]string + // New clusters, by default, have extended support enabled. You can disable + // extended support when creating a cluster by setting this value to STANDARD . + UpgradePolicy *types.UpgradePolicyRequest + // The desired Kubernetes version for your cluster. If you don't specify a value // here, the default version available in Amazon EKS is used. // diff --git a/service/eks/api_op_UpdateClusterConfig.go b/service/eks/api_op_UpdateClusterConfig.go index 965db7c6539..997a5c0770d 100644 --- a/service/eks/api_op_UpdateClusterConfig.go +++ b/service/eks/api_op_UpdateClusterConfig.go @@ -87,6 +87,11 @@ type UpdateClusterConfigInput struct { // An object representing the VPC configuration to use for an Amazon EKS cluster. ResourcesVpcConfig *types.VpcConfigRequest + // You can enable or disable extended support for clusters currently on standard + // support. You cannot disable extended support once it starts. You must enable + // extended support before your cluster exits standard support. + UpgradePolicy *types.UpgradePolicyRequest + noSmithyDocumentSerde } diff --git a/service/eks/deserializers.go b/service/eks/deserializers.go index 0b4d1808f5b..f2c147a1b0b 100644 --- a/service/eks/deserializers.go +++ b/service/eks/deserializers.go @@ -10820,6 +10820,11 @@ func awsRestjson1_deserializeDocumentCluster(v **types.Cluster, value interface{ return err } + case "upgradePolicy": + if err := awsRestjson1_deserializeDocumentUpgradePolicyResponse(&sv.UpgradePolicy, value); err != nil { + return err + } + case "version": if value != nil { jtv, ok := value.(string) @@ -15066,6 +15071,46 @@ func awsRestjson1_deserializeDocumentUpdateParams(v *[]types.UpdateParam, value return nil } +func awsRestjson1_deserializeDocumentUpgradePolicyResponse(v **types.UpgradePolicyResponse, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UpgradePolicyResponse + if *v == nil { + sv = &types.UpgradePolicyResponse{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "supportType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SupportType to be of type string, got %T instead", value) + } + sv.SupportType = types.SupportType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentVpcConfigResponse(v **types.VpcConfigResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/eks/serializers.go b/service/eks/serializers.go index 5185a0330da..ffc8a64d689 100644 --- a/service/eks/serializers.go +++ b/service/eks/serializers.go @@ -695,6 +695,13 @@ func awsRestjson1_serializeOpDocumentCreateClusterInput(v *CreateClusterInput, v } } + if v.UpgradePolicy != nil { + ok := object.Key("upgradePolicy") + if err := awsRestjson1_serializeDocumentUpgradePolicyRequest(v.UpgradePolicy, ok); err != nil { + return err + } + } + if v.Version != nil { ok := object.Key("version") ok.String(*v.Version) @@ -4450,6 +4457,13 @@ func awsRestjson1_serializeOpDocumentUpdateClusterConfigInput(v *UpdateClusterCo } } + if v.UpgradePolicy != nil { + ok := object.Key("upgradePolicy") + if err := awsRestjson1_serializeDocumentUpgradePolicyRequest(v.UpgradePolicy, ok); err != nil { + return err + } + } + return nil } @@ -5626,6 +5640,18 @@ func awsRestjson1_serializeDocumentUpdateTaintsPayload(v *types.UpdateTaintsPayl return nil } +func awsRestjson1_serializeDocumentUpgradePolicyRequest(v *types.UpgradePolicyRequest, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.SupportType) > 0 { + ok := object.Key("supportType") + ok.String(string(v.SupportType)) + } + + return nil +} + func awsRestjson1_serializeDocumentVpcConfigRequest(v *types.VpcConfigRequest, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/eks/types/enums.go b/service/eks/types/enums.go index 35604d954ca..91f8ccf361f 100644 --- a/service/eks/types/enums.go +++ b/service/eks/types/enums.go @@ -686,6 +686,25 @@ func (ResolveConflicts) Values() []ResolveConflicts { } } +type SupportType string + +// Enum values for SupportType +const ( + SupportTypeStandard SupportType = "STANDARD" + SupportTypeExtended SupportType = "EXTENDED" +) + +// Values returns all known values for SupportType. 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 (SupportType) Values() []SupportType { + return []SupportType{ + "STANDARD", + "EXTENDED", + } +} + type TaintEffect string // Enum values for TaintEffect @@ -739,6 +758,7 @@ const ( UpdateParamTypeSubnets UpdateParamType = "Subnets" UpdateParamTypeAuthenticationMode UpdateParamType = "AuthenticationMode" UpdateParamTypePodIdentityAssociations UpdateParamType = "PodIdentityAssociations" + UpdateParamTypeUpgradePolicy UpdateParamType = "UpgradePolicy" ) // Values returns all known values for UpdateParamType. Note that this can be @@ -775,6 +795,7 @@ func (UpdateParamType) Values() []UpdateParamType { "Subnets", "AuthenticationMode", "PodIdentityAssociations", + "UpgradePolicy", } } @@ -815,6 +836,7 @@ const ( UpdateTypeAddonUpdate UpdateType = "AddonUpdate" UpdateTypeVpcConfigUpdate UpdateType = "VpcConfigUpdate" UpdateTypeAccessConfigUpdate UpdateType = "AccessConfigUpdate" + UpdateTypeUpgradePolicyUpdate UpdateType = "UpgradePolicyUpdate" ) // Values returns all known values for UpdateType. Note that this can be expanded @@ -833,5 +855,6 @@ func (UpdateType) Values() []UpdateType { "AddonUpdate", "VpcConfigUpdate", "AccessConfigUpdate", + "UpgradePolicyUpdate", } } diff --git a/service/eks/types/types.go b/service/eks/types/types.go index f0c0186ca57..3034a927f59 100644 --- a/service/eks/types/types.go +++ b/service/eks/types/types.go @@ -410,6 +410,13 @@ type Cluster struct { // other cluster or Amazon Web Services resources. Tags map[string]string + // This value indicates if extended support is enabled or disabled for the cluster. + // + // [Learn more about EKS Extended Support in the EKS User Guide.] + // + // [Learn more about EKS Extended Support in the EKS User Guide.]: https://docs.aws.amazon.com/eks/latest/userguide/extended-support-control.html + UpgradePolicy *UpgradePolicyResponse + // The Kubernetes server version for the cluster. Version *string @@ -1757,6 +1764,47 @@ type UpdateTaintsPayload struct { noSmithyDocumentSerde } +// The support policy to use for the cluster. Extended support allows you to +// remain on specific Kubernetes versions for longer. Clusters in extended support +// have higher costs. The default value is EXTENDED . Use STANDARD to disable +// extended support. +// +// [Learn more about EKS Extended Support in the EKS User Guide.] +// +// [Learn more about EKS Extended Support in the EKS User Guide.]: https://docs.aws.amazon.com/eks/latest/userguide/extended-support-control.html +type UpgradePolicyRequest struct { + + // If the cluster is set to EXTENDED , it will enter extended support at the end of + // standard support. If the cluster is set to STANDARD , it will be automatically + // upgraded at the end of standard support. + // + // [Learn more about EKS Extended Support in the EKS User Guide.] + // + // [Learn more about EKS Extended Support in the EKS User Guide.]: https://docs.aws.amazon.com/eks/latest/userguide/extended-support-control.html + SupportType SupportType + + noSmithyDocumentSerde +} + +// This value indicates if extended support is enabled or disabled for the cluster. +// +// [Learn more about EKS Extended Support in the EKS User Guide.] +// +// [Learn more about EKS Extended Support in the EKS User Guide.]: https://docs.aws.amazon.com/eks/latest/userguide/extended-support-control.html +type UpgradePolicyResponse struct { + + // If the cluster is set to EXTENDED , it will enter extended support at the end of + // standard support. If the cluster is set to STANDARD , it will be automatically + // upgraded at the end of standard support. + // + // [Learn more about EKS Extended Support in the EKS User Guide.] + // + // [Learn more about EKS Extended Support in the EKS User Guide.]: https://docs.aws.amazon.com/eks/latest/userguide/extended-support-control.html + SupportType SupportType + + noSmithyDocumentSerde +} + // An object representing the VPC configuration to use for an Amazon EKS cluster. type VpcConfigRequest struct { diff --git a/service/elasticloadbalancingv2/api_op_DeleteSharedTrustStoreAssociation.go b/service/elasticloadbalancingv2/api_op_DeleteSharedTrustStoreAssociation.go new file mode 100644 index 00000000000..2f4fe79643b --- /dev/null +++ b/service/elasticloadbalancingv2/api_op_DeleteSharedTrustStoreAssociation.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/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a shared trust store association. +func (c *Client) DeleteSharedTrustStoreAssociation(ctx context.Context, params *DeleteSharedTrustStoreAssociationInput, optFns ...func(*Options)) (*DeleteSharedTrustStoreAssociationOutput, error) { + if params == nil { + params = &DeleteSharedTrustStoreAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteSharedTrustStoreAssociation", params, optFns, c.addOperationDeleteSharedTrustStoreAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteSharedTrustStoreAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteSharedTrustStoreAssociationInput struct { + + // The Amazon Resource Name (ARN) of the resource. + // + // This member is required. + ResourceArn *string + + // The Amazon Resource Name (ARN) of the trust store. + // + // This member is required. + TrustStoreArn *string + + noSmithyDocumentSerde +} + +type DeleteSharedTrustStoreAssociationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteSharedTrustStoreAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteSharedTrustStoreAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteSharedTrustStoreAssociation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteSharedTrustStoreAssociation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteSharedTrustStoreAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSharedTrustStoreAssociation(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteSharedTrustStoreAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteSharedTrustStoreAssociation", + } +} diff --git a/service/elasticloadbalancingv2/api_op_DescribeTargetHealth.go b/service/elasticloadbalancingv2/api_op_DescribeTargetHealth.go index aa389a03c6f..ab8a2d95357 100644 --- a/service/elasticloadbalancingv2/api_op_DescribeTargetHealth.go +++ b/service/elasticloadbalancingv2/api_op_DescribeTargetHealth.go @@ -40,7 +40,7 @@ type DescribeTargetHealthInput struct { // This member is required. TargetGroupArn *string - // Used to inclue anomaly detection information. + // Used to include anomaly detection information. Include []types.DescribeTargetHealthInputIncludeEnum // The targets. diff --git a/service/elasticloadbalancingv2/api_op_DescribeTrustStoreRevocations.go b/service/elasticloadbalancingv2/api_op_DescribeTrustStoreRevocations.go index d3bd3466125..a3923fb760d 100644 --- a/service/elasticloadbalancingv2/api_op_DescribeTrustStoreRevocations.go +++ b/service/elasticloadbalancingv2/api_op_DescribeTrustStoreRevocations.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describes the revocation files in use by the specified trust store arn, or -// revocation ID. +// Describes the revocation files in use by the specified trust store or +// revocation files. func (c *Client) DescribeTrustStoreRevocations(ctx context.Context, params *DescribeTrustStoreRevocationsInput, optFns ...func(*Options)) (*DescribeTrustStoreRevocationsOutput, error) { if params == nil { params = &DescribeTrustStoreRevocationsInput{} diff --git a/service/elasticloadbalancingv2/api_op_DescribeTrustStores.go b/service/elasticloadbalancingv2/api_op_DescribeTrustStores.go index 165a6381299..aea37d41852 100644 --- a/service/elasticloadbalancingv2/api_op_DescribeTrustStores.go +++ b/service/elasticloadbalancingv2/api_op_DescribeTrustStores.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describes all trust stores for a given account by trust store arn’s or name. +// Describes all trust stores for the specified account. func (c *Client) DescribeTrustStores(ctx context.Context, params *DescribeTrustStoresInput, optFns ...func(*Options)) (*DescribeTrustStoresOutput, error) { if params == nil { params = &DescribeTrustStoresInput{} diff --git a/service/elasticloadbalancingv2/api_op_GetResourcePolicy.go b/service/elasticloadbalancingv2/api_op_GetResourcePolicy.go new file mode 100644 index 00000000000..c732f87f500 --- /dev/null +++ b/service/elasticloadbalancingv2/api_op_GetResourcePolicy.go @@ -0,0 +1,141 @@ +// 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/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the resource policy for a specified resource. +func (c *Client) GetResourcePolicy(ctx context.Context, params *GetResourcePolicyInput, optFns ...func(*Options)) (*GetResourcePolicyOutput, error) { + if params == nil { + params = &GetResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetResourcePolicy", params, optFns, c.addOperationGetResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetResourcePolicyInput struct { + + // The Amazon Resource Name (ARN) of the resource. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type GetResourcePolicyOutput struct { + + // The content of the resource policy. + Policy *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetResourcePolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetResourcePolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetResourcePolicy", + } +} diff --git a/service/elasticloadbalancingv2/api_op_ModifyTrustStore.go b/service/elasticloadbalancingv2/api_op_ModifyTrustStore.go index aab587fafd7..56d04ece83c 100644 --- a/service/elasticloadbalancingv2/api_op_ModifyTrustStore.go +++ b/service/elasticloadbalancingv2/api_op_ModifyTrustStore.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Update the ca certificate bundle for a given trust store. +// Update the ca certificate bundle for the specified trust store. func (c *Client) ModifyTrustStore(ctx context.Context, params *ModifyTrustStoreInput, optFns ...func(*Options)) (*ModifyTrustStoreOutput, error) { if params == nil { params = &ModifyTrustStoreInput{} diff --git a/service/elasticloadbalancingv2/api_op_SetIpAddressType.go b/service/elasticloadbalancingv2/api_op_SetIpAddressType.go index 5423e5d418d..d02d55d391f 100644 --- a/service/elasticloadbalancingv2/api_op_SetIpAddressType.go +++ b/service/elasticloadbalancingv2/api_op_SetIpAddressType.go @@ -37,6 +37,11 @@ type SetIpAddressTypeInput struct { // dualstack-without-public-ipv4 (for IPv6 only public addresses, with private IPv4 // and IPv6 addresses). // + // Note: Application Load Balancer authentication only supports IPv4 addresses + // when connecting to an Identity Provider (IdP) or Amazon Cognito endpoint. + // Without a public IPv4 address the load balancer cannot complete the + // authentication process, resulting in HTTP 500 errors. + // // [Network Load Balancers] The IP address type. The possible values are ipv4 (for // only IPv4 addresses) and dualstack (for IPv4 and IPv6 addresses). You can’t // specify dualstack for a load balancer with a UDP or TCP_UDP listener. diff --git a/service/elasticloadbalancingv2/deserializers.go b/service/elasticloadbalancingv2/deserializers.go index 9172ddda176..81353792b2b 100644 --- a/service/elasticloadbalancingv2/deserializers.go +++ b/service/elasticloadbalancingv2/deserializers.go @@ -1423,6 +1423,120 @@ func awsAwsquery_deserializeOpErrorDeleteRule(response *smithyhttp.Response, met } } +type awsAwsquery_deserializeOpDeleteSharedTrustStoreAssociation struct { +} + +func (*awsAwsquery_deserializeOpDeleteSharedTrustStoreAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteSharedTrustStoreAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteSharedTrustStoreAssociation(response, &metadata) + } + output := &DeleteSharedTrustStoreAssociationOutput{} + 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("DeleteSharedTrustStoreAssociationResult") + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpDocumentDeleteSharedTrustStoreAssociationOutput(&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_deserializeOpErrorDeleteSharedTrustStoreAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("AssociationNotFound", errorCode): + return awsAwsquery_deserializeErrorTrustStoreAssociationNotFoundException(response, errorBody) + + case strings.EqualFold("DeleteAssociationSameAccount", errorCode): + return awsAwsquery_deserializeErrorDeleteAssociationSameAccountException(response, errorBody) + + case strings.EqualFold("TrustStoreNotFound", errorCode): + return awsAwsquery_deserializeErrorTrustStoreNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsquery_deserializeOpDeleteTargetGroup struct { } @@ -3298,6 +3412,114 @@ func awsAwsquery_deserializeOpErrorDescribeTrustStores(response *smithyhttp.Resp } } +type awsAwsquery_deserializeOpGetResourcePolicy struct { +} + +func (*awsAwsquery_deserializeOpGetResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorGetResourcePolicy(response, &metadata) + } + output := &GetResourcePolicyOutput{} + 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("GetResourcePolicyResult") + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpDocumentGetResourcePolicyOutput(&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_deserializeOpErrorGetResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + 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("ResourceNotFound", errorCode): + return awsAwsquery_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsquery_deserializeOpGetTrustStoreCaCertificatesBundle struct { } @@ -5411,6 +5633,50 @@ func awsAwsquery_deserializeErrorCertificateNotFoundException(response *smithyht return output } +func awsAwsquery_deserializeErrorDeleteAssociationSameAccountException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DeleteAssociationSameAccountException{} + 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_deserializeDocumentDeleteAssociationSameAccountException(&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_deserializeErrorDuplicateListenerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.DuplicateListenerException{} var buff [1024]byte @@ -6291,6 +6557,50 @@ func awsAwsquery_deserializeErrorResourceInUseException(response *smithyhttp.Res return output } +func awsAwsquery_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + 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_deserializeDocumentResourceNotFoundException(&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_deserializeErrorRevocationContentNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.RevocationContentNotFoundException{} var buff [1024]byte @@ -6894,7 +7204,51 @@ func awsAwsquery_deserializeErrorTooManyTagsException(response *smithyhttp.Respo } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTooManyTagsException(&output, decoder) + 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) @@ -6907,8 +7261,8 @@ func awsAwsquery_deserializeErrorTooManyTagsException(response *smithyhttp.Respo return output } -func awsAwsquery_deserializeErrorTooManyTargetGroupsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyTargetGroupsException{} +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) @@ -6938,7 +7292,7 @@ func awsAwsquery_deserializeErrorTooManyTargetGroupsException(response *smithyht } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTooManyTargetGroupsException(&output, decoder) + err = awsAwsquery_deserializeDocumentTooManyTargetsException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6951,8 +7305,8 @@ func awsAwsquery_deserializeErrorTooManyTargetGroupsException(response *smithyht return output } -func awsAwsquery_deserializeErrorTooManyTargetsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyTargetsException{} +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) @@ -6982,7 +7336,7 @@ func awsAwsquery_deserializeErrorTooManyTargetsException(response *smithyhttp.Re } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTooManyTargetsException(&output, decoder) + err = awsAwsquery_deserializeDocumentTooManyTrustStoreRevocationEntriesException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6995,8 +7349,8 @@ func awsAwsquery_deserializeErrorTooManyTargetsException(response *smithyhttp.Re return output } -func awsAwsquery_deserializeErrorTooManyTrustStoreRevocationEntriesException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyTrustStoreRevocationEntriesException{} +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) @@ -7026,7 +7380,7 @@ func awsAwsquery_deserializeErrorTooManyTrustStoreRevocationEntriesException(res } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTooManyTrustStoreRevocationEntriesException(&output, decoder) + err = awsAwsquery_deserializeDocumentTooManyTrustStoresException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7039,8 +7393,8 @@ func awsAwsquery_deserializeErrorTooManyTrustStoreRevocationEntriesException(res return output } -func awsAwsquery_deserializeErrorTooManyTrustStoresException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyTrustStoresException{} +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) @@ -7070,7 +7424,7 @@ func awsAwsquery_deserializeErrorTooManyTrustStoresException(response *smithyhtt } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTooManyTrustStoresException(&output, decoder) + err = awsAwsquery_deserializeDocumentTooManyUniqueTargetGroupsPerLoadBalancerException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7083,8 +7437,8 @@ func awsAwsquery_deserializeErrorTooManyTrustStoresException(response *smithyhtt return output } -func awsAwsquery_deserializeErrorTooManyUniqueTargetGroupsPerLoadBalancerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyUniqueTargetGroupsPerLoadBalancerException{} +func awsAwsquery_deserializeErrorTrustStoreAssociationNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TrustStoreAssociationNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -7114,7 +7468,7 @@ func awsAwsquery_deserializeErrorTooManyUniqueTargetGroupsPerLoadBalancerExcepti } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentTooManyUniqueTargetGroupsPerLoadBalancerException(&output, decoder) + err = awsAwsquery_deserializeDocumentTrustStoreAssociationNotFoundException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8808,6 +9162,55 @@ func awsAwsquery_deserializeDocumentCiphersUnwrapped(v *[]types.Cipher, decoder *v = sv return nil } +func awsAwsquery_deserializeDocumentDeleteAssociationSameAccountException(v **types.DeleteAssociationSameAccountException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DeleteAssociationSameAccountException + if *v == nil { + sv = &types.DeleteAssociationSameAccountException{} + } 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_deserializeDocumentDescribeTrustStoreRevocation(v **types.DescribeTrustStoreRevocation, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11297,6 +11700,19 @@ func awsAwsquery_deserializeDocumentMutualAuthenticationAttributes(v **types.Mut sv.TrustStoreArn = ptr.String(xtv) } + case strings.EqualFold("TrustStoreAssociationStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TrustStoreAssociationStatus = types.TrustStoreAssociationStatusEnum(xtv) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -11786,6 +12202,55 @@ func awsAwsquery_deserializeDocumentResourceInUseException(v **types.ResourceInU return nil } +func awsAwsquery_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } 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_deserializeDocumentRevocationContentNotFoundException(v **types.RevocationContentNotFoundException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14751,6 +15216,55 @@ func awsAwsquery_deserializeDocumentTrustStoreAssociation(v **types.TrustStoreAs return nil } +func awsAwsquery_deserializeDocumentTrustStoreAssociationNotFoundException(v **types.TrustStoreAssociationNotFoundException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TrustStoreAssociationNotFoundException + if *v == nil { + sv = &types.TrustStoreAssociationNotFoundException{} + } 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_deserializeDocumentTrustStoreAssociations(v *[]types.TrustStoreAssociation, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15685,6 +16199,42 @@ func awsAwsquery_deserializeOpDocumentDeleteRuleOutput(v **DeleteRuleOutput, dec return nil } +func awsAwsquery_deserializeOpDocumentDeleteSharedTrustStoreAssociationOutput(v **DeleteSharedTrustStoreAssociationOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteSharedTrustStoreAssociationOutput + if *v == nil { + sv = &DeleteSharedTrustStoreAssociationOutput{} + } 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_deserializeOpDocumentDeleteTargetGroupOutput(v **DeleteTargetGroupOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16511,6 +17061,55 @@ func awsAwsquery_deserializeOpDocumentDescribeTrustStoresOutput(v **DescribeTrus return nil } +func awsAwsquery_deserializeOpDocumentGetResourcePolicyOutput(v **GetResourcePolicyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetResourcePolicyOutput + if *v == nil { + sv = &GetResourcePolicyOutput{} + } 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 awsAwsquery_deserializeOpDocumentGetTrustStoreCaCertificatesBundleOutput(v **GetTrustStoreCaCertificatesBundleOutput, 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 47080cb4547..9c91956fe69 100644 --- a/service/elasticloadbalancingv2/generated.json +++ b/service/elasticloadbalancingv2/generated.json @@ -20,6 +20,7 @@ "api_op_DeleteListener.go", "api_op_DeleteLoadBalancer.go", "api_op_DeleteRule.go", + "api_op_DeleteSharedTrustStoreAssociation.go", "api_op_DeleteTargetGroup.go", "api_op_DeleteTrustStore.go", "api_op_DeregisterTargets.go", @@ -37,6 +38,7 @@ "api_op_DescribeTrustStoreAssociations.go", "api_op_DescribeTrustStoreRevocations.go", "api_op_DescribeTrustStores.go", + "api_op_GetResourcePolicy.go", "api_op_GetTrustStoreCaCertificatesBundle.go", "api_op_GetTrustStoreRevocationContent.go", "api_op_ModifyListener.go", diff --git a/service/elasticloadbalancingv2/serializers.go b/service/elasticloadbalancingv2/serializers.go index 53c7db843df..681867554c7 100644 --- a/service/elasticloadbalancingv2/serializers.go +++ b/service/elasticloadbalancingv2/serializers.go @@ -720,6 +720,70 @@ func (m *awsAwsquery_serializeOpDeleteRule) HandleSerialize(ctx context.Context, return next.HandleSerialize(ctx, in) } +type awsAwsquery_serializeOpDeleteSharedTrustStoreAssociation struct { +} + +func (*awsAwsquery_serializeOpDeleteSharedTrustStoreAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteSharedTrustStoreAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteSharedTrustStoreAssociationInput) + _ = 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("DeleteSharedTrustStoreAssociation") + body.Key("Version").String("2015-12-01") + + if err := awsAwsquery_serializeOpDocumentDeleteSharedTrustStoreAssociationInput(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_serializeOpDeleteTargetGroup struct { } @@ -1808,6 +1872,70 @@ func (m *awsAwsquery_serializeOpDescribeTrustStores) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } +type awsAwsquery_serializeOpGetResourcePolicy struct { +} + +func (*awsAwsquery_serializeOpGetResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("GetResourcePolicy") + body.Key("Version").String("2015-12-01") + + if err := awsAwsquery_serializeOpDocumentGetResourcePolicyInput(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_serializeOpGetTrustStoreCaCertificatesBundle struct { } @@ -3300,6 +3428,11 @@ func awsAwsquery_serializeDocumentMutualAuthenticationAttributes(v *types.Mutual objectKey.String(*v.TrustStoreArn) } + if len(v.TrustStoreAssociationStatus) > 0 { + objectKey := object.Key("TrustStoreAssociationStatus") + objectKey.String(string(v.TrustStoreAssociationStatus)) + } + return nil } @@ -4224,6 +4357,23 @@ func awsAwsquery_serializeOpDocumentDeleteRuleInput(v *DeleteRuleInput, value qu return nil } +func awsAwsquery_serializeOpDocumentDeleteSharedTrustStoreAssociationInput(v *DeleteSharedTrustStoreAssociationInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ResourceArn != nil { + objectKey := object.Key("ResourceArn") + objectKey.String(*v.ResourceArn) + } + + if v.TrustStoreArn != nil { + objectKey := object.Key("TrustStoreArn") + objectKey.String(*v.TrustStoreArn) + } + + return nil +} + func awsAwsquery_serializeOpDocumentDeleteTargetGroupInput(v *DeleteTargetGroupInput, value query.Value) error { object := value.Object() _ = object @@ -4606,6 +4756,18 @@ func awsAwsquery_serializeOpDocumentDescribeTrustStoresInput(v *DescribeTrustSto return nil } +func awsAwsquery_serializeOpDocumentGetResourcePolicyInput(v *GetResourcePolicyInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ResourceArn != nil { + objectKey := object.Key("ResourceArn") + objectKey.String(*v.ResourceArn) + } + + return nil +} + func awsAwsquery_serializeOpDocumentGetTrustStoreCaCertificatesBundleInput(v *GetTrustStoreCaCertificatesBundleInput, value query.Value) error { object := value.Object() _ = object diff --git a/service/elasticloadbalancingv2/snapshot/api_op_DeleteSharedTrustStoreAssociation.go.snap b/service/elasticloadbalancingv2/snapshot/api_op_DeleteSharedTrustStoreAssociation.go.snap new file mode 100644 index 00000000000..71d267a863a --- /dev/null +++ b/service/elasticloadbalancingv2/snapshot/api_op_DeleteSharedTrustStoreAssociation.go.snap @@ -0,0 +1,36 @@ +DeleteSharedTrustStoreAssociation + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/elasticloadbalancingv2/snapshot/api_op_GetResourcePolicy.go.snap b/service/elasticloadbalancingv2/snapshot/api_op_GetResourcePolicy.go.snap new file mode 100644 index 00000000000..04b5aba5c5f --- /dev/null +++ b/service/elasticloadbalancingv2/snapshot/api_op_GetResourcePolicy.go.snap @@ -0,0 +1,36 @@ +GetResourcePolicy + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/elasticloadbalancingv2/snapshot_test.go b/service/elasticloadbalancingv2/snapshot_test.go index f7ef7b91bc9..9c5c22f2a4d 100644 --- a/service/elasticloadbalancingv2/snapshot_test.go +++ b/service/elasticloadbalancingv2/snapshot_test.go @@ -194,6 +194,18 @@ func TestCheckSnapshot_DeleteRule(t *testing.T) { } } +func TestCheckSnapshot_DeleteSharedTrustStoreAssociation(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteSharedTrustStoreAssociation(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteSharedTrustStoreAssociation") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteTargetGroup(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteTargetGroup(context.Background(), nil, func(o *Options) { @@ -398,6 +410,18 @@ func TestCheckSnapshot_DescribeTrustStores(t *testing.T) { } } +func TestCheckSnapshot_GetResourcePolicy(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetResourcePolicy(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetResourcePolicy") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetTrustStoreCaCertificatesBundle(t *testing.T) { svc := New(Options{}) _, err := svc.GetTrustStoreCaCertificatesBundle(context.Background(), nil, func(o *Options) { @@ -721,6 +745,18 @@ func TestUpdateSnapshot_DeleteRule(t *testing.T) { } } +func TestUpdateSnapshot_DeleteSharedTrustStoreAssociation(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteSharedTrustStoreAssociation(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteSharedTrustStoreAssociation") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteTargetGroup(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteTargetGroup(context.Background(), nil, func(o *Options) { @@ -925,6 +961,18 @@ func TestUpdateSnapshot_DescribeTrustStores(t *testing.T) { } } +func TestUpdateSnapshot_GetResourcePolicy(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetResourcePolicy(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetResourcePolicy") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetTrustStoreCaCertificatesBundle(t *testing.T) { svc := New(Options{}) _, err := svc.GetTrustStoreCaCertificatesBundle(context.Background(), nil, func(o *Options) { diff --git a/service/elasticloadbalancingv2/types/enums.go b/service/elasticloadbalancingv2/types/enums.go index 13fc8192919..d891ec667f2 100644 --- a/service/elasticloadbalancingv2/types/enums.go +++ b/service/elasticloadbalancingv2/types/enums.go @@ -410,6 +410,26 @@ func (TargetTypeEnum) Values() []TargetTypeEnum { } } +type TrustStoreAssociationStatusEnum string + +// Enum values for TrustStoreAssociationStatusEnum +const ( + TrustStoreAssociationStatusEnumActive TrustStoreAssociationStatusEnum = "active" + TrustStoreAssociationStatusEnumRemoved TrustStoreAssociationStatusEnum = "removed" +) + +// Values returns all known values for TrustStoreAssociationStatusEnum. 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 (TrustStoreAssociationStatusEnum) Values() []TrustStoreAssociationStatusEnum { + return []TrustStoreAssociationStatusEnum{ + "active", + "removed", + } +} + type TrustStoreStatus string // Enum values for TrustStoreStatus diff --git a/service/elasticloadbalancingv2/types/errors.go b/service/elasticloadbalancingv2/types/errors.go index 8edc1b087a8..183a75a80df 100644 --- a/service/elasticloadbalancingv2/types/errors.go +++ b/service/elasticloadbalancingv2/types/errors.go @@ -141,6 +141,34 @@ func (e *CertificateNotFoundException) ErrorCode() string { } func (e *CertificateNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The specified association cannot be within the same account. +type DeleteAssociationSameAccountException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DeleteAssociationSameAccountException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DeleteAssociationSameAccountException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DeleteAssociationSameAccountException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DeleteAssociationSameAccount" + } + return *e.ErrorCodeOverride +} +func (e *DeleteAssociationSameAccountException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + // A listener with the specified port already exists. type DuplicateListenerException struct { Message *string @@ -672,6 +700,32 @@ func (e *ResourceInUseException) ErrorCode() string { } func (e *ResourceInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The specified resource does not exist. +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 "ResourceNotFound" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The specified revocation file does not exist. type RevocationContentNotFoundException struct { Message *string @@ -1182,6 +1236,34 @@ func (e *TooManyUniqueTargetGroupsPerLoadBalancerException) ErrorFault() smithy. return smithy.FaultClient } +// The specified association does not exist. +type TrustStoreAssociationNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TrustStoreAssociationNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TrustStoreAssociationNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TrustStoreAssociationNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AssociationNotFound" + } + return *e.ErrorCodeOverride +} +func (e *TrustStoreAssociationNotFoundException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + // The specified trust store is currently in use. type TrustStoreInUseException struct { Message *string diff --git a/service/elasticloadbalancingv2/types/types.go b/service/elasticloadbalancingv2/types/types.go index 52cb5de33d6..2b0677f6d35 100644 --- a/service/elasticloadbalancingv2/types/types.go +++ b/service/elasticloadbalancingv2/types/types.go @@ -714,6 +714,9 @@ type MutualAuthenticationAttributes struct { // The Amazon Resource Name (ARN) of the trust store. TrustStoreArn *string + // Indicates a shared trust stores association status. + TrustStoreAssociationStatus TrustStoreAssociationStatusEnum + noSmithyDocumentSerde } diff --git a/service/elasticloadbalancingv2/validators.go b/service/elasticloadbalancingv2/validators.go index 06057557ae8..a17f2f73214 100644 --- a/service/elasticloadbalancingv2/validators.go +++ b/service/elasticloadbalancingv2/validators.go @@ -230,6 +230,26 @@ func (m *validateOpDeleteRule) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpDeleteSharedTrustStoreAssociation struct { +} + +func (*validateOpDeleteSharedTrustStoreAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteSharedTrustStoreAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteSharedTrustStoreAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteSharedTrustStoreAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteTargetGroup struct { } @@ -430,6 +450,26 @@ func (m *validateOpDescribeTrustStoreRevocations) HandleInitialize(ctx context.C return next.HandleInitialize(ctx, in) } +type validateOpGetResourcePolicy struct { +} + +func (*validateOpGetResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetTrustStoreCaCertificatesBundle struct { } @@ -794,6 +834,10 @@ func addOpDeleteRuleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteRule{}, middleware.After) } +func addOpDeleteSharedTrustStoreAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteSharedTrustStoreAssociation{}, middleware.After) +} + func addOpDeleteTargetGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteTargetGroup{}, middleware.After) } @@ -834,6 +878,10 @@ func addOpDescribeTrustStoreRevocationsValidationMiddleware(stack *middleware.St return stack.Initialize.Add(&validateOpDescribeTrustStoreRevocations{}, middleware.After) } +func addOpGetResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetResourcePolicy{}, middleware.After) +} + func addOpGetTrustStoreCaCertificatesBundleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetTrustStoreCaCertificatesBundle{}, middleware.After) } @@ -1318,6 +1366,24 @@ func validateOpDeleteRuleInput(v *DeleteRuleInput) error { } } +func validateOpDeleteSharedTrustStoreAssociationInput(v *DeleteSharedTrustStoreAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteSharedTrustStoreAssociationInput"} + if v.TrustStoreArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TrustStoreArn")) + } + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteTargetGroupInput(v *DeleteTargetGroupInput) error { if v == nil { return nil @@ -1480,6 +1546,21 @@ func validateOpDescribeTrustStoreRevocationsInput(v *DescribeTrustStoreRevocatio } } +func validateOpGetResourcePolicyInput(v *GetResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetResourcePolicyInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetTrustStoreCaCertificatesBundleInput(v *GetTrustStoreCaCertificatesBundleInput) error { if v == nil { return nil diff --git a/service/internal/integrationtest/go.mod b/service/internal/integrationtest/go.mod index 6f0fad3261b..98071b37952 100644 --- a/service/internal/integrationtest/go.mod +++ b/service/internal/integrationtest/go.mod @@ -15,7 +15,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/cloudformation v1.53.3 github.com/aws/aws-sdk-go-v2/service/cloudfront v1.38.4 github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.25.2 - github.com/aws/aws-sdk-go-v2/service/cloudsearch v1.24.3 github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.42.3 github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.40.3 github.com/aws/aws-sdk-go-v2/service/codebuild v1.40.3 diff --git a/service/networkfirewall/api_op_CreateTLSInspectionConfiguration.go b/service/networkfirewall/api_op_CreateTLSInspectionConfiguration.go index a2c25ee22ef..e82eb35baab 100644 --- a/service/networkfirewall/api_op_CreateTLSInspectionConfiguration.go +++ b/service/networkfirewall/api_op_CreateTLSInspectionConfiguration.go @@ -11,13 +11,15 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates an Network Firewall TLS inspection configuration. A TLS inspection -// configuration contains Certificate Manager certificate associations between and -// the scope configurations that Network Firewall uses to decrypt and re-encrypt -// traffic traveling through your firewall. -// -// After you create a TLS inspection configuration, you can associate it with a -// new firewall policy. +// Creates an Network Firewall TLS inspection configuration. Network Firewall uses +// TLS inspection configurations to decrypt your firewall's inbound and outbound +// SSL/TLS traffic. After decryption, Network Firewall inspects the traffic +// according to your firewall policy's stateful rules, and then re-encrypts it +// before sending it to its destination. You can enable inspection of your +// firewall's inbound traffic, outbound traffic, or both. To use TLS inspection +// with your firewall, you must first import or provision certificates using ACM, +// create a TLS inspection configuration, add that configuration to a new firewall +// policy, and then associate that policy with your firewall. // // To update the settings for a TLS inspection configuration, use UpdateTLSInspectionConfiguration. // diff --git a/service/networkfirewall/types/enums.go b/service/networkfirewall/types/enums.go index 633f5fd6a26..0ab2f76f0ea 100644 --- a/service/networkfirewall/types/enums.go +++ b/service/networkfirewall/types/enums.go @@ -176,6 +176,7 @@ type LogType string const ( LogTypeAlert LogType = "ALERT" LogTypeFlow LogType = "FLOW" + LogTypeTls LogType = "TLS" ) // Values returns all known values for LogType. Note that this can be expanded in @@ -186,6 +187,7 @@ func (LogType) Values() []LogType { return []LogType{ "ALERT", "FLOW", + "TLS", } } diff --git a/service/networkfirewall/types/types.go b/service/networkfirewall/types/types.go index bcaef2e6cff..dcae145efb5 100644 --- a/service/networkfirewall/types/types.go +++ b/service/networkfirewall/types/types.go @@ -726,20 +726,20 @@ type IPSetReference struct { // Defines where Network Firewall sends logs for the firewall for one log type. // This is used in LoggingConfiguration. You can send each type of log to an Amazon S3 bucket, a -// CloudWatch log group, or a Kinesis Data Firehose delivery stream. +// CloudWatch log group, or a Firehose delivery stream. // -// Network Firewall generates logs for stateful rule groups. You can save alert -// and flow log types. The stateful rules engine records flow logs for all network -// traffic that it receives. It records alert logs for traffic that matches -// stateful rules that have the rule action set to DROP or ALERT . +// Network Firewall generates logs for stateful rule groups. You can save alert, +// flow, and TLS log types. type LogDestinationConfig struct { // The named location for the logs, provided in a key:value mapping that is // specific to the chosen destination type. // // - For an Amazon S3 bucket, provide the name of the bucket, with key bucketName - // , and optionally provide a prefix, with key prefix . The following example - // specifies an Amazon S3 bucket named DOC-EXAMPLE-BUCKET and the prefix alerts : + // , and optionally provide a prefix, with key prefix . + // + // The following example specifies an Amazon S3 bucket named DOC-EXAMPLE-BUCKET and + // the prefix alerts : // // "LogDestination": { "bucketName": "DOC-EXAMPLE-BUCKET", "prefix": "alerts" } // @@ -749,9 +749,9 @@ type LogDestinationConfig struct { // // "LogDestination": { "logGroup": "alert-log-group" } // - // - For a Kinesis Data Firehose delivery stream, provide the name of the - // delivery stream, with key deliveryStream . The following example specifies a - // delivery stream named alert-delivery-stream : + // - For a Firehose delivery stream, provide the name of the delivery stream, + // with key deliveryStream . The following example specifies a delivery stream + // named alert-delivery-stream : // // "LogDestination": { "deliveryStream": "alert-delivery-stream" } // @@ -759,15 +759,26 @@ type LogDestinationConfig struct { LogDestination map[string]string // The type of storage destination to send these logs to. You can send logs to an - // Amazon S3 bucket, a CloudWatch log group, or a Kinesis Data Firehose delivery - // stream. + // Amazon S3 bucket, a CloudWatch log group, or a Firehose delivery stream. // // This member is required. LogDestinationType LogDestinationType - // The type of log to send. Alert logs report traffic that matches a StatefulRule with an - // action setting that sends an alert log message. Flow logs are standard network - // traffic flow logs. + // The type of log to record. You can record the following types of logs from your + // Network Firewall stateful engine. + // + // - ALERT - Logs for traffic that matches your stateful rules and that have an + // action that sends an alert. A stateful rule sends alerts for the rule actions + // DROP, ALERT, and REJECT. For more information, see StatefulRule. + // + // - FLOW - Standard network traffic flow logs. The stateful rules engine records + // flow logs for all network traffic that it receives. Each flow log record + // captures the network flow for a specific standard stateless rule group. + // + // - TLS - Logs for events that are related to TLS inspection. For more + // information, see [Inspecting SSL/TLS traffic with TLS inspection configurations]in the Network Firewall Developer Guide. + // + // [Inspecting SSL/TLS traffic with TLS inspection configurations]: https://docs.aws.amazon.com/network-firewall/latest/developerguide/tls-inspection-configurations.html // // This member is required. LogType LogType @@ -1396,6 +1407,12 @@ type StatefulRule struct { // You can enable the rule with ALERT action, verify in the logs that the rule is // filtering as you want, then change the action to DROP . // + // - REJECT - Drops traffic that matches the conditions of the stateful rule, + // and sends a TCP reset packet back to sender of the packet. A TCP reset packet is + // a packet with no payload and an RST bit contained in the TCP header flags. + // REJECT is available only for TCP traffic. This option doesn't support FTP or + // IMAP protocols. + // // This member is required. Action StatefulAction diff --git a/service/outposts/deserializers.go b/service/outposts/deserializers.go index c934dbb4a06..6b96c7faf85 100644 --- a/service/outposts/deserializers.go +++ b/service/outposts/deserializers.go @@ -6171,6 +6171,19 @@ func awsRestjson1_deserializeDocumentInstanceTypeItem(v **types.InstanceTypeItem sv.InstanceType = ptr.String(jtv) } + case "VCPUs": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected VCPUCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.VCPUs = ptr.Int32(int32(i64)) + } + default: _, _ = key, value diff --git a/service/outposts/types/types.go b/service/outposts/types/types.go index dabef63c81c..aeea0b38892 100644 --- a/service/outposts/types/types.go +++ b/service/outposts/types/types.go @@ -244,6 +244,9 @@ type InstanceTypeItem struct { // The instance type. InstanceType *string + // The number of default VCPUs in an instance type. + VCPUs *int32 + noSmithyDocumentSerde } diff --git a/service/sfn/api_op_CreateActivity.go b/service/sfn/api_op_CreateActivity.go index a0a15561b13..d1ad5e08119 100644 --- a/service/sfn/api_op_CreateActivity.go +++ b/service/sfn/api_op_CreateActivity.go @@ -69,6 +69,9 @@ type CreateActivityInput struct { // This member is required. Name *string + // Settings to configure server-side encryption. + EncryptionConfiguration *types.EncryptionConfiguration + // The list of tags to add to a resource. // // An array of key-value pairs. For more information, see [Using Cost Allocation Tags] in the Amazon Web diff --git a/service/sfn/api_op_CreateStateMachine.go b/service/sfn/api_op_CreateStateMachine.go index fbb30064508..50e748e57c7 100644 --- a/service/sfn/api_op_CreateStateMachine.go +++ b/service/sfn/api_op_CreateStateMachine.go @@ -21,17 +21,23 @@ import ( // If you set the publish parameter of this API action to true , it publishes // version 1 as the first revision of the state machine. // +// For additional control over security, you can encrypt your data using a +// customer-managed key for Step Functions state machines. You can configure a +// symmetric KMS key and data key reuse period when creating or updating a State +// Machine. The execution history and state machine definition will be encrypted +// with the key applied to the State Machine. +// // This operation is eventually consistent. The results are best effort and may // not reflect very recent updates and changes. // // CreateStateMachine is an idempotent API. Subsequent requests won’t create a // duplicate resource if it was already created. CreateStateMachine 's idempotency // check is based on the state machine name , definition , type , -// LoggingConfiguration , and TracingConfiguration . The check is also based on the -// publish and versionDescription parameters. If a following request has a -// different roleArn or tags , Step Functions will ignore these differences and -// treat it as an idempotent request of the previous. In this case, roleArn and -// tags will not be updated, even if they are different. +// LoggingConfiguration , TracingConfiguration , and EncryptionConfiguration The +// check is also based on the publish and versionDescription parameters. If a +// following request has a different roleArn or tags , Step Functions will ignore +// these differences and treat it as an idempotent request of the previous. In this +// case, roleArn and tags will not be updated, even if they are different. // // [Amazon States Language]: https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html func (c *Client) CreateStateMachine(ctx context.Context, params *CreateStateMachineInput, optFns ...func(*Options)) (*CreateStateMachineOutput, error) { @@ -83,6 +89,9 @@ type CreateStateMachineInput struct { // This member is required. RoleArn *string + // Settings to configure server-side encryption. + EncryptionConfiguration *types.EncryptionConfiguration + // Defines what execution history events are logged and where they are logged. // // By default, the level is set to OFF . For more information see [Log Levels] in the Step diff --git a/service/sfn/api_op_DescribeActivity.go b/service/sfn/api_op_DescribeActivity.go index 2cd2bed0ef8..86daad8c44f 100644 --- a/service/sfn/api_op_DescribeActivity.go +++ b/service/sfn/api_op_DescribeActivity.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/sfn/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" @@ -72,6 +73,9 @@ type DescribeActivityOutput struct { // This member is required. Name *string + // Settings for configured server-side encryption. + EncryptionConfiguration *types.EncryptionConfiguration + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/sfn/api_op_DescribeExecution.go b/service/sfn/api_op_DescribeExecution.go index d150f4c2fba..b8e2b404f82 100644 --- a/service/sfn/api_op_DescribeExecution.go +++ b/service/sfn/api_op_DescribeExecution.go @@ -51,6 +51,12 @@ type DescribeExecutionInput struct { // This member is required. ExecutionArn *string + // If your state machine definition is encrypted with a KMS key, callers must have + // kms:Decrypt permission to decrypt the definition. Alternatively, you can call + // DescribeStateMachine API with includedData = METADATA_ONLY to get a successful + // response without the encrypted definition. + IncludedData types.IncludedData + noSmithyDocumentSerde } diff --git a/service/sfn/api_op_DescribeStateMachine.go b/service/sfn/api_op_DescribeStateMachine.go index 73000160f43..ea57635313e 100644 --- a/service/sfn/api_op_DescribeStateMachine.go +++ b/service/sfn/api_op_DescribeStateMachine.go @@ -74,6 +74,17 @@ type DescribeStateMachineInput struct { // This member is required. StateMachineArn *string + // If your state machine definition is encrypted with a KMS key, callers must have + // kms:Decrypt permission to decrypt the definition. Alternatively, you can call + // the API with includedData = METADATA_ONLY to get a successful response without + // the encrypted definition. + // + // When calling a labelled ARN for an encrypted state machine, the includedData = + // METADATA_ONLY parameter will not apply because Step Functions needs to decrypt + // the entire state machine definition to get the Distributed Map state’s + // definition. In this case, the API caller needs to have kms:Decrypt permission. + IncludedData types.IncludedData + noSmithyDocumentSerde } @@ -88,6 +99,9 @@ type DescribeStateMachineOutput struct { // The Amazon States Language definition of the state machine. See [Amazon States Language]. // + // If called with includedData = METADATA_ONLY , the returned definition will be {} + // . + // // [Amazon States Language]: https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html // // This member is required. @@ -137,6 +151,9 @@ type DescribeStateMachineOutput struct { // The description of the state machine version. Description *string + // Settings to configure server-side encryption. + EncryptionConfiguration *types.EncryptionConfiguration + // A user-defined or an auto-generated string that identifies a Map state. This // parameter is present only if the stateMachineArn specified in input is a // qualified state machine ARN. diff --git a/service/sfn/api_op_DescribeStateMachineForExecution.go b/service/sfn/api_op_DescribeStateMachineForExecution.go index 005dd1f201c..9121e747237 100644 --- a/service/sfn/api_op_DescribeStateMachineForExecution.go +++ b/service/sfn/api_op_DescribeStateMachineForExecution.go @@ -44,6 +44,12 @@ type DescribeStateMachineForExecutionInput struct { // This member is required. ExecutionArn *string + // If your state machine definition is encrypted with a KMS key, callers must have + // kms:Decrypt permission to decrypt the definition. Alternatively, you can call + // the API with includedData = METADATA_ONLY to get a successful response without + // the encrypted definition. + IncludedData types.IncludedData + noSmithyDocumentSerde } @@ -79,6 +85,9 @@ type DescribeStateMachineForExecutionOutput struct { // This member is required. UpdateDate *time.Time + // Settings to configure server-side encryption. + EncryptionConfiguration *types.EncryptionConfiguration + // A user-defined or an auto-generated string that identifies a Map state. This // field is returned only if the executionArn is a child workflow execution that // was started by a Distributed Map state. diff --git a/service/sfn/api_op_SendTaskFailure.go b/service/sfn/api_op_SendTaskFailure.go index 34b21184f76..9c80ed58ba4 100644 --- a/service/sfn/api_op_SendTaskFailure.go +++ b/service/sfn/api_op_SendTaskFailure.go @@ -14,6 +14,13 @@ import ( // states using the [job run]pattern to report that the task identified by the taskToken // failed. // +// For an execution with encryption enabled, Step Functions will encrypt the error +// and cause fields using the KMS key for the execution role. +// +// A caller can mark a task as fail without using any KMS permissions in the +// execution role if the caller provides a null value for both error and cause +// fields because no data needs to be encrypted. +// // [callback]: https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-wait-token // [job run]: https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-sync func (c *Client) SendTaskFailure(ctx context.Context, params *SendTaskFailureInput, optFns ...func(*Options)) (*SendTaskFailureOutput, error) { diff --git a/service/sfn/api_op_StartSyncExecution.go b/service/sfn/api_op_StartSyncExecution.go index e659fe69dfb..5932dbbac0a 100644 --- a/service/sfn/api_op_StartSyncExecution.go +++ b/service/sfn/api_op_StartSyncExecution.go @@ -44,6 +44,12 @@ type StartSyncExecutionInput struct { // This member is required. StateMachineArn *string + // If your state machine definition is encrypted with a KMS key, callers must have + // kms:Decrypt permission to decrypt the definition. Alternatively, you can call + // the API with includedData = METADATA_ONLY to get a successful response without + // the encrypted definition. + IncludedData types.IncludedData + // The string that contains the JSON input data for the execution, for example: // // "input": "{\"first_name\" : \"test\"}" diff --git a/service/sfn/api_op_StopExecution.go b/service/sfn/api_op_StopExecution.go index 61ccda25b85..52524945518 100644 --- a/service/sfn/api_op_StopExecution.go +++ b/service/sfn/api_op_StopExecution.go @@ -14,6 +14,13 @@ import ( // Stops an execution. // // This API action is not supported by EXPRESS state machines. +// +// For an execution with encryption enabled, Step Functions will encrypt the error +// and cause fields using the KMS key for the execution role. +// +// A caller can stop an execution without using any KMS permissions in the +// execution role if the caller provides a null value for both error and cause +// fields because no data needs to be encrypted. func (c *Client) StopExecution(ctx context.Context, params *StopExecutionInput, optFns ...func(*Options)) (*StopExecutionOutput, error) { if params == nil { params = &StopExecutionInput{} diff --git a/service/sfn/api_op_UpdateStateMachine.go b/service/sfn/api_op_UpdateStateMachine.go index 6d5f57cf382..7e283f75c71 100644 --- a/service/sfn/api_op_UpdateStateMachine.go +++ b/service/sfn/api_op_UpdateStateMachine.go @@ -12,10 +12,11 @@ import ( "time" ) -// Updates an existing state machine by modifying its definition , roleArn , or -// loggingConfiguration . Running executions will continue to use the previous -// definition and roleArn . You must include at least one of definition or roleArn -// or you will receive a MissingRequiredParameter error. +// Updates an existing state machine by modifying its definition , roleArn , +// loggingConfiguration , or EncryptionConfiguration . Running executions will +// continue to use the previous definition and roleArn . You must include at least +// one of definition or roleArn or you will receive a MissingRequiredParameter +// error. // // A qualified state machine ARN refers to a Distributed Map state defined within // a state machine. For example, the qualified state machine ARN @@ -89,6 +90,9 @@ type UpdateStateMachineInput struct { // [Amazon States Language]: https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html Definition *string + // Settings to configure server-side encryption. + EncryptionConfiguration *types.EncryptionConfiguration + // Use the LoggingConfiguration data type to set CloudWatch Logs options. LoggingConfiguration *types.LoggingConfiguration diff --git a/service/sfn/deserializers.go b/service/sfn/deserializers.go index 10802c8721c..a3851a100dc 100644 --- a/service/sfn/deserializers.go +++ b/service/sfn/deserializers.go @@ -123,12 +123,24 @@ func awsAwsjson10_deserializeOpErrorCreateActivity(response *smithyhttp.Response errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("ActivityAlreadyExists", errorCode): + return awsAwsjson10_deserializeErrorActivityAlreadyExists(response, errorBody) + case strings.EqualFold("ActivityLimitExceeded", errorCode): return awsAwsjson10_deserializeErrorActivityLimitExceeded(response, errorBody) + case strings.EqualFold("InvalidEncryptionConfiguration", errorCode): + return awsAwsjson10_deserializeErrorInvalidEncryptionConfiguration(response, errorBody) + case strings.EqualFold("InvalidName", errorCode): return awsAwsjson10_deserializeErrorInvalidName(response, errorBody) + case strings.EqualFold("KmsAccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorKmsAccessDeniedException(response, errorBody) + + case strings.EqualFold("KmsThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorKmsThrottlingException(response, errorBody) + case strings.EqualFold("TooManyTags", errorCode): return awsAwsjson10_deserializeErrorTooManyTags(response, errorBody) @@ -245,6 +257,9 @@ func awsAwsjson10_deserializeOpErrorCreateStateMachine(response *smithyhttp.Resp case strings.EqualFold("InvalidDefinition", errorCode): return awsAwsjson10_deserializeErrorInvalidDefinition(response, errorBody) + case strings.EqualFold("InvalidEncryptionConfiguration", errorCode): + return awsAwsjson10_deserializeErrorInvalidEncryptionConfiguration(response, errorBody) + case strings.EqualFold("InvalidLoggingConfiguration", errorCode): return awsAwsjson10_deserializeErrorInvalidLoggingConfiguration(response, errorBody) @@ -254,6 +269,12 @@ func awsAwsjson10_deserializeOpErrorCreateStateMachine(response *smithyhttp.Resp case strings.EqualFold("InvalidTracingConfiguration", errorCode): return awsAwsjson10_deserializeErrorInvalidTracingConfiguration(response, errorBody) + case strings.EqualFold("KmsAccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorKmsAccessDeniedException(response, errorBody) + + case strings.EqualFold("KmsThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorKmsThrottlingException(response, errorBody) + case strings.EqualFold("StateMachineAlreadyExists", errorCode): return awsAwsjson10_deserializeErrorStateMachineAlreadyExists(response, errorBody) @@ -1063,6 +1084,15 @@ func awsAwsjson10_deserializeOpErrorDescribeExecution(response *smithyhttp.Respo case strings.EqualFold("InvalidArn", errorCode): return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody) + case strings.EqualFold("KmsAccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorKmsAccessDeniedException(response, errorBody) + + case strings.EqualFold("KmsInvalidStateException", errorCode): + return awsAwsjson10_deserializeErrorKmsInvalidStateException(response, errorBody) + + case strings.EqualFold("KmsThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorKmsThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1280,6 +1310,15 @@ func awsAwsjson10_deserializeOpErrorDescribeStateMachine(response *smithyhttp.Re case strings.EqualFold("InvalidArn", errorCode): return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody) + case strings.EqualFold("KmsAccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorKmsAccessDeniedException(response, errorBody) + + case strings.EqualFold("KmsInvalidStateException", errorCode): + return awsAwsjson10_deserializeErrorKmsInvalidStateException(response, errorBody) + + case strings.EqualFold("KmsThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorKmsThrottlingException(response, errorBody) + case strings.EqualFold("StateMachineDoesNotExist", errorCode): return awsAwsjson10_deserializeErrorStateMachineDoesNotExist(response, errorBody) @@ -1506,6 +1545,15 @@ func awsAwsjson10_deserializeOpErrorDescribeStateMachineForExecution(response *s case strings.EqualFold("InvalidArn", errorCode): return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody) + case strings.EqualFold("KmsAccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorKmsAccessDeniedException(response, errorBody) + + case strings.EqualFold("KmsInvalidStateException", errorCode): + return awsAwsjson10_deserializeErrorKmsInvalidStateException(response, errorBody) + + case strings.EqualFold("KmsThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorKmsThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1619,6 +1667,15 @@ func awsAwsjson10_deserializeOpErrorGetActivityTask(response *smithyhttp.Respons case strings.EqualFold("InvalidArn", errorCode): return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody) + case strings.EqualFold("KmsAccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorKmsAccessDeniedException(response, errorBody) + + case strings.EqualFold("KmsInvalidStateException", errorCode): + return awsAwsjson10_deserializeErrorKmsInvalidStateException(response, errorBody) + + case strings.EqualFold("KmsThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorKmsThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1732,6 +1789,15 @@ func awsAwsjson10_deserializeOpErrorGetExecutionHistory(response *smithyhttp.Res case strings.EqualFold("InvalidToken", errorCode): return awsAwsjson10_deserializeErrorInvalidToken(response, errorBody) + case strings.EqualFold("KmsAccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorKmsAccessDeniedException(response, errorBody) + + case strings.EqualFold("KmsInvalidStateException", errorCode): + return awsAwsjson10_deserializeErrorKmsInvalidStateException(response, errorBody) + + case strings.EqualFold("KmsThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorKmsThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2871,6 +2937,15 @@ func awsAwsjson10_deserializeOpErrorSendTaskFailure(response *smithyhttp.Respons case strings.EqualFold("InvalidToken", errorCode): return awsAwsjson10_deserializeErrorInvalidToken(response, errorBody) + case strings.EqualFold("KmsAccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorKmsAccessDeniedException(response, errorBody) + + case strings.EqualFold("KmsInvalidStateException", errorCode): + return awsAwsjson10_deserializeErrorKmsInvalidStateException(response, errorBody) + + case strings.EqualFold("KmsThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorKmsThrottlingException(response, errorBody) + case strings.EqualFold("TaskDoesNotExist", errorCode): return awsAwsjson10_deserializeErrorTaskDoesNotExist(response, errorBody) @@ -3100,6 +3175,15 @@ func awsAwsjson10_deserializeOpErrorSendTaskSuccess(response *smithyhttp.Respons case strings.EqualFold("InvalidToken", errorCode): return awsAwsjson10_deserializeErrorInvalidToken(response, errorBody) + case strings.EqualFold("KmsAccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorKmsAccessDeniedException(response, errorBody) + + case strings.EqualFold("KmsInvalidStateException", errorCode): + return awsAwsjson10_deserializeErrorKmsInvalidStateException(response, errorBody) + + case strings.EqualFold("KmsThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorKmsThrottlingException(response, errorBody) + case strings.EqualFold("TaskDoesNotExist", errorCode): return awsAwsjson10_deserializeErrorTaskDoesNotExist(response, errorBody) @@ -3225,6 +3309,15 @@ func awsAwsjson10_deserializeOpErrorStartExecution(response *smithyhttp.Response case strings.EqualFold("InvalidName", errorCode): return awsAwsjson10_deserializeErrorInvalidName(response, errorBody) + case strings.EqualFold("KmsAccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorKmsAccessDeniedException(response, errorBody) + + case strings.EqualFold("KmsInvalidStateException", errorCode): + return awsAwsjson10_deserializeErrorKmsInvalidStateException(response, errorBody) + + case strings.EqualFold("KmsThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorKmsThrottlingException(response, errorBody) + case strings.EqualFold("StateMachineDeleting", errorCode): return awsAwsjson10_deserializeErrorStateMachineDeleting(response, errorBody) @@ -3347,6 +3440,15 @@ func awsAwsjson10_deserializeOpErrorStartSyncExecution(response *smithyhttp.Resp case strings.EqualFold("InvalidName", errorCode): return awsAwsjson10_deserializeErrorInvalidName(response, errorBody) + case strings.EqualFold("KmsAccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorKmsAccessDeniedException(response, errorBody) + + case strings.EqualFold("KmsInvalidStateException", errorCode): + return awsAwsjson10_deserializeErrorKmsInvalidStateException(response, errorBody) + + case strings.EqualFold("KmsThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorKmsThrottlingException(response, errorBody) + case strings.EqualFold("StateMachineDeleting", errorCode): return awsAwsjson10_deserializeErrorStateMachineDeleting(response, errorBody) @@ -3466,6 +3568,15 @@ func awsAwsjson10_deserializeOpErrorStopExecution(response *smithyhttp.Response, case strings.EqualFold("InvalidArn", errorCode): return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody) + case strings.EqualFold("KmsAccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorKmsAccessDeniedException(response, errorBody) + + case strings.EqualFold("KmsInvalidStateException", errorCode): + return awsAwsjson10_deserializeErrorKmsInvalidStateException(response, errorBody) + + case strings.EqualFold("KmsThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorKmsThrottlingException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsAwsjson10_deserializeErrorValidationException(response, errorBody) @@ -4034,12 +4145,21 @@ func awsAwsjson10_deserializeOpErrorUpdateStateMachine(response *smithyhttp.Resp case strings.EqualFold("InvalidDefinition", errorCode): return awsAwsjson10_deserializeErrorInvalidDefinition(response, errorBody) + case strings.EqualFold("InvalidEncryptionConfiguration", errorCode): + return awsAwsjson10_deserializeErrorInvalidEncryptionConfiguration(response, errorBody) + case strings.EqualFold("InvalidLoggingConfiguration", errorCode): return awsAwsjson10_deserializeErrorInvalidLoggingConfiguration(response, errorBody) case strings.EqualFold("InvalidTracingConfiguration", errorCode): return awsAwsjson10_deserializeErrorInvalidTracingConfiguration(response, errorBody) + case strings.EqualFold("KmsAccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorKmsAccessDeniedException(response, errorBody) + + case strings.EqualFold("KmsThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorKmsThrottlingException(response, errorBody) + case strings.EqualFold("MissingRequiredParameter", errorCode): return awsAwsjson10_deserializeErrorMissingRequiredParameter(response, errorBody) @@ -4291,6 +4411,41 @@ func awsAwsjson10_deserializeOpErrorValidateStateMachineDefinition(response *smi } } +func awsAwsjson10_deserializeErrorActivityAlreadyExists(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.ActivityAlreadyExists{} + err := awsAwsjson10_deserializeDocumentActivityAlreadyExists(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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_deserializeErrorActivityDoesNotExist(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -4641,6 +4796,41 @@ func awsAwsjson10_deserializeErrorInvalidDefinition(response *smithyhttp.Respons return output } +func awsAwsjson10_deserializeErrorInvalidEncryptionConfiguration(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.InvalidEncryptionConfiguration{} + err := awsAwsjson10_deserializeDocumentInvalidEncryptionConfiguration(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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_deserializeErrorInvalidExecutionInput(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -4851,6 +5041,111 @@ func awsAwsjson10_deserializeErrorInvalidTracingConfiguration(response *smithyht return output } +func awsAwsjson10_deserializeErrorKmsAccessDeniedException(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.KmsAccessDeniedException{} + err := awsAwsjson10_deserializeDocumentKmsAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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_deserializeErrorKmsInvalidStateException(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.KmsInvalidStateException{} + err := awsAwsjson10_deserializeDocumentKmsInvalidStateException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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_deserializeErrorKmsThrottlingException(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.KmsThrottlingException{} + err := awsAwsjson10_deserializeDocumentKmsThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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_deserializeErrorMissingRequiredParameter(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -5271,6 +5566,46 @@ func awsAwsjson10_deserializeErrorValidationException(response *smithyhttp.Respo return output } +func awsAwsjson10_deserializeDocumentActivityAlreadyExists(v **types.ActivityAlreadyExists, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ActivityAlreadyExists + if *v == nil { + sv = &types.ActivityAlreadyExists{} + } 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_deserializeDocumentActivityDoesNotExist(v **types.ActivityDoesNotExist, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5979,6 +6314,68 @@ func awsAwsjson10_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } +func awsAwsjson10_deserializeDocumentEncryptionConfiguration(v **types.EncryptionConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EncryptionConfiguration + if *v == nil { + sv = &types.EncryptionConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "kmsDataKeyReusePeriodSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected KmsDataKeyReusePeriodSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.KmsDataKeyReusePeriodSeconds = ptr.Int32(int32(i64)) + } + + 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 "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EncryptionType to be of type string, got %T instead", value) + } + sv.Type = types.EncryptionType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentExecutionAbortedEventDetails(v **types.ExecutionAbortedEventDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7312,6 +7709,46 @@ func awsAwsjson10_deserializeDocumentInvalidDefinition(v **types.InvalidDefiniti return nil } +func awsAwsjson10_deserializeDocumentInvalidEncryptionConfiguration(v **types.InvalidEncryptionConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidEncryptionConfiguration + if *v == nil { + sv = &types.InvalidEncryptionConfiguration{} + } 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_deserializeDocumentInvalidExecutionInput(v **types.InvalidExecutionInput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7552,6 +7989,135 @@ func awsAwsjson10_deserializeDocumentInvalidTracingConfiguration(v **types.Inval return nil } +func awsAwsjson10_deserializeDocumentKmsAccessDeniedException(v **types.KmsAccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KmsAccessDeniedException + if *v == nil { + sv = &types.KmsAccessDeniedException{} + } 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_deserializeDocumentKmsInvalidStateException(v **types.KmsInvalidStateException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KmsInvalidStateException + if *v == nil { + sv = &types.KmsInvalidStateException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "kmsKeyState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyState to be of type string, got %T instead", value) + } + sv.KmsKeyState = types.KmsKeyState(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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentKmsThrottlingException(v **types.KmsThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KmsThrottlingException + if *v == nil { + sv = &types.KmsThrottlingException{} + } 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_deserializeDocumentLambdaFunctionFailedEventDetails(v **types.LambdaFunctionFailedEventDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10817,6 +11383,11 @@ func awsAwsjson10_deserializeOpDocumentDescribeActivityOutput(v **DescribeActivi } } + case "encryptionConfiguration": + if err := awsAwsjson10_deserializeDocumentEncryptionConfiguration(&sv.EncryptionConfiguration, value); err != nil { + return err + } + case "name": if value != nil { jtv, ok := value.(string) @@ -11378,6 +11949,11 @@ func awsAwsjson10_deserializeOpDocumentDescribeStateMachineForExecutionOutput(v sv.Definition = ptr.String(jtv) } + case "encryptionConfiguration": + if err := awsAwsjson10_deserializeDocumentEncryptionConfiguration(&sv.EncryptionConfiguration, value); err != nil { + return err + } + case "label": if value != nil { jtv, ok := value.(string) @@ -11523,6 +12099,11 @@ func awsAwsjson10_deserializeOpDocumentDescribeStateMachineOutput(v **DescribeSt sv.Description = ptr.String(jtv) } + case "encryptionConfiguration": + if err := awsAwsjson10_deserializeDocumentEncryptionConfiguration(&sv.EncryptionConfiguration, value); err != nil { + return err + } + case "label": if value != nil { jtv, ok := value.(string) diff --git a/service/sfn/doc.go b/service/sfn/doc.go index 813fb6efd06..cadd486bad2 100644 --- a/service/sfn/doc.go +++ b/service/sfn/doc.go @@ -5,8 +5,8 @@ // // # Step Functions // -// Step Functions is a service that lets you coordinate the components of -// distributed applications and microservices using visual workflows. +// Step Functions coordinates the components of distributed applications and +// microservices using visual workflows. // // You can use Step Functions to build applications from individual components, // each of which performs a discrete function, or task, allowing you to scale and diff --git a/service/sfn/serializers.go b/service/sfn/serializers.go index 661b3622ec6..c57f46b96fe 100644 --- a/service/sfn/serializers.go +++ b/service/sfn/serializers.go @@ -2062,6 +2062,28 @@ func awsAwsjson10_serializeDocumentCloudWatchLogsLogGroup(v *types.CloudWatchLog return nil } +func awsAwsjson10_serializeDocumentEncryptionConfiguration(v *types.EncryptionConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KmsDataKeyReusePeriodSeconds != nil { + ok := object.Key("kmsDataKeyReusePeriodSeconds") + ok.Integer(*v.KmsDataKeyReusePeriodSeconds) + } + + if v.KmsKeyId != nil { + ok := object.Key("kmsKeyId") + ok.String(*v.KmsKeyId) + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + func awsAwsjson10_serializeDocumentLogDestination(v *types.LogDestination, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2200,6 +2222,13 @@ func awsAwsjson10_serializeOpDocumentCreateActivityInput(v *CreateActivityInput, object := value.Object() defer object.Close() + if v.EncryptionConfiguration != nil { + ok := object.Key("encryptionConfiguration") + if err := awsAwsjson10_serializeDocumentEncryptionConfiguration(v.EncryptionConfiguration, ok); err != nil { + return err + } + } + if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) @@ -2248,6 +2277,13 @@ func awsAwsjson10_serializeOpDocumentCreateStateMachineInput(v *CreateStateMachi ok.String(*v.Definition) } + if v.EncryptionConfiguration != nil { + ok := object.Key("encryptionConfiguration") + if err := awsAwsjson10_serializeDocumentEncryptionConfiguration(v.EncryptionConfiguration, ok); err != nil { + return err + } + } + if v.LoggingConfiguration != nil { ok := object.Key("loggingConfiguration") if err := awsAwsjson10_serializeDocumentLoggingConfiguration(v.LoggingConfiguration, ok); err != nil { @@ -2366,6 +2402,11 @@ func awsAwsjson10_serializeOpDocumentDescribeExecutionInput(v *DescribeExecution ok.String(*v.ExecutionArn) } + if len(v.IncludedData) > 0 { + ok := object.Key("includedData") + ok.String(string(v.IncludedData)) + } + return nil } @@ -2402,6 +2443,11 @@ func awsAwsjson10_serializeOpDocumentDescribeStateMachineForExecutionInput(v *De ok.String(*v.ExecutionArn) } + if len(v.IncludedData) > 0 { + ok := object.Key("includedData") + ok.String(string(v.IncludedData)) + } + return nil } @@ -2409,6 +2455,11 @@ func awsAwsjson10_serializeOpDocumentDescribeStateMachineInput(v *DescribeStateM object := value.Object() defer object.Close() + if len(v.IncludedData) > 0 { + ok := object.Key("includedData") + ok.String(string(v.IncludedData)) + } + if v.StateMachineArn != nil { ok := object.Key("stateMachineArn") ok.String(*v.StateMachineArn) @@ -2736,6 +2787,11 @@ func awsAwsjson10_serializeOpDocumentStartSyncExecutionInput(v *StartSyncExecuti object := value.Object() defer object.Close() + if len(v.IncludedData) > 0 { + ok := object.Key("includedData") + ok.String(string(v.IncludedData)) + } + if v.Input != nil { ok := object.Key("input") ok.String(*v.Input) @@ -2924,6 +2980,13 @@ func awsAwsjson10_serializeOpDocumentUpdateStateMachineInput(v *UpdateStateMachi ok.String(*v.Definition) } + if v.EncryptionConfiguration != nil { + ok := object.Key("encryptionConfiguration") + if err := awsAwsjson10_serializeDocumentEncryptionConfiguration(v.EncryptionConfiguration, ok); err != nil { + return err + } + } + if v.LoggingConfiguration != nil { ok := object.Key("loggingConfiguration") if err := awsAwsjson10_serializeDocumentLoggingConfiguration(v.LoggingConfiguration, ok); err != nil { diff --git a/service/sfn/types/enums.go b/service/sfn/types/enums.go index 800f92380da..d5858f05792 100644 --- a/service/sfn/types/enums.go +++ b/service/sfn/types/enums.go @@ -2,6 +2,25 @@ package types +type EncryptionType string + +// Enum values for EncryptionType +const ( + EncryptionTypeAwsOwnedKey EncryptionType = "AWS_OWNED_KEY" + EncryptionTypeCustomerManagedKmsKey EncryptionType = "CUSTOMER_MANAGED_KMS_KEY" +) + +// Values returns all known values for EncryptionType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (EncryptionType) Values() []EncryptionType { + return []EncryptionType{ + "AWS_OWNED_KEY", + "CUSTOMER_MANAGED_KMS_KEY", + } +} + type ExecutionRedriveFilter string // Enum values for ExecutionRedriveFilter @@ -206,6 +225,25 @@ func (HistoryEventType) Values() []HistoryEventType { } } +type IncludedData string + +// Enum values for IncludedData +const ( + IncludedDataAllData IncludedData = "ALL_DATA" + IncludedDataMetadataOnly IncludedData = "METADATA_ONLY" +) + +// Values returns all known values for IncludedData. 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 (IncludedData) Values() []IncludedData { + return []IncludedData{ + "ALL_DATA", + "METADATA_ONLY", + } +} + type InspectionLevel string // Enum values for InspectionLevel @@ -227,6 +265,31 @@ func (InspectionLevel) Values() []InspectionLevel { } } +type KmsKeyState string + +// Enum values for KmsKeyState +const ( + KmsKeyStateDisabled KmsKeyState = "DISABLED" + KmsKeyStatePendingDeletion KmsKeyState = "PENDING_DELETION" + KmsKeyStatePendingImport KmsKeyState = "PENDING_IMPORT" + KmsKeyStateUnavailable KmsKeyState = "UNAVAILABLE" + KmsKeyStateCreating KmsKeyState = "CREATING" +) + +// Values returns all known values for KmsKeyState. 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 (KmsKeyState) Values() []KmsKeyState { + return []KmsKeyState{ + "DISABLED", + "PENDING_DELETION", + "PENDING_IMPORT", + "UNAVAILABLE", + "CREATING", + } +} + type LogLevel string // Enum values for LogLevel diff --git a/service/sfn/types/errors.go b/service/sfn/types/errors.go index 871515f4640..2b9d834e68a 100644 --- a/service/sfn/types/errors.go +++ b/service/sfn/types/errors.go @@ -7,6 +7,32 @@ import ( smithy "github.com/aws/smithy-go" ) +// Activity already exists. EncryptionConfiguration may not be updated. +type ActivityAlreadyExists struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ActivityAlreadyExists) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ActivityAlreadyExists) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ActivityAlreadyExists) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ActivityAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *ActivityAlreadyExists) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The specified activity does not exist. type ActivityDoesNotExist struct { Message *string @@ -277,6 +303,35 @@ func (e *InvalidDefinition) ErrorCode() string { } func (e *InvalidDefinition) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// Received when encryptionConfiguration is specified but various conditions exist +// which make the configuration invalid. For example, if type is set to +// CUSTOMER_MANAGED_KMS_KEY , but kmsKeyId is null, or kmsDataKeyReusePeriodSeconds +// is not between 60 and 900, or the KMS key is not symmetric or inactive. +type InvalidEncryptionConfiguration struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidEncryptionConfiguration) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidEncryptionConfiguration) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidEncryptionConfiguration) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidEncryptionConfiguration" + } + return *e.ErrorCodeOverride +} +func (e *InvalidEncryptionConfiguration) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The provided JSON input data is not valid. type InvalidExecutionInput struct { Message *string @@ -303,6 +358,7 @@ func (e *InvalidExecutionInput) ErrorCode() string { } func (e *InvalidExecutionInput) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// Configuration is not valid. type InvalidLoggingConfiguration struct { Message *string @@ -433,6 +489,87 @@ func (e *InvalidTracingConfiguration) ErrorCode() string { } func (e *InvalidTracingConfiguration) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// Either your KMS key policy or API caller does not have the required permissions. +type KmsAccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *KmsAccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *KmsAccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *KmsAccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "KmsAccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *KmsAccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The KMS key is not in valid state, for example: Disabled or Deleted. +type KmsInvalidStateException struct { + Message *string + + ErrorCodeOverride *string + + KmsKeyState KmsKeyState + + noSmithyDocumentSerde +} + +func (e *KmsInvalidStateException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *KmsInvalidStateException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *KmsInvalidStateException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "KmsInvalidStateException" + } + return *e.ErrorCodeOverride +} +func (e *KmsInvalidStateException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Received when KMS returns ThrottlingException for a KMS call that Step +// Functions makes on behalf of the caller. +type KmsThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *KmsThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *KmsThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *KmsThrottlingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "KmsThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *KmsThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // Request is missing a required parameter. This error occurs if both definition // and roleArn are not specified. type MissingRequiredParameter struct { @@ -622,6 +759,7 @@ func (e *StateMachineLimitExceeded) ErrorCode() string { } func (e *StateMachineLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// State machine type is not supported. type StateMachineTypeNotSupported struct { Message *string diff --git a/service/sfn/types/types.go b/service/sfn/types/types.go index 8dd31c927a1..f366d23d56f 100644 --- a/service/sfn/types/types.go +++ b/service/sfn/types/types.go @@ -159,6 +159,43 @@ type CloudWatchLogsLogGroup struct { noSmithyDocumentSerde } +// Settings to configure server-side encryption. +// +// For additional control over security, you can encrypt your data using a +// customer-managed key for Step Functions state machines and activities. You can +// configure a symmetric KMS key and data key reuse period when creating or +// updating a State Machine, and when creating an Activity. The execution history +// and state machine definition will be encrypted with the key applied to the State +// Machine. Activity inputs will be encrypted with the key applied to the Activity. +// +// Step Functions automatically enables encryption at rest using Amazon Web +// Services owned keys at no charge. However, KMS charges apply when using a +// customer managed key. For more information about pricing, see [Key Management Service pricing]. +// +// For more information on KMS, see [What is Key Management Service?] +// +// [Key Management Service pricing]: https://aws.amazon.com/kms/pricing/ +// [What is Key Management Service?]: https://docs.aws.amazon.com/kms/latest/developerguide/overview.html +type EncryptionConfiguration struct { + + // Encryption type + // + // This member is required. + Type EncryptionType + + // Maximum duration that Step Functions will reuse data keys. When the period + // expires, Step Functions will call GenerateDataKey . Only applies to customer + // managed keys. + KmsDataKeyReusePeriodSeconds *int32 + + // An alias, alias ARN, key ID, or key ARN of a symmetric encryption KMS key to + // encrypt data. To specify a KMS key in a different Amazon Web Services account, + // you must use the key ARN or alias ARN. + KmsKeyId *string + + noSmithyDocumentSerde +} + // Contains details about an abort of an execution. type ExecutionAbortedEventDetails struct { diff --git a/service/sfn/validators.go b/service/sfn/validators.go index b7402b3c216..a38ebfd296d 100644 --- a/service/sfn/validators.go +++ b/service/sfn/validators.go @@ -826,6 +826,21 @@ func addOpValidateStateMachineDefinitionValidationMiddleware(stack *middleware.S return stack.Initialize.Add(&validateOpValidateStateMachineDefinition{}, middleware.After) } +func validateEncryptionConfiguration(v *types.EncryptionConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EncryptionConfiguration"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateRoutingConfigurationList(v []types.RoutingConfigurationListItem) error { if v == nil { return nil @@ -866,6 +881,11 @@ func validateOpCreateActivityInput(v *CreateActivityInput) error { if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } + if v.EncryptionConfiguration != nil { + if err := validateEncryptionConfiguration(v.EncryptionConfiguration); err != nil { + invalidParams.AddNested("EncryptionConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -909,6 +929,11 @@ func validateOpCreateStateMachineInput(v *CreateStateMachineInput) error { if v.RoleArn == nil { invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) } + if v.EncryptionConfiguration != nil { + if err := validateEncryptionConfiguration(v.EncryptionConfiguration); err != nil { + invalidParams.AddNested("EncryptionConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1376,6 +1401,11 @@ func validateOpUpdateStateMachineInput(v *UpdateStateMachineInput) error { if v.StateMachineArn == nil { invalidParams.Add(smithy.NewErrParamRequired("StateMachineArn")) } + if v.EncryptionConfiguration != nil { + if err := validateEncryptionConfiguration(v.EncryptionConfiguration); err != nil { + invalidParams.AddNested("EncryptionConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else {