@aws-sdk/client-pricing 3.509.0 → 3.513.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist-cjs/auth/httpAuthExtensionConfiguration.js +1 -0
  2. package/dist-cjs/auth/httpAuthSchemeProvider.js +47 -0
  3. package/dist-cjs/index.js +101 -7
  4. package/dist-cjs/runtimeConfig.shared.js +10 -0
  5. package/dist-es/PricingClient.js +17 -4
  6. package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  7. package/dist-es/auth/httpAuthSchemeProvider.js +41 -0
  8. package/dist-es/models/models_0.js +17 -0
  9. package/dist-es/protocols/Aws_json1_1.js +13 -1
  10. package/dist-es/runtimeConfig.shared.js +10 -0
  11. package/dist-es/runtimeExtensions.js +3 -0
  12. package/dist-types/Pricing.d.ts +1 -1
  13. package/dist-types/PricingClient.d.ts +14 -12
  14. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  15. package/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
  16. package/dist-types/commands/DescribeServicesCommand.d.ts +4 -0
  17. package/dist-types/commands/GetAttributeValuesCommand.d.ts +4 -0
  18. package/dist-types/commands/GetPriceListFileUrlCommand.d.ts +4 -0
  19. package/dist-types/commands/GetProductsCommand.d.ts +4 -0
  20. package/dist-types/commands/ListPriceListsCommand.d.ts +4 -0
  21. package/dist-types/extensionConfiguration.d.ts +2 -1
  22. package/dist-types/index.d.ts +1 -1
  23. package/dist-types/models/models_0.d.ts +18 -0
  24. package/dist-types/runtimeConfig.browser.d.ts +5 -3
  25. package/dist-types/runtimeConfig.d.ts +4 -2
  26. package/dist-types/runtimeConfig.native.d.ts +6 -4
  27. package/dist-types/runtimeConfig.shared.d.ts +2 -0
  28. package/dist-types/ts3.4/PricingClient.d.ts +11 -9
  29. package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
  30. package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +44 -0
  31. package/dist-types/ts3.4/extensionConfiguration.d.ts +3 -1
  32. package/dist-types/ts3.4/models/models_0.d.ts +12 -0
  33. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +5 -5
  34. package/dist-types/ts3.4/runtimeConfig.d.ts +4 -4
  35. package/dist-types/ts3.4/runtimeConfig.native.d.ts +8 -8
  36. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +2 -0
  37. package/package.json +16 -16
