@aws-sdk/client-pricing 3.281.0 → 3.287.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 (46) hide show
  1. package/README.md +16 -0
  2. package/dist-cjs/Pricing.js +30 -0
  3. package/dist-cjs/commands/GetPriceListFileUrlCommand.js +46 -0
  4. package/dist-cjs/commands/ListPriceListsCommand.js +46 -0
  5. package/dist-cjs/commands/index.js +2 -0
  6. package/dist-cjs/endpoint/ruleset.js +3 -3
  7. package/dist-cjs/models/models_0.js +35 -1
  8. package/dist-cjs/pagination/DescribeServicesPaginator.js +1 -8
  9. package/dist-cjs/pagination/GetAttributeValuesPaginator.js +1 -8
  10. package/dist-cjs/pagination/GetProductsPaginator.js +1 -8
  11. package/dist-cjs/pagination/ListPriceListsPaginator.js +29 -0
  12. package/dist-cjs/pagination/index.js +1 -0
  13. package/dist-cjs/protocols/Aws_json1_1.js +184 -1
  14. package/dist-es/Pricing.js +30 -0
  15. package/dist-es/commands/GetPriceListFileUrlCommand.js +42 -0
  16. package/dist-es/commands/ListPriceListsCommand.js +42 -0
  17. package/dist-es/commands/index.js +2 -0
  18. package/dist-es/endpoint/ruleset.js +3 -3
  19. package/dist-es/models/models_0.js +28 -0
  20. package/dist-es/pagination/DescribeServicesPaginator.js +1 -8
  21. package/dist-es/pagination/GetAttributeValuesPaginator.js +1 -8
  22. package/dist-es/pagination/GetProductsPaginator.js +1 -8
  23. package/dist-es/pagination/ListPriceListsPaginator.js +25 -0
  24. package/dist-es/pagination/index.js +1 -0
  25. package/dist-es/protocols/Aws_json1_1.js +180 -1
  26. package/dist-types/Pricing.d.ts +34 -0
  27. package/dist-types/PricingClient.d.ts +4 -2
  28. package/dist-types/commands/GetPriceListFileUrlCommand.d.ts +51 -0
  29. package/dist-types/commands/ListPriceListsCommand.d.ts +55 -0
  30. package/dist-types/commands/index.d.ts +2 -0
  31. package/dist-types/models/models_0.d.ts +146 -5
  32. package/dist-types/pagination/Interfaces.d.ts +1 -2
  33. package/dist-types/pagination/ListPriceListsPaginator.d.ts +4 -0
  34. package/dist-types/pagination/index.d.ts +1 -0
  35. package/dist-types/protocols/Aws_json1_1.d.ts +6 -0
  36. package/dist-types/ts3.4/Pricing.d.ts +34 -0
  37. package/dist-types/ts3.4/PricingClient.d.ts +14 -2
  38. package/dist-types/ts3.4/commands/GetPriceListFileUrlCommand.d.ts +38 -0
  39. package/dist-types/ts3.4/commands/ListPriceListsCommand.d.ts +37 -0
  40. package/dist-types/ts3.4/commands/index.d.ts +2 -0
  41. package/dist-types/ts3.4/models/models_0.d.ts +46 -0
  42. package/dist-types/ts3.4/pagination/Interfaces.d.ts +1 -2
  43. package/dist-types/ts3.4/pagination/ListPriceListsPaginator.d.ts +11 -0
  44. package/dist-types/ts3.4/pagination/index.d.ts +1 -0
  45. package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +24 -0
  46. package/package.json +19 -19
@@ -1,6 +1,8 @@
1
1
  import { DescribeServicesCommand, } from "./commands/DescribeServicesCommand";
2
2
  import { GetAttributeValuesCommand, } from "./commands/GetAttributeValuesCommand";
3
+ import { GetPriceListFileUrlCommand, } from "./commands/GetPriceListFileUrlCommand";
3
4
  import { GetProductsCommand } from "./commands/GetProductsCommand";
5
+ import { ListPriceListsCommand, } from "./commands/ListPriceListsCommand";
4
6
  import { PricingClient } from "./PricingClient";
