@aws-sdk/client-pricing 3.34.0 → 3.37.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 (142) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/{dist/cjs → dist-cjs}/Pricing.js +1 -28
  3. package/dist-cjs/PricingClient.js +35 -0
  4. package/{dist/cjs → dist-cjs}/commands/DescribeServicesCommand.js +2 -33
  5. package/{dist/cjs → dist-cjs}/commands/GetAttributeValuesCommand.js +2 -30
  6. package/{dist/cjs → dist-cjs}/commands/GetProductsCommand.js +2 -27
  7. package/{dist/cjs → dist-cjs}/endpoints.js +1 -2
  8. package/{dist/cjs → dist-cjs}/index.js +0 -1
  9. package/{dist/cjs → dist-cjs}/models/index.js +0 -1
  10. package/{dist/cjs → dist-cjs}/models/models_0.js +0 -43
  11. package/{dist/cjs → dist-cjs}/pagination/DescribeServicesPaginator.js +1 -12
  12. package/{dist/cjs → dist-cjs}/pagination/GetAttributeValuesPaginator.js +1 -12
  13. package/{dist/cjs → dist-cjs}/pagination/GetProductsPaginator.js +1 -12
  14. package/{dist/cjs → dist-cjs}/pagination/Interfaces.js +0 -1
  15. package/{dist/cjs → dist-cjs}/protocols/Aws_json1_1.js +0 -6
  16. package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +1 -5
  17. package/{dist/cjs → dist-cjs}/runtimeConfig.js +1 -5
  18. package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -4
  19. package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -5
  20. package/{dist/es → dist-es}/Pricing.js +1 -2
  21. package/{dist/es → dist-es}/PricingClient.js +1 -2
  22. package/{dist/es → dist-es}/commands/DescribeServicesCommand.js +2 -3
  23. package/{dist/es → dist-es}/commands/GetAttributeValuesCommand.js +2 -3
  24. package/{dist/es → dist-es}/commands/GetProductsCommand.js +2 -3
  25. package/{dist/es → dist-es}/endpoints.js +1 -2
  26. package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
  27. package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
  28. package/{dist/es → dist-es}/models/models_0.js +0 -1
  29. package/{dist/es → dist-es}/pagination/DescribeServicesPaginator.js +1 -2
  30. package/{dist/es → dist-es}/pagination/GetAttributeValuesPaginator.js +1 -2
  31. package/{dist/es → dist-es}/pagination/GetProductsPaginator.js +1 -2
  32. package/dist-es/pagination/Interfaces.js +1 -0
  33. package/{dist/es → dist-es}/protocols/Aws_json1_1.js +1 -2
  34. package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -2
  35. package/{dist/es → dist-es}/runtimeConfig.js +1 -2
  36. package/{dist/es → dist-es}/runtimeConfig.native.js +0 -1
  37. package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -2
  38. package/{dist/types → dist-types}/Pricing.d.ts +2 -2
  39. package/{dist/types → dist-types}/PricingClient.d.ts +4 -4
  40. package/{dist/types → dist-types}/commands/DescribeServicesCommand.d.ts +3 -3
  41. package/{dist/types → dist-types}/commands/GetAttributeValuesCommand.d.ts +3 -3
  42. package/{dist/types → dist-types}/commands/GetProductsCommand.d.ts +3 -3
  43. package/{dist/types → dist-types}/endpoints.d.ts +0 -0
  44. package/{index.ts → dist-types/index.d.ts} +0 -0
  45. package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
  46. package/{dist/types → dist-types}/models/models_0.d.ts +0 -0
  47. package/{dist/types → dist-types}/pagination/DescribeServicesPaginator.d.ts +1 -1
  48. package/{dist/types → dist-types}/pagination/GetAttributeValuesPaginator.d.ts +1 -1
  49. package/{dist/types → dist-types}/pagination/GetProductsPaginator.d.ts +1 -1
  50. package/{dist/types → dist-types}/pagination/Interfaces.d.ts +1 -1
  51. package/{dist/types → dist-types}/protocols/Aws_json1_1.d.ts +2 -2
  52. package/{dist/types → dist-types}/runtimeConfig.browser.d.ts +0 -0
  53. package/{dist/types → dist-types}/runtimeConfig.d.ts +1 -1
  54. package/{dist/types → dist-types}/runtimeConfig.native.d.ts +0 -0
  55. package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
  56. package/dist-types/ts3.4/Pricing.d.ts +20 -0
  57. package/dist-types/ts3.4/PricingClient.d.ts +70 -0
  58. package/dist-types/ts3.4/commands/DescribeServicesCommand.d.ts +17 -0
  59. package/dist-types/ts3.4/commands/GetAttributeValuesCommand.d.ts +17 -0
  60. package/dist-types/ts3.4/commands/GetProductsCommand.d.ts +17 -0
  61. package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
  62. package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
  63. package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
  64. package/dist-types/ts3.4/models/models_0.d.ts +166 -0
  65. package/{dist/types → dist-types}/ts3.4/pagination/DescribeServicesPaginator.d.ts +1 -1
  66. package/{dist/types → dist-types}/ts3.4/pagination/GetAttributeValuesPaginator.d.ts +1 -1
  67. package/{dist/types → dist-types}/ts3.4/pagination/GetProductsPaginator.d.ts +1 -1
  68. package/{dist/types → dist-types}/ts3.4/pagination/Interfaces.d.ts +1 -1
  69. package/{dist/types → dist-types}/ts3.4/protocols/Aws_json1_1.d.ts +2 -2
  70. package/{dist/types → dist-types}/ts3.4/runtimeConfig.browser.d.ts +1 -3
  71. package/{dist/types → dist-types}/ts3.4/runtimeConfig.d.ts +2 -4
  72. package/{dist/types → dist-types}/ts3.4/runtimeConfig.native.d.ts +1 -3
  73. package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +1 -3
  74. package/package.json +45 -42
  75. package/Pricing.ts +0 -140
  76. package/PricingClient.ts +0 -264
  77. package/commands/DescribeServicesCommand.ts +0 -100
  78. package/commands/GetAttributeValuesCommand.ts +0 -97
  79. package/commands/GetProductsCommand.ts +0 -94
  80. package/dist/cjs/Pricing.js.map +0 -1
  81. package/dist/cjs/PricingClient.js +0 -67
  82. package/dist/cjs/PricingClient.js.map +0 -1
  83. package/dist/cjs/commands/DescribeServicesCommand.js.map +0 -1
  84. package/dist/cjs/commands/GetAttributeValuesCommand.js.map +0 -1
  85. package/dist/cjs/commands/GetProductsCommand.js.map +0 -1
  86. package/dist/cjs/endpoints.js.map +0 -1
  87. package/dist/cjs/index.js.map +0 -1
  88. package/dist/cjs/models/index.js.map +0 -1
  89. package/dist/cjs/models/models_0.js.map +0 -1
  90. package/dist/cjs/package.json +0 -91
  91. package/dist/cjs/pagination/DescribeServicesPaginator.js.map +0 -1
  92. package/dist/cjs/pagination/GetAttributeValuesPaginator.js.map +0 -1
  93. package/dist/cjs/pagination/GetProductsPaginator.js.map +0 -1
  94. package/dist/cjs/pagination/Interfaces.js.map +0 -1
  95. package/dist/cjs/protocols/Aws_json1_1.js.map +0 -1
  96. package/dist/cjs/runtimeConfig.browser.js.map +0 -1
  97. package/dist/cjs/runtimeConfig.js.map +0 -1
  98. package/dist/cjs/runtimeConfig.native.js.map +0 -1
  99. package/dist/cjs/runtimeConfig.shared.js.map +0 -1
  100. package/dist/es/Pricing.js.map +0 -1
  101. package/dist/es/PricingClient.js.map +0 -1
  102. package/dist/es/commands/DescribeServicesCommand.js.map +0 -1
  103. package/dist/es/commands/GetAttributeValuesCommand.js.map +0 -1
  104. package/dist/es/commands/GetProductsCommand.js.map +0 -1
  105. package/dist/es/endpoints.js.map +0 -1
  106. package/dist/es/index.js +0 -11
  107. package/dist/es/index.js.map +0 -1
  108. package/dist/es/models/index.js +0 -2
  109. package/dist/es/models/index.js.map +0 -1
  110. package/dist/es/models/models_0.js.map +0 -1
  111. package/dist/es/package.json +0 -91
  112. package/dist/es/pagination/DescribeServicesPaginator.js.map +0 -1
  113. package/dist/es/pagination/GetAttributeValuesPaginator.js.map +0 -1
  114. package/dist/es/pagination/GetProductsPaginator.js.map +0 -1
  115. package/dist/es/pagination/Interfaces.js +0 -2
  116. package/dist/es/pagination/Interfaces.js.map +0 -1
  117. package/dist/es/protocols/Aws_json1_1.js.map +0 -1
  118. package/dist/es/runtimeConfig.browser.js.map +0 -1
  119. package/dist/es/runtimeConfig.js.map +0 -1
  120. package/dist/es/runtimeConfig.native.js.map +0 -1
  121. package/dist/es/runtimeConfig.shared.js.map +0 -1
  122. package/dist/types/ts3.4/Pricing.d.ts +0 -60
  123. package/dist/types/ts3.4/PricingClient.d.ts +0 -158
  124. package/dist/types/ts3.4/commands/DescribeServicesCommand.d.ts +0 -41
  125. package/dist/types/ts3.4/commands/GetAttributeValuesCommand.d.ts +0 -38
  126. package/dist/types/ts3.4/commands/GetProductsCommand.d.ts +0 -35
  127. package/dist/types/ts3.4/models/models_0.d.ts +0 -290
  128. package/endpoints.ts +0 -57
  129. package/jest.config.js +0 -4
  130. package/models/models_0.ts +0 -365
  131. package/pagination/DescribeServicesPaginator.ts +0 -58
  132. package/pagination/GetAttributeValuesPaginator.ts +0 -58
  133. package/pagination/GetProductsPaginator.ts +0 -54
  134. package/pagination/Interfaces.ts +0 -7
  135. package/protocols/Aws_json1_1.ts +0 -674
  136. package/runtimeConfig.browser.ts +0 -40
  137. package/runtimeConfig.native.ts +0 -16
  138. package/runtimeConfig.shared.ts +0 -16
  139. package/runtimeConfig.ts +0 -45
  140. package/tsconfig.es.json +0 -10
  141. package/tsconfig.json +0 -31
  142. package/tsconfig.types.json +0 -8