@@ -0,0 +1 @@
1
+ module.exports = require("../index.js");
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveHttpAuthSchemeConfig = exports.defaultPricingHttpAuthSchemeProvider = exports.defaultPricingHttpAuthSchemeParametersProvider = void 0;
4
+ const core_1 = require("@aws-sdk/core");
5
+ const util_middleware_1 = require("@smithy/util-middleware");
6
+ const defaultPricingHttpAuthSchemeParametersProvider = async (config, context, input) => {
7
+ return {
8
+ operation: (0, util_middleware_1.getSmithyContext)(context).operation,
9
+ region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
10
+ (() => {
11
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
12
+ })(),
13
+ };
14
+ };
15
+ exports.defaultPricingHttpAuthSchemeParametersProvider = defaultPricingHttpAuthSchemeParametersProvider;
16
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
17
+ return {
18
+ schemeId: "aws.auth#sigv4",
19
+ signingProperties: {
20
+ name: "pricing",
21
+ region: authParameters.region,
22
+ },
23
+ propertiesExtractor: (config, context) => ({
24
+ signingProperties: {
25
+ config,
26
+ context,
27
+ },
28
+ }),
29
+ };
30
+ }
31
+ const defaultPricingHttpAuthSchemeProvider = (authParameters) => {
32
+ const options = [];
33
+ switch (authParameters.operation) {
34
+ default: {
35
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
36
+ }
37
+ }
38
+ return options;
39
+ };
40
+ exports.defaultPricingHttpAuthSchemeProvider = defaultPricingHttpAuthSchemeProvider;
41
+ const resolveHttpAuthSchemeConfig = (config) => {
42
+ const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
43
+ return {
44
+ ...config_0,
45
+ };
46
+ };
47
+ exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
package/dist-cjs/index.js CHANGED
@@ -36,6 +36,7 @@ __export(src_exports, {
36
36
  Pricing: () => Pricing,
37
37
  PricingClient: () => PricingClient,
38
38
  PricingServiceException: () => PricingServiceException,
39
+ ThrottlingException: () => ThrottlingException,
39
40
  __Client: () => import_smithy_client.Client,
40
41
  paginateDescribeServices: () => paginateDescribeServices,
41
42
  paginateGetAttributeValues: () => paginateGetAttributeValues,
@@ -48,13 +49,14 @@ module.exports = __toCommonJS(src_exports);
48
49
  var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
49
50
  var import_middleware_logger = require("@aws-sdk/middleware-logger");
50
51
  var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
51
- var import_middleware_signing = require("@aws-sdk/middleware-signing");
52
52
  var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
53
53
  var import_config_resolver = require("@smithy/config-resolver");
54
+ var import_core = require("@smithy/core");
54
55
  var import_middleware_content_length = require("@smithy/middleware-content-length");
55
56
  var import_middleware_endpoint = require("@smithy/middleware-endpoint");
56
57
  var import_middleware_retry = require("@smithy/middleware-retry");
57
58
 
59
+ var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
58
60
 
59
61
  // src/endpoint/EndpointParameters.ts
60
62
  var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
@@ -79,19 +81,62 @@ var import_runtimeConfig = require("././runtimeConfig");
79
81
  var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
80
82
  var import_protocol_http = require("@smithy/protocol-http");
81
83
  var import_smithy_client = require("@smithy/smithy-client");
84
+
85
+ // src/auth/httpAuthExtensionConfiguration.ts
86
+ var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
87
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
88
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
89
+ let _credentials = runtimeConfig.credentials;
90
+ return {
91
+ setHttpAuthScheme(httpAuthScheme) {
92
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
93
+ if (index === -1) {
94
+ _httpAuthSchemes.push(httpAuthScheme);
95
+ } else {
96
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
97
+ }
98
+ },
99
+ httpAuthSchemes() {
100
+ return _httpAuthSchemes;
101
+ },
102
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
103
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
104
+ },
105
+ httpAuthSchemeProvider() {
106
+ return _httpAuthSchemeProvider;
107
+ },
108
+ setCredentials(credentials) {
109
+ _credentials = credentials;
110
+ },
111
+ credentials() {
112
+ return _credentials;
113
+ }
114
+ };
115
+ }, "getHttpAuthExtensionConfiguration");
116
+ var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
117
+ return {
118
+ httpAuthSchemes: config.httpAuthSchemes(),
119
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
120
+ credentials: config.credentials()
121
+ };
122
+ }, "resolveHttpAuthRuntimeConfig");
123
+
124
+ // src/runtimeExtensions.ts
82
125
  var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
83
126
  var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
84
127
  const extensionConfiguration = {
85
128
  ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
86
129
  ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
87
- ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
130
+ ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
131
+ ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig))
88
132
  };
89
133
  extensions.forEach((extension) => extension.configure(extensionConfiguration));
90
134
  return {
91
135
  ...runtimeConfig,
92
136
  ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
93
137
  ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
94
- ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
138
+ ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
139
+ ...resolveHttpAuthRuntimeConfig(extensionConfiguration)
95
140
  };
96
141
  }, "resolveRuntimeExtensions");
97
142
 
@@ -104,8 +149,8 @@ var _PricingClient = class _PricingClient extends import_smithy_client.Client {
104
149
  const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
105
150
  const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
106
151
  const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
107
- const _config_6 = (0, import_middleware_signing.resolveAwsAuthConfig)(_config_5);
108
- const _config_7 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_6);
152
+ const _config_6 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_5);
153
+ const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
109
154
  const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