5
7
  export class Pricing extends PricingClient {
6
8
  describeServices(args, optionsOrCb, cb) {
@@ -31,6 +33,20 @@ export class Pricing extends PricingClient {
31
33
  return this.send(command, optionsOrCb);
32
34
  }
33
35
  }
36
+ getPriceListFileUrl(args, optionsOrCb, cb) {
37
+ const command = new GetPriceListFileUrlCommand(args);
38
+ if (typeof optionsOrCb === "function") {
39
+ this.send(command, optionsOrCb);
40
+ }
41
+ else if (typeof cb === "function") {
42
+ if (typeof optionsOrCb !== "object")
43
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
44
+ this.send(command, optionsOrCb || {}, cb);
45
+ }
46
+ else {
47
+ return this.send(command, optionsOrCb);
48
+ }
49
+ }
34
50
  getProducts(args, optionsOrCb, cb) {
35
51
  const command = new GetProductsCommand(args);
36
52
  if (typeof optionsOrCb === "function") {
@@ -45,4 +61,18 @@ export class Pricing extends PricingClient {
45
61
  return this.send(command, optionsOrCb);
46
62
  }
47
63
  }
64
+ listPriceLists(args, optionsOrCb, cb) {
65
+ const command = new ListPriceListsCommand(args);
66
+ if (typeof optionsOrCb === "function") {
67
+ this.send(command, optionsOrCb);
68
+ }
69
+ else if (typeof cb === "function") {
70
+ if (typeof optionsOrCb !== "object")
71
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
72
+ this.send(command, optionsOrCb || {}, cb);
73
+ }
74
+ else {
75
+ return this.send(command, optionsOrCb);
76
+ }
77
+ }
48
78
  }
@@ -0,0 +1,42 @@
1
+ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
2
+ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { GetPriceListFileUrlRequestFilterSensitiveLog, GetPriceListFileUrlResponseFilterSensitiveLog, } from "../models/models_0";
5
+ import { deserializeAws_json1_1GetPriceListFileUrlCommand, serializeAws_json1_1GetPriceListFileUrlCommand, } from "../protocols/Aws_json1_1";
6
+ export class GetPriceListFileUrlCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
10
+ }
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
19
+ resolveMiddleware(clientStack, configuration, options) {
20
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
21
+ this.middlewareStack.use(getEndpointPlugin(configuration, GetPriceListFileUrlCommand.getEndpointParameterInstructions()));
22
+ const stack = clientStack.concat(this.middlewareStack);
23
+ const { logger } = configuration;
24
+ const clientName = "PricingClient";
25
+ const commandName = "GetPriceListFileUrlCommand";
26
+ const handlerExecutionContext = {
27
+ logger,
28
+ clientName,
29
+ commandName,
30
+ inputFilterSensitiveLog: GetPriceListFileUrlRequestFilterSensitiveLog,
31
+ outputFilterSensitiveLog: GetPriceListFileUrlResponseFilterSensitiveLog,
32
+ };
33
+ const { requestHandler } = configuration;
34
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
35
+ }
36
+ serialize(input, context) {
37
+ return serializeAws_json1_1GetPriceListFileUrlCommand(input, context);
38
+ }
39
+ deserialize(output, context) {
40
+ return deserializeAws_json1_1GetPriceListFileUrlCommand(output, context);
41
+ }
42
+ }
@@ -0,0 +1,42 @@
1
+ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
2
+ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { ListPriceListsRequestFilterSensitiveLog, ListPriceListsResponseFilterSensitiveLog, } from "../models/models_0";
5
+ import { deserializeAws_json1_1ListPriceListsCommand, serializeAws_json1_1ListPriceListsCommand, } from "../protocols/Aws_json1_1";
6
+ export class ListPriceListsCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
10
+ }
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
19
+ resolveMiddleware(clientStack, configuration, options) {
20
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
21
+ this.middlewareStack.use(getEndpointPlugin(configuration, ListPriceListsCommand.getEndpointParameterInstructions()));
22
+ const stack = clientStack.concat(this.middlewareStack);
23
+ const { logger } = configuration;
24
+ const clientName = "PricingClient";
25
+ const commandName = "ListPriceListsCommand";
26
+ const handlerExecutionContext = {
27
+ logger,
28
+ clientName,
29
+ commandName,
30
+ inputFilterSensitiveLog: ListPriceListsRequestFilterSensitiveLog,
31
+ outputFilterSensitiveLog: ListPriceListsResponseFilterSensitiveLog,
32
+ };
33
+ const { requestHandler } = configuration;
34
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
35
+ }
36
+ serialize(input, context) {
37
+ return serializeAws_json1_1ListPriceListsCommand(input, context);
38
+ }
39
+ deserialize(output, context) {
40
+ return deserializeAws_json1_1ListPriceListsCommand(output, context);
41
+ }
42
+ }
@@ -1,3 +1,5 @@
1
1
  export * from "./DescribeServicesCommand";
2
2
  export * from "./GetAttributeValuesCommand";
3
+ export * from "./GetPriceListFileUrlCommand";
3
4
  export * from "./GetProductsCommand";
