diff --git a/Makefile b/Makefile index 7dd135969ef1..6ed927371176 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,12 @@ test-integration: build-s3-browser-bundle rm -rf ./clients/client-sso/node_modules/\@smithy # todo(yarn) incompatible redundant nesting. yarn g:vitest run -c vitest.config.integ.ts npx jest -c jest.config.integ.js - make test-protocols; - make test-types; + make test-protocols + make test-types + make test-endpoints + +test-endpoints: + npx jest -c ./tests/endpoints-2.0/jest.config.js --bail test-e2e: build-s3-browser-bundle yarn g:vitest run -c vitest.config.e2e.ts --retry=4 diff --git a/clients/client-s3-control/src/models/models_1.ts b/clients/client-s3-control/src/models/models_1.ts index ee7e74374bf9..a184635cc63d 100644 --- a/clients/client-s3-control/src/models/models_1.ts +++ b/clients/client-s3-control/src/models/models_1.ts @@ -19,7 +19,6 @@ import { StorageLensTag, Tag, } from "./models_0"; - import { S3ControlServiceException as __BaseException } from "./S3ControlServiceException"; /** diff --git a/clients/client-s3-control/src/protocols/Aws_restXml.ts b/clients/client-s3-control/src/protocols/Aws_restXml.ts index 140dd5718b92..282cfaca6eab 100644 --- a/clients/client-s3-control/src/protocols/Aws_restXml.ts +++ b/clients/client-s3-control/src/protocols/Aws_restXml.ts @@ -2,11 +2,7 @@ import { loadRestXmlErrorCode, parseXmlBody as parseBody, parseXmlErrorBody as parseErrorBody } from "@aws-sdk/core"; import { XmlNode as __XmlNode, XmlText as __XmlText } from "@aws-sdk/xml-builder"; import { requestBuilder as rb } from "@smithy/core"; -import { - HttpRequest as __HttpRequest, - HttpResponse as __HttpResponse, - isValidHostname as __isValidHostname, -} from "@smithy/protocol-http"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { collectBody, decorateServiceException as __decorateServiceException, @@ -514,18 +510,6 @@ export const se_AssociateAccessGrantsIdentityCenterCommand = async ( bn.a("xmlns", "http://awss3control.amazonaws.com/doc/2018-08-20/"); bn.cc(input, _ICA); body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("POST").h(headers).b(body); return b.build(); }; @@ -561,18 +545,6 @@ export const se_CreateAccessGrantCommand = async ( bn.cc(input, _SPT); bn.lc(input, "Tags", "Tags", () => se_TagList(input[_T]!, context)); body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("POST").h(headers).b(body); return b.build(); }; @@ -597,18 +569,6 @@ export const se_CreateAccessGrantsInstanceCommand = async ( bn.cc(input, _ICA); bn.lc(input, "Tags", "Tags", () => se_TagList(input[_T]!, context)); body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("POST").h(headers).b(body); return b.build(); }; @@ -636,18 +596,6 @@ export const se_CreateAccessGrantsLocationCommand = async ( } bn.lc(input, "Tags", "Tags", () => se_TagList(input[_T]!, context)); body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("POST").h(headers).b(body); return b.build(); }; @@ -686,18 +634,6 @@ export const se_CreateAccessPointCommand = async ( bn.c(se_VpcConfiguration(input[_VC], context).n(_VC)); } body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; @@ -724,18 +660,6 @@ export const se_CreateAccessPointForObjectLambdaCommand = async ( bn.c(se_ObjectLambdaConfiguration(input[_C], context).n(_C)); } body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; @@ -822,18 +746,6 @@ export const se_CreateJobCommand = async ( } bn.lc(input, "Tags", "Tags", () => se_S3TagSet(input[_T]!, context)); body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("POST").h(headers).b(body); return b.build(); }; @@ -865,18 +777,6 @@ export const se_CreateMultiRegionAccessPointCommand = async ( bn.c(se_CreateMultiRegionAccessPointInput(input[_De], context).n(_De)); } body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("POST").h(headers).b(body); return b.build(); }; @@ -903,18 +803,6 @@ export const se_CreateStorageLensGroupCommand = async ( } bn.lc(input, "Tags", "Tags", () => se_TagList(input[_T]!, context)); body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("POST").h(headers).b(body); return b.build(); }; @@ -933,18 +821,6 @@ export const se_DeleteAccessGrantCommand = async ( b.bp("/v20180820/accessgrantsinstance/grant/{AccessGrantId}"); b.p("AccessGrantId", () => input.AccessGrantId!, "{AccessGrantId}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -962,18 +838,6 @@ export const se_DeleteAccessGrantsInstanceCommand = async ( }); b.bp("/v20180820/accessgrantsinstance"); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -991,18 +855,6 @@ export const se_DeleteAccessGrantsInstanceResourcePolicyCommand = async ( }); b.bp("/v20180820/accessgrantsinstance/resourcepolicy"); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1021,18 +873,6 @@ export const se_DeleteAccessGrantsLocationCommand = async ( b.bp("/v20180820/accessgrantsinstance/location/{AccessGrantsLocationId}"); b.p("AccessGrantsLocationId", () => input.AccessGrantsLocationId!, "{AccessGrantsLocationId}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1051,18 +891,6 @@ export const se_DeleteAccessPointCommand = async ( b.bp("/v20180820/accesspoint/{Name}"); b.p("Name", () => input.Name!, "{Name}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1081,18 +909,6 @@ export const se_DeleteAccessPointForObjectLambdaCommand = async ( b.bp("/v20180820/accesspointforobjectlambda/{Name}"); b.p("Name", () => input.Name!, "{Name}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1111,18 +927,6 @@ export const se_DeleteAccessPointPolicyCommand = async ( b.bp("/v20180820/accesspoint/{Name}/policy"); b.p("Name", () => input.Name!, "{Name}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1141,18 +945,6 @@ export const se_DeleteAccessPointPolicyForObjectLambdaCommand = async ( b.bp("/v20180820/accesspointforobjectlambda/{Name}/policy"); b.p("Name", () => input.Name!, "{Name}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1189,18 +981,6 @@ export const se_DeleteBucketCommand = async ( b.bp("/v20180820/bucket/{Bucket}"); b.p("Bucket", () => input.Bucket!, "{Bucket}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1219,18 +999,6 @@ export const se_DeleteBucketLifecycleConfigurationCommand = async ( b.bp("/v20180820/bucket/{Bucket}/lifecycleconfiguration"); b.p("Bucket", () => input.Bucket!, "{Bucket}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1249,18 +1017,6 @@ export const se_DeleteBucketPolicyCommand = async ( b.bp("/v20180820/bucket/{Bucket}/policy"); b.p("Bucket", () => input.Bucket!, "{Bucket}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1279,18 +1035,6 @@ export const se_DeleteBucketReplicationCommand = async ( b.bp("/v20180820/bucket/{Bucket}/replication"); b.p("Bucket", () => input.Bucket!, "{Bucket}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1309,18 +1053,6 @@ export const se_DeleteBucketTaggingCommand = async ( b.bp("/v20180820/bucket/{Bucket}/tagging"); b.p("Bucket", () => input.Bucket!, "{Bucket}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1339,18 +1071,6 @@ export const se_DeleteJobTaggingCommand = async ( b.bp("/v20180820/jobs/{JobId}/tagging"); b.p("JobId", () => input.JobId!, "{JobId}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1382,18 +1102,6 @@ export const se_DeleteMultiRegionAccessPointCommand = async ( bn.c(se_DeleteMultiRegionAccessPointInput(input[_De], context).n(_De)); } body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("POST").h(headers).b(body); return b.build(); }; @@ -1411,18 +1119,6 @@ export const se_DeletePublicAccessBlockCommand = async ( }); b.bp("/v20180820/configuration/publicAccessBlock"); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1441,18 +1137,6 @@ export const se_DeleteStorageLensConfigurationCommand = async ( b.bp("/v20180820/storagelens/{ConfigId}"); b.p("ConfigId", () => input.ConfigId!, "{ConfigId}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1471,18 +1155,6 @@ export const se_DeleteStorageLensConfigurationTaggingCommand = async ( b.bp("/v20180820/storagelens/{ConfigId}/tagging"); b.p("ConfigId", () => input.ConfigId!, "{ConfigId}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1501,18 +1173,6 @@ export const se_DeleteStorageLensGroupCommand = async ( b.bp("/v20180820/storagelensgroup/{Name}"); b.p("Name", () => input.Name!, "{Name}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1531,18 +1191,6 @@ export const se_DescribeJobCommand = async ( b.bp("/v20180820/jobs/{JobId}"); b.p("JobId", () => input.JobId!, "{JobId}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -1561,18 +1209,6 @@ export const se_DescribeMultiRegionAccessPointOperationCommand = async ( b.bp("/v20180820/async-requests/mrap/{RequestTokenARN+}"); b.p("RequestTokenARN", () => input.RequestTokenARN!, "{RequestTokenARN+}", true); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -1590,18 +1226,6 @@ export const se_DissociateAccessGrantsIdentityCenterCommand = async ( }); b.bp("/v20180820/accessgrantsinstance/identitycenter"); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).b(body); return b.build(); }; @@ -1620,18 +1244,6 @@ export const se_GetAccessGrantCommand = async ( b.bp("/v20180820/accessgrantsinstance/grant/{AccessGrantId}"); b.p("AccessGrantId", () => input.AccessGrantId!, "{AccessGrantId}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -1649,18 +1261,6 @@ export const se_GetAccessGrantsInstanceCommand = async ( }); b.bp("/v20180820/accessgrantsinstance"); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -1681,18 +1281,6 @@ export const se_GetAccessGrantsInstanceForPrefixCommand = async ( [_s]: [, __expectNonNull(input[_SP]!, `S3Prefix`)], }); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).q(query).b(body); return b.build(); }; @@ -1710,18 +1298,6 @@ export const se_GetAccessGrantsInstanceResourcePolicyCommand = async ( }); b.bp("/v20180820/accessgrantsinstance/resourcepolicy"); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -1740,18 +1316,6 @@ export const se_GetAccessGrantsLocationCommand = async ( b.bp("/v20180820/accessgrantsinstance/location/{AccessGrantsLocationId}"); b.p("AccessGrantsLocationId", () => input.AccessGrantsLocationId!, "{AccessGrantsLocationId}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -1770,18 +1334,6 @@ export const se_GetAccessPointCommand = async ( b.bp("/v20180820/accesspoint/{Name}"); b.p("Name", () => input.Name!, "{Name}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -1800,18 +1352,6 @@ export const se_GetAccessPointConfigurationForObjectLambdaCommand = async ( b.bp("/v20180820/accesspointforobjectlambda/{Name}/configuration"); b.p("Name", () => input.Name!, "{Name}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -1830,18 +1370,6 @@ export const se_GetAccessPointForObjectLambdaCommand = async ( b.bp("/v20180820/accesspointforobjectlambda/{Name}"); b.p("Name", () => input.Name!, "{Name}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -1860,18 +1388,6 @@ export const se_GetAccessPointPolicyCommand = async ( b.bp("/v20180820/accesspoint/{Name}/policy"); b.p("Name", () => input.Name!, "{Name}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -1890,18 +1406,6 @@ export const se_GetAccessPointPolicyForObjectLambdaCommand = async ( b.bp("/v20180820/accesspointforobjectlambda/{Name}/policy"); b.p("Name", () => input.Name!, "{Name}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -1920,18 +1424,6 @@ export const se_GetAccessPointPolicyStatusCommand = async ( b.bp("/v20180820/accesspoint/{Name}/policyStatus"); b.p("Name", () => input.Name!, "{Name}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -1950,18 +1442,6 @@ export const se_GetAccessPointPolicyStatusForObjectLambdaCommand = async ( b.bp("/v20180820/accesspointforobjectlambda/{Name}/policyStatus"); b.p("Name", () => input.Name!, "{Name}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -1998,18 +1478,6 @@ export const se_GetBucketCommand = async ( b.bp("/v20180820/bucket/{Bucket}"); b.p("Bucket", () => input.Bucket!, "{Bucket}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -2028,18 +1496,6 @@ export const se_GetBucketLifecycleConfigurationCommand = async ( b.bp("/v20180820/bucket/{Bucket}/lifecycleconfiguration"); b.p("Bucket", () => input.Bucket!, "{Bucket}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -2058,18 +1514,6 @@ export const se_GetBucketPolicyCommand = async ( b.bp("/v20180820/bucket/{Bucket}/policy"); b.p("Bucket", () => input.Bucket!, "{Bucket}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -2088,18 +1532,6 @@ export const se_GetBucketReplicationCommand = async ( b.bp("/v20180820/bucket/{Bucket}/replication"); b.p("Bucket", () => input.Bucket!, "{Bucket}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -2118,18 +1550,6 @@ export const se_GetBucketTaggingCommand = async ( b.bp("/v20180820/bucket/{Bucket}/tagging"); b.p("Bucket", () => input.Bucket!, "{Bucket}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -2148,18 +1568,6 @@ export const se_GetBucketVersioningCommand = async ( b.bp("/v20180820/bucket/{Bucket}/versioning"); b.p("Bucket", () => input.Bucket!, "{Bucket}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -2184,18 +1592,6 @@ export const se_GetDataAccessCommand = async ( [_tT]: [, input[_TT]!], }); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).q(query).b(body); return b.build(); }; @@ -2214,18 +1610,6 @@ export const se_GetJobTaggingCommand = async ( b.bp("/v20180820/jobs/{JobId}/tagging"); b.p("JobId", () => input.JobId!, "{JobId}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -2244,18 +1628,6 @@ export const se_GetMultiRegionAccessPointCommand = async ( b.bp("/v20180820/mrap/instances/{Name+}"); b.p("Name", () => input.Name!, "{Name+}", true); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -2274,18 +1646,6 @@ export const se_GetMultiRegionAccessPointPolicyCommand = async ( b.bp("/v20180820/mrap/instances/{Name+}/policy"); b.p("Name", () => input.Name!, "{Name+}", true); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -2304,18 +1664,6 @@ export const se_GetMultiRegionAccessPointPolicyStatusCommand = async ( b.bp("/v20180820/mrap/instances/{Name+}/policystatus"); b.p("Name", () => input.Name!, "{Name+}", true); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -2334,18 +1682,6 @@ export const se_GetMultiRegionAccessPointRoutesCommand = async ( b.bp("/v20180820/mrap/instances/{Mrap+}/routes"); b.p("Mrap", () => input.Mrap!, "{Mrap+}", true); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -2363,18 +1699,6 @@ export const se_GetPublicAccessBlockCommand = async ( }); b.bp("/v20180820/configuration/publicAccessBlock"); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -2393,18 +1717,6 @@ export const se_GetStorageLensConfigurationCommand = async ( b.bp("/v20180820/storagelens/{ConfigId}"); b.p("ConfigId", () => input.ConfigId!, "{ConfigId}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -2423,18 +1735,6 @@ export const se_GetStorageLensConfigurationTaggingCommand = async ( b.bp("/v20180820/storagelens/{ConfigId}/tagging"); b.p("ConfigId", () => input.ConfigId!, "{ConfigId}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -2453,18 +1753,6 @@ export const se_GetStorageLensGroupCommand = async ( b.bp("/v20180820/storagelensgroup/{Name}"); b.p("Name", () => input.Name!, "{Name}", false); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -2491,18 +1779,6 @@ export const se_ListAccessGrantsCommand = async ( [_aa]: [, input[_AA]!], }); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).q(query).b(body); return b.build(); }; @@ -2524,18 +1800,6 @@ export const se_ListAccessGrantsInstancesCommand = async ( [_mR]: [() => input.MaxResults !== void 0, () => input[_MR]!.toString()], }); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).q(query).b(body); return b.build(); }; @@ -2558,18 +1822,6 @@ export const se_ListAccessGrantsLocationsCommand = async ( [_l]: [, input[_LS]!], }); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).q(query).b(body); return b.build(); }; @@ -2592,18 +1844,6 @@ export const se_ListAccessPointsCommand = async ( [_mR]: [() => input.MaxResults !== void 0, () => input[_MR]!.toString()], }); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).q(query).b(body); return b.build(); }; @@ -2647,18 +1887,6 @@ export const se_ListAccessPointsForObjectLambdaCommand = async ( [_mR]: [() => input.MaxResults !== void 0, () => input[_MR]!.toString()], }); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).q(query).b(body); return b.build(); }; @@ -2682,18 +1910,6 @@ export const se_ListCallerAccessGrantsCommand = async ( [_aBA]: [() => input.AllowedByApplication !== void 0, () => input[_ABA]!.toString()], }); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).q(query).b(body); return b.build(); }; @@ -2716,18 +1932,6 @@ export const se_ListJobsCommand = async ( [_mR]: [() => input.MaxResults !== void 0, () => input[_MR]!.toString()], }); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).q(query).b(body); return b.build(); }; @@ -2749,18 +1953,6 @@ export const se_ListMultiRegionAccessPointsCommand = async ( [_mR]: [() => input.MaxResults !== void 0, () => input[_MR]!.toString()], }); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).q(query).b(body); return b.build(); }; @@ -2783,18 +1975,6 @@ export const se_ListRegionalBucketsCommand = async ( [_mR]: [() => input.MaxResults !== void 0, () => input[_MR]!.toString()], }); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).q(query).b(body); return b.build(); }; @@ -2815,18 +1995,6 @@ export const se_ListStorageLensConfigurationsCommand = async ( [_nT]: [, input[_NT]!], }); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).q(query).b(body); return b.build(); }; @@ -2847,18 +2015,6 @@ export const se_ListStorageLensGroupsCommand = async ( [_nT]: [, input[_NT]!], }); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).q(query).b(body); return b.build(); }; @@ -2877,18 +2033,6 @@ export const se_ListTagsForResourceCommand = async ( b.bp("/v20180820/tags/{ResourceArn+}"); b.p("ResourceArn", () => input.ResourceArn!, "{ResourceArn+}", true); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("GET").h(headers).b(body); return b.build(); }; @@ -2915,18 +2059,6 @@ export const se_PutAccessGrantsInstanceResourcePolicyCommand = async ( bn.c(__XmlNode.of(_PD, input[_Po]).n(_Po)); } body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; @@ -2953,18 +2085,6 @@ export const se_PutAccessPointConfigurationForObjectLambdaCommand = async ( bn.c(se_ObjectLambdaConfiguration(input[_C], context).n(_C)); } body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; @@ -2989,18 +2109,6 @@ export const se_PutAccessPointPolicyCommand = async ( bn.a("xmlns", "http://awss3control.amazonaws.com/doc/2018-08-20/"); bn.cc(input, _Po); body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; @@ -3027,18 +2135,6 @@ export const se_PutAccessPointPolicyForObjectLambdaCommand = async ( bn.c(__XmlNode.of(_OLP, input[_Po]).n(_Po)); } body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; @@ -3091,18 +2187,6 @@ export const se_PutBucketLifecycleConfigurationCommand = async ( contents.a("xmlns", "http://awss3control.amazonaws.com/doc/2018-08-20/"); body += contents.toString(); } - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; @@ -3128,18 +2212,6 @@ export const se_PutBucketPolicyCommand = async ( bn.a("xmlns", "http://awss3control.amazonaws.com/doc/2018-08-20/"); bn.cc(input, _Po); body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; @@ -3166,18 +2238,6 @@ export const se_PutBucketReplicationCommand = async ( contents.a("xmlns", "http://awss3control.amazonaws.com/doc/2018-08-20/"); body += contents.toString(); } - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; @@ -3204,18 +2264,6 @@ export const se_PutBucketTaggingCommand = async ( contents.a("xmlns", "http://awss3control.amazonaws.com/doc/2018-08-20/"); body += contents.toString(); } - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; @@ -3243,18 +2291,6 @@ export const se_PutBucketVersioningCommand = async ( contents.a("xmlns", "http://awss3control.amazonaws.com/doc/2018-08-20/"); body += contents.toString(); } - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; @@ -3279,18 +2315,6 @@ export const se_PutJobTaggingCommand = async ( bn.a("xmlns", "http://awss3control.amazonaws.com/doc/2018-08-20/"); bn.lc(input, "Tags", "Tags", () => se_S3TagSet(input[_T]!, context)); body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; @@ -3322,18 +2346,6 @@ export const se_PutMultiRegionAccessPointPolicyCommand = async ( bn.c(se_PutMultiRegionAccessPointPolicyInput(input[_De], context).n(_De)); } body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("POST").h(headers).b(body); return b.build(); }; @@ -3359,18 +2371,6 @@ export const se_PutPublicAccessBlockCommand = async ( contents.a("xmlns", "http://awss3control.amazonaws.com/doc/2018-08-20/"); body += contents.toString(); } - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; @@ -3398,18 +2398,6 @@ export const se_PutStorageLensConfigurationCommand = async ( } bn.lc(input, "Tags", "Tags", () => se_StorageLensTags(input[_T]!, context)); body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; @@ -3434,18 +2422,6 @@ export const se_PutStorageLensConfigurationTaggingCommand = async ( bn.a("xmlns", "http://awss3control.amazonaws.com/doc/2018-08-20/"); bn.lc(input, "Tags", "Tags", () => se_StorageLensTags(input[_T]!, context)); body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; @@ -3470,18 +2446,6 @@ export const se_SubmitMultiRegionAccessPointRoutesCommand = async ( bn.a("xmlns", "http://awss3control.amazonaws.com/doc/2018-08-20/"); bn.lc(input, "RouteUpdates", "RouteUpdates", () => se_RouteList(input[_RU]!, context)); body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PATCH").h(headers).b(body); return b.build(); }; @@ -3506,18 +2470,6 @@ export const se_TagResourceCommand = async ( bn.a("xmlns", "http://awss3control.amazonaws.com/doc/2018-08-20/"); bn.lc(input, "Tags", "Tags", () => se_TagList(input[_T]!, context)); body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("POST").h(headers).b(body); return b.build(); }; @@ -3539,18 +2491,6 @@ export const se_UntagResourceCommand = async ( [_tK]: [__expectNonNull(input.TagKeys, `TagKeys`) != null, () => input[_TK]! || []], }); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("DELETE").h(headers).q(query).b(body); return b.build(); }; @@ -3575,18 +2515,6 @@ export const se_UpdateAccessGrantsLocationCommand = async ( bn.a("xmlns", "http://awss3control.amazonaws.com/doc/2018-08-20/"); bn.cc(input, _IAMRA); body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; @@ -3608,18 +2536,6 @@ export const se_UpdateJobPriorityCommand = async ( [_pri]: [__expectNonNull(input.Priority, `Priority`) != null, () => input[_Pr]!.toString()], }); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("POST").h(headers).q(query).b(body); return b.build(); }; @@ -3642,18 +2558,6 @@ export const se_UpdateJobStatusCommand = async ( [_sUR]: [, input[_SUR]!], }); let body: any; - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("POST").h(headers).q(query).b(body); return b.build(); }; @@ -3680,18 +2584,6 @@ export const se_UpdateStorageLensGroupCommand = async ( bn.c(se_StorageLensGroup(input[_SLG], context).n(_SLG)); } body += bn.toString(); - let { hostname: resolvedHostname } = await context.endpoint(); - if (context.disableHostPrefix !== true) { - resolvedHostname = "{AccountId}." + resolvedHostname; - if (input.AccountId === undefined) { - throw new Error("Empty value provided for input host prefix: AccountId."); - } - resolvedHostname = resolvedHostname.replace("{AccountId}", input.AccountId!); - if (!__isValidHostname(resolvedHostname)) { - throw new Error("ValidationError: prefixed hostname must be hostname compatible."); - } - } - b.hn(resolvedHostname); b.m("PUT").h(headers).b(body); return b.build(); }; diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddS3Config.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddS3Config.java index 1dc06723f962..e11c105afab7 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddS3Config.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddS3Config.java @@ -43,9 +43,12 @@ import software.amazon.smithy.model.shapes.TimestampShape; import software.amazon.smithy.model.traits.DeprecatedTrait; import software.amazon.smithy.model.traits.DocumentationTrait; +import software.amazon.smithy.model.traits.EndpointTrait; import software.amazon.smithy.model.traits.HttpHeaderTrait; import software.amazon.smithy.model.traits.HttpPayloadTrait; import software.amazon.smithy.model.traits.StreamingTrait; +import software.amazon.smithy.model.transform.ModelTransformer; +import software.amazon.smithy.rulesengine.traits.EndpointRuleSetTrait; import software.amazon.smithy.typescript.codegen.LanguageTarget; import software.amazon.smithy.typescript.codegen.TypeScriptDependency; import software.amazon.smithy.typescript.codegen.TypeScriptSettings; @@ -79,6 +82,19 @@ public final class AddS3Config implements TypeScriptIntegration { + " you need to install the \"@aws-sdk/signature-v4-crt\" package to your project dependencies. \n" + "For more information, please go to https://github.com/aws/aws-sdk-js-v3#known-issues