110
155
  super(_config_8);
111
156
  this.config = _config_8;
@@ -114,8 +159,14 @@ var _PricingClient = class _PricingClient extends import_smithy_client.Client {
114
159
  this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
115
160
  this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
116
161
  this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
117
- this.middlewareStack.use((0, import_middleware_signing.getAwsAuthPlugin)(this.config));
118
162
  this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
163
+ this.middlewareStack.use(
164
+ (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
165
+ httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
166
+ identityProviderConfigProvider: this.getIdentityProviderConfigProvider()
167
+ })
168
+ );
169
+ this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
119
170
  }
120
171
  /**
121
172
  * Destroy underlying resources, like sockets. It's usually not necessary to do this.
@@ -125,6 +176,14 @@ var _PricingClient = class _PricingClient extends import_smithy_client.Client {
125
176
  destroy() {
126
177
  super.destroy();
127
178
  }
179
+ getDefaultHttpAuthSchemeParametersProvider() {
180
+ return import_httpAuthSchemeProvider.defaultPricingHttpAuthSchemeParametersProvider;
181
+ }
182
+ getIdentityProviderConfigProvider() {
183
+ return async (config) => new import_core.DefaultIdentityProviderConfig({
184
+ "aws.auth#sigv4": config.credentials
185
+ });
186
+ }
128
187
  };
129
188
  __name(_PricingClient, "PricingClient");
130
189
  var PricingClient = _PricingClient;
@@ -205,6 +264,7 @@ var _InternalErrorException = class _InternalErrorException extends PricingServi
205
264
  });
206
265
  this.name = "InternalErrorException";
207
266
  this.$fault = "server";
267
+ this.$retryable = {};
208
268
  Object.setPrototypeOf(this, _InternalErrorException.prototype);
209
269
  this.Message = opts.Message;
210
270
  }
@@ -265,6 +325,27 @@ var _NotFoundException = class _NotFoundException extends PricingServiceExceptio
265
325
  };
266
326
  __name(_NotFoundException, "NotFoundException");
267
327
  var NotFoundException = _NotFoundException;
328
+ var _ThrottlingException = class _ThrottlingException extends PricingServiceException {
329
+ /**
330
+ * @internal
331
+ */
332
+ constructor(opts) {
333
+ super({
334
+ name: "ThrottlingException",
335
+ $fault: "client",
336
+ ...opts
337
+ });
338
+ this.name = "ThrottlingException";
339
+ this.$fault = "client";
340
+ this.$retryable = {
341
+ throttling: true
342
+ };
343
+ Object.setPrototypeOf(this, _ThrottlingException.prototype);
344
+ this.Message = opts.Message;
345
+ }
346
+ };
347
+ __name(_ThrottlingException, "ThrottlingException");
348
+ var ThrottlingException = _ThrottlingException;
268
349
  var FilterType = {
269
350
  TERM_MATCH: "TERM_MATCH"
270
351
  };
@@ -387,6 +468,9 @@ var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
387
468
  case "NotFoundException":
388
469
  case "com.amazonaws.pricing#NotFoundException":
389
470
  throw await de_NotFoundExceptionRes(parsedOutput, context);
471
+ case "ThrottlingException":
472
+ case "com.amazonaws.pricing#ThrottlingException":
473
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
390
474
  case "AccessDeniedException":
391
475
  case "com.amazonaws.pricing#AccessDeniedException":
392
476
  throw await de_AccessDeniedExceptionRes(parsedOutput, context);
@@ -453,6 +537,15 @@ var de_NotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, contex
453
537
  });
454
538
  return (0, import_smithy_client.decorateServiceException)(exception, body);
455
539
  }, "de_NotFoundExceptionRes");
