From 3fe6736a20f5581051dc4fd3f35a0960ed6f8a01 Mon Sep 17 00:00:00 2001 From: Isaiah Vita <82135527+isaiahvita@users.noreply.github.com> Date: Wed, 19 Jul 2023 11:40:41 -0700 Subject: [PATCH] Fix S3Control endpoint customization tests (#2195) --- .../aws/go/codegen/AwsGoDependency.java | 3 + .../DisableEndpointHostPrefix.java | 21 ++++ ...lHostPrefixAccountIdFilterIntegration.java | 50 -------- .../customization/S3UpdateOutpostArn.java | 115 ++++++++++++++++++ ...mithy.go.codegen.integration.GoIntegration | 3 +- ...tPrefixAccountIdFilterIntegrationTest.java | 37 ------ service/internal/s3shared/arn/arn_member.go | 32 +++++ service/internal/s3shared/arn_lookup.go | 5 - service/s3/api_op_AbortMultipartUpload.go | 2 + service/s3/api_op_CompleteMultipartUpload.go | 2 + service/s3/api_op_CopyObject.go | 2 + service/s3/api_op_CreateBucket.go | 2 + service/s3/api_op_CreateMultipartUpload.go | 2 + service/s3/api_op_DeleteBucket.go | 2 + ...i_op_DeleteBucketAnalyticsConfiguration.go | 2 + service/s3/api_op_DeleteBucketCors.go | 2 + service/s3/api_op_DeleteBucketEncryption.go | 2 + ...teBucketIntelligentTieringConfiguration.go | 2 + ...i_op_DeleteBucketInventoryConfiguration.go | 2 + service/s3/api_op_DeleteBucketLifecycle.go | 2 + ...api_op_DeleteBucketMetricsConfiguration.go | 2 + .../api_op_DeleteBucketOwnershipControls.go | 2 + service/s3/api_op_DeleteBucketPolicy.go | 2 + service/s3/api_op_DeleteBucketReplication.go | 2 + service/s3/api_op_DeleteBucketTagging.go | 2 + service/s3/api_op_DeleteBucketWebsite.go | 2 + service/s3/api_op_DeleteObject.go | 2 + service/s3/api_op_DeleteObjectTagging.go | 2 + service/s3/api_op_DeleteObjects.go | 2 + service/s3/api_op_DeletePublicAccessBlock.go | 2 + ...api_op_GetBucketAccelerateConfiguration.go | 2 + service/s3/api_op_GetBucketAcl.go | 2 + .../api_op_GetBucketAnalyticsConfiguration.go | 2 + service/s3/api_op_GetBucketCors.go | 2 + service/s3/api_op_GetBucketEncryption.go | 2 + ...etBucketIntelligentTieringConfiguration.go | 2 + .../api_op_GetBucketInventoryConfiguration.go | 2 + .../api_op_GetBucketLifecycleConfiguration.go | 2 + service/s3/api_op_GetBucketLocation.go | 2 + service/s3/api_op_GetBucketLogging.go | 2 + .../api_op_GetBucketMetricsConfiguration.go | 2 + ...i_op_GetBucketNotificationConfiguration.go | 2 + .../s3/api_op_GetBucketOwnershipControls.go | 2 + service/s3/api_op_GetBucketPolicy.go | 2 + service/s3/api_op_GetBucketPolicyStatus.go | 2 + service/s3/api_op_GetBucketReplication.go | 2 + service/s3/api_op_GetBucketRequestPayment.go | 2 + service/s3/api_op_GetBucketTagging.go | 2 + service/s3/api_op_GetBucketVersioning.go | 2 + service/s3/api_op_GetBucketWebsite.go | 2 + service/s3/api_op_GetObject.go | 2 + service/s3/api_op_GetObjectAcl.go | 2 + service/s3/api_op_GetObjectAttributes.go | 2 + service/s3/api_op_GetObjectLegalHold.go | 2 + .../s3/api_op_GetObjectLockConfiguration.go | 2 + service/s3/api_op_GetObjectRetention.go | 2 + service/s3/api_op_GetObjectTagging.go | 2 + service/s3/api_op_GetObjectTorrent.go | 2 + service/s3/api_op_GetPublicAccessBlock.go | 2 + service/s3/api_op_HeadBucket.go | 2 + service/s3/api_op_HeadObject.go | 2 + ...pi_op_ListBucketAnalyticsConfigurations.go | 2 + ...tBucketIntelligentTieringConfigurations.go | 2 + ...pi_op_ListBucketInventoryConfigurations.go | 2 + .../api_op_ListBucketMetricsConfigurations.go | 2 + service/s3/api_op_ListBuckets.go | 2 + service/s3/api_op_ListMultipartUploads.go | 2 + service/s3/api_op_ListObjectVersions.go | 2 + service/s3/api_op_ListObjects.go | 2 + service/s3/api_op_ListObjectsV2.go | 2 + service/s3/api_op_ListParts.go | 2 + ...api_op_PutBucketAccelerateConfiguration.go | 2 + service/s3/api_op_PutBucketAcl.go | 2 + .../api_op_PutBucketAnalyticsConfiguration.go | 2 + service/s3/api_op_PutBucketCors.go | 2 + service/s3/api_op_PutBucketEncryption.go | 2 + ...utBucketIntelligentTieringConfiguration.go | 2 + .../api_op_PutBucketInventoryConfiguration.go | 2 + .../api_op_PutBucketLifecycleConfiguration.go | 2 + service/s3/api_op_PutBucketLogging.go | 2 + .../api_op_PutBucketMetricsConfiguration.go | 2 + ...i_op_PutBucketNotificationConfiguration.go | 2 + .../s3/api_op_PutBucketOwnershipControls.go | 2 + service/s3/api_op_PutBucketPolicy.go | 2 + service/s3/api_op_PutBucketReplication.go | 2 + service/s3/api_op_PutBucketRequestPayment.go | 2 + service/s3/api_op_PutBucketTagging.go | 2 + service/s3/api_op_PutBucketVersioning.go | 2 + service/s3/api_op_PutBucketWebsite.go | 2 + service/s3/api_op_PutObject.go | 2 + service/s3/api_op_PutObjectAcl.go | 2 + service/s3/api_op_PutObjectLegalHold.go | 2 + .../s3/api_op_PutObjectLockConfiguration.go | 2 + service/s3/api_op_PutObjectRetention.go | 2 + service/s3/api_op_PutObjectTagging.go | 2 + service/s3/api_op_PutPublicAccessBlock.go | 2 + service/s3/api_op_RestoreObject.go | 2 + service/s3/api_op_SelectObjectContent.go | 2 + service/s3/api_op_UploadPart.go | 2 + service/s3/api_op_UploadPartCopy.go | 2 + service/s3/api_op_WriteGetObjectResponse.go | 2 + service/s3/endpoints.go | 22 ++-- service/s3control/api_op_CreateAccessPoint.go | 62 ++++++++++ ...api_op_CreateAccessPointForObjectLambda.go | 50 ++++++++ service/s3control/api_op_CreateBucket.go | 17 +++ service/s3control/api_op_CreateJob.go | 50 ++++++++ .../api_op_CreateMultiRegionAccessPoint.go | 50 ++++++++ service/s3control/api_op_DeleteAccessPoint.go | 62 ++++++++++ ...api_op_DeleteAccessPointForObjectLambda.go | 50 ++++++++ .../api_op_DeleteAccessPointPolicy.go | 62 ++++++++++ ..._DeleteAccessPointPolicyForObjectLambda.go | 50 ++++++++ service/s3control/api_op_DeleteBucket.go | 62 ++++++++++ ...i_op_DeleteBucketLifecycleConfiguration.go | 62 ++++++++++ .../s3control/api_op_DeleteBucketPolicy.go | 62 ++++++++++ .../api_op_DeleteBucketReplication.go | 62 ++++++++++ .../s3control/api_op_DeleteBucketTagging.go | 62 ++++++++++ service/s3control/api_op_DeleteJobTagging.go | 50 ++++++++ .../api_op_DeleteMultiRegionAccessPoint.go | 50 ++++++++ .../api_op_DeletePublicAccessBlock.go | 50 ++++++++ .../api_op_DeleteStorageLensConfiguration.go | 50 ++++++++ ...p_DeleteStorageLensConfigurationTagging.go | 50 ++++++++ service/s3control/api_op_DescribeJob.go | 50 ++++++++ ...DescribeMultiRegionAccessPointOperation.go | 50 ++++++++ service/s3control/api_op_GetAccessPoint.go | 62 ++++++++++ ...AccessPointConfigurationForObjectLambda.go | 50 ++++++++ .../api_op_GetAccessPointForObjectLambda.go | 50 ++++++++ .../s3control/api_op_GetAccessPointPolicy.go | 62 ++++++++++ ..._op_GetAccessPointPolicyForObjectLambda.go | 50 ++++++++ .../api_op_GetAccessPointPolicyStatus.go | 50 ++++++++ ...tAccessPointPolicyStatusForObjectLambda.go | 50 ++++++++ service/s3control/api_op_GetBucket.go | 62 ++++++++++ .../api_op_GetBucketLifecycleConfiguration.go | 62 ++++++++++ service/s3control/api_op_GetBucketPolicy.go | 62 ++++++++++ .../s3control/api_op_GetBucketReplication.go | 62 ++++++++++ service/s3control/api_op_GetBucketTagging.go | 62 ++++++++++ .../s3control/api_op_GetBucketVersioning.go | 62 ++++++++++ service/s3control/api_op_GetJobTagging.go | 50 ++++++++ .../api_op_GetMultiRegionAccessPoint.go | 50 ++++++++ .../api_op_GetMultiRegionAccessPointPolicy.go | 50 ++++++++ ...p_GetMultiRegionAccessPointPolicyStatus.go | 50 ++++++++ .../api_op_GetMultiRegionAccessPointRoutes.go | 50 ++++++++ .../s3control/api_op_GetPublicAccessBlock.go | 50 ++++++++ .../api_op_GetStorageLensConfiguration.go | 50 ++++++++ ...i_op_GetStorageLensConfigurationTagging.go | 50 ++++++++ service/s3control/api_op_ListAccessPoints.go | 62 ++++++++++ .../api_op_ListAccessPointsForObjectLambda.go | 50 ++++++++ service/s3control/api_op_ListJobs.go | 50 ++++++++ .../api_op_ListMultiRegionAccessPoints.go | 50 ++++++++ .../s3control/api_op_ListRegionalBuckets.go | 50 ++++++++ .../api_op_ListStorageLensConfigurations.go | 50 ++++++++ ...AccessPointConfigurationForObjectLambda.go | 50 ++++++++ .../s3control/api_op_PutAccessPointPolicy.go | 62 ++++++++++ ..._op_PutAccessPointPolicyForObjectLambda.go | 50 ++++++++ .../api_op_PutBucketLifecycleConfiguration.go | 62 ++++++++++ service/s3control/api_op_PutBucketPolicy.go | 62 ++++++++++ .../s3control/api_op_PutBucketReplication.go | 62 ++++++++++ service/s3control/api_op_PutBucketTagging.go | 62 ++++++++++ .../s3control/api_op_PutBucketVersioning.go | 62 ++++++++++ service/s3control/api_op_PutJobTagging.go | 50 ++++++++ .../api_op_PutMultiRegionAccessPointPolicy.go | 50 ++++++++ .../s3control/api_op_PutPublicAccessBlock.go | 50 ++++++++ .../api_op_PutStorageLensConfiguration.go | 50 ++++++++ ...i_op_PutStorageLensConfigurationTagging.go | 50 ++++++++ ...i_op_SubmitMultiRegionAccessPointRoutes.go | 50 ++++++++ service/s3control/api_op_UpdateJobPriority.go | 50 ++++++++ service/s3control/api_op_UpdateJobStatus.go | 50 ++++++++ service/s3control/endpoints.go | 6 +- .../customizations/process_arn_resource.go | 4 + .../customizations/process_outpost_id.go | 4 + .../customizations/update_endpoint_test.go | 32 ++--- .../customizations/update_outpost_arn.go | 56 +++++++++ service/s3outposts/api_op_CreateEndpoint.go | 2 + service/s3outposts/api_op_DeleteEndpoint.go | 2 + service/s3outposts/api_op_ListEndpoints.go | 2 + .../s3outposts/api_op_ListOutpostsWithS3.go | 2 + .../s3outposts/api_op_ListSharedEndpoints.go | 2 + service/s3outposts/endpoints.go | 2 +- 177 files changed, 3907 insertions(+), 124 deletions(-) create mode 100644 codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/DisableEndpointHostPrefix.java delete mode 100644 codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/S3ControlHostPrefixAccountIdFilterIntegration.java create mode 100644 codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/S3UpdateOutpostArn.java delete mode 100644 codegen/smithy-aws-go-codegen/src/test/java/software/amazon/smithy/aws/go/codegen/customization/S3ControlHostPrefixAccountIdFilterIntegrationTest.java create mode 100644 service/internal/s3shared/arn/arn_member.go create mode 100644 service/s3control/internal/customizations/update_outpost_arn.go diff --git a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsGoDependency.java b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsGoDependency.java index ff435673ff5..a0b310ad380 100644 --- a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsGoDependency.java +++ b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsGoDependency.java @@ -55,6 +55,9 @@ public class AwsGoDependency { null, Versions.SERVICE_INTERNAL_CHECKSUM, "internalChecksum"); public static final GoDependency INTERNAL_SIGV4A = awsModuleDep("internal/v4a", null, Versions.INTERNAL_SIGV4A, "v4a"); + public static final GoDependency S3_INTERNAL_ARN = aws("service/internal/s3shared/arn", "s3arn"); + public static final GoDependency AWS_ARN = aws("aws/arn", "awsarn"); + public static final GoDependency REGEXP = SmithyGoDependency.stdlib("regexp"); diff --git a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/DisableEndpointHostPrefix.java b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/DisableEndpointHostPrefix.java new file mode 100644 index 00000000000..8dc2a2139d4 --- /dev/null +++ b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/DisableEndpointHostPrefix.java @@ -0,0 +1,21 @@ +package software.amazon.smithy.aws.go.codegen.customization; + +import software.amazon.smithy.go.codegen.GoSettings; +import software.amazon.smithy.go.codegen.GoWriter; +import software.amazon.smithy.go.codegen.SmithyGoDependency; +import software.amazon.smithy.go.codegen.SymbolUtils; +import software.amazon.smithy.go.codegen.integration.GoIntegration; +import software.amazon.smithy.model.Model; + +public class DisableEndpointHostPrefix implements GoIntegration { + @Override + public void renderPostEndpointResolutionHook(GoSettings settings, GoWriter writer, Model model) { + writer.write( + """ + ctx = $T(ctx, true) + """, + SymbolUtils.createPointableSymbolBuilder("DisableEndpointHostPrefix", SmithyGoDependency.SMITHY_HTTP_TRANSPORT).build() + ); + } + +} diff --git a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/S3ControlHostPrefixAccountIdFilterIntegration.java b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/S3ControlHostPrefixAccountIdFilterIntegration.java deleted file mode 100644 index e8c3b409c9d..00000000000 --- a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/S3ControlHostPrefixAccountIdFilterIntegration.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -package software.amazon.smithy.aws.go.codegen.customization; - -import java.util.logging.Logger; -import software.amazon.smithy.go.codegen.GoSettings; -import software.amazon.smithy.go.codegen.integration.GoIntegration; -import software.amazon.smithy.model.Model; -import software.amazon.smithy.model.pattern.SmithyPattern.Segment; -import software.amazon.smithy.model.traits.EndpointTrait; -import software.amazon.smithy.model.transform.ModelTransformer; -import software.amazon.smithy.utils.SmithyInternalApi; - -@SmithyInternalApi -public class S3ControlHostPrefixAccountIdFilterIntegration implements GoIntegration { - private static final Logger LOGGER = Logger.getLogger(S3ControlHostPrefixAccountIdFilterIntegration.class.getName()); - - @Override - public Model preprocessModel(Model model, GoSettings settings) { - if (!S3ModelUtils.isServiceS3Control(model, settings.getService(model))) { - return model; - } - LOGGER.info("Filtering S3 Control Endpoint Traits with AccountId host prefixes"); - return ModelTransformer.create().removeTraitsIf(model, (shape, trait) -> { - if (trait instanceof EndpointTrait) { - EndpointTrait endpointTrait = (EndpointTrait) trait; - for (Segment segment : endpointTrait.getHostPrefix().getLabels()) { - if (segment.isLabel() && segment.getContent().equals("AccountId")) { - LOGGER.info("Removing Endpoint Trait with AccountId host prefix: " + endpointTrait); - return true; - } - } - } - return false; - }); - } -} diff --git a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/S3UpdateOutpostArn.java b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/S3UpdateOutpostArn.java new file mode 100644 index 00000000000..a05cdd180b7 --- /dev/null +++ b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/S3UpdateOutpostArn.java @@ -0,0 +1,115 @@ +package software.amazon.smithy.aws.go.codegen.customization; + +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import software.amazon.smithy.codegen.core.CodegenException; +import software.amazon.smithy.codegen.core.SymbolProvider; +import software.amazon.smithy.go.codegen.GoDelegator; +import software.amazon.smithy.go.codegen.GoSettings; +import software.amazon.smithy.go.codegen.GoWriter; +import software.amazon.smithy.go.codegen.SymbolUtils; +import software.amazon.smithy.go.codegen.integration.GoIntegration; +import software.amazon.smithy.go.codegen.integration.MiddlewareRegistrar; +import software.amazon.smithy.go.codegen.integration.RuntimeClientPlugin; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.knowledge.TopDownIndex; +import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.utils.ListUtils; +import software.amazon.smithy.utils.SetUtils; + +/** + * Implements the arnable interface on all relevant S3/S3Control outposts operations. + */ +public class S3UpdateOutpostArn implements GoIntegration { + + private final Set LIST_ACCESSPOINT_ARN_INPUT = SetUtils.of( + "GetAccessPoint", "DeleteAccessPoint", "PutAccessPointPolicy", + "GetAccessPointPolicy", "DeleteAccessPointPolicy" + ); + + private final MiddlewareRegistrar middlewareAdder = + MiddlewareRegistrar.builder() + .resolvedFunction(SymbolUtils.createValueSymbolBuilder("AddUpdateOutpostARN", AwsCustomGoDependency.S3CONTROL_CUSTOMIZATION).build()) + .build(); + + @Override + public List getClientPlugins() { + return ListUtils.of( + RuntimeClientPlugin.builder() + .servicePredicate(S3ModelUtils::isServiceS3Control) + .registerMiddleware(middlewareAdder) + .build() + ); + } + + public void writeAdditionalFiles(GoSettings settings, Model model, SymbolProvider symbolProvider, GoDelegator goDelegator) { + ServiceShape service = settings.getService(model); + if (!S3ModelUtils.isServiceS3Control(model, service)) return; + + for (OperationShape operation : TopDownIndex.of(model).getContainedOperations(service)) { + goDelegator.useShapeWriter(operation, writer -> { + writeARNHelper(settings, writer, model, symbolProvider, operation); + }); + } + } + + private void writeARNHelper( + GoSettings settings, GoWriter writer, + Model model, SymbolProvider symbolProvider, OperationShape operation + ) { + ServiceShape service = settings.getService(model); + + String arnType = LIST_ACCESSPOINT_ARN_INPUT.contains( + operation.getId().getName(service) + ) ? "AccessPointName" : "BucketName"; + + StructureShape input = model.expectShape(operation.getInput().get(), StructureShape.class); + List listOfARNMembers = input.getAllMembers().values().stream() + .filter(m -> m.getTarget().getName(service).equals(arnType)) + .collect(Collectors.toList()); + if (listOfARNMembers.size() > 1) { + throw new CodegenException(arnType + " shape should be targeted by only one input member, found " + + listOfARNMembers.size() + " for Input shape: " + input.getId()); + } + + if (listOfARNMembers.isEmpty()) { + return; + } + + String inputName = symbolProvider.toSymbol(input).getName(); + String memberName = listOfARNMembers.get(0).getMemberName(); + + writer.write( + """ + func (m *$1L) GetARNMember() (*string, bool) { + if m.$2L == nil { + return nil, false + } + return m.$2L, true + } + """, + inputName, + memberName + ); + + + writer.write( + """ + func (m *$1L) SetARNMember(v string) error { + m.$2L = &v + return nil + } + """, + inputName, + memberName + ); + } + + + +} diff --git a/codegen/smithy-aws-go-codegen/src/main/resources/META-INF/services/software.amazon.smithy.go.codegen.integration.GoIntegration b/codegen/smithy-aws-go-codegen/src/main/resources/META-INF/services/software.amazon.smithy.go.codegen.integration.GoIntegration index b808fbd87b2..b29a8236400 100644 --- a/codegen/smithy-aws-go-codegen/src/main/resources/META-INF/services/software.amazon.smithy.go.codegen.integration.GoIntegration +++ b/codegen/smithy-aws-go-codegen/src/main/resources/META-INF/services/software.amazon.smithy.go.codegen.integration.GoIntegration @@ -52,12 +52,13 @@ software.amazon.smithy.aws.go.codegen.customization.LambdaRecursionDetection software.amazon.smithy.aws.go.codegen.customization.SQSCustomizations software.amazon.smithy.aws.go.codegen.AwsEndpointResolverInitializerGenerator software.amazon.smithy.aws.go.codegen.AwsEndpointResolverBuiltInGenerator -software.amazon.smithy.aws.go.codegen.customization.S3ControlHostPrefixAccountIdFilterIntegration software.amazon.smithy.aws.go.codegen.customization.S3HttpPathBucketFilterIntegration software.amazon.smithy.aws.go.codegen.customization.S3HttpLabelBucketFilterIntegration +software.amazon.smithy.aws.go.codegen.customization.DisableEndpointHostPrefix software.amazon.smithy.aws.go.codegen.AwsEndpointAuthSchemeGenerator software.amazon.smithy.aws.go.codegen.EndpointDisableHttps software.amazon.smithy.aws.go.codegen.customization.S3Bucketer software.amazon.smithy.aws.go.codegen.customization.S3SerializeImmutableHostnameBucket +software.amazon.smithy.aws.go.codegen.customization.S3UpdateOutpostArn software.amazon.smithy.aws.go.codegen.LegacyEndpointContextSetter diff --git a/codegen/smithy-aws-go-codegen/src/test/java/software/amazon/smithy/aws/go/codegen/customization/S3ControlHostPrefixAccountIdFilterIntegrationTest.java b/codegen/smithy-aws-go-codegen/src/test/java/software/amazon/smithy/aws/go/codegen/customization/S3ControlHostPrefixAccountIdFilterIntegrationTest.java deleted file mode 100644 index 571f809fe17..00000000000 --- a/codegen/smithy-aws-go-codegen/src/test/java/software/amazon/smithy/aws/go/codegen/customization/S3ControlHostPrefixAccountIdFilterIntegrationTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -package software.amazon.smithy.aws.go.codegen.customization; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -import org.junit.jupiter.api.Test; -import software.amazon.smithy.model.Model; -import software.amazon.smithy.model.shapes.OperationShape; -import software.amazon.smithy.model.shapes.ShapeId; -import software.amazon.smithy.model.traits.EndpointTrait; - -public class S3ControlHostPrefixAccountIdFilterIntegrationTest { - @Test - public void test() { - Model model = TestUtils.preprocessModelIntegration( - new S3ControlHostPrefixAccountIdFilterIntegration(), - S3ModelUtils.SERVICE_S3_CONTROL_MODEL_FILE); - OperationShape operation = model.expectShape( - ShapeId.from("com.amazonaws.s3control#PutAccessPointConfigurationForObjectLambda"), - OperationShape.class); - assertTrue(operation.getTrait(EndpointTrait.class).isEmpty()); - } -} diff --git a/service/internal/s3shared/arn/arn_member.go b/service/internal/s3shared/arn/arn_member.go new file mode 100644 index 00000000000..9a3258e15aa --- /dev/null +++ b/service/internal/s3shared/arn/arn_member.go @@ -0,0 +1,32 @@ +package arn + +import "fmt" + +// arnable is implemented by the relevant S3/S3Control +// operations which have members that may need ARN +// processing. +type arnable interface { + SetARNMember(string) error + GetARNMember() (*string, bool) +} + +// GetARNField would be called during middleware execution +// to retrieve a member value that is an ARN in need of +// processing. +func GetARNField(input interface{}) (*string, bool) { + v, ok := input.(arnable) + if !ok { + return nil, false + } + return v.GetARNMember() +} + +// SetARNField would called during middleware exeuction +// to set a member value that required ARN processing. +func SetARNField(input interface{}, v string) error { + params, ok := input.(arnable) + if !ok { + return fmt.Errorf("Params does not contain arn field member") + } + return params.SetARNMember(v) +} diff --git a/service/internal/s3shared/arn_lookup.go b/service/internal/s3shared/arn_lookup.go index 664d7fcd924..b51532085f6 100644 --- a/service/internal/s3shared/arn_lookup.go +++ b/service/internal/s3shared/arn_lookup.go @@ -4,7 +4,6 @@ import ( "context" "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/smithy-go/middleware" "github.com/aws/aws-sdk-go-v2/aws/arn" @@ -29,10 +28,6 @@ func (m *ARNLookup) ID() string { func (m *ARNLookup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { - if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleInitialize(ctx, in) - } - // check if GetARNValue is supported if m.GetARNValue == nil { return next.HandleInitialize(ctx, in) diff --git a/service/s3/api_op_AbortMultipartUpload.go b/service/s3/api_op_AbortMultipartUpload.go index b609de60f1a..5a6d58c7da2 100644 --- a/service/s3/api_op_AbortMultipartUpload.go +++ b/service/s3/api_op_AbortMultipartUpload.go @@ -290,6 +290,8 @@ func (m *opAbortMultipartUploadResolveEndpointMiddleware) HandleSerialize(ctx co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_CompleteMultipartUpload.go b/service/s3/api_op_CompleteMultipartUpload.go index ffb417c7aef..3c25e3d1d6a 100644 --- a/service/s3/api_op_CompleteMultipartUpload.go +++ b/service/s3/api_op_CompleteMultipartUpload.go @@ -462,6 +462,8 @@ func (m *opCompleteMultipartUploadResolveEndpointMiddleware) HandleSerialize(ctx ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_CopyObject.go b/service/s3/api_op_CopyObject.go index fc6af131a31..7c37d1e0ca4 100644 --- a/service/s3/api_op_CopyObject.go +++ b/service/s3/api_op_CopyObject.go @@ -634,6 +634,8 @@ func (m *opCopyObjectResolveEndpointMiddleware) HandleSerialize(ctx context.Cont ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_CreateBucket.go b/service/s3/api_op_CreateBucket.go index ee21b7f946b..bffcaece460 100644 --- a/service/s3/api_op_CreateBucket.go +++ b/service/s3/api_op_CreateBucket.go @@ -339,6 +339,8 @@ func (m *opCreateBucketResolveEndpointMiddleware) HandleSerialize(ctx context.Co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_CreateMultipartUpload.go b/service/s3/api_op_CreateMultipartUpload.go index e51b5fc63f1..fef771f9c8c 100644 --- a/service/s3/api_op_CreateMultipartUpload.go +++ b/service/s3/api_op_CreateMultipartUpload.go @@ -611,6 +611,8 @@ func (m *opCreateMultipartUploadResolveEndpointMiddleware) HandleSerialize(ctx c ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeleteBucket.go b/service/s3/api_op_DeleteBucket.go index 95b41156bc6..7b569d4299e 100644 --- a/service/s3/api_op_DeleteBucket.go +++ b/service/s3/api_op_DeleteBucket.go @@ -272,6 +272,8 @@ func (m *opDeleteBucketResolveEndpointMiddleware) HandleSerialize(ctx context.Co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeleteBucketAnalyticsConfiguration.go b/service/s3/api_op_DeleteBucketAnalyticsConfiguration.go index 34e7011d08b..2c771c44471 100644 --- a/service/s3/api_op_DeleteBucketAnalyticsConfiguration.go +++ b/service/s3/api_op_DeleteBucketAnalyticsConfiguration.go @@ -254,6 +254,8 @@ func (m *opDeleteBucketAnalyticsConfigurationResolveEndpointMiddleware) HandleSe ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeleteBucketCors.go b/service/s3/api_op_DeleteBucketCors.go index d2195df2038..1d0bc1960ed 100644 --- a/service/s3/api_op_DeleteBucketCors.go +++ b/service/s3/api_op_DeleteBucketCors.go @@ -243,6 +243,8 @@ func (m *opDeleteBucketCorsResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeleteBucketEncryption.go b/service/s3/api_op_DeleteBucketEncryption.go index e2e0d460dd6..7eb883a68fb 100644 --- a/service/s3/api_op_DeleteBucketEncryption.go +++ b/service/s3/api_op_DeleteBucketEncryption.go @@ -251,6 +251,8 @@ func (m *opDeleteBucketEncryptionResolveEndpointMiddleware) HandleSerialize(ctx ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeleteBucketIntelligentTieringConfiguration.go b/service/s3/api_op_DeleteBucketIntelligentTieringConfiguration.go index f9a7ed53702..5e8985319e2 100644 --- a/service/s3/api_op_DeleteBucketIntelligentTieringConfiguration.go +++ b/service/s3/api_op_DeleteBucketIntelligentTieringConfiguration.go @@ -255,6 +255,8 @@ func (m *opDeleteBucketIntelligentTieringConfigurationResolveEndpointMiddleware) ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeleteBucketInventoryConfiguration.go b/service/s3/api_op_DeleteBucketInventoryConfiguration.go index 4c1a519fc67..1e0bed05e98 100644 --- a/service/s3/api_op_DeleteBucketInventoryConfiguration.go +++ b/service/s3/api_op_DeleteBucketInventoryConfiguration.go @@ -253,6 +253,8 @@ func (m *opDeleteBucketInventoryConfigurationResolveEndpointMiddleware) HandleSe ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeleteBucketLifecycle.go b/service/s3/api_op_DeleteBucketLifecycle.go index c2d31ee3463..3b35aac1998 100644 --- a/service/s3/api_op_DeleteBucketLifecycle.go +++ b/service/s3/api_op_DeleteBucketLifecycle.go @@ -249,6 +249,8 @@ func (m *opDeleteBucketLifecycleResolveEndpointMiddleware) HandleSerialize(ctx c ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeleteBucketMetricsConfiguration.go b/service/s3/api_op_DeleteBucketMetricsConfiguration.go index 88e51b5374b..6db53c4beb5 100644 --- a/service/s3/api_op_DeleteBucketMetricsConfiguration.go +++ b/service/s3/api_op_DeleteBucketMetricsConfiguration.go @@ -257,6 +257,8 @@ func (m *opDeleteBucketMetricsConfigurationResolveEndpointMiddleware) HandleSeri ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeleteBucketOwnershipControls.go b/service/s3/api_op_DeleteBucketOwnershipControls.go index c39c3336323..df8f8b99325 100644 --- a/service/s3/api_op_DeleteBucketOwnershipControls.go +++ b/service/s3/api_op_DeleteBucketOwnershipControls.go @@ -243,6 +243,8 @@ func (m *opDeleteBucketOwnershipControlsResolveEndpointMiddleware) HandleSeriali ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeleteBucketPolicy.go b/service/s3/api_op_DeleteBucketPolicy.go index af9ccfd9be8..11fe777f8f5 100644 --- a/service/s3/api_op_DeleteBucketPolicy.go +++ b/service/s3/api_op_DeleteBucketPolicy.go @@ -255,6 +255,8 @@ func (m *opDeleteBucketPolicyResolveEndpointMiddleware) HandleSerialize(ctx cont ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeleteBucketReplication.go b/service/s3/api_op_DeleteBucketReplication.go index 470d8d709f9..643c6183276 100644 --- a/service/s3/api_op_DeleteBucketReplication.go +++ b/service/s3/api_op_DeleteBucketReplication.go @@ -248,6 +248,8 @@ func (m *opDeleteBucketReplicationResolveEndpointMiddleware) HandleSerialize(ctx ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeleteBucketTagging.go b/service/s3/api_op_DeleteBucketTagging.go index 5c61f4d2274..00ba6d30c35 100644 --- a/service/s3/api_op_DeleteBucketTagging.go +++ b/service/s3/api_op_DeleteBucketTagging.go @@ -242,6 +242,8 @@ func (m *opDeleteBucketTaggingResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeleteBucketWebsite.go b/service/s3/api_op_DeleteBucketWebsite.go index 7698e606708..eaf5af6c65d 100644 --- a/service/s3/api_op_DeleteBucketWebsite.go +++ b/service/s3/api_op_DeleteBucketWebsite.go @@ -250,6 +250,8 @@ func (m *opDeleteBucketWebsiteResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeleteObject.go b/service/s3/api_op_DeleteObject.go index 5544d8dddef..9e872831fb0 100644 --- a/service/s3/api_op_DeleteObject.go +++ b/service/s3/api_op_DeleteObject.go @@ -340,6 +340,8 @@ func (m *opDeleteObjectResolveEndpointMiddleware) HandleSerialize(ctx context.Co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeleteObjectTagging.go b/service/s3/api_op_DeleteObjectTagging.go index eba4f8d9486..d8cd5cac9de 100644 --- a/service/s3/api_op_DeleteObjectTagging.go +++ b/service/s3/api_op_DeleteObjectTagging.go @@ -271,6 +271,8 @@ func (m *opDeleteObjectTaggingResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeleteObjects.go b/service/s3/api_op_DeleteObjects.go index 2d26640f89d..0a3bdd67149 100644 --- a/service/s3/api_op_DeleteObjects.go +++ b/service/s3/api_op_DeleteObjects.go @@ -353,6 +353,8 @@ func (m *opDeleteObjectsResolveEndpointMiddleware) HandleSerialize(ctx context.C ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_DeletePublicAccessBlock.go b/service/s3/api_op_DeletePublicAccessBlock.go index 3ed1f26cfe7..d637e525f2a 100644 --- a/service/s3/api_op_DeletePublicAccessBlock.go +++ b/service/s3/api_op_DeletePublicAccessBlock.go @@ -246,6 +246,8 @@ func (m *opDeletePublicAccessBlockResolveEndpointMiddleware) HandleSerialize(ctx ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketAccelerateConfiguration.go b/service/s3/api_op_GetBucketAccelerateConfiguration.go index f0ef36a0fb0..d80a050950c 100644 --- a/service/s3/api_op_GetBucketAccelerateConfiguration.go +++ b/service/s3/api_op_GetBucketAccelerateConfiguration.go @@ -271,6 +271,8 @@ func (m *opGetBucketAccelerateConfigurationResolveEndpointMiddleware) HandleSeri ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketAcl.go b/service/s3/api_op_GetBucketAcl.go index 4e13435534c..6732676a60a 100644 --- a/service/s3/api_op_GetBucketAcl.go +++ b/service/s3/api_op_GetBucketAcl.go @@ -270,6 +270,8 @@ func (m *opGetBucketAclResolveEndpointMiddleware) HandleSerialize(ctx context.Co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketAnalyticsConfiguration.go b/service/s3/api_op_GetBucketAnalyticsConfiguration.go index facec7755b4..4b509ea185e 100644 --- a/service/s3/api_op_GetBucketAnalyticsConfiguration.go +++ b/service/s3/api_op_GetBucketAnalyticsConfiguration.go @@ -260,6 +260,8 @@ func (m *opGetBucketAnalyticsConfigurationResolveEndpointMiddleware) HandleSeria ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketCors.go b/service/s3/api_op_GetBucketCors.go index 58498d54332..432f066a8ea 100644 --- a/service/s3/api_op_GetBucketCors.go +++ b/service/s3/api_op_GetBucketCors.go @@ -263,6 +263,8 @@ func (m *opGetBucketCorsResolveEndpointMiddleware) HandleSerialize(ctx context.C ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketEncryption.go b/service/s3/api_op_GetBucketEncryption.go index 67a9567e88d..89f7acaac12 100644 --- a/service/s3/api_op_GetBucketEncryption.go +++ b/service/s3/api_op_GetBucketEncryption.go @@ -256,6 +256,8 @@ func (m *opGetBucketEncryptionResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketIntelligentTieringConfiguration.go b/service/s3/api_op_GetBucketIntelligentTieringConfiguration.go index 72c8f904756..73d7a9dd8db 100644 --- a/service/s3/api_op_GetBucketIntelligentTieringConfiguration.go +++ b/service/s3/api_op_GetBucketIntelligentTieringConfiguration.go @@ -260,6 +260,8 @@ func (m *opGetBucketIntelligentTieringConfigurationResolveEndpointMiddleware) Ha ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketInventoryConfiguration.go b/service/s3/api_op_GetBucketInventoryConfiguration.go index bf197e4047e..b5aa9771553 100644 --- a/service/s3/api_op_GetBucketInventoryConfiguration.go +++ b/service/s3/api_op_GetBucketInventoryConfiguration.go @@ -257,6 +257,8 @@ func (m *opGetBucketInventoryConfigurationResolveEndpointMiddleware) HandleSeria ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketLifecycleConfiguration.go b/service/s3/api_op_GetBucketLifecycleConfiguration.go index a74e4021800..2435e6a755b 100644 --- a/service/s3/api_op_GetBucketLifecycleConfiguration.go +++ b/service/s3/api_op_GetBucketLifecycleConfiguration.go @@ -266,6 +266,8 @@ func (m *opGetBucketLifecycleConfigurationResolveEndpointMiddleware) HandleSeria ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketLocation.go b/service/s3/api_op_GetBucketLocation.go index f2d8ee2119e..89e5fa6cf41 100644 --- a/service/s3/api_op_GetBucketLocation.go +++ b/service/s3/api_op_GetBucketLocation.go @@ -331,6 +331,8 @@ func (m *opGetBucketLocationResolveEndpointMiddleware) HandleSerialize(ctx conte ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketLogging.go b/service/s3/api_op_GetBucketLogging.go index 3c82ed2371b..9f7c9e67c67 100644 --- a/service/s3/api_op_GetBucketLogging.go +++ b/service/s3/api_op_GetBucketLogging.go @@ -248,6 +248,8 @@ func (m *opGetBucketLoggingResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketMetricsConfiguration.go b/service/s3/api_op_GetBucketMetricsConfiguration.go index 8cddfb91474..e84cee0b1c3 100644 --- a/service/s3/api_op_GetBucketMetricsConfiguration.go +++ b/service/s3/api_op_GetBucketMetricsConfiguration.go @@ -262,6 +262,8 @@ func (m *opGetBucketMetricsConfigurationResolveEndpointMiddleware) HandleSeriali ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketNotificationConfiguration.go b/service/s3/api_op_GetBucketNotificationConfiguration.go index e3d2b9e5807..1418596140f 100644 --- a/service/s3/api_op_GetBucketNotificationConfiguration.go +++ b/service/s3/api_op_GetBucketNotificationConfiguration.go @@ -279,6 +279,8 @@ func (m *opGetBucketNotificationConfigurationResolveEndpointMiddleware) HandleSe ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketOwnershipControls.go b/service/s3/api_op_GetBucketOwnershipControls.go index 7df927fc1e6..c971ef87635 100644 --- a/service/s3/api_op_GetBucketOwnershipControls.go +++ b/service/s3/api_op_GetBucketOwnershipControls.go @@ -249,6 +249,8 @@ func (m *opGetBucketOwnershipControlsResolveEndpointMiddleware) HandleSerialize( ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketPolicy.go b/service/s3/api_op_GetBucketPolicy.go index 1c2bfa07642..0c64efbaec1 100644 --- a/service/s3/api_op_GetBucketPolicy.go +++ b/service/s3/api_op_GetBucketPolicy.go @@ -271,6 +271,8 @@ func (m *opGetBucketPolicyResolveEndpointMiddleware) HandleSerialize(ctx context ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketPolicyStatus.go b/service/s3/api_op_GetBucketPolicyStatus.go index dd897a43c9f..de162000021 100644 --- a/service/s3/api_op_GetBucketPolicyStatus.go +++ b/service/s3/api_op_GetBucketPolicyStatus.go @@ -252,6 +252,8 @@ func (m *opGetBucketPolicyStatusResolveEndpointMiddleware) HandleSerialize(ctx c ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketReplication.go b/service/s3/api_op_GetBucketReplication.go index c2d6a42bc19..d944da09570 100644 --- a/service/s3/api_op_GetBucketReplication.go +++ b/service/s3/api_op_GetBucketReplication.go @@ -256,6 +256,8 @@ func (m *opGetBucketReplicationResolveEndpointMiddleware) HandleSerialize(ctx co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketRequestPayment.go b/service/s3/api_op_GetBucketRequestPayment.go index ca5f3f09afb..8ce00d10231 100644 --- a/service/s3/api_op_GetBucketRequestPayment.go +++ b/service/s3/api_op_GetBucketRequestPayment.go @@ -246,6 +246,8 @@ func (m *opGetBucketRequestPaymentResolveEndpointMiddleware) HandleSerialize(ctx ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketTagging.go b/service/s3/api_op_GetBucketTagging.go index 6d6c7c27190..65b5f39ddb5 100644 --- a/service/s3/api_op_GetBucketTagging.go +++ b/service/s3/api_op_GetBucketTagging.go @@ -253,6 +253,8 @@ func (m *opGetBucketTaggingResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketVersioning.go b/service/s3/api_op_GetBucketVersioning.go index 5956550e6e5..e8bb9afac12 100644 --- a/service/s3/api_op_GetBucketVersioning.go +++ b/service/s3/api_op_GetBucketVersioning.go @@ -254,6 +254,8 @@ func (m *opGetBucketVersioningResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetBucketWebsite.go b/service/s3/api_op_GetBucketWebsite.go index 0d281bd2b27..ff78afe469b 100644 --- a/service/s3/api_op_GetBucketWebsite.go +++ b/service/s3/api_op_GetBucketWebsite.go @@ -261,6 +261,8 @@ func (m *opGetBucketWebsiteResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetObject.go b/service/s3/api_op_GetObject.go index 298df0146f4..198002939bf 100644 --- a/service/s3/api_op_GetObject.go +++ b/service/s3/api_op_GetObject.go @@ -628,6 +628,8 @@ func (m *opGetObjectResolveEndpointMiddleware) HandleSerialize(ctx context.Conte ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetObjectAcl.go b/service/s3/api_op_GetObjectAcl.go index cbbb4cf16c0..b71a4ae1fa9 100644 --- a/service/s3/api_op_GetObjectAcl.go +++ b/service/s3/api_op_GetObjectAcl.go @@ -287,6 +287,8 @@ func (m *opGetObjectAclResolveEndpointMiddleware) HandleSerialize(ctx context.Co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetObjectAttributes.go b/service/s3/api_op_GetObjectAttributes.go index 808ec9214a5..e6fde510ff8 100644 --- a/service/s3/api_op_GetObjectAttributes.go +++ b/service/s3/api_op_GetObjectAttributes.go @@ -389,6 +389,8 @@ func (m *opGetObjectAttributesResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetObjectLegalHold.go b/service/s3/api_op_GetObjectLegalHold.go index 0c99c3b6e01..3bcf708bad1 100644 --- a/service/s3/api_op_GetObjectLegalHold.go +++ b/service/s3/api_op_GetObjectLegalHold.go @@ -268,6 +268,8 @@ func (m *opGetObjectLegalHoldResolveEndpointMiddleware) HandleSerialize(ctx cont ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetObjectLockConfiguration.go b/service/s3/api_op_GetObjectLockConfiguration.go index b331143224b..200ea71dc0a 100644 --- a/service/s3/api_op_GetObjectLockConfiguration.go +++ b/service/s3/api_op_GetObjectLockConfiguration.go @@ -253,6 +253,8 @@ func (m *opGetObjectLockConfigurationResolveEndpointMiddleware) HandleSerialize( ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetObjectRetention.go b/service/s3/api_op_GetObjectRetention.go index a6f38ec1600..d3b83227aef 100644 --- a/service/s3/api_op_GetObjectRetention.go +++ b/service/s3/api_op_GetObjectRetention.go @@ -268,6 +268,8 @@ func (m *opGetObjectRetentionResolveEndpointMiddleware) HandleSerialize(ctx cont ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetObjectTagging.go b/service/s3/api_op_GetObjectTagging.go index 252967087f3..f113d3081d6 100644 --- a/service/s3/api_op_GetObjectTagging.go +++ b/service/s3/api_op_GetObjectTagging.go @@ -288,6 +288,8 @@ func (m *opGetObjectTaggingResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetObjectTorrent.go b/service/s3/api_op_GetObjectTorrent.go index 37567e46838..88f5427b151 100644 --- a/service/s3/api_op_GetObjectTorrent.go +++ b/service/s3/api_op_GetObjectTorrent.go @@ -262,6 +262,8 @@ func (m *opGetObjectTorrentResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_GetPublicAccessBlock.go b/service/s3/api_op_GetPublicAccessBlock.go index e0a923935cf..3a5a1bef245 100644 --- a/service/s3/api_op_GetPublicAccessBlock.go +++ b/service/s3/api_op_GetPublicAccessBlock.go @@ -259,6 +259,8 @@ func (m *opGetPublicAccessBlockResolveEndpointMiddleware) HandleSerialize(ctx co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_HeadBucket.go b/service/s3/api_op_HeadBucket.go index c45fd77b575..d0b78643065 100644 --- a/service/s3/api_op_HeadBucket.go +++ b/service/s3/api_op_HeadBucket.go @@ -622,6 +622,8 @@ func (m *opHeadBucketResolveEndpointMiddleware) HandleSerialize(ctx context.Cont ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_HeadObject.go b/service/s3/api_op_HeadObject.go index 7f432dfbb50..35bca221d14 100644 --- a/service/s3/api_op_HeadObject.go +++ b/service/s3/api_op_HeadObject.go @@ -902,6 +902,8 @@ func (m *opHeadObjectResolveEndpointMiddleware) HandleSerialize(ctx context.Cont ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_ListBucketAnalyticsConfigurations.go b/service/s3/api_op_ListBucketAnalyticsConfigurations.go index 70e593b1c95..11c7ff3a0ed 100644 --- a/service/s3/api_op_ListBucketAnalyticsConfigurations.go +++ b/service/s3/api_op_ListBucketAnalyticsConfigurations.go @@ -279,6 +279,8 @@ func (m *opListBucketAnalyticsConfigurationsResolveEndpointMiddleware) HandleSer ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_ListBucketIntelligentTieringConfigurations.go b/service/s3/api_op_ListBucketIntelligentTieringConfigurations.go index ce11b4fdc1d..8d33c8db42a 100644 --- a/service/s3/api_op_ListBucketIntelligentTieringConfigurations.go +++ b/service/s3/api_op_ListBucketIntelligentTieringConfigurations.go @@ -273,6 +273,8 @@ func (m *opListBucketIntelligentTieringConfigurationsResolveEndpointMiddleware) ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_ListBucketInventoryConfigurations.go b/service/s3/api_op_ListBucketInventoryConfigurations.go index 6f6c61639f7..242765886d6 100644 --- a/service/s3/api_op_ListBucketInventoryConfigurations.go +++ b/service/s3/api_op_ListBucketInventoryConfigurations.go @@ -280,6 +280,8 @@ func (m *opListBucketInventoryConfigurationsResolveEndpointMiddleware) HandleSer ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_ListBucketMetricsConfigurations.go b/service/s3/api_op_ListBucketMetricsConfigurations.go index 1872d429bae..b6399133c71 100644 --- a/service/s3/api_op_ListBucketMetricsConfigurations.go +++ b/service/s3/api_op_ListBucketMetricsConfigurations.go @@ -283,6 +283,8 @@ func (m *opListBucketMetricsConfigurationsResolveEndpointMiddleware) HandleSeria ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_ListBuckets.go b/service/s3/api_op_ListBuckets.go index 0a144eddc4a..02e8840dafa 100644 --- a/service/s3/api_op_ListBuckets.go +++ b/service/s3/api_op_ListBuckets.go @@ -211,6 +211,8 @@ func (m *opListBucketsResolveEndpointMiddleware) HandleSerialize(ctx context.Con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_ListMultipartUploads.go b/service/s3/api_op_ListMultipartUploads.go index d6ab4787028..d9b21dc884f 100644 --- a/service/s3/api_op_ListMultipartUploads.go +++ b/service/s3/api_op_ListMultipartUploads.go @@ -380,6 +380,8 @@ func (m *opListMultipartUploadsResolveEndpointMiddleware) HandleSerialize(ctx co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_ListObjectVersions.go b/service/s3/api_op_ListObjectVersions.go index da79d275212..957c847fe36 100644 --- a/service/s3/api_op_ListObjectVersions.go +++ b/service/s3/api_op_ListObjectVersions.go @@ -357,6 +357,8 @@ func (m *opListObjectVersionsResolveEndpointMiddleware) HandleSerialize(ctx cont ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_ListObjects.go b/service/s3/api_op_ListObjects.go index 61d8f1be82a..ef696cf9b6e 100644 --- a/service/s3/api_op_ListObjects.go +++ b/service/s3/api_op_ListObjects.go @@ -352,6 +352,8 @@ func (m *opListObjectsResolveEndpointMiddleware) HandleSerialize(ctx context.Con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_ListObjectsV2.go b/service/s3/api_op_ListObjectsV2.go index 30a580cdd09..252d1f3a8dc 100644 --- a/service/s3/api_op_ListObjectsV2.go +++ b/service/s3/api_op_ListObjectsV2.go @@ -477,6 +477,8 @@ func (m *opListObjectsV2ResolveEndpointMiddleware) HandleSerialize(ctx context.C ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_ListParts.go b/service/s3/api_op_ListParts.go index e2440747364..eed7fa5222b 100644 --- a/service/s3/api_op_ListParts.go +++ b/service/s3/api_op_ListParts.go @@ -473,6 +473,8 @@ func (m *opListPartsResolveEndpointMiddleware) HandleSerialize(ctx context.Conte ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketAccelerateConfiguration.go b/service/s3/api_op_PutBucketAccelerateConfiguration.go index 2844cee42ee..175e36bf630 100644 --- a/service/s3/api_op_PutBucketAccelerateConfiguration.go +++ b/service/s3/api_op_PutBucketAccelerateConfiguration.go @@ -299,6 +299,8 @@ func (m *opPutBucketAccelerateConfigurationResolveEndpointMiddleware) HandleSeri ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketAcl.go b/service/s3/api_op_PutBucketAcl.go index fffe8efbc60..204b6316bcd 100644 --- a/service/s3/api_op_PutBucketAcl.go +++ b/service/s3/api_op_PutBucketAcl.go @@ -384,6 +384,8 @@ func (m *opPutBucketAclResolveEndpointMiddleware) HandleSerialize(ctx context.Co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketAnalyticsConfiguration.go b/service/s3/api_op_PutBucketAnalyticsConfiguration.go index 66ada478075..24e04562d72 100644 --- a/service/s3/api_op_PutBucketAnalyticsConfiguration.go +++ b/service/s3/api_op_PutBucketAnalyticsConfiguration.go @@ -286,6 +286,8 @@ func (m *opPutBucketAnalyticsConfigurationResolveEndpointMiddleware) HandleSeria ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketCors.go b/service/s3/api_op_PutBucketCors.go index 262a6f8a9fc..72391bd25d1 100644 --- a/service/s3/api_op_PutBucketCors.go +++ b/service/s3/api_op_PutBucketCors.go @@ -313,6 +313,8 @@ func (m *opPutBucketCorsResolveEndpointMiddleware) HandleSerialize(ctx context.C ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketEncryption.go b/service/s3/api_op_PutBucketEncryption.go index 9720edb3bd5..55e50500f43 100644 --- a/service/s3/api_op_PutBucketEncryption.go +++ b/service/s3/api_op_PutBucketEncryption.go @@ -314,6 +314,8 @@ func (m *opPutBucketEncryptionResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketIntelligentTieringConfiguration.go b/service/s3/api_op_PutBucketIntelligentTieringConfiguration.go index fd0bb47a54e..c9e454b0826 100644 --- a/service/s3/api_op_PutBucketIntelligentTieringConfiguration.go +++ b/service/s3/api_op_PutBucketIntelligentTieringConfiguration.go @@ -273,6 +273,8 @@ func (m *opPutBucketIntelligentTieringConfigurationResolveEndpointMiddleware) Ha ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketInventoryConfiguration.go b/service/s3/api_op_PutBucketInventoryConfiguration.go index 63b1a15e41c..e7e2f7c86d6 100644 --- a/service/s3/api_op_PutBucketInventoryConfiguration.go +++ b/service/s3/api_op_PutBucketInventoryConfiguration.go @@ -289,6 +289,8 @@ func (m *opPutBucketInventoryConfigurationResolveEndpointMiddleware) HandleSeria ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketLifecycleConfiguration.go b/service/s3/api_op_PutBucketLifecycleConfiguration.go index 0162ea82ff9..a847118f8c6 100644 --- a/service/s3/api_op_PutBucketLifecycleConfiguration.go +++ b/service/s3/api_op_PutBucketLifecycleConfiguration.go @@ -324,6 +324,8 @@ func (m *opPutBucketLifecycleConfigurationResolveEndpointMiddleware) HandleSeria ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketLogging.go b/service/s3/api_op_PutBucketLogging.go index a5b214a9e75..bdc02e2c635 100644 --- a/service/s3/api_op_PutBucketLogging.go +++ b/service/s3/api_op_PutBucketLogging.go @@ -314,6 +314,8 @@ func (m *opPutBucketLoggingResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketMetricsConfiguration.go b/service/s3/api_op_PutBucketMetricsConfiguration.go index eb44e605da2..539bc8f8480 100644 --- a/service/s3/api_op_PutBucketMetricsConfiguration.go +++ b/service/s3/api_op_PutBucketMetricsConfiguration.go @@ -270,6 +270,8 @@ func (m *opPutBucketMetricsConfigurationResolveEndpointMiddleware) HandleSeriali ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketNotificationConfiguration.go b/service/s3/api_op_PutBucketNotificationConfiguration.go index ac6d1eeb64d..2a8eae91de4 100644 --- a/service/s3/api_op_PutBucketNotificationConfiguration.go +++ b/service/s3/api_op_PutBucketNotificationConfiguration.go @@ -281,6 +281,8 @@ func (m *opPutBucketNotificationConfigurationResolveEndpointMiddleware) HandleSe ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketOwnershipControls.go b/service/s3/api_op_PutBucketOwnershipControls.go index 04a09551780..b25c91edb39 100644 --- a/service/s3/api_op_PutBucketOwnershipControls.go +++ b/service/s3/api_op_PutBucketOwnershipControls.go @@ -269,6 +269,8 @@ func (m *opPutBucketOwnershipControlsResolveEndpointMiddleware) HandleSerialize( ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketPolicy.go b/service/s3/api_op_PutBucketPolicy.go index 42283865823..3a535233099 100644 --- a/service/s3/api_op_PutBucketPolicy.go +++ b/service/s3/api_op_PutBucketPolicy.go @@ -303,6 +303,8 @@ func (m *opPutBucketPolicyResolveEndpointMiddleware) HandleSerialize(ctx context ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketReplication.go b/service/s3/api_op_PutBucketReplication.go index 77b01d08e24..ebcb3eae399 100644 --- a/service/s3/api_op_PutBucketReplication.go +++ b/service/s3/api_op_PutBucketReplication.go @@ -326,6 +326,8 @@ func (m *opPutBucketReplicationResolveEndpointMiddleware) HandleSerialize(ctx co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketRequestPayment.go b/service/s3/api_op_PutBucketRequestPayment.go index 613f02cf949..b0a207a2c14 100644 --- a/service/s3/api_op_PutBucketRequestPayment.go +++ b/service/s3/api_op_PutBucketRequestPayment.go @@ -290,6 +290,8 @@ func (m *opPutBucketRequestPaymentResolveEndpointMiddleware) HandleSerialize(ctx ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketTagging.go b/service/s3/api_op_PutBucketTagging.go index 46d8a1a071c..cd7ca633bed 100644 --- a/service/s3/api_op_PutBucketTagging.go +++ b/service/s3/api_op_PutBucketTagging.go @@ -318,6 +318,8 @@ func (m *opPutBucketTaggingResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketVersioning.go b/service/s3/api_op_PutBucketVersioning.go index d73d34368a9..6306a977e28 100644 --- a/service/s3/api_op_PutBucketVersioning.go +++ b/service/s3/api_op_PutBucketVersioning.go @@ -308,6 +308,8 @@ func (m *opPutBucketVersioningResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutBucketWebsite.go b/service/s3/api_op_PutBucketWebsite.go index 82c73b7393a..47b7691ddb6 100644 --- a/service/s3/api_op_PutBucketWebsite.go +++ b/service/s3/api_op_PutBucketWebsite.go @@ -326,6 +326,8 @@ func (m *opPutBucketWebsiteResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutObject.go b/service/s3/api_op_PutObject.go index 2dd40edf29a..50ecef1208e 100644 --- a/service/s3/api_op_PutObject.go +++ b/service/s3/api_op_PutObject.go @@ -664,6 +664,8 @@ func (m *opPutObjectResolveEndpointMiddleware) HandleSerialize(ctx context.Conte ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutObjectAcl.go b/service/s3/api_op_PutObjectAcl.go index 46a6f3e85e5..4b95089b729 100644 --- a/service/s3/api_op_PutObjectAcl.go +++ b/service/s3/api_op_PutObjectAcl.go @@ -428,6 +428,8 @@ func (m *opPutObjectAclResolveEndpointMiddleware) HandleSerialize(ctx context.Co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutObjectLegalHold.go b/service/s3/api_op_PutObjectLegalHold.go index 2ec3860a998..28f11dd29bb 100644 --- a/service/s3/api_op_PutObjectLegalHold.go +++ b/service/s3/api_op_PutObjectLegalHold.go @@ -310,6 +310,8 @@ func (m *opPutObjectLegalHoldResolveEndpointMiddleware) HandleSerialize(ctx cont ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutObjectLockConfiguration.go b/service/s3/api_op_PutObjectLockConfiguration.go index 44c5590a14a..ebb0460ea82 100644 --- a/service/s3/api_op_PutObjectLockConfiguration.go +++ b/service/s3/api_op_PutObjectLockConfiguration.go @@ -303,6 +303,8 @@ func (m *opPutObjectLockConfigurationResolveEndpointMiddleware) HandleSerialize( ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutObjectRetention.go b/service/s3/api_op_PutObjectRetention.go index 27aad98dd26..c9f2f5e9e76 100644 --- a/service/s3/api_op_PutObjectRetention.go +++ b/service/s3/api_op_PutObjectRetention.go @@ -317,6 +317,8 @@ func (m *opPutObjectRetentionResolveEndpointMiddleware) HandleSerialize(ctx cont ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutObjectTagging.go b/service/s3/api_op_PutObjectTagging.go index 86d7bc9f2d9..52143bd6e72 100644 --- a/service/s3/api_op_PutObjectTagging.go +++ b/service/s3/api_op_PutObjectTagging.go @@ -344,6 +344,8 @@ func (m *opPutObjectTaggingResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_PutPublicAccessBlock.go b/service/s3/api_op_PutPublicAccessBlock.go index 74e2b8fd395..a75ab4aa872 100644 --- a/service/s3/api_op_PutPublicAccessBlock.go +++ b/service/s3/api_op_PutPublicAccessBlock.go @@ -302,6 +302,8 @@ func (m *opPutPublicAccessBlockResolveEndpointMiddleware) HandleSerialize(ctx co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_RestoreObject.go b/service/s3/api_op_RestoreObject.go index c2f718e1e5d..c0c9f2975b2 100644 --- a/service/s3/api_op_RestoreObject.go +++ b/service/s3/api_op_RestoreObject.go @@ -460,6 +460,8 @@ func (m *opRestoreObjectResolveEndpointMiddleware) HandleSerialize(ctx context.C ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_SelectObjectContent.go b/service/s3/api_op_SelectObjectContent.go index e6b5fd0733b..907c57fae11 100644 --- a/service/s3/api_op_SelectObjectContent.go +++ b/service/s3/api_op_SelectObjectContent.go @@ -467,6 +467,8 @@ func (m *opSelectObjectContentResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_UploadPart.go b/service/s3/api_op_UploadPart.go index f870c376a62..1818c8fd2f2 100644 --- a/service/s3/api_op_UploadPart.go +++ b/service/s3/api_op_UploadPart.go @@ -538,6 +538,8 @@ func (m *opUploadPartResolveEndpointMiddleware) HandleSerialize(ctx context.Cont ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_UploadPartCopy.go b/service/s3/api_op_UploadPartCopy.go index 440e75f3dff..e474167086f 100644 --- a/service/s3/api_op_UploadPartCopy.go +++ b/service/s3/api_op_UploadPartCopy.go @@ -467,6 +467,8 @@ func (m *opUploadPartCopyResolveEndpointMiddleware) HandleSerialize(ctx context. ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/api_op_WriteGetObjectResponse.go b/service/s3/api_op_WriteGetObjectResponse.go index c4a28654266..436aff87029 100644 --- a/service/s3/api_op_WriteGetObjectResponse.go +++ b/service/s3/api_op_WriteGetObjectResponse.go @@ -498,6 +498,8 @@ func (m *opWriteGetObjectResponseResolveEndpointMiddleware) HandleSerialize(ctx ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3/endpoints.go b/service/s3/endpoints.go index 16c9aa0976e..66db2b0627a 100644 --- a/service/s3/endpoints.go +++ b/service/s3/endpoints.go @@ -554,7 +554,7 @@ func (r *resolver) ResolveEndpoint( }, nil } } - return endpoint, fmt.Errorf("no rules matched these parameters. This is a bug, %#v", params) + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") } uriString := func() string { var out strings.Builder @@ -634,7 +634,7 @@ func (r *resolver) ResolveEndpoint( }, nil } } - return endpoint, fmt.Errorf("no rules matched these parameters. This is a bug, %#v", params) + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") } uriString := func() string { var out strings.Builder @@ -1798,12 +1798,12 @@ func (r *resolver) ResolveEndpoint( } } } - return endpoint, fmt.Errorf("no rules matched these parameters. This is a bug, %#v", params) + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") } return endpoint, fmt.Errorf("endpoint rule error, %s", "Path-style addressing cannot be used with S3 Accelerate") } return endpoint, fmt.Errorf("endpoint rule error, %s", "A valid partition could not be determined") - return endpoint, fmt.Errorf("no rules matched these parameters. This is a bug, %#v", params) + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") } } if awsrulesfn.IsVirtualHostableS3Bucket(_Bucket, false) { @@ -3382,7 +3382,7 @@ func (r *resolver) ResolveEndpoint( } } } - return endpoint, fmt.Errorf("no rules matched these parameters. This is a bug, %#v", params) + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") } return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid region: region was not a valid DNS name.") } @@ -3940,7 +3940,7 @@ func (r *resolver) ResolveEndpoint( }, nil } } - return endpoint, fmt.Errorf("no rules matched these parameters. This is a bug, %#v", params) + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") } return endpoint, fmt.Errorf("endpoint rule error, %s", func() string { var out strings.Builder @@ -3999,7 +3999,7 @@ func (r *resolver) ResolveEndpoint( } return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid ARN: bucket ARN is missing a region") } - return endpoint, fmt.Errorf("no rules matched these parameters. This is a bug, %#v", params) + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") } if rulesfn.IsValidHostLabel(_accessPointName, true) { if _UseDualStack == true { @@ -5376,12 +5376,12 @@ func (r *resolver) ResolveEndpoint( } } } - return endpoint, fmt.Errorf("no rules matched these parameters. This is a bug, %#v", params) + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") } return endpoint, fmt.Errorf("endpoint rule error, %s", "Path-style addressing cannot be used with S3 Accelerate") } return endpoint, fmt.Errorf("endpoint rule error, %s", "A valid partition could not be determined") - return endpoint, fmt.Errorf("no rules matched these parameters. This is a bug, %#v", params) + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") } if exprVal := params.UseObjectLambdaEndpoint; exprVal != nil { _UseObjectLambdaEndpoint := *exprVal @@ -6908,13 +6908,13 @@ func (r *resolver) ResolveEndpoint( } } } - return endpoint, fmt.Errorf("no rules matched these parameters. This is a bug, %#v", params) + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") } return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid region: region was not a valid DNS name.") } return endpoint, fmt.Errorf("endpoint rule error, %s", "A valid partition could not be determined") } - return endpoint, fmt.Errorf("no rules matched these parameters. This is a bug, %#v", params) + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") } return endpoint, fmt.Errorf("endpoint rule error, %s", "A region must be set when sending requests to S3.") } diff --git a/service/s3control/api_op_CreateAccessPoint.go b/service/s3control/api_op_CreateAccessPoint.go index 56967a65988..ece48bc3908 100644 --- a/service/s3control/api_op_CreateAccessPoint.go +++ b/service/s3control/api_op_CreateAccessPoint.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -152,6 +153,12 @@ func (c *Client) addOperationCreateAccessPointMiddlewares(stack *middleware.Stac if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opCreateAccessPointMiddleware(stack); err != nil { + return err + } if err = addCreateAccessPointResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -185,6 +192,59 @@ func (c *Client) addOperationCreateAccessPointMiddlewares(stack *middleware.Stac return nil } +func (m *CreateAccessPointInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *CreateAccessPointInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opCreateAccessPointMiddleware struct { +} + +func (*endpointPrefix_opCreateAccessPointMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opCreateAccessPointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*CreateAccessPointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opCreateAccessPointMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opCreateAccessPointMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opCreateAccessPoint(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -294,6 +354,8 @@ func (m *opCreateAccessPointResolveEndpointMiddleware) HandleSerialize(ctx conte ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_CreateAccessPointForObjectLambda.go b/service/s3control/api_op_CreateAccessPointForObjectLambda.go index 87f178d7e7d..7940cfcac15 100644 --- a/service/s3control/api_op_CreateAccessPointForObjectLambda.go +++ b/service/s3control/api_op_CreateAccessPointForObjectLambda.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -124,6 +125,12 @@ func (c *Client) addOperationCreateAccessPointForObjectLambdaMiddlewares(stack * if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opCreateAccessPointForObjectLambdaMiddleware(stack); err != nil { + return err + } if err = addCreateAccessPointForObjectLambdaResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -157,6 +164,47 @@ func (c *Client) addOperationCreateAccessPointForObjectLambdaMiddlewares(stack * return nil } +type endpointPrefix_opCreateAccessPointForObjectLambdaMiddleware struct { +} + +func (*endpointPrefix_opCreateAccessPointForObjectLambdaMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opCreateAccessPointForObjectLambdaMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*CreateAccessPointForObjectLambdaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opCreateAccessPointForObjectLambdaMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opCreateAccessPointForObjectLambdaMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opCreateAccessPointForObjectLambda(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -252,6 +300,8 @@ func (m *opCreateAccessPointForObjectLambdaResolveEndpointMiddleware) HandleSeri ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_CreateBucket.go b/service/s3control/api_op_CreateBucket.go index e792198634a..f47839dd3b2 100644 --- a/service/s3control/api_op_CreateBucket.go +++ b/service/s3control/api_op_CreateBucket.go @@ -171,6 +171,9 @@ func (c *Client) addOperationCreateBucketMiddlewares(stack *middleware.Stack, op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { return err } @@ -207,6 +210,18 @@ func (c *Client) addOperationCreateBucketMiddlewares(stack *middleware.Stack, op return nil } +func (m *CreateBucketInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *CreateBucketInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + func newServiceMetadataMiddleware_opCreateBucket(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -302,6 +317,8 @@ func (m *opCreateBucketResolveEndpointMiddleware) HandleSerialize(ctx context.Co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_CreateJob.go b/service/s3control/api_op_CreateJob.go index 4747f7fabb0..2ea93829524 100644 --- a/service/s3control/api_op_CreateJob.go +++ b/service/s3control/api_op_CreateJob.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -163,6 +164,12 @@ func (c *Client) addOperationCreateJobMiddlewares(stack *middleware.Stack, optio if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opCreateJobMiddleware(stack); err != nil { + return err + } if err = addCreateJobResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -199,6 +206,47 @@ func (c *Client) addOperationCreateJobMiddlewares(stack *middleware.Stack, optio return nil } +type endpointPrefix_opCreateJobMiddleware struct { +} + +func (*endpointPrefix_opCreateJobMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opCreateJobMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*CreateJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opCreateJobMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opCreateJobMiddleware{}, `OperationSerializer`, middleware.After) +} + type idempotencyToken_initializeOpCreateJob struct { tokenProvider IdempotencyTokenProvider } @@ -327,6 +375,8 @@ func (m *opCreateJobResolveEndpointMiddleware) HandleSerialize(ctx context.Conte ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_CreateMultiRegionAccessPoint.go b/service/s3control/api_op_CreateMultiRegionAccessPoint.go index 8691113bfaf..ee817284f3e 100644 --- a/service/s3control/api_op_CreateMultiRegionAccessPoint.go +++ b/service/s3control/api_op_CreateMultiRegionAccessPoint.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -133,9 +134,15 @@ func (c *Client) addOperationCreateMultiRegionAccessPointMiddlewares(stack *midd if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { return err } + if err = addEndpointPrefix_opCreateMultiRegionAccessPointMiddleware(stack); err != nil { + return err + } if err = addCreateMultiRegionAccessPointResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -172,6 +179,47 @@ func (c *Client) addOperationCreateMultiRegionAccessPointMiddlewares(stack *midd return nil } +type endpointPrefix_opCreateMultiRegionAccessPointMiddleware struct { +} + +func (*endpointPrefix_opCreateMultiRegionAccessPointMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opCreateMultiRegionAccessPointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*CreateMultiRegionAccessPointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opCreateMultiRegionAccessPointMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opCreateMultiRegionAccessPointMiddleware{}, `OperationSerializer`, middleware.After) +} + type idempotencyToken_initializeOpCreateMultiRegionAccessPoint struct { tokenProvider IdempotencyTokenProvider } @@ -300,6 +348,8 @@ func (m *opCreateMultiRegionAccessPointResolveEndpointMiddleware) HandleSerializ ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_DeleteAccessPoint.go b/service/s3control/api_op_DeleteAccessPoint.go index 5c56a306582..8467e25a6dc 100644 --- a/service/s3control/api_op_DeleteAccessPoint.go +++ b/service/s3control/api_op_DeleteAccessPoint.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -122,6 +123,12 @@ func (c *Client) addOperationDeleteAccessPointMiddlewares(stack *middleware.Stac if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteAccessPointMiddleware(stack); err != nil { + return err + } if err = addDeleteAccessPointResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -155,6 +162,59 @@ func (c *Client) addOperationDeleteAccessPointMiddlewares(stack *middleware.Stac return nil } +func (m *DeleteAccessPointInput) GetARNMember() (*string, bool) { + if m.Name == nil { + return nil, false + } + return m.Name, true +} + +func (m *DeleteAccessPointInput) SetARNMember(v string) error { + m.Name = &v + return nil +} + +type endpointPrefix_opDeleteAccessPointMiddleware struct { +} + +func (*endpointPrefix_opDeleteAccessPointMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteAccessPointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*DeleteAccessPointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDeleteAccessPointMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDeleteAccessPointMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opDeleteAccessPoint(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -264,6 +324,8 @@ func (m *opDeleteAccessPointResolveEndpointMiddleware) HandleSerialize(ctx conte ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_DeleteAccessPointForObjectLambda.go b/service/s3control/api_op_DeleteAccessPointForObjectLambda.go index 4a3d528e479..38e2e834e82 100644 --- a/service/s3control/api_op_DeleteAccessPointForObjectLambda.go +++ b/service/s3control/api_op_DeleteAccessPointForObjectLambda.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -109,6 +110,12 @@ func (c *Client) addOperationDeleteAccessPointForObjectLambdaMiddlewares(stack * if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteAccessPointForObjectLambdaMiddleware(stack); err != nil { + return err + } if err = addDeleteAccessPointForObjectLambdaResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -142,6 +149,47 @@ func (c *Client) addOperationDeleteAccessPointForObjectLambdaMiddlewares(stack * return nil } +type endpointPrefix_opDeleteAccessPointForObjectLambdaMiddleware struct { +} + +func (*endpointPrefix_opDeleteAccessPointForObjectLambdaMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteAccessPointForObjectLambdaMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*DeleteAccessPointForObjectLambdaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDeleteAccessPointForObjectLambdaMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDeleteAccessPointForObjectLambdaMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opDeleteAccessPointForObjectLambda(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -237,6 +285,8 @@ func (m *opDeleteAccessPointForObjectLambdaResolveEndpointMiddleware) HandleSeri ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_DeleteAccessPointPolicy.go b/service/s3control/api_op_DeleteAccessPointPolicy.go index 941932c11b3..07d7dc4565a 100644 --- a/service/s3control/api_op_DeleteAccessPointPolicy.go +++ b/service/s3control/api_op_DeleteAccessPointPolicy.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -122,6 +123,12 @@ func (c *Client) addOperationDeleteAccessPointPolicyMiddlewares(stack *middlewar if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteAccessPointPolicyMiddleware(stack); err != nil { + return err + } if err = addDeleteAccessPointPolicyResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -155,6 +162,59 @@ func (c *Client) addOperationDeleteAccessPointPolicyMiddlewares(stack *middlewar return nil } +func (m *DeleteAccessPointPolicyInput) GetARNMember() (*string, bool) { + if m.Name == nil { + return nil, false + } + return m.Name, true +} + +func (m *DeleteAccessPointPolicyInput) SetARNMember(v string) error { + m.Name = &v + return nil +} + +type endpointPrefix_opDeleteAccessPointPolicyMiddleware struct { +} + +func (*endpointPrefix_opDeleteAccessPointPolicyMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteAccessPointPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*DeleteAccessPointPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDeleteAccessPointPolicyMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDeleteAccessPointPolicyMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opDeleteAccessPointPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -264,6 +324,8 @@ func (m *opDeleteAccessPointPolicyResolveEndpointMiddleware) HandleSerialize(ctx ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_DeleteAccessPointPolicyForObjectLambda.go b/service/s3control/api_op_DeleteAccessPointPolicyForObjectLambda.go index b94dfd29539..e179dc76197 100644 --- a/service/s3control/api_op_DeleteAccessPointPolicyForObjectLambda.go +++ b/service/s3control/api_op_DeleteAccessPointPolicyForObjectLambda.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -108,6 +109,12 @@ func (c *Client) addOperationDeleteAccessPointPolicyForObjectLambdaMiddlewares(s if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteAccessPointPolicyForObjectLambdaMiddleware(stack); err != nil { + return err + } if err = addDeleteAccessPointPolicyForObjectLambdaResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -141,6 +148,47 @@ func (c *Client) addOperationDeleteAccessPointPolicyForObjectLambdaMiddlewares(s return nil } +type endpointPrefix_opDeleteAccessPointPolicyForObjectLambdaMiddleware struct { +} + +func (*endpointPrefix_opDeleteAccessPointPolicyForObjectLambdaMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteAccessPointPolicyForObjectLambdaMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*DeleteAccessPointPolicyForObjectLambdaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDeleteAccessPointPolicyForObjectLambdaMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDeleteAccessPointPolicyForObjectLambdaMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opDeleteAccessPointPolicyForObjectLambda(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -236,6 +284,8 @@ func (m *opDeleteAccessPointPolicyForObjectLambdaResolveEndpointMiddleware) Hand ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_DeleteBucket.go b/service/s3control/api_op_DeleteBucket.go index 06535bfa67b..5495cbbb170 100644 --- a/service/s3control/api_op_DeleteBucket.go +++ b/service/s3control/api_op_DeleteBucket.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -127,6 +128,12 @@ func (c *Client) addOperationDeleteBucketMiddlewares(stack *middleware.Stack, op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteBucketMiddleware(stack); err != nil { + return err + } if err = addDeleteBucketResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -160,6 +167,59 @@ func (c *Client) addOperationDeleteBucketMiddlewares(stack *middleware.Stack, op return nil } +func (m *DeleteBucketInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *DeleteBucketInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opDeleteBucketMiddleware struct { +} + +func (*endpointPrefix_opDeleteBucketMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteBucketMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*DeleteBucketInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDeleteBucketMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDeleteBucketMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opDeleteBucket(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -269,6 +329,8 @@ func (m *opDeleteBucketResolveEndpointMiddleware) HandleSerialize(ctx context.Co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_DeleteBucketLifecycleConfiguration.go b/service/s3control/api_op_DeleteBucketLifecycleConfiguration.go index a8ca499614b..52a3c2b1ff9 100644 --- a/service/s3control/api_op_DeleteBucketLifecycleConfiguration.go +++ b/service/s3control/api_op_DeleteBucketLifecycleConfiguration.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -133,6 +134,12 @@ func (c *Client) addOperationDeleteBucketLifecycleConfigurationMiddlewares(stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteBucketLifecycleConfigurationMiddleware(stack); err != nil { + return err + } if err = addDeleteBucketLifecycleConfigurationResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -166,6 +173,59 @@ func (c *Client) addOperationDeleteBucketLifecycleConfigurationMiddlewares(stack return nil } +func (m *DeleteBucketLifecycleConfigurationInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *DeleteBucketLifecycleConfigurationInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opDeleteBucketLifecycleConfigurationMiddleware struct { +} + +func (*endpointPrefix_opDeleteBucketLifecycleConfigurationMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteBucketLifecycleConfigurationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*DeleteBucketLifecycleConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDeleteBucketLifecycleConfigurationMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDeleteBucketLifecycleConfigurationMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opDeleteBucketLifecycleConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -275,6 +335,8 @@ func (m *opDeleteBucketLifecycleConfigurationResolveEndpointMiddleware) HandleSe ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_DeleteBucketPolicy.go b/service/s3control/api_op_DeleteBucketPolicy.go index 80d5885b0e9..62437d85c7d 100644 --- a/service/s3control/api_op_DeleteBucketPolicy.go +++ b/service/s3control/api_op_DeleteBucketPolicy.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -137,6 +138,12 @@ func (c *Client) addOperationDeleteBucketPolicyMiddlewares(stack *middleware.Sta if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteBucketPolicyMiddleware(stack); err != nil { + return err + } if err = addDeleteBucketPolicyResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -170,6 +177,59 @@ func (c *Client) addOperationDeleteBucketPolicyMiddlewares(stack *middleware.Sta return nil } +func (m *DeleteBucketPolicyInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *DeleteBucketPolicyInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opDeleteBucketPolicyMiddleware struct { +} + +func (*endpointPrefix_opDeleteBucketPolicyMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteBucketPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*DeleteBucketPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDeleteBucketPolicyMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDeleteBucketPolicyMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opDeleteBucketPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -279,6 +339,8 @@ func (m *opDeleteBucketPolicyResolveEndpointMiddleware) HandleSerialize(ctx cont ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_DeleteBucketReplication.go b/service/s3control/api_op_DeleteBucketReplication.go index b56cf5e13db..db5820bbbcf 100644 --- a/service/s3control/api_op_DeleteBucketReplication.go +++ b/service/s3control/api_op_DeleteBucketReplication.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -140,6 +141,12 @@ func (c *Client) addOperationDeleteBucketReplicationMiddlewares(stack *middlewar if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteBucketReplicationMiddleware(stack); err != nil { + return err + } if err = addDeleteBucketReplicationResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -173,6 +180,59 @@ func (c *Client) addOperationDeleteBucketReplicationMiddlewares(stack *middlewar return nil } +func (m *DeleteBucketReplicationInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *DeleteBucketReplicationInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opDeleteBucketReplicationMiddleware struct { +} + +func (*endpointPrefix_opDeleteBucketReplicationMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteBucketReplicationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*DeleteBucketReplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDeleteBucketReplicationMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDeleteBucketReplicationMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opDeleteBucketReplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -282,6 +342,8 @@ func (m *opDeleteBucketReplicationResolveEndpointMiddleware) HandleSerialize(ctx ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_DeleteBucketTagging.go b/service/s3control/api_op_DeleteBucketTagging.go index e440e6c47fa..7f85eb869ec 100644 --- a/service/s3control/api_op_DeleteBucketTagging.go +++ b/service/s3control/api_op_DeleteBucketTagging.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -126,6 +127,12 @@ func (c *Client) addOperationDeleteBucketTaggingMiddlewares(stack *middleware.St if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteBucketTaggingMiddleware(stack); err != nil { + return err + } if err = addDeleteBucketTaggingResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -159,6 +166,59 @@ func (c *Client) addOperationDeleteBucketTaggingMiddlewares(stack *middleware.St return nil } +func (m *DeleteBucketTaggingInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *DeleteBucketTaggingInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opDeleteBucketTaggingMiddleware struct { +} + +func (*endpointPrefix_opDeleteBucketTaggingMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteBucketTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*DeleteBucketTaggingInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDeleteBucketTaggingMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDeleteBucketTaggingMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opDeleteBucketTagging(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -268,6 +328,8 @@ func (m *opDeleteBucketTaggingResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_DeleteJobTagging.go b/service/s3control/api_op_DeleteJobTagging.go index 3bf447f5bb7..38bd269f4d5 100644 --- a/service/s3control/api_op_DeleteJobTagging.go +++ b/service/s3control/api_op_DeleteJobTagging.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -111,6 +112,12 @@ func (c *Client) addOperationDeleteJobTaggingMiddlewares(stack *middleware.Stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteJobTaggingMiddleware(stack); err != nil { + return err + } if err = addDeleteJobTaggingResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -144,6 +151,47 @@ func (c *Client) addOperationDeleteJobTaggingMiddlewares(stack *middleware.Stack return nil } +type endpointPrefix_opDeleteJobTaggingMiddleware struct { +} + +func (*endpointPrefix_opDeleteJobTaggingMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteJobTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*DeleteJobTaggingInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDeleteJobTaggingMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDeleteJobTaggingMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opDeleteJobTagging(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -239,6 +287,8 @@ func (m *opDeleteJobTaggingResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_DeleteMultiRegionAccessPoint.go b/service/s3control/api_op_DeleteMultiRegionAccessPoint.go index fcf057401f5..7b92bf95f27 100644 --- a/service/s3control/api_op_DeleteMultiRegionAccessPoint.go +++ b/service/s3control/api_op_DeleteMultiRegionAccessPoint.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -131,9 +132,15 @@ func (c *Client) addOperationDeleteMultiRegionAccessPointMiddlewares(stack *midd if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { return err } + if err = addEndpointPrefix_opDeleteMultiRegionAccessPointMiddleware(stack); err != nil { + return err + } if err = addDeleteMultiRegionAccessPointResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -170,6 +177,47 @@ func (c *Client) addOperationDeleteMultiRegionAccessPointMiddlewares(stack *midd return nil } +type endpointPrefix_opDeleteMultiRegionAccessPointMiddleware struct { +} + +func (*endpointPrefix_opDeleteMultiRegionAccessPointMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteMultiRegionAccessPointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*DeleteMultiRegionAccessPointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDeleteMultiRegionAccessPointMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDeleteMultiRegionAccessPointMiddleware{}, `OperationSerializer`, middleware.After) +} + type idempotencyToken_initializeOpDeleteMultiRegionAccessPoint struct { tokenProvider IdempotencyTokenProvider } @@ -298,6 +346,8 @@ func (m *opDeleteMultiRegionAccessPointResolveEndpointMiddleware) HandleSerializ ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_DeletePublicAccessBlock.go b/service/s3control/api_op_DeletePublicAccessBlock.go index fdce87fcb79..e4c3678ffc4 100644 --- a/service/s3control/api_op_DeletePublicAccessBlock.go +++ b/service/s3control/api_op_DeletePublicAccessBlock.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -104,6 +105,12 @@ func (c *Client) addOperationDeletePublicAccessBlockMiddlewares(stack *middlewar if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeletePublicAccessBlockMiddleware(stack); err != nil { + return err + } if err = addDeletePublicAccessBlockResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -137,6 +144,47 @@ func (c *Client) addOperationDeletePublicAccessBlockMiddlewares(stack *middlewar return nil } +type endpointPrefix_opDeletePublicAccessBlockMiddleware struct { +} + +func (*endpointPrefix_opDeletePublicAccessBlockMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeletePublicAccessBlockMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*DeletePublicAccessBlockInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDeletePublicAccessBlockMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDeletePublicAccessBlockMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opDeletePublicAccessBlock(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -232,6 +280,8 @@ func (m *opDeletePublicAccessBlockResolveEndpointMiddleware) HandleSerialize(ctx ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_DeleteStorageLensConfiguration.go b/service/s3control/api_op_DeleteStorageLensConfiguration.go index 0984472ab30..4854334efd8 100644 --- a/service/s3control/api_op_DeleteStorageLensConfiguration.go +++ b/service/s3control/api_op_DeleteStorageLensConfiguration.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -110,6 +111,12 @@ func (c *Client) addOperationDeleteStorageLensConfigurationMiddlewares(stack *mi if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteStorageLensConfigurationMiddleware(stack); err != nil { + return err + } if err = addDeleteStorageLensConfigurationResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -143,6 +150,47 @@ func (c *Client) addOperationDeleteStorageLensConfigurationMiddlewares(stack *mi return nil } +type endpointPrefix_opDeleteStorageLensConfigurationMiddleware struct { +} + +func (*endpointPrefix_opDeleteStorageLensConfigurationMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteStorageLensConfigurationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*DeleteStorageLensConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDeleteStorageLensConfigurationMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDeleteStorageLensConfigurationMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opDeleteStorageLensConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -238,6 +286,8 @@ func (m *opDeleteStorageLensConfigurationResolveEndpointMiddleware) HandleSerial ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_DeleteStorageLensConfigurationTagging.go b/service/s3control/api_op_DeleteStorageLensConfigurationTagging.go index 0beca9f5adc..a968094277e 100644 --- a/service/s3control/api_op_DeleteStorageLensConfigurationTagging.go +++ b/service/s3control/api_op_DeleteStorageLensConfigurationTagging.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -110,6 +111,12 @@ func (c *Client) addOperationDeleteStorageLensConfigurationTaggingMiddlewares(st if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteStorageLensConfigurationTaggingMiddleware(stack); err != nil { + return err + } if err = addDeleteStorageLensConfigurationTaggingResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -143,6 +150,47 @@ func (c *Client) addOperationDeleteStorageLensConfigurationTaggingMiddlewares(st return nil } +type endpointPrefix_opDeleteStorageLensConfigurationTaggingMiddleware struct { +} + +func (*endpointPrefix_opDeleteStorageLensConfigurationTaggingMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteStorageLensConfigurationTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*DeleteStorageLensConfigurationTaggingInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDeleteStorageLensConfigurationTaggingMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDeleteStorageLensConfigurationTaggingMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opDeleteStorageLensConfigurationTagging(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -238,6 +286,8 @@ func (m *opDeleteStorageLensConfigurationTaggingResolveEndpointMiddleware) Handl ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_DescribeJob.go b/service/s3control/api_op_DescribeJob.go index c4b375665e0..da79529458b 100644 --- a/service/s3control/api_op_DescribeJob.go +++ b/service/s3control/api_op_DescribeJob.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -116,6 +117,12 @@ func (c *Client) addOperationDescribeJobMiddlewares(stack *middleware.Stack, opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDescribeJobMiddleware(stack); err != nil { + return err + } if err = addDescribeJobResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -149,6 +156,47 @@ func (c *Client) addOperationDescribeJobMiddlewares(stack *middleware.Stack, opt return nil } +type endpointPrefix_opDescribeJobMiddleware struct { +} + +func (*endpointPrefix_opDescribeJobMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDescribeJobMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*DescribeJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDescribeJobMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDescribeJobMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opDescribeJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -244,6 +292,8 @@ func (m *opDescribeJobResolveEndpointMiddleware) HandleSerialize(ctx context.Con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_DescribeMultiRegionAccessPointOperation.go b/service/s3control/api_op_DescribeMultiRegionAccessPointOperation.go index 1a1fe846fc5..73b9e2a4236 100644 --- a/service/s3control/api_op_DescribeMultiRegionAccessPointOperation.go +++ b/service/s3control/api_op_DescribeMultiRegionAccessPointOperation.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -121,9 +122,15 @@ func (c *Client) addOperationDescribeMultiRegionAccessPointOperationMiddlewares( if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { return err } + if err = addEndpointPrefix_opDescribeMultiRegionAccessPointOperationMiddleware(stack); err != nil { + return err + } if err = addDescribeMultiRegionAccessPointOperationResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -157,6 +164,47 @@ func (c *Client) addOperationDescribeMultiRegionAccessPointOperationMiddlewares( return nil } +type endpointPrefix_opDescribeMultiRegionAccessPointOperationMiddleware struct { +} + +func (*endpointPrefix_opDescribeMultiRegionAccessPointOperationMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDescribeMultiRegionAccessPointOperationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*DescribeMultiRegionAccessPointOperationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opDescribeMultiRegionAccessPointOperationMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opDescribeMultiRegionAccessPointOperationMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opDescribeMultiRegionAccessPointOperation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -252,6 +300,8 @@ func (m *opDescribeMultiRegionAccessPointOperationResolveEndpointMiddleware) Han ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetAccessPoint.go b/service/s3control/api_op_GetAccessPoint.go index 5dcaeaa2985..759ec42c456 100644 --- a/service/s3control/api_op_GetAccessPoint.go +++ b/service/s3control/api_op_GetAccessPoint.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -170,6 +171,12 @@ func (c *Client) addOperationGetAccessPointMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetAccessPointMiddleware(stack); err != nil { + return err + } if err = addGetAccessPointResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -203,6 +210,59 @@ func (c *Client) addOperationGetAccessPointMiddlewares(stack *middleware.Stack, return nil } +func (m *GetAccessPointInput) GetARNMember() (*string, bool) { + if m.Name == nil { + return nil, false + } + return m.Name, true +} + +func (m *GetAccessPointInput) SetARNMember(v string) error { + m.Name = &v + return nil +} + +type endpointPrefix_opGetAccessPointMiddleware struct { +} + +func (*endpointPrefix_opGetAccessPointMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetAccessPointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetAccessPointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetAccessPointMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetAccessPointMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetAccessPoint(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -312,6 +372,8 @@ func (m *opGetAccessPointResolveEndpointMiddleware) HandleSerialize(ctx context. ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetAccessPointConfigurationForObjectLambda.go b/service/s3control/api_op_GetAccessPointConfigurationForObjectLambda.go index ef005ee3c03..21a3520a652 100644 --- a/service/s3control/api_op_GetAccessPointConfigurationForObjectLambda.go +++ b/service/s3control/api_op_GetAccessPointConfigurationForObjectLambda.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -113,6 +114,12 @@ func (c *Client) addOperationGetAccessPointConfigurationForObjectLambdaMiddlewar if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetAccessPointConfigurationForObjectLambdaMiddleware(stack); err != nil { + return err + } if err = addGetAccessPointConfigurationForObjectLambdaResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -146,6 +153,47 @@ func (c *Client) addOperationGetAccessPointConfigurationForObjectLambdaMiddlewar return nil } +type endpointPrefix_opGetAccessPointConfigurationForObjectLambdaMiddleware struct { +} + +func (*endpointPrefix_opGetAccessPointConfigurationForObjectLambdaMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetAccessPointConfigurationForObjectLambdaMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetAccessPointConfigurationForObjectLambdaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetAccessPointConfigurationForObjectLambdaMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetAccessPointConfigurationForObjectLambdaMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetAccessPointConfigurationForObjectLambda(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -241,6 +289,8 @@ func (m *opGetAccessPointConfigurationForObjectLambdaResolveEndpointMiddleware) ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetAccessPointForObjectLambda.go b/service/s3control/api_op_GetAccessPointForObjectLambda.go index 7ca03cbbd44..34b093f1ef9 100644 --- a/service/s3control/api_op_GetAccessPointForObjectLambda.go +++ b/service/s3control/api_op_GetAccessPointForObjectLambda.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -125,6 +126,12 @@ func (c *Client) addOperationGetAccessPointForObjectLambdaMiddlewares(stack *mid if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetAccessPointForObjectLambdaMiddleware(stack); err != nil { + return err + } if err = addGetAccessPointForObjectLambdaResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -158,6 +165,47 @@ func (c *Client) addOperationGetAccessPointForObjectLambdaMiddlewares(stack *mid return nil } +type endpointPrefix_opGetAccessPointForObjectLambdaMiddleware struct { +} + +func (*endpointPrefix_opGetAccessPointForObjectLambdaMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetAccessPointForObjectLambdaMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetAccessPointForObjectLambdaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetAccessPointForObjectLambdaMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetAccessPointForObjectLambdaMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetAccessPointForObjectLambda(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -253,6 +301,8 @@ func (m *opGetAccessPointForObjectLambdaResolveEndpointMiddleware) HandleSeriali ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetAccessPointPolicy.go b/service/s3control/api_op_GetAccessPointPolicy.go index a703081ae3b..67969ed98a6 100644 --- a/service/s3control/api_op_GetAccessPointPolicy.go +++ b/service/s3control/api_op_GetAccessPointPolicy.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -120,6 +121,12 @@ func (c *Client) addOperationGetAccessPointPolicyMiddlewares(stack *middleware.S if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetAccessPointPolicyMiddleware(stack); err != nil { + return err + } if err = addGetAccessPointPolicyResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -153,6 +160,59 @@ func (c *Client) addOperationGetAccessPointPolicyMiddlewares(stack *middleware.S return nil } +func (m *GetAccessPointPolicyInput) GetARNMember() (*string, bool) { + if m.Name == nil { + return nil, false + } + return m.Name, true +} + +func (m *GetAccessPointPolicyInput) SetARNMember(v string) error { + m.Name = &v + return nil +} + +type endpointPrefix_opGetAccessPointPolicyMiddleware struct { +} + +func (*endpointPrefix_opGetAccessPointPolicyMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetAccessPointPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetAccessPointPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetAccessPointPolicyMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetAccessPointPolicyMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetAccessPointPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -262,6 +322,8 @@ func (m *opGetAccessPointPolicyResolveEndpointMiddleware) HandleSerialize(ctx co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetAccessPointPolicyForObjectLambda.go b/service/s3control/api_op_GetAccessPointPolicyForObjectLambda.go index 5aa2de45b82..37273c460b3 100644 --- a/service/s3control/api_op_GetAccessPointPolicyForObjectLambda.go +++ b/service/s3control/api_op_GetAccessPointPolicyForObjectLambda.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -112,6 +113,12 @@ func (c *Client) addOperationGetAccessPointPolicyForObjectLambdaMiddlewares(stac if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetAccessPointPolicyForObjectLambdaMiddleware(stack); err != nil { + return err + } if err = addGetAccessPointPolicyForObjectLambdaResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -145,6 +152,47 @@ func (c *Client) addOperationGetAccessPointPolicyForObjectLambdaMiddlewares(stac return nil } +type endpointPrefix_opGetAccessPointPolicyForObjectLambdaMiddleware struct { +} + +func (*endpointPrefix_opGetAccessPointPolicyForObjectLambdaMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetAccessPointPolicyForObjectLambdaMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetAccessPointPolicyForObjectLambdaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetAccessPointPolicyForObjectLambdaMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetAccessPointPolicyForObjectLambdaMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetAccessPointPolicyForObjectLambda(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -240,6 +288,8 @@ func (m *opGetAccessPointPolicyForObjectLambdaResolveEndpointMiddleware) HandleS ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetAccessPointPolicyStatus.go b/service/s3control/api_op_GetAccessPointPolicyStatus.go index 81d07eb3a22..42b861cc463 100644 --- a/service/s3control/api_op_GetAccessPointPolicyStatus.go +++ b/service/s3control/api_op_GetAccessPointPolicyStatus.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -112,6 +113,12 @@ func (c *Client) addOperationGetAccessPointPolicyStatusMiddlewares(stack *middle if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetAccessPointPolicyStatusMiddleware(stack); err != nil { + return err + } if err = addGetAccessPointPolicyStatusResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -145,6 +152,47 @@ func (c *Client) addOperationGetAccessPointPolicyStatusMiddlewares(stack *middle return nil } +type endpointPrefix_opGetAccessPointPolicyStatusMiddleware struct { +} + +func (*endpointPrefix_opGetAccessPointPolicyStatusMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetAccessPointPolicyStatusMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetAccessPointPolicyStatusInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetAccessPointPolicyStatusMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetAccessPointPolicyStatusMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetAccessPointPolicyStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -242,6 +290,8 @@ func (m *opGetAccessPointPolicyStatusResolveEndpointMiddleware) HandleSerialize( ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetAccessPointPolicyStatusForObjectLambda.go b/service/s3control/api_op_GetAccessPointPolicyStatusForObjectLambda.go index a8cb1904ecf..cbb67a43f2f 100644 --- a/service/s3control/api_op_GetAccessPointPolicyStatusForObjectLambda.go +++ b/service/s3control/api_op_GetAccessPointPolicyStatusForObjectLambda.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -114,6 +115,12 @@ func (c *Client) addOperationGetAccessPointPolicyStatusForObjectLambdaMiddleware if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetAccessPointPolicyStatusForObjectLambdaMiddleware(stack); err != nil { + return err + } if err = addGetAccessPointPolicyStatusForObjectLambdaResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -147,6 +154,47 @@ func (c *Client) addOperationGetAccessPointPolicyStatusForObjectLambdaMiddleware return nil } +type endpointPrefix_opGetAccessPointPolicyStatusForObjectLambdaMiddleware struct { +} + +func (*endpointPrefix_opGetAccessPointPolicyStatusForObjectLambdaMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetAccessPointPolicyStatusForObjectLambdaMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetAccessPointPolicyStatusForObjectLambdaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetAccessPointPolicyStatusForObjectLambdaMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetAccessPointPolicyStatusForObjectLambdaMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetAccessPointPolicyStatusForObjectLambda(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -242,6 +290,8 @@ func (m *opGetAccessPointPolicyStatusForObjectLambdaResolveEndpointMiddleware) H ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetBucket.go b/service/s3control/api_op_GetBucket.go index 178fd24a730..c2fa921fd6e 100644 --- a/service/s3control/api_op_GetBucket.go +++ b/service/s3control/api_op_GetBucket.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -143,6 +144,12 @@ func (c *Client) addOperationGetBucketMiddlewares(stack *middleware.Stack, optio if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetBucketMiddleware(stack); err != nil { + return err + } if err = addGetBucketResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -176,6 +183,59 @@ func (c *Client) addOperationGetBucketMiddlewares(stack *middleware.Stack, optio return nil } +func (m *GetBucketInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *GetBucketInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opGetBucketMiddleware struct { +} + +func (*endpointPrefix_opGetBucketMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetBucketMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetBucketInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetBucketMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetBucketMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetBucket(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -285,6 +345,8 @@ func (m *opGetBucketResolveEndpointMiddleware) HandleSerialize(ctx context.Conte ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetBucketLifecycleConfiguration.go b/service/s3control/api_op_GetBucketLifecycleConfiguration.go index 8f53b4cba7d..139a25aef77 100644 --- a/service/s3control/api_op_GetBucketLifecycleConfiguration.go +++ b/service/s3control/api_op_GetBucketLifecycleConfiguration.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -144,6 +145,12 @@ func (c *Client) addOperationGetBucketLifecycleConfigurationMiddlewares(stack *m if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetBucketLifecycleConfigurationMiddleware(stack); err != nil { + return err + } if err = addGetBucketLifecycleConfigurationResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -177,6 +184,59 @@ func (c *Client) addOperationGetBucketLifecycleConfigurationMiddlewares(stack *m return nil } +func (m *GetBucketLifecycleConfigurationInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *GetBucketLifecycleConfigurationInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opGetBucketLifecycleConfigurationMiddleware struct { +} + +func (*endpointPrefix_opGetBucketLifecycleConfigurationMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetBucketLifecycleConfigurationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetBucketLifecycleConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetBucketLifecycleConfigurationMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetBucketLifecycleConfigurationMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetBucketLifecycleConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -286,6 +346,8 @@ func (m *opGetBucketLifecycleConfigurationResolveEndpointMiddleware) HandleSeria ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetBucketPolicy.go b/service/s3control/api_op_GetBucketPolicy.go index 689bbf0b2a7..5980c3859c7 100644 --- a/service/s3control/api_op_GetBucketPolicy.go +++ b/service/s3control/api_op_GetBucketPolicy.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -141,6 +142,12 @@ func (c *Client) addOperationGetBucketPolicyMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetBucketPolicyMiddleware(stack); err != nil { + return err + } if err = addGetBucketPolicyResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -174,6 +181,59 @@ func (c *Client) addOperationGetBucketPolicyMiddlewares(stack *middleware.Stack, return nil } +func (m *GetBucketPolicyInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *GetBucketPolicyInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opGetBucketPolicyMiddleware struct { +} + +func (*endpointPrefix_opGetBucketPolicyMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetBucketPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetBucketPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetBucketPolicyMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetBucketPolicyMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetBucketPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -283,6 +343,8 @@ func (m *opGetBucketPolicyResolveEndpointMiddleware) HandleSerialize(ctx context ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetBucketReplication.go b/service/s3control/api_op_GetBucketReplication.go index b1f57732cbc..8218301fdca 100644 --- a/service/s3control/api_op_GetBucketReplication.go +++ b/service/s3control/api_op_GetBucketReplication.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -150,6 +151,12 @@ func (c *Client) addOperationGetBucketReplicationMiddlewares(stack *middleware.S if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetBucketReplicationMiddleware(stack); err != nil { + return err + } if err = addGetBucketReplicationResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -183,6 +190,59 @@ func (c *Client) addOperationGetBucketReplicationMiddlewares(stack *middleware.S return nil } +func (m *GetBucketReplicationInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *GetBucketReplicationInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opGetBucketReplicationMiddleware struct { +} + +func (*endpointPrefix_opGetBucketReplicationMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetBucketReplicationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetBucketReplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetBucketReplicationMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetBucketReplicationMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetBucketReplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -292,6 +352,8 @@ func (m *opGetBucketReplicationResolveEndpointMiddleware) HandleSerialize(ctx co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetBucketTagging.go b/service/s3control/api_op_GetBucketTagging.go index a6bf49af42d..8dff4ae16a3 100644 --- a/service/s3control/api_op_GetBucketTagging.go +++ b/service/s3control/api_op_GetBucketTagging.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -138,6 +139,12 @@ func (c *Client) addOperationGetBucketTaggingMiddlewares(stack *middleware.Stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetBucketTaggingMiddleware(stack); err != nil { + return err + } if err = addGetBucketTaggingResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -171,6 +178,59 @@ func (c *Client) addOperationGetBucketTaggingMiddlewares(stack *middleware.Stack return nil } +func (m *GetBucketTaggingInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *GetBucketTaggingInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opGetBucketTaggingMiddleware struct { +} + +func (*endpointPrefix_opGetBucketTaggingMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetBucketTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetBucketTaggingInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetBucketTaggingMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetBucketTaggingMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetBucketTagging(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -280,6 +340,8 @@ func (m *opGetBucketTaggingResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetBucketVersioning.go b/service/s3control/api_op_GetBucketVersioning.go index 961b648cc09..c558de47e3e 100644 --- a/service/s3control/api_op_GetBucketVersioning.go +++ b/service/s3control/api_op_GetBucketVersioning.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -133,6 +134,12 @@ func (c *Client) addOperationGetBucketVersioningMiddlewares(stack *middleware.St if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetBucketVersioningMiddleware(stack); err != nil { + return err + } if err = addGetBucketVersioningResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -166,6 +173,59 @@ func (c *Client) addOperationGetBucketVersioningMiddlewares(stack *middleware.St return nil } +func (m *GetBucketVersioningInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *GetBucketVersioningInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opGetBucketVersioningMiddleware struct { +} + +func (*endpointPrefix_opGetBucketVersioningMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetBucketVersioningMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetBucketVersioningInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetBucketVersioningMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetBucketVersioningMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetBucketVersioning(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -275,6 +335,8 @@ func (m *opGetBucketVersioningResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetJobTagging.go b/service/s3control/api_op_GetJobTagging.go index 2b804ad6f4a..70212bd198c 100644 --- a/service/s3control/api_op_GetJobTagging.go +++ b/service/s3control/api_op_GetJobTagging.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -115,6 +116,12 @@ func (c *Client) addOperationGetJobTaggingMiddlewares(stack *middleware.Stack, o if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetJobTaggingMiddleware(stack); err != nil { + return err + } if err = addGetJobTaggingResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -148,6 +155,47 @@ func (c *Client) addOperationGetJobTaggingMiddlewares(stack *middleware.Stack, o return nil } +type endpointPrefix_opGetJobTaggingMiddleware struct { +} + +func (*endpointPrefix_opGetJobTaggingMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetJobTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetJobTaggingInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetJobTaggingMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetJobTaggingMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetJobTagging(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -243,6 +291,8 @@ func (m *opGetJobTaggingResolveEndpointMiddleware) HandleSerialize(ctx context.C ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetMultiRegionAccessPoint.go b/service/s3control/api_op_GetMultiRegionAccessPoint.go index 430bc6a4a87..8ac0af6532e 100644 --- a/service/s3control/api_op_GetMultiRegionAccessPoint.go +++ b/service/s3control/api_op_GetMultiRegionAccessPoint.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -124,9 +125,15 @@ func (c *Client) addOperationGetMultiRegionAccessPointMiddlewares(stack *middlew if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { return err } + if err = addEndpointPrefix_opGetMultiRegionAccessPointMiddleware(stack); err != nil { + return err + } if err = addGetMultiRegionAccessPointResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -160,6 +167,47 @@ func (c *Client) addOperationGetMultiRegionAccessPointMiddlewares(stack *middlew return nil } +type endpointPrefix_opGetMultiRegionAccessPointMiddleware struct { +} + +func (*endpointPrefix_opGetMultiRegionAccessPointMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetMultiRegionAccessPointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetMultiRegionAccessPointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetMultiRegionAccessPointMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetMultiRegionAccessPointMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetMultiRegionAccessPoint(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -255,6 +303,8 @@ func (m *opGetMultiRegionAccessPointResolveEndpointMiddleware) HandleSerialize(c ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetMultiRegionAccessPointPolicy.go b/service/s3control/api_op_GetMultiRegionAccessPointPolicy.go index 6ff99e32cd5..e4755a3f07f 100644 --- a/service/s3control/api_op_GetMultiRegionAccessPointPolicy.go +++ b/service/s3control/api_op_GetMultiRegionAccessPointPolicy.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -121,9 +122,15 @@ func (c *Client) addOperationGetMultiRegionAccessPointPolicyMiddlewares(stack *m if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { return err } + if err = addEndpointPrefix_opGetMultiRegionAccessPointPolicyMiddleware(stack); err != nil { + return err + } if err = addGetMultiRegionAccessPointPolicyResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -157,6 +164,47 @@ func (c *Client) addOperationGetMultiRegionAccessPointPolicyMiddlewares(stack *m return nil } +type endpointPrefix_opGetMultiRegionAccessPointPolicyMiddleware struct { +} + +func (*endpointPrefix_opGetMultiRegionAccessPointPolicyMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetMultiRegionAccessPointPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetMultiRegionAccessPointPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetMultiRegionAccessPointPolicyMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetMultiRegionAccessPointPolicyMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetMultiRegionAccessPointPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -252,6 +300,8 @@ func (m *opGetMultiRegionAccessPointPolicyResolveEndpointMiddleware) HandleSeria ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetMultiRegionAccessPointPolicyStatus.go b/service/s3control/api_op_GetMultiRegionAccessPointPolicyStatus.go index 9a96b5c7e96..ddf6bd858dd 100644 --- a/service/s3control/api_op_GetMultiRegionAccessPointPolicyStatus.go +++ b/service/s3control/api_op_GetMultiRegionAccessPointPolicyStatus.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -124,9 +125,15 @@ func (c *Client) addOperationGetMultiRegionAccessPointPolicyStatusMiddlewares(st if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { return err } + if err = addEndpointPrefix_opGetMultiRegionAccessPointPolicyStatusMiddleware(stack); err != nil { + return err + } if err = addGetMultiRegionAccessPointPolicyStatusResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -160,6 +167,47 @@ func (c *Client) addOperationGetMultiRegionAccessPointPolicyStatusMiddlewares(st return nil } +type endpointPrefix_opGetMultiRegionAccessPointPolicyStatusMiddleware struct { +} + +func (*endpointPrefix_opGetMultiRegionAccessPointPolicyStatusMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetMultiRegionAccessPointPolicyStatusMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetMultiRegionAccessPointPolicyStatusInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetMultiRegionAccessPointPolicyStatusMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetMultiRegionAccessPointPolicyStatusMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetMultiRegionAccessPointPolicyStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -255,6 +303,8 @@ func (m *opGetMultiRegionAccessPointPolicyStatusResolveEndpointMiddleware) Handl ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetMultiRegionAccessPointRoutes.go b/service/s3control/api_op_GetMultiRegionAccessPointRoutes.go index 29f22564182..f026ce8f323 100644 --- a/service/s3control/api_op_GetMultiRegionAccessPointRoutes.go +++ b/service/s3control/api_op_GetMultiRegionAccessPointRoutes.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -124,9 +125,15 @@ func (c *Client) addOperationGetMultiRegionAccessPointRoutesMiddlewares(stack *m if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { return err } + if err = addEndpointPrefix_opGetMultiRegionAccessPointRoutesMiddleware(stack); err != nil { + return err + } if err = addGetMultiRegionAccessPointRoutesResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -160,6 +167,47 @@ func (c *Client) addOperationGetMultiRegionAccessPointRoutesMiddlewares(stack *m return nil } +type endpointPrefix_opGetMultiRegionAccessPointRoutesMiddleware struct { +} + +func (*endpointPrefix_opGetMultiRegionAccessPointRoutesMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetMultiRegionAccessPointRoutesMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetMultiRegionAccessPointRoutesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetMultiRegionAccessPointRoutesMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetMultiRegionAccessPointRoutesMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetMultiRegionAccessPointRoutes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -255,6 +303,8 @@ func (m *opGetMultiRegionAccessPointRoutesResolveEndpointMiddleware) HandleSeria ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetPublicAccessBlock.go b/service/s3control/api_op_GetPublicAccessBlock.go index a46d081e22a..5b7be34d6f0 100644 --- a/service/s3control/api_op_GetPublicAccessBlock.go +++ b/service/s3control/api_op_GetPublicAccessBlock.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -110,6 +111,12 @@ func (c *Client) addOperationGetPublicAccessBlockMiddlewares(stack *middleware.S if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetPublicAccessBlockMiddleware(stack); err != nil { + return err + } if err = addGetPublicAccessBlockResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -143,6 +150,47 @@ func (c *Client) addOperationGetPublicAccessBlockMiddlewares(stack *middleware.S return nil } +type endpointPrefix_opGetPublicAccessBlockMiddleware struct { +} + +func (*endpointPrefix_opGetPublicAccessBlockMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetPublicAccessBlockMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetPublicAccessBlockInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetPublicAccessBlockMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetPublicAccessBlockMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetPublicAccessBlock(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -238,6 +286,8 @@ func (m *opGetPublicAccessBlockResolveEndpointMiddleware) HandleSerialize(ctx co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetStorageLensConfiguration.go b/service/s3control/api_op_GetStorageLensConfiguration.go index bada6bc488a..ed16e13141e 100644 --- a/service/s3control/api_op_GetStorageLensConfiguration.go +++ b/service/s3control/api_op_GetStorageLensConfiguration.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -116,6 +117,12 @@ func (c *Client) addOperationGetStorageLensConfigurationMiddlewares(stack *middl if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetStorageLensConfigurationMiddleware(stack); err != nil { + return err + } if err = addGetStorageLensConfigurationResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -149,6 +156,47 @@ func (c *Client) addOperationGetStorageLensConfigurationMiddlewares(stack *middl return nil } +type endpointPrefix_opGetStorageLensConfigurationMiddleware struct { +} + +func (*endpointPrefix_opGetStorageLensConfigurationMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetStorageLensConfigurationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetStorageLensConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetStorageLensConfigurationMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetStorageLensConfigurationMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetStorageLensConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -244,6 +292,8 @@ func (m *opGetStorageLensConfigurationResolveEndpointMiddleware) HandleSerialize ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_GetStorageLensConfigurationTagging.go b/service/s3control/api_op_GetStorageLensConfigurationTagging.go index af1416f0d39..c8ed8ae7506 100644 --- a/service/s3control/api_op_GetStorageLensConfigurationTagging.go +++ b/service/s3control/api_op_GetStorageLensConfigurationTagging.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -115,6 +116,12 @@ func (c *Client) addOperationGetStorageLensConfigurationTaggingMiddlewares(stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetStorageLensConfigurationTaggingMiddleware(stack); err != nil { + return err + } if err = addGetStorageLensConfigurationTaggingResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -148,6 +155,47 @@ func (c *Client) addOperationGetStorageLensConfigurationTaggingMiddlewares(stack return nil } +type endpointPrefix_opGetStorageLensConfigurationTaggingMiddleware struct { +} + +func (*endpointPrefix_opGetStorageLensConfigurationTaggingMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetStorageLensConfigurationTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*GetStorageLensConfigurationTaggingInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opGetStorageLensConfigurationTaggingMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opGetStorageLensConfigurationTaggingMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opGetStorageLensConfigurationTagging(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -243,6 +291,8 @@ func (m *opGetStorageLensConfigurationTaggingResolveEndpointMiddleware) HandleSe ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_ListAccessPoints.go b/service/s3control/api_op_ListAccessPoints.go index afde9f0de82..8d945557113 100644 --- a/service/s3control/api_op_ListAccessPoints.go +++ b/service/s3control/api_op_ListAccessPoints.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -147,6 +148,12 @@ func (c *Client) addOperationListAccessPointsMiddlewares(stack *middleware.Stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opListAccessPointsMiddleware(stack); err != nil { + return err + } if err = addListAccessPointsResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -180,6 +187,59 @@ func (c *Client) addOperationListAccessPointsMiddlewares(stack *middleware.Stack return nil } +func (m *ListAccessPointsInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *ListAccessPointsInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opListAccessPointsMiddleware struct { +} + +func (*endpointPrefix_opListAccessPointsMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListAccessPointsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*ListAccessPointsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opListAccessPointsMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opListAccessPointsMiddleware{}, `OperationSerializer`, middleware.After) +} + // ListAccessPointsAPIClient is a client that implements the ListAccessPoints // operation. type ListAccessPointsAPIClient interface { @@ -378,6 +438,8 @@ func (m *opListAccessPointsResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_ListAccessPointsForObjectLambda.go b/service/s3control/api_op_ListAccessPointsForObjectLambda.go index 84f0c70a3c4..fdc7e1e52c0 100644 --- a/service/s3control/api_op_ListAccessPointsForObjectLambda.go +++ b/service/s3control/api_op_ListAccessPointsForObjectLambda.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -129,6 +130,12 @@ func (c *Client) addOperationListAccessPointsForObjectLambdaMiddlewares(stack *m if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opListAccessPointsForObjectLambdaMiddleware(stack); err != nil { + return err + } if err = addListAccessPointsForObjectLambdaResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -162,6 +169,47 @@ func (c *Client) addOperationListAccessPointsForObjectLambdaMiddlewares(stack *m return nil } +type endpointPrefix_opListAccessPointsForObjectLambdaMiddleware struct { +} + +func (*endpointPrefix_opListAccessPointsForObjectLambdaMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListAccessPointsForObjectLambdaMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*ListAccessPointsForObjectLambdaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opListAccessPointsForObjectLambdaMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opListAccessPointsForObjectLambdaMiddleware{}, `OperationSerializer`, middleware.After) +} + // ListAccessPointsForObjectLambdaAPIClient is a client that implements the // ListAccessPointsForObjectLambda operation. type ListAccessPointsForObjectLambdaAPIClient interface { @@ -350,6 +398,8 @@ func (m *opListAccessPointsForObjectLambdaResolveEndpointMiddleware) HandleSeria ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_ListJobs.go b/service/s3control/api_op_ListJobs.go index cd061ed11ca..26afa38a602 100644 --- a/service/s3control/api_op_ListJobs.go +++ b/service/s3control/api_op_ListJobs.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -131,6 +132,12 @@ func (c *Client) addOperationListJobsMiddlewares(stack *middleware.Stack, option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opListJobsMiddleware(stack); err != nil { + return err + } if err = addListJobsResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -164,6 +171,47 @@ func (c *Client) addOperationListJobsMiddlewares(stack *middleware.Stack, option return nil } +type endpointPrefix_opListJobsMiddleware struct { +} + +func (*endpointPrefix_opListJobsMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListJobsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*ListJobsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opListJobsMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opListJobsMiddleware{}, `OperationSerializer`, middleware.After) +} + // ListJobsAPIClient is a client that implements the ListJobs operation. type ListJobsAPIClient interface { ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) @@ -351,6 +399,8 @@ func (m *opListJobsResolveEndpointMiddleware) HandleSerialize(ctx context.Contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_ListMultiRegionAccessPoints.go b/service/s3control/api_op_ListMultiRegionAccessPoints.go index 339e277d850..6d3bf7deede 100644 --- a/service/s3control/api_op_ListMultiRegionAccessPoints.go +++ b/service/s3control/api_op_ListMultiRegionAccessPoints.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -129,9 +130,15 @@ func (c *Client) addOperationListMultiRegionAccessPointsMiddlewares(stack *middl if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { return err } + if err = addEndpointPrefix_opListMultiRegionAccessPointsMiddleware(stack); err != nil { + return err + } if err = addListMultiRegionAccessPointsResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -165,6 +172,47 @@ func (c *Client) addOperationListMultiRegionAccessPointsMiddlewares(stack *middl return nil } +type endpointPrefix_opListMultiRegionAccessPointsMiddleware struct { +} + +func (*endpointPrefix_opListMultiRegionAccessPointsMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListMultiRegionAccessPointsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*ListMultiRegionAccessPointsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opListMultiRegionAccessPointsMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opListMultiRegionAccessPointsMiddleware{}, `OperationSerializer`, middleware.After) +} + // ListMultiRegionAccessPointsAPIClient is a client that implements the // ListMultiRegionAccessPoints operation. type ListMultiRegionAccessPointsAPIClient interface { @@ -349,6 +397,8 @@ func (m *opListMultiRegionAccessPointsResolveEndpointMiddleware) HandleSerialize ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_ListRegionalBuckets.go b/service/s3control/api_op_ListRegionalBuckets.go index d5a3d44917c..48782793999 100644 --- a/service/s3control/api_op_ListRegionalBuckets.go +++ b/service/s3control/api_op_ListRegionalBuckets.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -125,6 +126,12 @@ func (c *Client) addOperationListRegionalBucketsMiddlewares(stack *middleware.St if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opListRegionalBucketsMiddleware(stack); err != nil { + return err + } if err = addListRegionalBucketsResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -158,6 +165,47 @@ func (c *Client) addOperationListRegionalBucketsMiddlewares(stack *middleware.St return nil } +type endpointPrefix_opListRegionalBucketsMiddleware struct { +} + +func (*endpointPrefix_opListRegionalBucketsMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListRegionalBucketsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*ListRegionalBucketsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opListRegionalBucketsMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opListRegionalBucketsMiddleware{}, `OperationSerializer`, middleware.After) +} + // ListRegionalBucketsAPIClient is a client that implements the // ListRegionalBuckets operation. type ListRegionalBucketsAPIClient interface { @@ -353,6 +401,8 @@ func (m *opListRegionalBucketsResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_ListStorageLensConfigurations.go b/service/s3control/api_op_ListStorageLensConfigurations.go index 55aaf6f4790..e3fdedf85e9 100644 --- a/service/s3control/api_op_ListStorageLensConfigurations.go +++ b/service/s3control/api_op_ListStorageLensConfigurations.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -118,6 +119,12 @@ func (c *Client) addOperationListStorageLensConfigurationsMiddlewares(stack *mid if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opListStorageLensConfigurationsMiddleware(stack); err != nil { + return err + } if err = addListStorageLensConfigurationsResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -151,6 +158,47 @@ func (c *Client) addOperationListStorageLensConfigurationsMiddlewares(stack *mid return nil } +type endpointPrefix_opListStorageLensConfigurationsMiddleware struct { +} + +func (*endpointPrefix_opListStorageLensConfigurationsMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListStorageLensConfigurationsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*ListStorageLensConfigurationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opListStorageLensConfigurationsMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opListStorageLensConfigurationsMiddleware{}, `OperationSerializer`, middleware.After) +} + // ListStorageLensConfigurationsAPIClient is a client that implements the // ListStorageLensConfigurations operation. type ListStorageLensConfigurationsAPIClient interface { @@ -327,6 +375,8 @@ func (m *opListStorageLensConfigurationsResolveEndpointMiddleware) HandleSeriali ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_PutAccessPointConfigurationForObjectLambda.go b/service/s3control/api_op_PutAccessPointConfigurationForObjectLambda.go index 3a7bc75bd65..7d2b78c94c4 100644 --- a/service/s3control/api_op_PutAccessPointConfigurationForObjectLambda.go +++ b/service/s3control/api_op_PutAccessPointConfigurationForObjectLambda.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -113,6 +114,12 @@ func (c *Client) addOperationPutAccessPointConfigurationForObjectLambdaMiddlewar if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opPutAccessPointConfigurationForObjectLambdaMiddleware(stack); err != nil { + return err + } if err = addPutAccessPointConfigurationForObjectLambdaResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -146,6 +153,47 @@ func (c *Client) addOperationPutAccessPointConfigurationForObjectLambdaMiddlewar return nil } +type endpointPrefix_opPutAccessPointConfigurationForObjectLambdaMiddleware struct { +} + +func (*endpointPrefix_opPutAccessPointConfigurationForObjectLambdaMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opPutAccessPointConfigurationForObjectLambdaMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*PutAccessPointConfigurationForObjectLambdaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opPutAccessPointConfigurationForObjectLambdaMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opPutAccessPointConfigurationForObjectLambdaMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opPutAccessPointConfigurationForObjectLambda(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -241,6 +289,8 @@ func (m *opPutAccessPointConfigurationForObjectLambdaResolveEndpointMiddleware) ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_PutAccessPointPolicy.go b/service/s3control/api_op_PutAccessPointPolicy.go index 4aa7ddfafda..efe4d8f0f64 100644 --- a/service/s3control/api_op_PutAccessPointPolicy.go +++ b/service/s3control/api_op_PutAccessPointPolicy.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -133,6 +134,12 @@ func (c *Client) addOperationPutAccessPointPolicyMiddlewares(stack *middleware.S if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opPutAccessPointPolicyMiddleware(stack); err != nil { + return err + } if err = addPutAccessPointPolicyResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -166,6 +173,59 @@ func (c *Client) addOperationPutAccessPointPolicyMiddlewares(stack *middleware.S return nil } +func (m *PutAccessPointPolicyInput) GetARNMember() (*string, bool) { + if m.Name == nil { + return nil, false + } + return m.Name, true +} + +func (m *PutAccessPointPolicyInput) SetARNMember(v string) error { + m.Name = &v + return nil +} + +type endpointPrefix_opPutAccessPointPolicyMiddleware struct { +} + +func (*endpointPrefix_opPutAccessPointPolicyMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opPutAccessPointPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*PutAccessPointPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opPutAccessPointPolicyMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opPutAccessPointPolicyMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opPutAccessPointPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -275,6 +335,8 @@ func (m *opPutAccessPointPolicyResolveEndpointMiddleware) HandleSerialize(ctx co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_PutAccessPointPolicyForObjectLambda.go b/service/s3control/api_op_PutAccessPointPolicyForObjectLambda.go index ace21c5685e..328ab60ba85 100644 --- a/service/s3control/api_op_PutAccessPointPolicyForObjectLambda.go +++ b/service/s3control/api_op_PutAccessPointPolicyForObjectLambda.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -115,6 +116,12 @@ func (c *Client) addOperationPutAccessPointPolicyForObjectLambdaMiddlewares(stac if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opPutAccessPointPolicyForObjectLambdaMiddleware(stack); err != nil { + return err + } if err = addPutAccessPointPolicyForObjectLambdaResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -148,6 +155,47 @@ func (c *Client) addOperationPutAccessPointPolicyForObjectLambdaMiddlewares(stac return nil } +type endpointPrefix_opPutAccessPointPolicyForObjectLambdaMiddleware struct { +} + +func (*endpointPrefix_opPutAccessPointPolicyForObjectLambdaMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opPutAccessPointPolicyForObjectLambdaMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*PutAccessPointPolicyForObjectLambdaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opPutAccessPointPolicyForObjectLambdaMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opPutAccessPointPolicyForObjectLambdaMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opPutAccessPointPolicyForObjectLambda(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -243,6 +291,8 @@ func (m *opPutAccessPointPolicyForObjectLambdaResolveEndpointMiddleware) HandleS ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_PutBucketLifecycleConfiguration.go b/service/s3control/api_op_PutBucketLifecycleConfiguration.go index 5f643f0d4a0..b7b9a7dc8fc 100644 --- a/service/s3control/api_op_PutBucketLifecycleConfiguration.go +++ b/service/s3control/api_op_PutBucketLifecycleConfiguration.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -123,9 +124,15 @@ func (c *Client) addOperationPutBucketLifecycleConfigurationMiddlewares(stack *m if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { return err } + if err = addEndpointPrefix_opPutBucketLifecycleConfigurationMiddleware(stack); err != nil { + return err + } if err = addPutBucketLifecycleConfigurationResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -159,6 +166,59 @@ func (c *Client) addOperationPutBucketLifecycleConfigurationMiddlewares(stack *m return nil } +func (m *PutBucketLifecycleConfigurationInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *PutBucketLifecycleConfigurationInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opPutBucketLifecycleConfigurationMiddleware struct { +} + +func (*endpointPrefix_opPutBucketLifecycleConfigurationMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opPutBucketLifecycleConfigurationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*PutBucketLifecycleConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opPutBucketLifecycleConfigurationMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opPutBucketLifecycleConfigurationMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opPutBucketLifecycleConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -268,6 +328,8 @@ func (m *opPutBucketLifecycleConfigurationResolveEndpointMiddleware) HandleSeria ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_PutBucketPolicy.go b/service/s3control/api_op_PutBucketPolicy.go index 5719e71ef87..16008851f87 100644 --- a/service/s3control/api_op_PutBucketPolicy.go +++ b/service/s3control/api_op_PutBucketPolicy.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -146,9 +147,15 @@ func (c *Client) addOperationPutBucketPolicyMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { return err } + if err = addEndpointPrefix_opPutBucketPolicyMiddleware(stack); err != nil { + return err + } if err = addPutBucketPolicyResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -182,6 +189,59 @@ func (c *Client) addOperationPutBucketPolicyMiddlewares(stack *middleware.Stack, return nil } +func (m *PutBucketPolicyInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *PutBucketPolicyInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opPutBucketPolicyMiddleware struct { +} + +func (*endpointPrefix_opPutBucketPolicyMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opPutBucketPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*PutBucketPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opPutBucketPolicyMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opPutBucketPolicyMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opPutBucketPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -291,6 +351,8 @@ func (m *opPutBucketPolicyResolveEndpointMiddleware) HandleSerialize(ctx context ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_PutBucketReplication.go b/service/s3control/api_op_PutBucketReplication.go index 5fca47c1c3b..41bb93d11fb 100644 --- a/service/s3control/api_op_PutBucketReplication.go +++ b/service/s3control/api_op_PutBucketReplication.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -173,9 +174,15 @@ func (c *Client) addOperationPutBucketReplicationMiddlewares(stack *middleware.S if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { return err } + if err = addEndpointPrefix_opPutBucketReplicationMiddleware(stack); err != nil { + return err + } if err = addPutBucketReplicationResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -209,6 +216,59 @@ func (c *Client) addOperationPutBucketReplicationMiddlewares(stack *middleware.S return nil } +func (m *PutBucketReplicationInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *PutBucketReplicationInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opPutBucketReplicationMiddleware struct { +} + +func (*endpointPrefix_opPutBucketReplicationMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opPutBucketReplicationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*PutBucketReplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opPutBucketReplicationMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opPutBucketReplicationMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opPutBucketReplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -318,6 +378,8 @@ func (m *opPutBucketReplicationResolveEndpointMiddleware) HandleSerialize(ctx co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_PutBucketTagging.go b/service/s3control/api_op_PutBucketTagging.go index 39e3b88753c..417055e8763 100644 --- a/service/s3control/api_op_PutBucketTagging.go +++ b/service/s3control/api_op_PutBucketTagging.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -163,9 +164,15 @@ func (c *Client) addOperationPutBucketTaggingMiddlewares(stack *middleware.Stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { return err } + if err = addEndpointPrefix_opPutBucketTaggingMiddleware(stack); err != nil { + return err + } if err = addPutBucketTaggingResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -199,6 +206,59 @@ func (c *Client) addOperationPutBucketTaggingMiddlewares(stack *middleware.Stack return nil } +func (m *PutBucketTaggingInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *PutBucketTaggingInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opPutBucketTaggingMiddleware struct { +} + +func (*endpointPrefix_opPutBucketTaggingMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opPutBucketTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*PutBucketTaggingInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opPutBucketTaggingMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opPutBucketTaggingMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opPutBucketTagging(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -308,6 +368,8 @@ func (m *opPutBucketTaggingResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_PutBucketVersioning.go b/service/s3control/api_op_PutBucketVersioning.go index d2f45f0e2f0..84dd994cd20 100644 --- a/service/s3control/api_op_PutBucketVersioning.go +++ b/service/s3control/api_op_PutBucketVersioning.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -148,9 +149,15 @@ func (c *Client) addOperationPutBucketVersioningMiddlewares(stack *middleware.St if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { return err } + if err = addEndpointPrefix_opPutBucketVersioningMiddleware(stack); err != nil { + return err + } if err = addPutBucketVersioningResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -184,6 +191,59 @@ func (c *Client) addOperationPutBucketVersioningMiddlewares(stack *middleware.St return nil } +func (m *PutBucketVersioningInput) GetARNMember() (*string, bool) { + if m.Bucket == nil { + return nil, false + } + return m.Bucket, true +} + +func (m *PutBucketVersioningInput) SetARNMember(v string) error { + m.Bucket = &v + return nil +} + +type endpointPrefix_opPutBucketVersioningMiddleware struct { +} + +func (*endpointPrefix_opPutBucketVersioningMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opPutBucketVersioningMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*PutBucketVersioningInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opPutBucketVersioningMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opPutBucketVersioningMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opPutBucketVersioning(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -293,6 +353,8 @@ func (m *opPutBucketVersioningResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_PutJobTagging.go b/service/s3control/api_op_PutJobTagging.go index 5dc384e8156..219e4163bf0 100644 --- a/service/s3control/api_op_PutJobTagging.go +++ b/service/s3control/api_op_PutJobTagging.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -142,6 +143,12 @@ func (c *Client) addOperationPutJobTaggingMiddlewares(stack *middleware.Stack, o if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opPutJobTaggingMiddleware(stack); err != nil { + return err + } if err = addPutJobTaggingResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -175,6 +182,47 @@ func (c *Client) addOperationPutJobTaggingMiddlewares(stack *middleware.Stack, o return nil } +type endpointPrefix_opPutJobTaggingMiddleware struct { +} + +func (*endpointPrefix_opPutJobTaggingMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opPutJobTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*PutJobTaggingInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opPutJobTaggingMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opPutJobTaggingMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opPutJobTagging(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -270,6 +318,8 @@ func (m *opPutJobTaggingResolveEndpointMiddleware) HandleSerialize(ctx context.C ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_PutMultiRegionAccessPointPolicy.go b/service/s3control/api_op_PutMultiRegionAccessPointPolicy.go index d8d43ae0138..fd05cc0cf08 100644 --- a/service/s3control/api_op_PutMultiRegionAccessPointPolicy.go +++ b/service/s3control/api_op_PutMultiRegionAccessPointPolicy.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -128,9 +129,15 @@ func (c *Client) addOperationPutMultiRegionAccessPointPolicyMiddlewares(stack *m if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { return err } + if err = addEndpointPrefix_opPutMultiRegionAccessPointPolicyMiddleware(stack); err != nil { + return err + } if err = addPutMultiRegionAccessPointPolicyResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -167,6 +174,47 @@ func (c *Client) addOperationPutMultiRegionAccessPointPolicyMiddlewares(stack *m return nil } +type endpointPrefix_opPutMultiRegionAccessPointPolicyMiddleware struct { +} + +func (*endpointPrefix_opPutMultiRegionAccessPointPolicyMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opPutMultiRegionAccessPointPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*PutMultiRegionAccessPointPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opPutMultiRegionAccessPointPolicyMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opPutMultiRegionAccessPointPolicyMiddleware{}, `OperationSerializer`, middleware.After) +} + type idempotencyToken_initializeOpPutMultiRegionAccessPointPolicy struct { tokenProvider IdempotencyTokenProvider } @@ -295,6 +343,8 @@ func (m *opPutMultiRegionAccessPointPolicyResolveEndpointMiddleware) HandleSeria ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_PutPublicAccessBlock.go b/service/s3control/api_op_PutPublicAccessBlock.go index 13d36ef2711..7e69e82115a 100644 --- a/service/s3control/api_op_PutPublicAccessBlock.go +++ b/service/s3control/api_op_PutPublicAccessBlock.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -113,6 +114,12 @@ func (c *Client) addOperationPutPublicAccessBlockMiddlewares(stack *middleware.S if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opPutPublicAccessBlockMiddleware(stack); err != nil { + return err + } if err = addPutPublicAccessBlockResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -146,6 +153,47 @@ func (c *Client) addOperationPutPublicAccessBlockMiddlewares(stack *middleware.S return nil } +type endpointPrefix_opPutPublicAccessBlockMiddleware struct { +} + +func (*endpointPrefix_opPutPublicAccessBlockMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opPutPublicAccessBlockMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*PutPublicAccessBlockInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opPutPublicAccessBlockMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opPutPublicAccessBlockMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opPutPublicAccessBlock(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -241,6 +289,8 @@ func (m *opPutPublicAccessBlockResolveEndpointMiddleware) HandleSerialize(ctx co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_PutStorageLensConfiguration.go b/service/s3control/api_op_PutStorageLensConfiguration.go index 89de20ad208..b5763db96c5 100644 --- a/service/s3control/api_op_PutStorageLensConfiguration.go +++ b/service/s3control/api_op_PutStorageLensConfiguration.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -121,6 +122,12 @@ func (c *Client) addOperationPutStorageLensConfigurationMiddlewares(stack *middl if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opPutStorageLensConfigurationMiddleware(stack); err != nil { + return err + } if err = addPutStorageLensConfigurationResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -154,6 +161,47 @@ func (c *Client) addOperationPutStorageLensConfigurationMiddlewares(stack *middl return nil } +type endpointPrefix_opPutStorageLensConfigurationMiddleware struct { +} + +func (*endpointPrefix_opPutStorageLensConfigurationMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opPutStorageLensConfigurationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*PutStorageLensConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opPutStorageLensConfigurationMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opPutStorageLensConfigurationMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opPutStorageLensConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -249,6 +297,8 @@ func (m *opPutStorageLensConfigurationResolveEndpointMiddleware) HandleSerialize ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_PutStorageLensConfigurationTagging.go b/service/s3control/api_op_PutStorageLensConfigurationTagging.go index 9b53d358f4f..c571c5d45cd 100644 --- a/service/s3control/api_op_PutStorageLensConfigurationTagging.go +++ b/service/s3control/api_op_PutStorageLensConfigurationTagging.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -117,6 +118,12 @@ func (c *Client) addOperationPutStorageLensConfigurationTaggingMiddlewares(stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opPutStorageLensConfigurationTaggingMiddleware(stack); err != nil { + return err + } if err = addPutStorageLensConfigurationTaggingResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -150,6 +157,47 @@ func (c *Client) addOperationPutStorageLensConfigurationTaggingMiddlewares(stack return nil } +type endpointPrefix_opPutStorageLensConfigurationTaggingMiddleware struct { +} + +func (*endpointPrefix_opPutStorageLensConfigurationTaggingMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opPutStorageLensConfigurationTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*PutStorageLensConfigurationTaggingInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opPutStorageLensConfigurationTaggingMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opPutStorageLensConfigurationTaggingMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opPutStorageLensConfigurationTagging(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -245,6 +293,8 @@ func (m *opPutStorageLensConfigurationTaggingResolveEndpointMiddleware) HandleSe ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_SubmitMultiRegionAccessPointRoutes.go b/service/s3control/api_op_SubmitMultiRegionAccessPointRoutes.go index 75933c7b035..1b6590eda59 100644 --- a/service/s3control/api_op_SubmitMultiRegionAccessPointRoutes.go +++ b/service/s3control/api_op_SubmitMultiRegionAccessPointRoutes.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -132,9 +133,15 @@ func (c *Client) addOperationSubmitMultiRegionAccessPointRoutesMiddlewares(stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil { return err } + if err = addEndpointPrefix_opSubmitMultiRegionAccessPointRoutesMiddleware(stack); err != nil { + return err + } if err = addSubmitMultiRegionAccessPointRoutesResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -168,6 +175,47 @@ func (c *Client) addOperationSubmitMultiRegionAccessPointRoutesMiddlewares(stack return nil } +type endpointPrefix_opSubmitMultiRegionAccessPointRoutesMiddleware struct { +} + +func (*endpointPrefix_opSubmitMultiRegionAccessPointRoutesMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opSubmitMultiRegionAccessPointRoutesMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*SubmitMultiRegionAccessPointRoutesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opSubmitMultiRegionAccessPointRoutesMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opSubmitMultiRegionAccessPointRoutesMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opSubmitMultiRegionAccessPointRoutes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -263,6 +311,8 @@ func (m *opSubmitMultiRegionAccessPointRoutesResolveEndpointMiddleware) HandleSe ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_UpdateJobPriority.go b/service/s3control/api_op_UpdateJobPriority.go index 50e9dcc0244..a429e626e3b 100644 --- a/service/s3control/api_op_UpdateJobPriority.go +++ b/service/s3control/api_op_UpdateJobPriority.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -126,6 +127,12 @@ func (c *Client) addOperationUpdateJobPriorityMiddlewares(stack *middleware.Stac if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opUpdateJobPriorityMiddleware(stack); err != nil { + return err + } if err = addUpdateJobPriorityResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -159,6 +166,47 @@ func (c *Client) addOperationUpdateJobPriorityMiddlewares(stack *middleware.Stac return nil } +type endpointPrefix_opUpdateJobPriorityMiddleware struct { +} + +func (*endpointPrefix_opUpdateJobPriorityMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opUpdateJobPriorityMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*UpdateJobPriorityInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opUpdateJobPriorityMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opUpdateJobPriorityMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opUpdateJobPriority(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -254,6 +302,8 @@ func (m *opUpdateJobPriorityResolveEndpointMiddleware) HandleSerialize(ctx conte ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/api_op_UpdateJobStatus.go b/service/s3control/api_op_UpdateJobStatus.go index fe23e39d9fc..b5c31154e0d 100644 --- a/service/s3control/api_op_UpdateJobStatus.go +++ b/service/s3control/api_op_UpdateJobStatus.go @@ -12,6 +12,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" s3controlcust "github.com/aws/aws-sdk-go-v2/service/s3control/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3control/types" + smithy "github.com/aws/smithy-go" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" @@ -131,6 +132,12 @@ func (c *Client) addOperationUpdateJobStatusMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = s3controlcust.AddUpdateOutpostARN(stack); err != nil { + return err + } + if err = addEndpointPrefix_opUpdateJobStatusMiddleware(stack); err != nil { + return err + } if err = addUpdateJobStatusResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -164,6 +171,47 @@ func (c *Client) addOperationUpdateJobStatusMiddlewares(stack *middleware.Stack, return nil } +type endpointPrefix_opUpdateJobStatusMiddleware struct { +} + +func (*endpointPrefix_opUpdateJobStatusMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opUpdateJobStatusMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + input, ok := in.Parameters.(*UpdateJobStatusInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + } + + var prefix strings.Builder + if input.AccountId == nil { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so may not be nil")} + } else if !smithyhttp.ValidHostLabel(*input.AccountId) { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("AccountId forms part of the endpoint host and so must match \"[a-zA-Z0-9-]{1,63}\", but was \"%s\"", *input.AccountId)} + } else { + prefix.WriteString(*input.AccountId) + } + prefix.WriteString(".") + req.URL.Host = prefix.String() + req.URL.Host + + return next.HandleSerialize(ctx, in) +} +func addEndpointPrefix_opUpdateJobStatusMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&endpointPrefix_opUpdateJobStatusMiddleware{}, `OperationSerializer`, middleware.After) +} + func newServiceMetadataMiddleware_opUpdateJobStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, @@ -259,6 +307,8 @@ func (m *opUpdateJobStatusResolveEndpointMiddleware) HandleSerialize(ctx context ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3control/endpoints.go b/service/s3control/endpoints.go index 67de7e47959..5083b70bc81 100644 --- a/service/s3control/endpoints.go +++ b/service/s3control/endpoints.go @@ -859,7 +859,7 @@ func (r *resolver) ResolveEndpoint( } return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid ARN: The Outpost Id was not set") } - return endpoint, fmt.Errorf("no rules matched these parameters. This is a bug, %#v", params) + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") } } return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid ARN: No ARN type specified") @@ -1108,7 +1108,7 @@ func (r *resolver) ResolveEndpoint( } return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid ARN: The Outpost Id was not set") } - return endpoint, fmt.Errorf("no rules matched these parameters. This is a bug, %#v", params) + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") } } return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid ARN: No ARN type specified") @@ -1542,7 +1542,7 @@ func (r *resolver) ResolveEndpoint( }, nil } } - return endpoint, fmt.Errorf("no rules matched these parameters. This is a bug, %#v", params) + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") } return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid region: region was not a valid DNS name.") } diff --git a/service/s3control/internal/customizations/process_arn_resource.go b/service/s3control/internal/customizations/process_arn_resource.go index 69ebb25c4db..122e6489c0b 100644 --- a/service/s3control/internal/customizations/process_arn_resource.go +++ b/service/s3control/internal/customizations/process_arn_resource.go @@ -53,6 +53,10 @@ func (m *processARNResource) HandleSerialize( ) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + // if arn region resolves to custom endpoint that is mutable if smithyhttp.GetHostnameImmutable(ctx) { return next.HandleSerialize(ctx, in) diff --git a/service/s3control/internal/customizations/process_outpost_id.go b/service/s3control/internal/customizations/process_outpost_id.go index 295e3ab099e..044b9d46e93 100644 --- a/service/s3control/internal/customizations/process_outpost_id.go +++ b/service/s3control/internal/customizations/process_outpost_id.go @@ -37,6 +37,10 @@ func (m *processOutpostIDMiddleware) HandleSerialize( ) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + // if host name is immutable, skip this customization if smithyhttp.GetHostnameImmutable(ctx) { return next.HandleSerialize(ctx, in) diff --git a/service/s3control/internal/customizations/update_endpoint_test.go b/service/s3control/internal/customizations/update_endpoint_test.go index c2663cd5fbf..6ba349c72e9 100644 --- a/service/s3control/internal/customizations/update_endpoint_test.go +++ b/service/s3control/internal/customizations/update_endpoint_test.go @@ -170,7 +170,7 @@ func TestEndpointWithARN(t *testing.T) { options: s3control.Options{ Region: "us-west-2", }, - expectedErr: "client region does not match provided ARN region", + expectedErr: "Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false`", }, "Outpost AccessPoint other partition": { accessPoint: "arn:aws-cn:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint", @@ -178,7 +178,7 @@ func TestEndpointWithARN(t *testing.T) { Region: "us-west-2", UseARNRegion: true, }, - expectedErr: "ConfigurationError : client partition does not match provided ARN partition", + expectedErr: "Client was configured for partition `aws` but ARN has `aws-cn`", }, "Outpost AccessPoint us-gov region": { accessPoint: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint", @@ -305,21 +305,21 @@ func TestEndpointWithARN(t *testing.T) { UseARNRegion: true, UseDualstack: true, }, - expectedErr: "ConfigurationError : client configured for S3 Dual-stack but is not supported with resource ARN", + expectedErr: "Invalid configuration: Outpost Access Points do not support dual-stack", }, "Invalid outpost resource format": { bucket: "arn:aws:s3-outposts:us-west-2:123456789012:outpost", options: s3control.Options{ Region: "us-west-2", }, - expectedErr: "outpost resource-id not set", + expectedErr: "Invalid ARN: The Outpost Id was not set", }, "Missing access point for outpost resource": { bucket: "arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456", options: s3control.Options{ Region: "us-west-2", }, - expectedErr: "incomplete outpost resource type", + expectedErr: "Invalid ARN: Expected a 4-component resource", }, "access point": { accessPoint: "myaccesspoint", @@ -343,7 +343,7 @@ func TestEndpointWithARN(t *testing.T) { options: s3control.Options{ Region: "us-west-2", }, - expectedErr: "invalid Amazon s3-outposts ARN", + expectedErr: "Invalid ARN: Expected a 4-component resource", }, "Outpost Bucket with no S3UseARNRegion flag set": { bucket: "arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket:mybucket", @@ -373,7 +373,7 @@ func TestEndpointWithARN(t *testing.T) { options: s3control.Options{ Region: "us-west-2", }, - expectedErr: "client region does not match provided ARN region", + expectedErr: "Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false`", }, "Outpost Bucket other partition": { bucket: "arn:aws-cn:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:bucket:mybucket", @@ -381,7 +381,7 @@ func TestEndpointWithARN(t *testing.T) { Region: "us-west-2", UseARNRegion: true, }, - expectedErr: "ConfigurationError : client partition does not match provided ARN partition", + expectedErr: "Client was configured for partition `aws` but ARN has `aws-cn`", }, "Outpost Bucket us-gov region": { bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket", @@ -403,14 +403,14 @@ func TestEndpointWithARN(t *testing.T) { UseFIPSEndpoint: aws.FIPSEndpointStateEnabled, }, }, - expectedErr: "ConfigurationError : client region does not match provided ARN region", + expectedErr: "Invalid configuration: region from ARN `us-gov-east-1` does not match client region `us-gov-west-1` and UseArnRegion is `false`", }, "Outpost Bucket client FIPS (ResolvedRegion), cross-region ARN": { bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket", options: s3control.Options{ Region: "us-gov-west-1-fips", }, - expectedErr: "ConfigurationError : client region does not match provided ARN region", + expectedErr: "Invalid configuration: region from ARN `us-gov-east-1` does not match client region `us-gov-west-1` and UseArnRegion is `false`", }, "Outpost Bucket client FIPS with non cross-region ARN region": { bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket", @@ -445,21 +445,21 @@ func TestEndpointWithARN(t *testing.T) { Region: "us-west-2", UseDualstack: true, }, - expectedErr: "ConfigurationError : client configured for S3 Dual-stack but is not supported with resource ARN", + expectedErr: "Invalid configuration: Outpost buckets do not support dual-stack", }, "Missing bucket id": { bucket: "arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket", options: s3control.Options{ Region: "us-west-2", }, - expectedErr: "invalid Amazon s3-outposts ARN", + expectedErr: "Invalid ARN: expected a bucket name", }, "Invalid ARN": { bucket: "arn:aws:s3-outposts:us-west-2:123456789012:bucket:mybucket", options: s3control.Options{ Region: "us-west-2", }, - expectedErr: "invalid Amazon s3-outposts ARN, unknown resource type", + expectedErr: "Invalid ARN: Expected a 4-component resource", }, "Invalid Outpost Bucket ARN with FIPS pseudo-region (prefix)": { bucket: "arn:aws:s3-outposts:fips-us-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket", @@ -478,7 +478,7 @@ func TestEndpointWithARN(t *testing.T) { expectedErr: "FIPS region not allowed in ARN", }, "Invalid Outpost AccessPoint ARN with FIPS pseudo-region (prefix)": { - bucket: "arn:aws-us-gov:s3-outposts:fips-us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint", + accessPoint: "arn:aws-us-gov:s3-outposts:fips-us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint", options: s3control.Options{ Region: "us-west-2", UseARNRegion: true, @@ -486,7 +486,7 @@ func TestEndpointWithARN(t *testing.T) { expectedErr: "FIPS region not allowed in ARN", }, "Invalid Outpost AccessPoint ARN with FIPS pseudo-region (suffix)": { - bucket: "arn:aws-us-gov:s3-outposts:us-east-1-fips:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint", + accessPoint: "arn:aws-us-gov:s3-outposts:us-east-1-fips:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint", options: s3control.Options{ Region: "us-west-2", UseARNRegion: true, @@ -760,7 +760,7 @@ func TestCustomEndpoint_SpecialOperations(t *testing.T) { }) }) }, - expectedErr: "invalid Amazon s3 ARN, unknown resource type", + expectedErr: "Endpoint resolution failed. Invalid operation or environment input", }, "CreateAccessPoint outpost bucket arn": { options: s3control.Options{ diff --git a/service/s3control/internal/customizations/update_outpost_arn.go b/service/s3control/internal/customizations/update_outpost_arn.go new file mode 100644 index 00000000000..b4a50fbaedc --- /dev/null +++ b/service/s3control/internal/customizations/update_outpost_arn.go @@ -0,0 +1,56 @@ +package customizations + +import ( + "context" + "fmt" + awsarn "github.com/aws/aws-sdk-go-v2/aws/arn" + s3arn "github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn" + "github.com/aws/smithy-go/middleware" +) + +type updateOutpostARN struct { +} + +func (*updateOutpostARN) ID() string { + return "setArnFieldName" +} + +// updateOutpostARN handles updating the relevant operation member +// whose value is an S3 Outposts ARN provided by the customer. +func (m *updateOutpostARN) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + + v, ok := s3arn.GetARNField(in.Parameters) + if ok && awsarn.IsARN(*v) { + + av, err := awsarn.Parse(*v) + if err != nil { + return out, metadata, fmt.Errorf("error parsing arn: %w", err) + } + resource, err := s3arn.ParseResource(av, resourceParser) + if err != nil { + return out, metadata, err + } + + switch tv := resource.(type) { + case s3arn.OutpostAccessPointARN: + s3arn.SetARNField(in.Parameters, tv.AccessPointName) + case s3arn.OutpostBucketARN: + s3arn.SetARNField(in.Parameters, tv.BucketName) + } + } + return next.HandleSerialize(ctx, in) +} + +// AddUpdateOutpostARN is used by operation runtimes to add +// this middleware to their middleware stack. +func AddUpdateOutpostARN(stack *middleware.Stack) error { + return stack.Serialize.Insert( + &updateOutpostARN{}, + "OperationSerializer", + middleware.Before, + ) +} diff --git a/service/s3outposts/api_op_CreateEndpoint.go b/service/s3outposts/api_op_CreateEndpoint.go index bb470dd3a1f..3eafb38e662 100644 --- a/service/s3outposts/api_op_CreateEndpoint.go +++ b/service/s3outposts/api_op_CreateEndpoint.go @@ -206,6 +206,8 @@ func (m *opCreateEndpointResolveEndpointMiddleware) HandleSerialize(ctx context. ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3outposts/api_op_DeleteEndpoint.go b/service/s3outposts/api_op_DeleteEndpoint.go index 701b3e0c199..6bad318478d 100644 --- a/service/s3outposts/api_op_DeleteEndpoint.go +++ b/service/s3outposts/api_op_DeleteEndpoint.go @@ -184,6 +184,8 @@ func (m *opDeleteEndpointResolveEndpointMiddleware) HandleSerialize(ctx context. ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3outposts/api_op_ListEndpoints.go b/service/s3outposts/api_op_ListEndpoints.go index ef8bd4be337..0f75edb8b46 100644 --- a/service/s3outposts/api_op_ListEndpoints.go +++ b/service/s3outposts/api_op_ListEndpoints.go @@ -272,6 +272,8 @@ func (m *opListEndpointsResolveEndpointMiddleware) HandleSerialize(ctx context.C ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3outposts/api_op_ListOutpostsWithS3.go b/service/s3outposts/api_op_ListOutpostsWithS3.go index 95fdafc83b9..e48b2099079 100644 --- a/service/s3outposts/api_op_ListOutpostsWithS3.go +++ b/service/s3outposts/api_op_ListOutpostsWithS3.go @@ -277,6 +277,8 @@ func (m *opListOutpostsWithS3ResolveEndpointMiddleware) HandleSerialize(ctx cont ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3outposts/api_op_ListSharedEndpoints.go b/service/s3outposts/api_op_ListSharedEndpoints.go index 624ded4974b..8f6788688dd 100644 --- a/service/s3outposts/api_op_ListSharedEndpoints.go +++ b/service/s3outposts/api_op_ListSharedEndpoints.go @@ -284,6 +284,8 @@ func (m *opListSharedEndpointsResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError diff --git a/service/s3outposts/endpoints.go b/service/s3outposts/endpoints.go index 5676780ab9f..6d1acf22cc9 100644 --- a/service/s3outposts/endpoints.go +++ b/service/s3outposts/endpoints.go @@ -486,7 +486,7 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, }, nil } - return endpoint, fmt.Errorf("no rules matched these parameters. This is a bug, %#v", params) + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") } return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") }