"; + /** + * Remove the hostPrefix functionality by removing the endpoint traits. + * Only applied if endpointRuleSet trait present on S3/S3Control services. + */ + public static Shape removeHostPrefixTrait(Shape shape) { + return shape.asOperationShape() + .map(OperationShape::shapeToBuilder) + .map(builder -> ((OperationShape.Builder) builder).removeTrait(EndpointTrait.ID)) + .map(OperationShape.Builder::build) + .map(s -> (Shape) s) + .orElse(shape); + } + @Override public List runAfter() { return List.of( @@ -96,6 +112,7 @@ public Model preprocessModel(Model model, TypeScriptSettings settings) { } Model.Builder modelBuilder = model.toBuilder(); + boolean hasRuleset = !model.getServiceShapesWithTrait(EndpointRuleSetTrait.class).isEmpty(); TopDownIndex topDownIndex = TopDownIndex.of(model); Set inputShapes = new HashSet<>(); @@ -206,7 +223,13 @@ public Model preprocessModel(Model model, TypeScriptSettings settings) { } } - return modelBuilder.addShapes(inputShapes).build(); + Model builtModel = modelBuilder.addShapes(inputShapes).build(); + if (hasRuleset) { + ModelTransformer.create().mapShapes( + builtModel, AddS3Config::removeHostPrefixTrait + ); + } + return builtModel; } @Override diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddS3ControlDependency.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddS3ControlDependency.java index 44c383da65b2..fb54b6f196cc 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddS3ControlDependency.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddS3ControlDependency.java @@ -23,6 +23,7 @@ import java.util.Map; import java.util.Optional; import java.util.function.Consumer; +import java.util.function.Function; import software.amazon.smithy.aws.traits.ServiceTrait; import software.amazon.smithy.codegen.core.SymbolProvider; import software.amazon.smithy.model.Model; @@ -32,6 +33,7 @@ import software.amazon.smithy.model.shapes.Shape; import software.amazon.smithy.model.traits.RequiredTrait; import software.amazon.smithy.model.transform.ModelTransformer; +import software.amazon.smithy.rulesengine.traits.EndpointRuleSetTrait; import software.amazon.smithy.typescript.codegen.LanguageTarget; import software.amazon.smithy.typescript.codegen.TypeScriptSettings; import software.amazon.smithy.typescript.codegen.TypeScriptWriter; @@ -90,15 +92,19 @@ public Model preprocessModel(Model model, TypeScriptSettings settings) { if (!isS3Control(settings.getService(model))) { return model; } + boolean hasRuleset = !model.getServiceShapesWithTrait(EndpointRuleSetTrait.class).isEmpty(); ServiceShape serviceShape = model.expectShape(settings.getService(), ServiceShape.class); - return ModelTransformer.create().mapShapes(model, shape -> { + Function removeRequired = shape -> { Optional modified = shape.asMemberShape() - .filter(memberShape -> memberShape.getTarget().getName(serviceShape).equals("AccountId")) - .filter(memberShape -> model.expectShape(memberShape.getTarget()).isStringShape()) - .filter(memberShape -> memberShape.isRequired()) - .map(memberShape -> Shape.shapeToBuilder(memberShape).removeTrait(RequiredTrait.ID).build()); + .filter(memberShape -> memberShape.getTarget().getName(serviceShape).equals("AccountId")) + .filter(memberShape -> model.expectShape(memberShape.getTarget()).isStringShape()) + .filter(MemberShape::isRequired) + .map(memberShape -> Shape.shapeToBuilder(memberShape).removeTrait(RequiredTrait.ID).build()); return modified.isPresent() ? modified.get() : shape; - }); + }; + return ModelTransformer.create().mapShapes( + model, hasRuleset ? removeRequired.andThen(AddS3Config::removeHostPrefixTrait) : removeRequired + ); } @Override diff --git a/packages/middleware-sdk-s3-control/src/host-prefix-deduplication/deduplicateHostPrefix.spec.ts b/packages/middleware-sdk-s3-control/src/host-prefix-deduplication/deduplicateHostPrefix.spec.ts deleted file mode 100644 index c1b4c231014b..000000000000 --- a/packages/middleware-sdk-s3-control/src/host-prefix-deduplication/deduplicateHostPrefix.spec.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { describe, expect, test as it } from "vitest"; - -import { deduplicateHostPrefix } from "./deduplicateHostPrefix"; - -describe(deduplicateHostPrefix.name, () => { - it("should deduplicate host name prefixes", () => { - expect(deduplicateHostPrefix("a.a.host.com")).toEqual("a.host.com"); - expect(deduplicateHostPrefix("1234567890.1234567890.host.com")).toEqual("1234567890.host.com"); - expect(deduplicateHostPrefix("abcdefgh.abcdefgh.host.com")).toEqual("abcdefgh.host.com"); - }); - - it("should do nothing if no duplication exists in the first two positions", () => { - expect(deduplicateHostPrefix("b.a.host.com")).toEqual("b.a.host.com"); - expect(deduplicateHostPrefix("0123456789.1234567890.host.com")).toEqual("0123456789.1234567890.host.com"); - expect(deduplicateHostPrefix("zabcdefg.abcdefgh.host.com")).toEqual("zabcdefg.abcdefgh.host.com"); - - expect(deduplicateHostPrefix("12345.abcdefgh.12345.12345.host.com")).toEqual("12345.abcdefgh.12345.12345.host.com"); - }); - - it("should not act on IP hostnames", () => { - expect(deduplicateHostPrefix("1.2.3.4")).toEqual("1.2.3.4"); - expect(deduplicateHostPrefix("1.2.3.4:80")).toEqual("1.2.3.4:80"); - expect(deduplicateHostPrefix("10.10.10.10")).toEqual("10.10.10.10"); - expect(deduplicateHostPrefix("10.10.10.10:80")).toEqual("10.10.10.10:80"); - }); -}); diff --git a/packages/middleware-sdk-s3-control/src/host-prefix-deduplication/deduplicateHostPrefix.ts b/packages/middleware-sdk-s3-control/src/host-prefix-deduplication/deduplicateHostPrefix.ts deleted file mode 100644 index 54be6930efa8..000000000000 --- a/packages/middleware-sdk-s3-control/src/host-prefix-deduplication/deduplicateHostPrefix.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { isIpAddress } from "@smithy/util-endpoints"; - -/** - * @example - * 12345.12345.____.com should become 12345.____.com. - */ -export const deduplicateHostPrefix = (hostname: string): string => { - const [p1, p2, p3, p4, ...rest] = hostname.split("."); - if (isIpAddress(`${p1}.${p2}.${p3}.${parseInt(p4, 10)}`)) { - return hostname; - } - if (p1 === p2) { - return [p2, p3, p4, ...rest].join("."); - } - return hostname; -}; diff --git a/packages/middleware-sdk-s3-control/src/host-prefix-deduplication/hostPrefixDeduplicationMiddleware.ts b/packages/middleware-sdk-s3-control/src/host-prefix-deduplication/hostPrefixDeduplicationMiddleware.ts index 55ac3ea1c8b8..04074c78d173 100644 --- a/packages/middleware-sdk-s3-control/src/host-prefix-deduplication/hostPrefixDeduplicationMiddleware.ts +++ b/packages/middleware-sdk-s3-control/src/host-prefix-deduplication/hostPrefixDeduplicationMiddleware.ts @@ -1,6 +1,5 @@ import { HandlerExecutionContext, - HttpRequest, Pluggable, RelativeMiddlewareOptions, SerializeHandler, @@ -9,28 +8,21 @@ import { SerializeMiddleware, } from "@smithy/types"; -import { deduplicateHostPrefix } from "./deduplicateHostPrefix"; - /** * @internal - * This customization handles an edge case where - * a hostprefix may be duplicated in the endpoint ruleset resolution - * and hostPrefix serialization via the pre-endpoints 2.0 trait, - * and which cannot be reconciled automatically. + * @deprecated - the middleware is no longer necessary since hostPrefix was + * removed by S3Control codegen customization's model preprocessing. */ export const hostPrefixDeduplicationMiddleware = (): SerializeMiddleware => { return (next: SerializeHandler, context: HandlerExecutionContext): SerializeHandler => - async (args: SerializeHandlerArguments): Promise> => { - const httpRequest: HttpRequest = (args.request ?? {}) as HttpRequest; - if (httpRequest?.hostname) { - httpRequest.hostname = deduplicateHostPrefix(httpRequest.hostname); - } + (args: SerializeHandlerArguments): Promise> => { return next(args); }; }; /** * @internal + * @deprecated */ export const hostPrefixDeduplicationMiddlewareOptions: RelativeMiddlewareOptions = { tags: ["HOST_PREFIX_DEDUPLICATION", "ENDPOINT_V2", "ENDPOINT"], @@ -42,6 +34,7 @@ export const hostPrefixDeduplicationMiddlewareOptions: RelativeMiddlewareOptions /** * @internal + * @deprecated */ export const getHostPrefixDeduplicationPlugin = (config: T): Pluggable => ({ applyToStack: (clientStack) => { diff --git a/packages/middleware-sdk-s3-control/src/middleware-sdk-s3-control.integ.spec.ts b/packages/middleware-sdk-s3-control/src/middleware-sdk-s3-control.integ.spec.ts index 186a362de21d..6759685f6005 100644 --- a/packages/middleware-sdk-s3-control/src/middleware-sdk-s3-control.integ.spec.ts +++ b/packages/middleware-sdk-s3-control/src/middleware-sdk-s3-control.integ.spec.ts @@ -78,9 +78,9 @@ describe("middleware-sdk-s3-control", () => { requireRequestsFrom(client).toMatch({ method: "GET", - hostname: "123456789012.s3-outposts.us-west-2.amazonaws.com", + hostname: "s3-outposts.us-west-2.amazonaws.com", headers: { - host: "123456789012.s3-outposts.us-west-2.amazonaws.com", + host: "s3-outposts.us-west-2.amazonaws.com", }, protocol: "https:", path: "/v20180820/bucket", diff --git a/tests/endpoints-2.0/endpoints-integration.spec.ts b/tests/endpoints-2.0/endpoints-integration.spec.ts index cae14cbd475d..96f1e61840aa 100644 --- a/tests/endpoints-2.0/endpoints-integration.spec.ts +++ b/tests/endpoints-2.0/endpoints-integration.spec.ts @@ -1,14 +1,15 @@ import { resolveParams } from "@smithy/middleware-endpoint"; -import { EndpointV2 } from "@smithy/types"; -import { resolveEndpoint, EndpointParams } from "@smithy/util-endpoints"; +import { EndpointV2, RelativeMiddlewareOptions } from "@smithy/types"; +import { EndpointParams, resolveEndpoint } from "@smithy/util-endpoints"; import { existsSync, readdirSync } from "fs"; import { join } from "path"; import { EndpointExpectation, ServiceModel, ServiceNamespace } from "./integration-test-types"; +import { HttpRequest } from "@smithy/protocol-http"; describe("client list", () => { const root = join(__dirname, "..", ".."); - const clientPackageNameList = readdirSync(join(root, "clients")); + const clientPackageNameList = readdirSync(join(root, "clients")).filter((f) => f.startsWith("client-")); it("should be at least 300 clients", () => { expect(clientPackageNameList.length).toBeGreaterThan(300); @@ -37,6 +38,7 @@ describe("client list", () => { function runTestCases(service: ServiceModel, namespace: ServiceNamespace) { const serviceId = service.traits["aws.api#service"].serviceId; const testCases = service.traits["smithy.rules#endpointTests"]?.testCases; + const Client: any = Object.entries(namespace).find(([k, v]) => k.endsWith("Client"))![1]; const ruleSet = service.traits["smithy.rules#endpointRuleSet"]; const defaultEndpointResolver = (endpointParams: EndpointParams) => resolveEndpoint(ruleSet, { endpointParams }); @@ -46,14 +48,23 @@ function runTestCases(service: ServiceModel, namespace: ServiceNamespace) { const { documentation, params = {}, expect: expectation, operationInputs } = testCase; params.serviceId = serviceId; - it(documentation || "undocumented testcase", async () => { + const test = Client.name === "DynamoDBClient" && "AccountId" in params ? it.skip : it; + + test(documentation || "undocumented testcase", async () => { if ("endpoint" in expectation) { const { endpoint } = expectation; if (operationInputs) { for (const operationInput of operationInputs) { const { operationName, operationParams = {} } = operationInput; - const command = namespace[`${operationName}Command`]; - const endpointParams = await resolveParams(operationParams, command, params); + const Command = namespace[`${operationName}Command`]; + const endpointParams = await resolveParams(operationParams, Command, mapClientConfig(params)); + + // todo: Use an actual client for a more integrated test. + // todo: This call returns an intercepted EndpointV2 object that can replace the one + // todo: used below. + void useClient; + void [Client, params, Command, operationParams]; + const observed = defaultEndpointResolver(endpointParams as EndpointParams); assertEndpointResolvedCorrectly(endpoint, observed); } @@ -106,3 +117,72 @@ function assertEndpointResolvedCorrectly(expected: EndpointExpectation["endpoint expect(observed.properties?.authSchemes).toEqual(authSchemes); } } + +/** + * Makes a client operation return its EndpointV2 instead of making a request. + */ +const requestInterceptorMiddleware = (next: any, context: any) => async (args: any) => { + const { request } = args; + if (HttpRequest.isInstance(request)) { + const endpoint = context.endpointV2; + return { + response: { + statusCode: 200, + }, + output: { + ...endpoint, + url: { + protocol: request.protocol, + hostname: request.hostname, + pathname: request.path, + href: `${request.protocol}//${request.hostname}${request.path}`, + } as URL, + }, + } as { + output: EndpointV2; + }; + } + throw new Error("Request must not continue beyond serialization step."); +}; +const requestInterceptorMiddlewareOptions: RelativeMiddlewareOptions = { + name: "requestInterceptorMiddleware", + override: true, + toMiddleware: "serializerMiddleware", + relation: "after", +}; + +const paramMap = { + Region: "region", + UseFIPS: "useFipsEndpoint", + UseDualStack: "useDualstackEndpoint", + ForcePathStyle: "forcePathStyle", + Accelerate: "useAccelerateEndpoint", + DisableMRAP: "disableMultiregionAccessPoints", + DisableMultiRegionAccessPoints: "disableMultiregionAccessPoints", + UseArnRegion: "useArnRegion", + Endpoint: "endpoint", + UseGlobalEndpoint: "useGlobalEndpoint", +}; + +async function useClient(Client: any, Command: any, clientConfig: any, input: any): Promise { + const client = new Client({ + ...mapClientConfig(clientConfig), + credentials: { + accessKeyId: "ENDPOINTS_TEST", + secretAccessKey: "ENDPOINTS_TEST", + }, + }); + client.middlewareStack.addRelativeTo(requestInterceptorMiddleware, requestInterceptorMiddlewareOptions); + const command = new Command(input); + const observed: EndpointV2 = await client.send(command); + return observed; +} + +function mapClientConfig(params: any) { + return Object.entries(params).reduce((acc: any, cur: [string, any]) => { + const [k, v] = cur; + const key = paramMap[k as keyof typeof paramMap] ?? k; + acc[key] = v; + return acc; + }, {} as any); +}