540
+ var de_ThrottlingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
541
+ const body = parsedOutput.body;
542
+ const deserialized = (0, import_smithy_client._json)(body);
543
+ const exception = new ThrottlingException({
544
+ $metadata: deserializeMetadata(parsedOutput),
545
+ ...deserialized
546
+ });
547
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
548
+ }, "de_ThrottlingExceptionRes");
456
549
  var se_ListPriceListsRequest = /* @__PURE__ */ __name((input, context) => {
457
550
  return (0, import_smithy_client.take)(input, {
458
551
  CurrencyCode: [],
@@ -646,7 +739,7 @@ var Pricing = _Pricing;
646
739
  (0, import_smithy_client.createAggregatedClient)(commands, Pricing);
647
740
 
648
741
  // src/pagination/DescribeServicesPaginator.ts
649
- var import_core = require("@smithy/core");
742
+
650
743
  var paginateDescribeServices = (0, import_core.createPaginator)(PricingClient, DescribeServicesCommand, "NextToken", "NextToken", "MaxResults");
651
744
 
652
745
  // src/pagination/GetAttributeValuesPaginator.ts
@@ -686,6 +779,7 @@ var import_util_endpoints = require("@aws-sdk/util-endpoints");
686
779
  InvalidNextTokenException,
687
780
  InvalidParameterException,
688
781
  NotFoundException,
782
+ ThrottlingException,
689
783
  FilterType
690
784
  });
691
785
 
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRuntimeConfig = void 0;
4
+ const core_1 = require("@aws-sdk/core");
4
5
  const smithy_client_1 = require("@smithy/smithy-client");
5
6
  const url_parser_1 = require("@smithy/url-parser");
6
7
  const util_base64_1 = require("@smithy/util-base64");
7
8
  const util_utf8_1 = require("@smithy/util-utf8");
9
+ const httpAuthSchemeProvider_1 = require("./auth/httpAuthSchemeProvider");
8
10
  const endpointResolver_1 = require("./endpoint/endpointResolver");
9
11
  const getRuntimeConfig = (config) => {
10
12
  return {
@@ -14,6 +16,14 @@ const getRuntimeConfig = (config) => {
14
16
  disableHostPrefix: config?.disableHostPrefix ?? false,
15
17
  endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
16
18
  extensions: config?.extensions ?? [],
19
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultPricingHttpAuthSchemeProvider,
20
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
21
+ {
22
+ schemeId: "aws.auth#sigv4",
23
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
24
+ signer: new core_1.AwsSdkSigV4Signer(),
25
+ },
26
+ ],
17
27
  logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
18
28
  serviceId: config?.serviceId ?? "Pricing",
19
29
  urlParser: config?.urlParser ?? url_parser_1.parseUrl,
@@ -1,13 +1,14 @@
1
1
  import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
2
2
  import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
3
3
  import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
4
- import { getAwsAuthPlugin, resolveAwsAuthConfig, } from "@aws-sdk/middleware-signing";
5
4
  import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
6
5
  import { resolveRegionConfig } from "@smithy/config-resolver";
6
+ import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
7
7
  import { getContentLengthPlugin } from "@smithy/middleware-content-length";
8
8
  import { resolveEndpointConfig } from "@smithy/middleware-endpoint";
9
9
  import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
10
10
  import { Client as __Client, } from "@smithy/smithy-client";
11
+ import { defaultPricingHttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
11
12
  import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
12
13
  import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
13
14
  import { resolveRuntimeExtensions } from "./runtimeExtensions";
@@ -20,8 +21,8 @@ export class PricingClient extends __Client {
20
21
  const _config_3 = resolveEndpointConfig(_config_2);
21
22
  const _config_4 = resolveRetryConfig(_config_3);
22
23
  const _config_5 = resolveHostHeaderConfig(_config_4);
23
- const _config_6 = resolveAwsAuthConfig(_config_5);
24
- const _config_7 = resolveUserAgentConfig(_config_6);
24
+ const _config_6 = resolveUserAgentConfig(_config_5);
25
+ const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
25
26
  const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
26
27
  super(_config_8);
27
28
  this.config = _config_8;
@@ -30,10 +31,22 @@ export class PricingClient extends __Client {
30
31
  this.middlewareStack.use(getHostHeaderPlugin(this.config));
31
32
  this.middlewareStack.use(getLoggerPlugin(this.config));
32
33
  this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
33
- this.middlewareStack.use(getAwsAuthPlugin(this.config));
34
34
  this.middlewareStack.use(getUserAgentPlugin(this.config));
35
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
36
+ httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
37
+ identityProviderConfigProvider: this.getIdentityProviderConfigProvider(),
38
+ }));
39
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
35
40
  }
36
41
  destroy() {
37
42
  super.destroy();
38
43
  }
44
+ getDefaultHttpAuthSchemeParametersProvider() {
45
+ return defaultPricingHttpAuthSchemeParametersProvider;
46
+ }
47
+ getIdentityProviderConfigProvider() {
48
+ return async (config) => new DefaultIdentityProviderConfig({
49
+ "aws.auth#sigv4": config.credentials,
50
+ });
51
+ }
39
52
  }
@@ -0,0 +1,38 @@
1
+ export const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
2
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
3
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
4
+ let _credentials = runtimeConfig.credentials;
5
+ return {
6
+ setHttpAuthScheme(httpAuthScheme) {
7
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
8
+ if (index === -1) {
9
+ _httpAuthSchemes.push(httpAuthScheme);
10
+ }
11
+ else {
12
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
13
+ }
14
+ },
15
+ httpAuthSchemes() {
16
+ return _httpAuthSchemes;
17
+ },
18
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
19
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
20
+ },
21
+ httpAuthSchemeProvider() {
22
+ return _httpAuthSchemeProvider;
23
+ },
24
+ setCredentials(credentials) {
25
+ _credentials = credentials;
26
+ },
27
+ credentials() {
28
+ return _credentials;
29
+ },
30
+ };
31
+ };
32
+ export const resolveHttpAuthRuntimeConfig = (config) => {
33
+ return {
34
+ httpAuthSchemes: config.httpAuthSchemes(),
35
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
36
+ credentials: config.credentials(),
37
+ };
38
+ };
@@ -0,0 +1,41 @@
1
+ import { resolveAwsSdkSigV4Config, } from "@aws-sdk/core";
2
+ import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";
3
+ export const defaultPricingHttpAuthSchemeParametersProvider = async (config, context, input) => {
4
+ return {
5
+ operation: getSmithyContext(context).operation,
6
+ region: (await normalizeProvider(config.region)()) ||
7
+ (() => {
8
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
9
+ })(),
10
+ };
11
+ };
12
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
13
+ return {
14
+ schemeId: "aws.auth#sigv4",
15
+ signingProperties: {
16
+ name: "pricing",
17
+ region: authParameters.region,
18
+ },
19
+ propertiesExtractor: (config, context) => ({
20
+ signingProperties: {
21
+ config,
22
+ context,
23
+ },
24
+ }),
25
+ };
26
+ }
27
+ export const defaultPricingHttpAuthSchemeProvider = (authParameters) => {
28
+ const options = [];
29
+ switch (authParameters.operation) {
30
+ default: {
31
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
32
+ }
33
+ }
34
+ return options;
35
+ };
36
+ export const resolveHttpAuthSchemeConfig = (config) => {
37
+ const config_0 = resolveAwsSdkSigV4Config(config);
38
+ return {
39
+ ...config_0,
40
+ };
41
+ };
@@ -34,6 +34,7 @@ export class InternalErrorException extends __BaseException {
34
34
  });