5
+ export * from "./ListPriceListsCommand";
@@ -1,4 +1,4 @@
1
- const p = "required", q = "fn", r = "argv", s = "ref";
2
- const a = "PartitionResult", b = "tree", c = "error", d = "endpoint", e = { [p]: false, "type": "String" }, f = { [p]: true, "default": false, "type": "Boolean" }, g = { [s]: "Endpoint" }, h = { [q]: "booleanEquals", [r]: [{ [s]: "UseFIPS" }, true] }, i = { [q]: "booleanEquals", [r]: [{ [s]: "UseDualStack" }, true] }, j = {}, k = { [q]: "booleanEquals", [r]: [true, { [q]: "getAttr", [r]: [{ [s]: a }, "supportsFIPS"] }] }, l = { [q]: "booleanEquals", [r]: [true, { [q]: "getAttr", [r]: [{ [s]: a }, "supportsDualStack"] }] }, m = [g], n = [h], o = [i];
3
- const _data = { version: "1.0", parameters: { Region: e, UseDualStack: f, UseFIPS: f, Endpoint: e }, rules: [{ conditions: [{ [q]: "aws.partition", [r]: [{ [s]: "Region" }], assign: a }], type: b, rules: [{ conditions: [{ [q]: "isSet", [r]: m }, { [q]: "parseURL", [r]: m, assign: "url" }], type: b, rules: [{ conditions: n, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { type: b, rules: [{ conditions: o, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: g, properties: j, headers: j }, type: d }] }] }, { conditions: [h, i], type: b, rules: [{ conditions: [k, l], type: b, rules: [{ endpoint: { url: "https://api.pricing-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: j, headers: j }, type: d }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }] }, { conditions: n, type: b, rules: [{ conditions: [k], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://api.pricing-fips.{Region}.{PartitionResult#dnsSuffix}", properties: j, headers: j }, type: d }] }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: c }] }, { conditions: o, type: b, rules: [{ conditions: [l], type: b, rules: [{ endpoint: { url: "https://api.pricing.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: j, headers: j }, type: d }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: c }] }, { endpoint: { url: "https://api.pricing.{Region}.{PartitionResult#dnsSuffix}", properties: j, headers: j }, type: d }] }] };
1
+ const s = "required", t = "fn", u = "argv", v = "ref";
2
+ const a = "isSet", b = "tree", c = "error", d = "endpoint", e = "PartitionResult", f = "getAttr", g = { [s]: false, "type": "String" }, h = { [s]: true, "default": false, "type": "Boolean" }, i = { [v]: "Endpoint" }, j = { [t]: "booleanEquals", [u]: [{ [v]: "UseFIPS" }, true] }, k = { [t]: "booleanEquals", [u]: [{ [v]: "UseDualStack" }, true] }, l = {}, m = { [t]: "booleanEquals", [u]: [true, { [t]: f, [u]: [{ [v]: e }, "supportsFIPS"] }] }, n = { [v]: e }, o = { [t]: "booleanEquals", [u]: [true, { [t]: f, [u]: [n, "supportsDualStack"] }] }, p = [j], q = [k], r = [{ [v]: "Region" }];
3
+ const _data = { version: "1.0", parameters: { Region: g, UseDualStack: h, UseFIPS: h, Endpoint: g }, rules: [{ conditions: [{ [t]: a, [u]: [i] }], type: b, rules: [{ conditions: p, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { type: b, rules: [{ conditions: q, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: i, properties: l, headers: l }, type: d }] }] }, { type: b, rules: [{ conditions: [{ [t]: a, [u]: r }], type: b, rules: [{ conditions: [{ [t]: "aws.partition", [u]: r, assign: e }], type: b, rules: [{ conditions: [j, k], type: b, rules: [{ conditions: [m, o], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://api.pricing-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: l, headers: l }, type: d }] }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }] }, { conditions: p, type: b, rules: [{ conditions: [m], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://api.pricing-fips.{Region}.{PartitionResult#dnsSuffix}", properties: l, headers: l }, type: d }] }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: c }] }, { conditions: q, type: b, rules: [{ conditions: [o], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://api.pricing.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: l, headers: l }, type: d }] }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: c }] }, { type: b, rules: [{ conditions: [{ [t]: "stringEquals", [u]: ["aws", { [t]: f, [u]: [n, "name"] }] }], endpoint: { url: "https://api.pricing.{Region}.amazonaws.com", properties: l, headers: l }, type: d }, { endpoint: { url: "https://api.pricing.{Region}.{PartitionResult#dnsSuffix}", properties: l, headers: l }, type: d }] }] }] }, { error: "Invalid Configuration: Missing Region", type: c }] }] };
4
4
  export const ruleSet = _data;
@@ -1,4 +1,17 @@
1
1
  import { PricingServiceException as __BaseException } from "./PricingServiceException";
2
+ export class AccessDeniedException extends __BaseException {
3
+ constructor(opts) {
4
+ super({
5
+ name: "AccessDeniedException",
6
+ $fault: "client",
7
+ ...opts,
8
+ });
9
+ this.name = "AccessDeniedException";
10
+ this.$fault = "client";
11
+ Object.setPrototypeOf(this, AccessDeniedException.prototype);
12
+ this.Message = opts.Message;
13
+ }
14
+ }
2
15
  export class ExpiredNextTokenException extends __BaseException {
3
16
  constructor(opts) {
4
17
  super({
@@ -86,6 +99,12 @@ export const GetAttributeValuesRequestFilterSensitiveLog = (obj) => ({
86
99
  export const GetAttributeValuesResponseFilterSensitiveLog = (obj) => ({
87
100
  ...obj,
88
101
  });
102
+ export const GetPriceListFileUrlRequestFilterSensitiveLog = (obj) => ({
103
+ ...obj,
104
+ });
105
+ export const GetPriceListFileUrlResponseFilterSensitiveLog = (obj) => ({
106
+ ...obj,
107
+ });
89
108
  export const FilterFilterSensitiveLog = (obj) => ({
90
109
  ...obj,
91
110
  });
@@ -95,3 +114,12 @@ export const GetProductsRequestFilterSensitiveLog = (obj) => ({
95
114
  export const GetProductsResponseFilterSensitiveLog = (obj) => ({
96
115
  ...obj,
97
116
  });
117
+ export const ListPriceListsRequestFilterSensitiveLog = (obj) => ({
118
+ ...obj,
119
+ });
120
+ export const PriceListFilterSensitiveLog = (obj) => ({
121
+ ...obj,
122
+ });
123
+ export const ListPriceListsResponseFilterSensitiveLog = (obj) => ({
124
+ ...obj,
125
+ });
@@ -1,12 +1,8 @@
1
1
  import { DescribeServicesCommand, } from "../commands/DescribeServicesCommand";
2
- import { Pricing } from "../Pricing";
3
2
  import { PricingClient } from "../PricingClient";
4
3
  const makePagedClientRequest = async (client, input, ...args) => {
5
4
  return await client.send(new DescribeServicesCommand(input), ...args);
6
5
  };
7
- const makePagedRequest = async (client, input, ...args) => {
8
- return await client.describeServices(input, ...args);
9
- };
10
6
  export async function* paginateDescribeServices(config, input, ...additionalArguments) {
11
7
  let token = config.startingToken || undefined;
12
8
  let hasNext = true;
@@ -14,10 +10,7 @@ export async function* paginateDescribeServices(config, input, ...additionalArgu
14
10
  while (hasNext) {
15
11
  input.NextToken = token;
16
12
  input["MaxResults"] = config.pageSize;
17
- if (config.client instanceof Pricing) {
18
- page = await makePagedRequest(config.client, input, ...additionalArguments);
19
- }
20
- else if (config.client instanceof PricingClient) {
13
+ if (config.client instanceof PricingClient) {
21
14
  page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
15
  }
23
16
  else {
@@ -1,12 +1,8 @@
1
1
  import { GetAttributeValuesCommand, } from "../commands/GetAttributeValuesCommand";
2
- import { Pricing } from "../Pricing";
3
2
  import { PricingClient } from "../PricingClient";
4
3
  const makePagedClientRequest = async (client, input, ...args) => {
5
4
  return await client.send(new GetAttributeValuesCommand(input), ...args);
6
5
  };
7
- const makePagedRequest = async (client, input, ...args) => {
8
- return await client.getAttributeValues(input, ...args);
9
- };
10
6
  export async function* paginateGetAttributeValues(config, input, ...additionalArguments) {
11
7
  let token = config.startingToken || undefined;
12
8
  let hasNext = true;
@@ -14,10 +10,7 @@ export async function* paginateGetAttributeValues(config, input, ...additionalAr
14
10
  while (hasNext) {
15
11
  input.NextToken = token;
16
12
  input["MaxResults"] = config.pageSize;
17
- if (config.client instanceof Pricing) {
18
- page = await makePagedRequest(config.client, input, ...additionalArguments);
19
- }
20
- else if (config.client instanceof PricingClient) {
13
+ if (config.client instanceof PricingClient) {
21
14
  page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
15
  }
23
16
  else {
@@ -1,12 +1,8 @@
1
1
  import { GetProductsCommand } from "../commands/GetProductsCommand";
2
- import { Pricing } from "../Pricing";
3
2
  import { PricingClient } from "../PricingClient";
4
3
  const makePagedClientRequest = async (client, input, ...args) => {
5
4
  return await client.send(new GetProductsCommand(input), ...args);
6
5
  };
7
- const makePagedRequest = async (client, input, ...args) => {
8
- return await client.getProducts(input, ...args);
9
- };
10
6
  export async function* paginateGetProducts(config, input, ...additionalArguments) {
11
7
  let token = config.startingToken || undefined;
12
8
  let hasNext = true;
@@ -14,10 +10,7 @@ export async function* paginateGetProducts(config, input, ...additionalArguments
14
10
  while (hasNext) {
15
11
  input.NextToken = token;
16
12
  input["MaxResults"] = config.pageSize;
17
- if (config.client instanceof Pricing) {
18
- page = await makePagedRequest(config.client, input, ...additionalArguments);
19
- }
20
- else if (config.client instanceof PricingClient) {
13
+ if (config.client instanceof PricingClient) {
21
14
  page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
15
  }
23
16
  else {
@@ -0,0 +1,25 @@
1
+ import { ListPriceListsCommand, } from "../commands/ListPriceListsCommand";
2
+ import { PricingClient } from "../PricingClient";
3
+ const makePagedClientRequest = async (client, input, ...args) => {
4
+ return await client.send(new ListPriceListsCommand(input), ...args);
5
+ };
6
+ export async function* paginateListPriceLists(config, input, ...additionalArguments) {
7
+ let token = config.startingToken || undefined;
8
+ let hasNext = true;
9
+ let page;
10
+ while (hasNext) {
11
+ input.NextToken = token;
12
+ input["MaxResults"] = config.pageSize;
13
+ if (config.client instanceof PricingClient) {
14
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
+ }
16
+ else {
17
+ throw new Error("Invalid client, expected Pricing | PricingClient");
18
+ }
19
+ yield page;
20
+ const prevToken = token;
21
+ token = page.NextToken;
22
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
+ }
24
+ return undefined;
25
+ }
@@ -2,3 +2,4 @@ export * from "./DescribeServicesPaginator";
2
2
  export * from "./GetAttributeValuesPaginator";
3
3
  export * from "./GetProductsPaginator";
4
4
  export * from "./Interfaces";
5
+ export * from "./ListPriceListsPaginator";
@@ -1,6 +1,6 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
2
  import { decorateServiceException as __decorateServiceException, expectString as __expectString, LazyJsonString as __LazyJsonString, throwDefaultError, } from "@aws-sdk/smithy-client";
3
- import { ExpiredNextTokenException, InternalErrorException, InvalidNextTokenException, InvalidParameterException, NotFoundException, } from "../models/models_0";
3
+ import { AccessDeniedException, ExpiredNextTokenException, InternalErrorException, InvalidNextTokenException, InvalidParameterException, NotFoundException, } from "../models/models_0";
4
4
  import { PricingServiceException as __BaseException } from "../models/PricingServiceException";
5
5
  export const serializeAws_json1_1DescribeServicesCommand = async (input, context) => {
6
6
  const headers = {
@@ -20,6 +20,15 @@ export const serializeAws_json1_1GetAttributeValuesCommand = async (input, conte
20
20
  body = JSON.stringify(serializeAws_json1_1GetAttributeValuesRequest(input, context));
21
21
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
22
  };
23
+ export const serializeAws_json1_1GetPriceListFileUrlCommand = async (input, context) => {
24
+ const headers = {
25
+ "content-type": "application/x-amz-json-1.1",
26
+ "x-amz-target": "AWSPriceListService.GetPriceListFileUrl",
27
+ };
28
+ let body;
29
+ body = JSON.stringify(serializeAws_json1_1GetPriceListFileUrlRequest(input, context));
30
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
+ };
23
32
  export const serializeAws_json1_1GetProductsCommand = async (input, context) => {
24
33
  const headers = {
25
34
  "content-type": "application/x-amz-json-1.1",
@@ -29,6 +38,15 @@ export const serializeAws_json1_1GetProductsCommand = async (input, context) =>
29
38
  body = JSON.stringify(serializeAws_json1_1GetProductsRequest(input, context));
30
39
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
40
  };
41
+ export const serializeAws_json1_1ListPriceListsCommand = async (input, context) => {
42
+ const headers = {
43
+ "content-type": "application/x-amz-json-1.1",
44
+ "x-amz-target": "AWSPriceListService.ListPriceLists",
45
+ };
46
+ let body;
47
+ body = JSON.stringify(serializeAws_json1_1ListPriceListsRequest(input, context));
48
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
+ };
32
50
  export const deserializeAws_json1_1DescribeServicesCommand = async (output, context) => {
33
51
  if (output.statusCode >= 300) {
34
52
  return deserializeAws_json1_1DescribeServicesCommandError(output, context);
@@ -119,6 +137,48 @@ const deserializeAws_json1_1GetAttributeValuesCommandError = async (output, cont
119
137
  });
120
138
  }
121
139
  };
140
+ export const deserializeAws_json1_1GetPriceListFileUrlCommand = async (output, context) => {
141
+ if (output.statusCode >= 300) {
142
+ return deserializeAws_json1_1GetPriceListFileUrlCommandError(output, context);
143
+ }
144
+ const data = await parseBody(output.body, context);
145
+ let contents = {};
146
+ contents = deserializeAws_json1_1GetPriceListFileUrlResponse(data, context);
147
+ const response = {
148
+ $metadata: deserializeMetadata(output),
149
+ ...contents,
150
+ };
151
+ return Promise.resolve(response);
152
+ };
153
+ const deserializeAws_json1_1GetPriceListFileUrlCommandError = async (output, context) => {
154
+ const parsedOutput = {
155
+ ...output,
156
+ body: await parseErrorBody(output.body, context),
157
+ };
158
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
159
+ switch (errorCode) {
160
+ case "AccessDeniedException":
161
+ case "com.amazonaws.pricing#AccessDeniedException":
162
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
163
+ case "InternalErrorException":
164
+ case "com.amazonaws.pricing#InternalErrorException":
165
+ throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context);
166
+ case "InvalidParameterException":
167
+ case "com.amazonaws.pricing#InvalidParameterException":
168
+ throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
169
+ case "NotFoundException":
170
+ case "com.amazonaws.pricing#NotFoundException":
171
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
172
+ default:
173
+ const parsedBody = parsedOutput.body;
174
+ throwDefaultError({
175
+ output,
176
+ parsedBody,
177
+ exceptionCtor: __BaseException,
178
+ errorCode,
179
+ });
180
+ }
181
+ };
122
182
  export const deserializeAws_json1_1GetProductsCommand = async (output, context) => {
123
183
  if (output.statusCode >= 300) {
124
184
  return deserializeAws_json1_1GetProductsCommandError(output, context);
@@ -164,6 +224,63 @@ const deserializeAws_json1_1GetProductsCommandError = async (output, context) =>
164
224
  });
165
225
  }
166
226
  };
227
+ export const deserializeAws_json1_1ListPriceListsCommand = async (output, context) => {
228
+ if (output.statusCode >= 300) {
229
+ return deserializeAws_json1_1ListPriceListsCommandError(output, context);
230
+ }
231
+ const data = await parseBody(output.body, context);
232
+ let contents = {};
233
+ contents = deserializeAws_json1_1ListPriceListsResponse(data, context);
234
+ const response = {
235
+ $metadata: deserializeMetadata(output),
236
+ ...contents,
237
+ };
238
+ return Promise.resolve(response);
239
+ };
240
+ const deserializeAws_json1_1ListPriceListsCommandError = async (output, context) => {
241
+ const parsedOutput = {
242
+ ...output,
243
+ body: await parseErrorBody(output.body, context),
244
+ };
245
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
246
+ switch (errorCode) {
247
+ case "AccessDeniedException":
248
+ case "com.amazonaws.pricing#AccessDeniedException":
249
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
250
+ case "ExpiredNextTokenException":
251
+ case "com.amazonaws.pricing#ExpiredNextTokenException":
252
+ throw await deserializeAws_json1_1ExpiredNextTokenExceptionResponse(parsedOutput, context);
253
+ case "InternalErrorException":
254
+ case "com.amazonaws.pricing#InternalErrorException":
255
+ throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context);
256
+ case "InvalidNextTokenException":
257
+ case "com.amazonaws.pricing#InvalidNextTokenException":
258
+ throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
259
+ case "InvalidParameterException":
260
+ case "com.amazonaws.pricing#InvalidParameterException":
261
+ throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
262
+ case "NotFoundException":
263
+ case "com.amazonaws.pricing#NotFoundException":
264
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
265
+ default:
266
+ const parsedBody = parsedOutput.body;
267
+ throwDefaultError({
268
+ output,
269
+ parsedBody,
270
+ exceptionCtor: __BaseException,
271
+ errorCode,
272
+ });
273
+ }
274
+ };
275
+ const deserializeAws_json1_1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
276
+ const body = parsedOutput.body;
277
+ const deserialized = deserializeAws_json1_1AccessDeniedException(body, context);
278
+ const exception = new AccessDeniedException({
279
+ $metadata: deserializeMetadata(parsedOutput),
280
+ ...deserialized,
281
+ });
282
+ return __decorateServiceException(exception, body);
283
+ };
167
284
  const deserializeAws_json1_1ExpiredNextTokenExceptionResponse = async (parsedOutput, context) => {
168
285
  const body = parsedOutput.body;
169
286
  const deserialized = deserializeAws_json1_1ExpiredNextTokenException(body, context);
@@ -239,6 +356,12 @@ const serializeAws_json1_1GetAttributeValuesRequest = (input, context) => {
239
356
  ...(input.ServiceCode != null && { ServiceCode: input.ServiceCode }),
240
357
  };
241
358
  };
359
+ const serializeAws_json1_1GetPriceListFileUrlRequest = (input, context) => {
360
+ return {
361
+ ...(input.FileFormat != null && { FileFormat: input.FileFormat }),
362
+ ...(input.PriceListArn != null && { PriceListArn: input.PriceListArn }),
363
+ };
364
+ };
242
365
  const serializeAws_json1_1GetProductsRequest = (input, context) => {
243
366
  return {
244
367
  ...(input.Filters != null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }),
@@ -248,6 +371,21 @@ const serializeAws_json1_1GetProductsRequest = (input, context) => {
248
371
  ...(input.ServiceCode != null && { ServiceCode: input.ServiceCode }),
249
372
  };
250
373
  };
374
+ const serializeAws_json1_1ListPriceListsRequest = (input, context) => {
375
+ return {
376
+ ...(input.CurrencyCode != null && { CurrencyCode: input.CurrencyCode }),
377
+ ...(input.EffectiveDate != null && { EffectiveDate: Math.round(input.EffectiveDate.getTime() / 1000) }),
378
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
379
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
380
+ ...(input.RegionCode != null && { RegionCode: input.RegionCode }),
381
+ ...(input.ServiceCode != null && { ServiceCode: input.ServiceCode }),
382
+ };
383
+ };
384
+ const deserializeAws_json1_1AccessDeniedException = (output, context) => {
385
+ return {
386
+ Message: __expectString(output.Message),
387
+ };
388
+ };
251
389
  const deserializeAws_json1_1AttributeNameList = (output, context) => {
252
390
  const retVal = (output || [])
253
391
  .filter((e) => e != null)
@@ -287,6 +425,17 @@ const deserializeAws_json1_1ExpiredNextTokenException = (output, context) => {
287
425
  Message: __expectString(output.Message),
288
426
  };
289
427
  };
428
+ const deserializeAws_json1_1FileFormats = (output, context) => {
429
+ const retVal = (output || [])
430
+ .filter((e) => e != null)
431
+ .map((entry) => {
432
+ if (entry === null) {
433
+ return null;
434
+ }
435
+ return __expectString(entry);
436
+ });
437
+ return retVal;
438
+ };
290
439
  const deserializeAws_json1_1GetAttributeValuesResponse = (output, context) => {
291
440
  return {
292
441
  AttributeValues: output.AttributeValues != null
@@ -295,6 +444,11 @@ const deserializeAws_json1_1GetAttributeValuesResponse = (output, context) => {
295
444
  NextToken: __expectString(output.NextToken),
296
445
  };
297
446
  };
447
+ const deserializeAws_json1_1GetPriceListFileUrlResponse = (output, context) => {
448
+ return {
449
+ Url: __expectString(output.Url),
450
+ };
451
+ };
298
452
  const deserializeAws_json1_1GetProductsResponse = (output, context) => {
299
453
  return {
300
454
  FormatVersion: __expectString(output.FormatVersion),
@@ -317,11 +471,25 @@ const deserializeAws_json1_1InvalidParameterException = (output, context) => {
317
471
  Message: __expectString(output.Message),
318
472
  };
319
473
  };
474
+ const deserializeAws_json1_1ListPriceListsResponse = (output, context) => {
475
+ return {
476
+ NextToken: __expectString(output.NextToken),
477
+ PriceLists: output.PriceLists != null ? deserializeAws_json1_1PriceLists(output.PriceLists, context) : undefined,
478
+ };
479
+ };
320
480
  const deserializeAws_json1_1NotFoundException = (output, context) => {
321
481
  return {
322
482
  Message: __expectString(output.Message),
323
483
  };
324
484
  };
485
+ const deserializeAws_json1_1PriceList = (output, context) => {
486
+ return {
487
+ CurrencyCode: __expectString(output.CurrencyCode),
488
+ FileFormats: output.FileFormats != null ? deserializeAws_json1_1FileFormats(output.FileFormats, context) : undefined,
489
+ PriceListArn: __expectString(output.PriceListArn),
490
+ RegionCode: __expectString(output.RegionCode),
491
+ };
492
+ };
325
493
  const deserializeAws_json1_1PriceListJsonItems = (output, context) => {
326
494
  const retVal = (output || [])
327
495
  .filter((e) => e != null)
@@ -333,6 +501,17 @@ const deserializeAws_json1_1PriceListJsonItems = (output, context) => {
333
501
  });
334
502
  return retVal;
335
503
  };
504
+ const deserializeAws_json1_1PriceLists = (output, context) => {
505
+ const retVal = (output || [])
506
+ .filter((e) => e != null)
507
+ .map((entry) => {
508
+ if (entry === null) {
509
+ return null;
510
+ }
511
+ return deserializeAws_json1_1PriceList(entry, context);
512
+ });
513
+ return retVal;
514
+ };
336
515
  const deserializeAws_json1_1Service = (output, context) => {
337
516
  return {
338
517
  AttributeNames: output.AttributeNames != null
@@ -1,7 +1,9 @@
1
1
  import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
2
2
  import { DescribeServicesCommandInput, DescribeServicesCommandOutput } from "./commands/DescribeServicesCommand";
3
3
  import { GetAttributeValuesCommandInput, GetAttributeValuesCommandOutput } from "./commands/GetAttributeValuesCommand";
4
+ import { GetPriceListFileUrlCommandInput, GetPriceListFileUrlCommandOutput } from "./commands/GetPriceListFileUrlCommand";
4
5
  import { GetProductsCommandInput, GetProductsCommandOutput } from "./commands/GetProductsCommand";
6
+ import { ListPriceListsCommandInput, ListPriceListsCommandOutput } from "./commands/ListPriceListsCommand";
5
7
  import { PricingClient } from "./PricingClient";
6
8
  /**
7
9
  * <p>Amazon Web Services Price List API is a centralized and convenient way to
@@ -51,10 +53,42 @@ export declare class Pricing extends PricingClient {
51
53
  getAttributeValues(args: GetAttributeValuesCommandInput, options?: __HttpHandlerOptions): Promise<GetAttributeValuesCommandOutput>;
52
54
  getAttributeValues(args: GetAttributeValuesCommandInput, cb: (err: any, data?: GetAttributeValuesCommandOutput) => void): void;
53
55
  getAttributeValues(args: GetAttributeValuesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetAttributeValuesCommandOutput) => void): void;
56
+ /**
57
+ * <p>
58
+ * <i>
59
+ * <b>This feature is in preview release and is subject to change. Your use of Amazon Web Services Price List API is subject to the Beta Service Participation terms of the <a href="https://aws.amazon.com/service-terms/">Amazon Web Services Service Terms</a> (Section 1.10).</b>
60
+ * </i>
61
+ * </p>
62
+ * <p>This returns the URL that you can retrieve your Price List file from. This URL is based on
63
+ * the <code>PriceListArn</code> and <code>FileFormat</code> that you retrieve from the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html">
64
+ * <code>ListPriceLists</code>
65
+ * </a> response. </p>
66
+ */
67
+ getPriceListFileUrl(args: GetPriceListFileUrlCommandInput, options?: __HttpHandlerOptions): Promise<GetPriceListFileUrlCommandOutput>;
68
+ getPriceListFileUrl(args: GetPriceListFileUrlCommandInput, cb: (err: any, data?: GetPriceListFileUrlCommandOutput) => void): void;
69
+ getPriceListFileUrl(args: GetPriceListFileUrlCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetPriceListFileUrlCommandOutput) => void): void;
54
70
  /**
55
71
  * <p>Returns a list of all products that match the filter criteria.</p>
56
72
  */
57
73
  getProducts(args: GetProductsCommandInput, options?: __HttpHandlerOptions): Promise<GetProductsCommandOutput>;
58
74
  getProducts(args: GetProductsCommandInput, cb: (err: any, data?: GetProductsCommandOutput) => void): void;
59
75
  getProducts(args: GetProductsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetProductsCommandOutput) => void): void;
76
+ /**
77
+ * <p>
78
+ * <i>
79
+ * <b>This feature is in preview release and is subject to change. Your use of Amazon Web Services Price List API is subject to the Beta Service Participation terms of the <a href="https://aws.amazon.com/service-terms/">Amazon Web Services Service Terms</a> (Section 1.10).</b>
80
+ * </i>
81
+ * </p>
82
+ * <p>This returns a list of Price List references that the requester if authorized to view, given a <code>ServiceCode</code>, <code>CurrencyCode</code>, and an <code>EffectiveDate</code>.
83
+ * Use without a <code>RegionCode</code> filter to list Price List references from all
84
+ * available Amazon Web Services Regions. Use with a <code>RegionCode</code> filter to get the
85
+ * Price List reference that's specific to a specific Amazon Web Services Region. You can use
86
+ * the <code>PriceListArn</code> from the response to get your preferred Price List files
87
+ * through the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_GetPriceListFileUrl.html">
88
+ * <code>GetPriceListFileUrl</code>
89
+ * </a> API.</p>
90
+ */
91
+ listPriceLists(args: ListPriceListsCommandInput, options?: __HttpHandlerOptions): Promise<ListPriceListsCommandOutput>;
92
+ listPriceLists(args: ListPriceListsCommandInput, cb: (err: any, data?: ListPriceListsCommandOutput) => void): void;
93
+ listPriceLists(args: ListPriceListsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListPriceListsCommandOutput) => void): void;
60
94
  }
@@ -9,10 +9,12 @@ import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration
9
9
  import { BodyLengthCalculator as __BodyLengthCalculator, ChecksumConstructor as __ChecksumConstructor, Credentials as __Credentials, 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 "@aws-sdk/types";
10
10
  import { DescribeServicesCommandInput, DescribeServicesCommandOutput } from "./commands/DescribeServicesCommand";
11
11
  import { GetAttributeValuesCommandInput, GetAttributeValuesCommandOutput } from "./commands/GetAttributeValuesCommand";
12
+ import { GetPriceListFileUrlCommandInput, GetPriceListFileUrlCommandOutput } from "./commands/GetPriceListFileUrlCommand";
12
13
  import { GetProductsCommandInput, GetProductsCommandOutput } from "./commands/GetProductsCommand";
14
+ import { ListPriceListsCommandInput, ListPriceListsCommandOutput } from "./commands/ListPriceListsCommand";
13
15
  import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, EndpointParameters } from "./endpoint/EndpointParameters";
14
- export declare type ServiceInputTypes = DescribeServicesCommandInput | GetAttributeValuesCommandInput | GetProductsCommandInput;
15
- export declare type ServiceOutputTypes = DescribeServicesCommandOutput | GetAttributeValuesCommandOutput | GetProductsCommandOutput;
16
+ export declare type ServiceInputTypes = DescribeServicesCommandInput | GetAttributeValuesCommandInput | GetPriceListFileUrlCommandInput | GetProductsCommandInput | ListPriceListsCommandInput;
17
+ export declare type ServiceOutputTypes = DescribeServicesCommandOutput | GetAttributeValuesCommandOutput | GetPriceListFileUrlCommandOutput | GetProductsCommandOutput | ListPriceListsCommandOutput;
16
18
  export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
17
19
  /**
18
20
  * The HTTP handler to use. Fetch in browser and Https in Nodejs.