@@ -1,365 +0,0 @@
1
- import { LazyJsonString as __LazyJsonString } from "@aws-sdk/smithy-client";
2
- import { MetadataBearer as $MetadataBearer, SmithyException as __SmithyException } from "@aws-sdk/types";
3
-
4
- /**
5
- * <p>The values of a given attribute, such as <code>Throughput Optimized HDD</code> or <code>Provisioned
6
- * IOPS</code> for the <code>Amazon EC2</code>
7
- * <code>volumeType</code> attribute.</p>
8
- */
9
- export interface AttributeValue {
10
- /**
11
- * <p>The specific value of an <code>attributeName</code>.</p>
12
- */
13
- Value?: string;
14
- }
15
-
16
- export namespace AttributeValue {
17
- /**
18
- * @internal
19
- */
20
- export const filterSensitiveLog = (obj: AttributeValue): any => ({
21
- ...obj,
22
- });
23
- }
24
-
25
- export interface DescribeServicesRequest {
26
- /**
27
- * <p>The code for the service whose information you want to retrieve, such as <code>AmazonEC2</code>.
28
- * You can use
29
- * the <code>ServiceCode</code> to filter the results in a <code>GetProducts</code> call.
30
- * To retrieve a list of all services, leave this blank.</p>
31
- */
32
- ServiceCode?: string;
33
-
34
- /**
35
- * <p>The format version that you want the response to be in.</p>
36
- * <p>Valid values are: <code>aws_v1</code>
37
- * </p>
38
- */
39
- FormatVersion?: string;
40
-
41
- /**
42
- * <p>The pagination token that indicates the next set of results that you want to retrieve.</p>
43
- */
44
- NextToken?: string;
45
-
46
- /**
47
- * <p>The maximum number of results that you want returned in the response.</p>
48
- */
49
- MaxResults?: number;
50
- }
51
-
52
- export namespace DescribeServicesRequest {
53
- /**
54
- * @internal
55
- */
56
- export const filterSensitiveLog = (obj: DescribeServicesRequest): any => ({
57
- ...obj,
58
- });
59
- }
60
-
61
- /**
62
- * <p>The metadata for a service, such as the service code and available attribute names.</p>
63
- */
64
- export interface Service {
65
- /**
66
- * <p>The code for the Amazon Web Services service.</p>
67
- */
68
- ServiceCode?: string;
69
-
70
- /**
71
- * <p>The attributes that are available for this service.</p>
72
- */
73
- AttributeNames?: string[];
74
- }
75
-
76
- export namespace Service {
77
- /**
78
- * @internal
79
- */
80
- export const filterSensitiveLog = (obj: Service): any => ({
81
- ...obj,
82
- });
83
- }
84
-
85
- export interface DescribeServicesResponse {
86
- /**
87
- * <p>The service metadata for the service or services in the response.</p>
88
- */
89
- Services?: Service[];
90
-
91
- /**
92
- * <p>The format version of the response. For example, <code>aws_v1</code>.</p>
93
- */
94
- FormatVersion?: string;
95
-
96
- /**
97
- * <p>The pagination token for the next set of retreivable results.</p>
98
- */
99
- NextToken?: string;
100
- }
101
-
102
- export namespace DescribeServicesResponse {
103
- /**
104
- * @internal
105
- */
106
- export const filterSensitiveLog = (obj: DescribeServicesResponse): any => ({
107
- ...obj,
108
- });
109
- }
110
-
111
- /**
112
- * <p>The pagination token expired. Try again without a pagination token.</p>
113
- */
114
- export interface ExpiredNextTokenException extends __SmithyException, $MetadataBearer {
115
- name: "ExpiredNextTokenException";
116
- $fault: "client";
117
- Message?: string;
118
- }
119
-
120
- export namespace ExpiredNextTokenException {
121
- /**
122
- * @internal
123
- */
124
- export const filterSensitiveLog = (obj: ExpiredNextTokenException): any => ({
125
- ...obj,
126
- });
127
- }
128
-
129
- /**
130
- * <p>An error on the server occurred during the processing of your request. Try again later.</p>
131
- */
132
- export interface InternalErrorException extends __SmithyException, $MetadataBearer {
133
- name: "InternalErrorException";
134
- $fault: "server";
135
- Message?: string;
136
- }
137
-
138
- export namespace InternalErrorException {
139
- /**
140
- * @internal
141
- */
142
- export const filterSensitiveLog = (obj: InternalErrorException): any => ({
143
- ...obj,
144
- });
145
- }
146
-
147
- /**
148
- * <p>The pagination token is invalid. Try again without a pagination token.</p>
149
- */
150
- export interface InvalidNextTokenException extends __SmithyException, $MetadataBearer {
151
- name: "InvalidNextTokenException";
152
- $fault: "client";
153
- Message?: string;
154
- }
155
-
156
- export namespace InvalidNextTokenException {
157
- /**
158
- * @internal
159
- */
160
- export const filterSensitiveLog = (obj: InvalidNextTokenException): any => ({
161
- ...obj,
162
- });
163
- }
164
-
165
- /**
166
- * <p>One or more parameters had an invalid value.</p>
167
- */
168
- export interface InvalidParameterException extends __SmithyException, $MetadataBearer {
169
- name: "InvalidParameterException";
170
- $fault: "client";
171
- Message?: string;
172
- }
173
-
174
- export namespace InvalidParameterException {
175
- /**
176
- * @internal
177
- */
178
- export const filterSensitiveLog = (obj: InvalidParameterException): any => ({
179
- ...obj,
180
- });
181
- }
182
-
183
- /**
184
- * <p>The requested resource can't be found.</p>
185
- */
186
- export interface NotFoundException extends __SmithyException, $MetadataBearer {
187
- name: "NotFoundException";
188
- $fault: "client";
189
- Message?: string;
190
- }
191
-
192
- export namespace NotFoundException {
193
- /**
194
- * @internal
195
- */
196
- export const filterSensitiveLog = (obj: NotFoundException): any => ({
197
- ...obj,
198
- });
199
- }
200
-
201
- export interface GetAttributeValuesRequest {
202
- /**
203
- * <p>The service code for the service whose attributes you want to retrieve. For example, if you want
204
- * the retrieve an EC2 attribute, use <code>AmazonEC2</code>.</p>
205
- */
206
- ServiceCode: string | undefined;
207
-
208
- /**
209
- * <p>The name of the attribute that you want to retrieve the values for, such as <code>volumeType</code>.</p>
210
- */
211
- AttributeName: string | undefined;
212
-
213
- /**
214
- * <p>The pagination token that indicates the next set of results that you want to retrieve.</p>
215
- */
216
- NextToken?: string;
217
-
218
- /**
219
- * <p>The maximum number of results to return in response.</p>
220
- */
221
- MaxResults?: number;
222
- }
223
-
224
- export namespace GetAttributeValuesRequest {
225
- /**
226
- * @internal
227
- */
228
- export const filterSensitiveLog = (obj: GetAttributeValuesRequest): any => ({
229
- ...obj,
230
- });
231
- }
232
-
233
- export interface GetAttributeValuesResponse {
234
- /**
235
- * <p>The list of values for an attribute. For example, <code>Throughput Optimized HDD</code> and
236
- * <code>Provisioned IOPS</code> are two available values for the <code>AmazonEC2</code>
237
- * <code>volumeType</code>.</p>
238
- */
239
- AttributeValues?: AttributeValue[];
240
-
241
- /**
242
- * <p>The pagination token that indicates the next set of results to retrieve.</p>
243
- */
244
- NextToken?: string;
245
- }
246
-
247
- export namespace GetAttributeValuesResponse {
248
- /**
249
- * @internal
250
- */
251
- export const filterSensitiveLog = (obj: GetAttributeValuesResponse): any => ({
252
- ...obj,
253
- });
254
- }
255
-
256
- export enum FilterType {
257
- TERM_MATCH = "TERM_MATCH",
258
- }
259
-
260
- /**
261
- * <p>The constraints that you want all returned products to match.</p>
262
- */
263
- export interface Filter {
264
- /**
265
- * <p>The type of filter that you want to use.</p>
266
- * <p>Valid values are: <code>TERM_MATCH</code>. <code>TERM_MATCH</code> returns only
267
- * products that match both the given filter field and the given value.</p>
268
- */
269
- Type: FilterType | string | undefined;
270
-
271
- /**
272
- * <p>The product metadata field that you want to filter on. You can filter by just the
273
- * service code to see all products for a specific service, filter
274
- * by just the attribute name to see a specific attribute for multiple services, or use both a service code
275
- * and an attribute name to retrieve only products that match both fields.</p>
276
- * <p>Valid values include: <code>ServiceCode</code>, and all attribute names</p>
277
- *
278
- * <p>For example, you can filter by the <code>AmazonEC2</code> service code and the
279
- * <code>volumeType</code> attribute name to get the prices for only Amazon EC2 volumes.</p>
280
- */
281
- Field: string | undefined;
282
-
283
- /**
284
- * <p>The service code or attribute value that you want to filter by. If you are filtering by
285
- * service code this is the actual service code, such as <code>AmazonEC2</code>. If you are
286
- * filtering by attribute name, this is the attribute value that you want the returned products
287
- * to match, such as a <code>Provisioned IOPS</code> volume.</p>
288
- */
289
- Value: string | undefined;
290
- }
291
-
292
- export namespace Filter {
293
- /**
294
- * @internal
295
- */
296
- export const filterSensitiveLog = (obj: Filter): any => ({
297
- ...obj,
298
- });
299
- }
300
-
301
- export interface GetProductsRequest {
302
- /**
303
- * <p>The code for the service whose products you want to retrieve. </p>
304
- */
305
- ServiceCode?: string;
306
-
307
- /**
308
- * <p>The list of filters that limit the returned products. only products that match all filters
309
- * are returned.</p>
310
- */
311
- Filters?: Filter[];
312
-
313
- /**
314
- * <p>The format version that you want the response to be in.</p>
315
- * <p>Valid values are: <code>aws_v1</code>
316
- * </p>
317
- */
318
- FormatVersion?: string;
319
-
320
- /**
321
- * <p>The pagination token that indicates the next set of results that you want to retrieve.</p>
322
- */
323
- NextToken?: string;
324
-
325
- /**
326
- * <p>The maximum number of results to return in the response.</p>
327
- */
328
- MaxResults?: number;
329
- }
330
-
331
- export namespace GetProductsRequest {
332
- /**
333
- * @internal
334
- */
335
- export const filterSensitiveLog = (obj: GetProductsRequest): any => ({
336
- ...obj,
337
- });
338
- }
339
-
340
- export interface GetProductsResponse {
341
- /**
342
- * <p>The format version of the response. For example, aws_v1.</p>
343
- */
344
- FormatVersion?: string;
345
-
346
- /**
347
- * <p>The list of products that match your filters. The list contains both the product metadata and
348
- * the price information.</p>
349
- */
350
- PriceList?: (__LazyJsonString | string)[];
351
-
352
- /**
353
- * <p>The pagination token that indicates the next set of results to retrieve.</p>
354
- */
355
- NextToken?: string;
356
- }
357
-
358
- export namespace GetProductsResponse {
359
- /**
360
- * @internal
361
- */
362
- export const filterSensitiveLog = (obj: GetProductsResponse): any => ({
363
- ...obj,
364
- });
365
- }
@@ -1,58 +0,0 @@
1
- import { Pricing } from "../Pricing";
2
- import { PricingClient } from "../PricingClient";
3
- import {
4
- DescribeServicesCommand,
5
- DescribeServicesCommandInput,
6
- DescribeServicesCommandOutput,
7
- } from "../commands/DescribeServicesCommand";
8
- import { PricingPaginationConfiguration } from "./Interfaces";
9
- import { Paginator } from "@aws-sdk/types";
10
-
11
- /**
12
- * @private
13
- */
14
- const makePagedClientRequest = async (
15
- client: PricingClient,
16
- input: DescribeServicesCommandInput,
17
- ...args: any
18
- ): Promise<DescribeServicesCommandOutput> => {
19
- // @ts-ignore
20
- return await client.send(new DescribeServicesCommand(input), ...args);
21
- };
22
- /**
23
- * @private
24
- */
25
- const makePagedRequest = async (
26
- client: Pricing,
27
- input: DescribeServicesCommandInput,
28
- ...args: any
29
- ): Promise<DescribeServicesCommandOutput> => {
30
- // @ts-ignore
31
- return await client.describeServices(input, ...args);
32
- };
33
- export async function* paginateDescribeServices(
34
- config: PricingPaginationConfiguration,
35
- input: DescribeServicesCommandInput,
36
- ...additionalArguments: any
37
- ): Paginator<DescribeServicesCommandOutput> {
38
- // ToDo: replace with actual type instead of typeof input.NextToken
39
- let token: typeof input.NextToken | undefined = config.startingToken || undefined;
40
- let hasNext = true;
41
- let page: DescribeServicesCommandOutput;
42
- while (hasNext) {
43
- input.NextToken = token;
44
- input["MaxResults"] = config.pageSize;
45
- if (config.client instanceof Pricing) {
46
- page = await makePagedRequest(config.client, input, ...additionalArguments);
47
- } else if (config.client instanceof PricingClient) {
48
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
49
- } else {
50
- throw new Error("Invalid client, expected Pricing | PricingClient");
51
- }
52
- yield page;
53
- token = page.NextToken;
54
- hasNext = !!token;
55
- }
56
- // @ts-ignore
57
- return undefined;
58
- }
@@ -1,58 +0,0 @@
1
- import { Pricing } from "../Pricing";
2
- import { PricingClient } from "../PricingClient";
3
- import {
4
- GetAttributeValuesCommand,
5
- GetAttributeValuesCommandInput,
6
- GetAttributeValuesCommandOutput,
7
- } from "../commands/GetAttributeValuesCommand";
8
- import { PricingPaginationConfiguration } from "./Interfaces";
9
- import { Paginator } from "@aws-sdk/types";
10
-
11
- /**
12
- * @private
13
- */
14
- const makePagedClientRequest = async (
15
- client: PricingClient,
16
- input: GetAttributeValuesCommandInput,
17
- ...args: any
18
- ): Promise<GetAttributeValuesCommandOutput> => {
19
- // @ts-ignore
20
- return await client.send(new GetAttributeValuesCommand(input), ...args);
21
- };
22
- /**
23
- * @private
24
- */
25
- const makePagedRequest = async (
26
- client: Pricing,
27
- input: GetAttributeValuesCommandInput,
28
- ...args: any
29
- ): Promise<GetAttributeValuesCommandOutput> => {
30
- // @ts-ignore
31
- return await client.getAttributeValues(input, ...args);
32
- };
33
- export async function* paginateGetAttributeValues(
34
- config: PricingPaginationConfiguration,
35
- input: GetAttributeValuesCommandInput,
36
- ...additionalArguments: any
37
- ): Paginator<GetAttributeValuesCommandOutput> {
38
- // ToDo: replace with actual type instead of typeof input.NextToken
39
- let token: typeof input.NextToken | undefined = config.startingToken || undefined;
40
- let hasNext = true;
41
- let page: GetAttributeValuesCommandOutput;
42
- while (hasNext) {
43
- input.NextToken = token;
44
- input["MaxResults"] = config.pageSize;
45
- if (config.client instanceof Pricing) {
46
- page = await makePagedRequest(config.client, input, ...additionalArguments);
47
- } else if (config.client instanceof PricingClient) {
48
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
49
- } else {
50
- throw new Error("Invalid client, expected Pricing | PricingClient");
51
- }
52
- yield page;
53
- token = page.NextToken;
54
- hasNext = !!token;
55
- }
56
- // @ts-ignore
57
- return undefined;
58
- }
@@ -1,54 +0,0 @@
1
- import { Pricing } from "../Pricing";
2
- import { PricingClient } from "../PricingClient";
3
- import { GetProductsCommand, GetProductsCommandInput, GetProductsCommandOutput } from "../commands/GetProductsCommand";
4
- import { PricingPaginationConfiguration } from "./Interfaces";
5
- import { Paginator } from "@aws-sdk/types";
6
-
7
- /**
8
- * @private
9
- */
10
- const makePagedClientRequest = async (
11
- client: PricingClient,
12
- input: GetProductsCommandInput,
13
- ...args: any
14
- ): Promise<GetProductsCommandOutput> => {
15
- // @ts-ignore
16
- return await client.send(new GetProductsCommand(input), ...args);
17
- };
18
- /**
19
- * @private
20
- */
21
- const makePagedRequest = async (
22
- client: Pricing,
23
- input: GetProductsCommandInput,
24
- ...args: any
25
- ): Promise<GetProductsCommandOutput> => {
26
- // @ts-ignore
27
- return await client.getProducts(input, ...args);
28
- };
29
- export async function* paginateGetProducts(
30
- config: PricingPaginationConfiguration,
31
- input: GetProductsCommandInput,
32
- ...additionalArguments: any
33
- ): Paginator<GetProductsCommandOutput> {
34
- // ToDo: replace with actual type instead of typeof input.NextToken
35
- let token: typeof input.NextToken | undefined = config.startingToken || undefined;
36
- let hasNext = true;
37
- let page: GetProductsCommandOutput;
38
- while (hasNext) {
39
- input.NextToken = token;
40
- input["MaxResults"] = config.pageSize;
41
- if (config.client instanceof Pricing) {
42
- page = await makePagedRequest(config.client, input, ...additionalArguments);
43
- } else if (config.client instanceof PricingClient) {
44
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
45
- } else {
46
- throw new Error("Invalid client, expected Pricing | PricingClient");
47
- }
48
- yield page;
49
- token = page.NextToken;
50
- hasNext = !!token;
51
- }
52
- // @ts-ignore
53
- return undefined;
54
- }
@@ -1,7 +0,0 @@
1
- import { Pricing } from "../Pricing";
2
- import { PricingClient } from "../PricingClient";
3
- import { PaginationConfiguration } from "@aws-sdk/types";
4
-
5
- export interface PricingPaginationConfiguration extends PaginationConfiguration {
6
- client: Pricing | PricingClient;
7
- }