35
35
  this.name = "InternalErrorException";
36
36
  this.$fault = "server";
37
+ this.$retryable = {};
37
38
  Object.setPrototypeOf(this, InternalErrorException.prototype);
38
39
  this.Message = opts.Message;
39
40
  }
@@ -77,6 +78,22 @@ export class NotFoundException extends __BaseException {
77
78
  this.Message = opts.Message;
78
79
  }
79
80
  }
81
+ export class ThrottlingException extends __BaseException {
82
+ constructor(opts) {
83
+ super({
84
+ name: "ThrottlingException",
85
+ $fault: "client",
86
+ ...opts,
87
+ });
88
+ this.name = "ThrottlingException";
89
+ this.$fault = "client";
90
+ this.$retryable = {
91
+ throttling: true,
92
+ };
93
+ Object.setPrototypeOf(this, ThrottlingException.prototype);
94
+ this.Message = opts.Message;
95
+ }
96
+ }
80
97
  export const FilterType = {
81
98
  TERM_MATCH: "TERM_MATCH",
82
99
  };
@@ -1,6 +1,6 @@
1
1
  import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
2
2
  import { _json, collectBody, decorateServiceException as __decorateServiceException, expectString as __expectString, LazyJsonString as __LazyJsonString, take, withBaseException, } from "@smithy/smithy-client";
3
- import { AccessDeniedException, ExpiredNextTokenException, InternalErrorException, InvalidNextTokenException, InvalidParameterException, NotFoundException, } from "../models/models_0";
3
+ import { AccessDeniedException, ExpiredNextTokenException, InternalErrorException, InvalidNextTokenException, InvalidParameterException, NotFoundException, ThrottlingException, } from "../models/models_0";
4
4
  import { PricingServiceException as __BaseException } from "../models/PricingServiceException";
5
5
  export const se_DescribeServicesCommand = async (input, context) => {
6
6
  const headers = sharedHeaders("DescribeServices");
@@ -119,6 +119,9 @@ const de_CommandError = async (output, context) => {
119
119
  case "NotFoundException":
120
120
  case "com.amazonaws.pricing#NotFoundException":
121
121
  throw await de_NotFoundExceptionRes(parsedOutput, context);
122
+ case "ThrottlingException":
123
+ case "com.amazonaws.pricing#ThrottlingException":
124
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
122
125
  case "AccessDeniedException":
123
126
  case "com.amazonaws.pricing#AccessDeniedException":
124
127
  throw await de_AccessDeniedExceptionRes(parsedOutput, context);
@@ -185,6 +188,15 @@ const de_NotFoundExceptionRes = async (parsedOutput, context) => {
185
188
  });
186
189
  return __decorateServiceException(exception, body);
187
190
  };
191
+ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
192
+ const body = parsedOutput.body;
193
+ const deserialized = _json(body);
194
+ const exception = new ThrottlingException({
195
+ $metadata: deserializeMetadata(parsedOutput),
196
+ ...deserialized,
197
+ });
198
+ return __decorateServiceException(exception, body);
199
+ };
188
200
  const se_ListPriceListsRequest = (input, context) => {
189
201
  return take(input, {
190
202
  CurrencyCode: [],
@@ -1,7 +1,9 @@
1
+ import { AwsSdkSigV4Signer } from "@aws-sdk/core";
1
2
  import { NoOpLogger } from "@smithy/smithy-client";
2
3
  import { parseUrl } from "@smithy/url-parser";
3
4
  import { fromBase64, toBase64 } from "@smithy/util-base64";
4
5
  import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
6
+ import { defaultPricingHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider";
5
7
  import { defaultEndpointResolver } from "./endpoint/endpointResolver";
6
8
  export const getRuntimeConfig = (config) => {
7
9
  return {
@@ -11,6 +13,14 @@ export const getRuntimeConfig = (config) => {
11
13
  disableHostPrefix: config?.disableHostPrefix ?? false,
12
14
  endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
13
15
  extensions: config?.extensions ?? [],
16
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultPricingHttpAuthSchemeProvider,
17
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
18
+ {
19
+ schemeId: "aws.auth#sigv4",
20
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
21
+ signer: new AwsSdkSigV4Signer(),
22
+ },
23
+ ],
14
24
  logger: config?.logger ?? new NoOpLogger(),
15
25
  serviceId: config?.serviceId ?? "Pricing",
16
26
  urlParser: config?.urlParser ?? parseUrl,
@@ -1,12 +1,14 @@
1
1
  import { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "@aws-sdk/region-config-resolver";
2
2
  import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
3
3
  import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
4
+ import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration";
4
5
  const asPartial = (t) => t;
5
6
  export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
6
7
  const extensionConfiguration = {
7
8
  ...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
8
9
  ...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
9
10
  ...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
11
+ ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)),
10
12
  };
11
13
  extensions.forEach((extension) => extension.configure(extensionConfiguration));
12
14
  return {
@@ -14,5 +16,6 @@ export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
14
16
  ...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
15
17
  ...resolveDefaultRuntimeConfig(extensionConfiguration),
16
18
  ...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
19
+ ...resolveHttpAuthRuntimeConfig(extensionConfiguration),
17
20
  };
18
21
  };
@@ -66,7 +66,7 @@ export interface Pricing {
66
66
  * an <code>AmazonEC2</code> instance, with a <code>Provisioned IOPS</code>
67
67
  * <code>volumeType</code>.</p>
68
68
  * <p>For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html">Using the
69
- * Amazon Web Services Price List API</a> in the <i>Billing User
69
+ * Amazon Web Services Price List API</a> in the <i>Billing User
70
70
  * Guide</i>.</p>
71
71
  */
72
72
  export declare class Pricing extends PricingClient implements Pricing {
@@ -1,13 +1,12 @@
1
1
  import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header";
2
- import { AwsAuthInputConfig, AwsAuthResolvedConfig } from "@aws-sdk/middleware-signing";
3
2
  import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent";
4
- import { Credentials as __Credentials } from "@aws-sdk/types";
5
3
  import { RegionInputConfig, RegionResolvedConfig } from "@smithy/config-resolver";
6
4
  import { EndpointInputConfig, EndpointResolvedConfig } from "@smithy/middleware-endpoint";
7
5
  import { RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
8
6
  import { HttpHandler as __HttpHandler } from "@smithy/protocol-http";
9
7
  import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@smithy/smithy-client";
10
- import { BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
8
+ import { AwsCredentialIdentityProvider, BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
9
+ import { HttpAuthSchemeInputConfig, HttpAuthSchemeResolvedConfig } from "./auth/httpAuthSchemeProvider";
11
10
  import { DescribeServicesCommandInput, DescribeServicesCommandOutput } from "./commands/DescribeServicesCommand";
12
11
  import { GetAttributeValuesCommandInput, GetAttributeValuesCommandOutput } from "./commands/GetAttributeValuesCommand";
13
12
  import { GetPriceListFileUrlCommandInput, GetPriceListFileUrlCommandOutput } from "./commands/GetPriceListFileUrlCommand";
@@ -96,20 +95,21 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
96
95
  * Enables FIPS compatible endpoints.
97
96
  */
98
97
  useFipsEndpoint?: boolean | __Provider<boolean>;
98
+ /**
99
+ * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
100
+ * @internal
101
+ */
102
+ defaultUserAgentProvider?: Provider<__UserAgent>;
99
103
  /**
100
104
  * The AWS region to which this client will send requests
101
105
  */
102
106
  region?: string | __Provider<string>;
103
107
  /**
104
108
  * Default credentials provider; Not available in browser runtime.
109
+ * @deprecated
105
110
  * @internal
106
111
  */
107
- credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;
108
- /**
109
- * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
110
- * @internal
111
- */
112
- defaultUserAgentProvider?: Provider<__UserAgent>;
112
+ credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider;
113
113
  /**
114
114
  * Value for how many times a request will be made at most in case of retry.
115
115
  */
@@ -136,7 +136,7 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
136
136
  /**
137
137
  * @public
138
138
  */
139
- export type PricingClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointInputConfig<EndpointParameters> & RetryInputConfig & HostHeaderInputConfig & AwsAuthInputConfig & UserAgentInputConfig & ClientInputEndpointParameters;
139
+ export type PricingClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointInputConfig<EndpointParameters> & RetryInputConfig & HostHeaderInputConfig & UserAgentInputConfig & HttpAuthSchemeInputConfig & ClientInputEndpointParameters;
140
140
  /**
141
141
  * @public
142
142
  *
@@ -147,7 +147,7 @@ export interface PricingClientConfig extends PricingClientConfigType {
147
147
  /**
148
148
  * @public
149
149
  */
150
- export type PricingClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & RegionResolvedConfig & EndpointResolvedConfig<EndpointParameters> & RetryResolvedConfig & HostHeaderResolvedConfig & AwsAuthResolvedConfig & UserAgentResolvedConfig & ClientResolvedEndpointParameters;
150
+ export type PricingClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & RegionResolvedConfig & EndpointResolvedConfig<EndpointParameters> & RetryResolvedConfig & HostHeaderResolvedConfig & UserAgentResolvedConfig & HttpAuthSchemeResolvedConfig & ClientResolvedEndpointParameters;
151
151
  /**
152
152
  * @public
153
153
  *
@@ -184,7 +184,7 @@ export interface PricingClientResolvedConfig extends PricingClientResolvedConfig
184
184
  * an <code>AmazonEC2</code> instance, with a <code>Provisioned IOPS</code>
185
185
  * <code>volumeType</code>.</p>
186
186
  * <p>For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html">Using the
187
- * Amazon Web Services Price List API</a> in the <i>Billing User
187
+ * Amazon Web Services Price List API</a> in the <i>Billing User
188
188
  * Guide</i>.</p>
189
189
  */
190
190
  export declare class PricingClient extends __Client<__HttpHandlerOptions, ServiceInputTypes, ServiceOutputTypes, PricingClientResolvedConfig> {
@@ -199,4 +199,6 @@ export declare class PricingClient extends __Client<__HttpHandlerOptions, Servic
199
199
  * Otherwise, sockets might stay open for quite a long time before the server terminates them.
200
200
  */
201
201
  destroy(): void;
202
+ private getDefaultHttpAuthSchemeParametersProvider;
203
+ private getIdentityProviderConfigProvider;
202
204
  }
@@ -0,0 +1,29 @@
1
+ import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme } from "@smithy/types";
2
+ import { PricingHttpAuthSchemeProvider } from "./httpAuthSchemeProvider";
3
+ /**
4
+ * @internal
5
+ */
6
+ export interface HttpAuthExtensionConfiguration {
7
+ setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void;
8
+ httpAuthSchemes(): HttpAuthScheme[];
9
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider: PricingHttpAuthSchemeProvider): void;
10
+ httpAuthSchemeProvider(): PricingHttpAuthSchemeProvider;
11
+ setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void;
12
+ credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined;
13
+ }
14
+ /**
15
+ * @internal
16
+ */
17
+ export type HttpAuthRuntimeConfig = Partial<{
18
+ httpAuthSchemes: HttpAuthScheme[];
19
+ httpAuthSchemeProvider: PricingHttpAuthSchemeProvider;
20
+ credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider;
21
+ }>;
22
+ /**
23
+ * @internal
24
+ */
25
+ export declare const getHttpAuthExtensionConfiguration: (runtimeConfig: HttpAuthRuntimeConfig) => HttpAuthExtensionConfiguration;
26
+ /**
27
+ * @internal
28
+ */
29
+ export declare const resolveHttpAuthRuntimeConfig: (config: HttpAuthExtensionConfiguration) => HttpAuthRuntimeConfig;