@aws-sdk/client-pricing 3.312.0 → 3.315.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.
@@ -8,28 +8,28 @@ const PricingServiceException_1 = require("../models/PricingServiceException");
8
8
  const se_DescribeServicesCommand = async (input, context) => {
9
9
  const headers = sharedHeaders("DescribeServices");
10
10
  let body;
11
- body = JSON.stringify(se_DescribeServicesRequest(input, context));
11
+ body = JSON.stringify((0, smithy_client_1._json)(input));
12
12
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
13
  };
14
14
  exports.se_DescribeServicesCommand = se_DescribeServicesCommand;
15
15
  const se_GetAttributeValuesCommand = async (input, context) => {
16
16
  const headers = sharedHeaders("GetAttributeValues");
17
17
  let body;
18
- body = JSON.stringify(se_GetAttributeValuesRequest(input, context));
18
+ body = JSON.stringify((0, smithy_client_1._json)(input));
19
19
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
20
20
  };
21
21
  exports.se_GetAttributeValuesCommand = se_GetAttributeValuesCommand;
22
22
  const se_GetPriceListFileUrlCommand = async (input, context) => {
23
23
  const headers = sharedHeaders("GetPriceListFileUrl");
24
24
  let body;
25
- body = JSON.stringify(se_GetPriceListFileUrlRequest(input, context));
25
+ body = JSON.stringify((0, smithy_client_1._json)(input));
26
26
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
27
27
  };
28
28
  exports.se_GetPriceListFileUrlCommand = se_GetPriceListFileUrlCommand;
29
29
  const se_GetProductsCommand = async (input, context) => {
30
30
  const headers = sharedHeaders("GetProducts");
31
31
  let body;
32
- body = JSON.stringify(se_GetProductsRequest(input, context));
32
+ body = JSON.stringify((0, smithy_client_1._json)(input));
33
33
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
34
34
  };
35
35
  exports.se_GetProductsCommand = se_GetProductsCommand;
@@ -46,12 +46,12 @@ const de_DescribeServicesCommand = async (output, context) => {
46
46
  }
47
47
  const data = await parseBody(output.body, context);
48
48
  let contents = {};
49
- contents = de_DescribeServicesResponse(data, context);
49
+ contents = (0, smithy_client_1._json)(data);
50
50
  const response = {
51
51
  $metadata: deserializeMetadata(output),
52
52
  ...contents,
53
53
  };
54
- return Promise.resolve(response);
54
+ return response;
55
55
  };
56
56
  exports.de_DescribeServicesCommand = de_DescribeServicesCommand;
57
57
  const de_DescribeServicesCommandError = async (output, context) => {
@@ -78,10 +78,9 @@ const de_DescribeServicesCommandError = async (output, context) => {
78
78
  throw await de_NotFoundExceptionRes(parsedOutput, context);
79
79
  default:
80
80
  const parsedBody = parsedOutput.body;
81
- (0, smithy_client_1.throwDefaultError)({
81
+ return throwDefaultError({
82
82
  output,
83
83
  parsedBody,
84
- exceptionCtor: PricingServiceException_1.PricingServiceException,
85
84
  errorCode,
86
85
  });
87
86
  }
@@ -92,12 +91,12 @@ const de_GetAttributeValuesCommand = async (output, context) => {
92
91
  }
93
92
  const data = await parseBody(output.body, context);
94
93
  let contents = {};
95
- contents = de_GetAttributeValuesResponse(data, context);
94
+ contents = (0, smithy_client_1._json)(data);
96
95
  const response = {
97
96
  $metadata: deserializeMetadata(output),
98
97
  ...contents,
99
98
  };
100
- return Promise.resolve(response);
99
+ return response;
101
100
  };
102
101
  exports.de_GetAttributeValuesCommand = de_GetAttributeValuesCommand;
103
102
  const de_GetAttributeValuesCommandError = async (output, context) => {
@@ -124,10 +123,9 @@ const de_GetAttributeValuesCommandError = async (output, context) => {
124
123
  throw await de_NotFoundExceptionRes(parsedOutput, context);
125
124
  default:
126
125
  const parsedBody = parsedOutput.body;
127
- (0, smithy_client_1.throwDefaultError)({
126
+ return throwDefaultError({
128
127
  output,
129
128
  parsedBody,
130
- exceptionCtor: PricingServiceException_1.PricingServiceException,
131
129
  errorCode,
132
130
  });
133
131
  }
@@ -138,12 +136,12 @@ const de_GetPriceListFileUrlCommand = async (output, context) => {
138
136
  }
139
137
  const data = await parseBody(output.body, context);
140
138
  let contents = {};
141
- contents = de_GetPriceListFileUrlResponse(data, context);
139
+ contents = (0, smithy_client_1._json)(data);
142
140
  const response = {
143
141
  $metadata: deserializeMetadata(output),
144
142
  ...contents,
145
143
  };
146
- return Promise.resolve(response);
144
+ return response;
147
145
  };
148
146
  exports.de_GetPriceListFileUrlCommand = de_GetPriceListFileUrlCommand;
149
147
  const de_GetPriceListFileUrlCommandError = async (output, context) => {
@@ -167,10 +165,9 @@ const de_GetPriceListFileUrlCommandError = async (output, context) => {
167
165
  throw await de_NotFoundExceptionRes(parsedOutput, context);
168
166
  default:
169
167
  const parsedBody = parsedOutput.body;
170
- (0, smithy_client_1.throwDefaultError)({
168
+ return throwDefaultError({
171
169
  output,
172
170
  parsedBody,
173
- exceptionCtor: PricingServiceException_1.PricingServiceException,
174
171
  errorCode,
175
172
  });
176
173
  }
@@ -186,7 +183,7 @@ const de_GetProductsCommand = async (output, context) => {
186
183
  $metadata: deserializeMetadata(output),
187
184
  ...contents,
188
185
  };
189
- return Promise.resolve(response);
186
+ return response;
190
187
  };
191
188
  exports.de_GetProductsCommand = de_GetProductsCommand;
192
189
  const de_GetProductsCommandError = async (output, context) => {
@@ -213,10 +210,9 @@ const de_GetProductsCommandError = async (output, context) => {
213
210
  throw await de_NotFoundExceptionRes(parsedOutput, context);
214
211
  default:
215
212
  const parsedBody = parsedOutput.body;
216
- (0, smithy_client_1.throwDefaultError)({
213
+ return throwDefaultError({
217
214
  output,
218
215
  parsedBody,
219
- exceptionCtor: PricingServiceException_1.PricingServiceException,
220
216
  errorCode,
221
217
  });
222
218
  }
@@ -227,12 +223,12 @@ const de_ListPriceListsCommand = async (output, context) => {
227
223
  }
228
224
  const data = await parseBody(output.body, context);
229
225
  let contents = {};
230
- contents = de_ListPriceListsResponse(data, context);
226
+ contents = (0, smithy_client_1._json)(data);
231
227
  const response = {
232
228
  $metadata: deserializeMetadata(output),
233
229
  ...contents,
234
230
  };
235
- return Promise.resolve(response);
231
+ return response;
236
232
  };
237
233
  exports.de_ListPriceListsCommand = de_ListPriceListsCommand;
238
234
  const de_ListPriceListsCommandError = async (output, context) => {
@@ -262,17 +258,16 @@ const de_ListPriceListsCommandError = async (output, context) => {
262
258
  throw await de_NotFoundExceptionRes(parsedOutput, context);
263
259
  default:
264
260
  const parsedBody = parsedOutput.body;
265
- (0, smithy_client_1.throwDefaultError)({
261
+ return throwDefaultError({
266
262
  output,
267
263
  parsedBody,
268
- exceptionCtor: PricingServiceException_1.PricingServiceException,
269
264
  errorCode,
270
265
  });
271
266
  }
272
267
  };
273
268
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
274
269
  const body = parsedOutput.body;
275
- const deserialized = de_AccessDeniedException(body, context);
270
+ const deserialized = (0, smithy_client_1._json)(body);
276
271
  const exception = new models_0_1.AccessDeniedException({
277
272
  $metadata: deserializeMetadata(parsedOutput),
278
273
  ...deserialized,
@@ -281,7 +276,7 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
281
276
  };
282
277
  const de_ExpiredNextTokenExceptionRes = async (parsedOutput, context) => {
283
278
  const body = parsedOutput.body;
284
- const deserialized = de_ExpiredNextTokenException(body, context);
279
+ const deserialized = (0, smithy_client_1._json)(body);
285
280
  const exception = new models_0_1.ExpiredNextTokenException({
286
281
  $metadata: deserializeMetadata(parsedOutput),
287
282
  ...deserialized,
@@ -290,7 +285,7 @@ const de_ExpiredNextTokenExceptionRes = async (parsedOutput, context) => {
290
285
  };
291
286
  const de_InternalErrorExceptionRes = async (parsedOutput, context) => {
292
287
  const body = parsedOutput.body;
293
- const deserialized = de_InternalErrorException(body, context);
288
+ const deserialized = (0, smithy_client_1._json)(body);
294
289
  const exception = new models_0_1.InternalErrorException({
295
290
  $metadata: deserializeMetadata(parsedOutput),
296
291
  ...deserialized,
@@ -299,7 +294,7 @@ const de_InternalErrorExceptionRes = async (parsedOutput, context) => {
299
294
  };
300
295
  const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
301
296
  const body = parsedOutput.body;
302
- const deserialized = de_InvalidNextTokenException(body, context);
297
+ const deserialized = (0, smithy_client_1._json)(body);
303
298
  const exception = new models_0_1.InvalidNextTokenException({
304
299
  $metadata: deserializeMetadata(parsedOutput),
305
300
  ...deserialized,
@@ -308,7 +303,7 @@ const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
308
303
  };
309
304
  const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
310
305
  const body = parsedOutput.body;
311
- const deserialized = de_InvalidParameterException(body, context);
306
+ const deserialized = (0, smithy_client_1._json)(body);
312
307
  const exception = new models_0_1.InvalidParameterException({
313
308
  $metadata: deserializeMetadata(parsedOutput),
314
309
  ...deserialized,
@@ -317,214 +312,38 @@ const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
317
312
  };
318
313
  const de_NotFoundExceptionRes = async (parsedOutput, context) => {
319
314
  const body = parsedOutput.body;
320
- const deserialized = de_NotFoundException(body, context);
315
+ const deserialized = (0, smithy_client_1._json)(body);
321
316
  const exception = new models_0_1.NotFoundException({
322
317
  $metadata: deserializeMetadata(parsedOutput),
323
318
  ...deserialized,
324
319
  });
325
320
  return (0, smithy_client_1.decorateServiceException)(exception, body);
326
321
  };
327
- const se_DescribeServicesRequest = (input, context) => {
328
- return {
329
- ...(input.FormatVersion != null && { FormatVersion: input.FormatVersion }),
330
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
331
- ...(input.NextToken != null && { NextToken: input.NextToken }),
332
- ...(input.ServiceCode != null && { ServiceCode: input.ServiceCode }),
333
- };
334
- };
335
- const se_Filter = (input, context) => {
336
- return {
337
- ...(input.Field != null && { Field: input.Field }),
338
- ...(input.Type != null && { Type: input.Type }),
339
- ...(input.Value != null && { Value: input.Value }),
340
- };
341
- };
342
- const se_Filters = (input, context) => {
343
- return input
344
- .filter((e) => e != null)
345
- .map((entry) => {
346
- return se_Filter(entry, context);
347
- });
348
- };
349
- const se_GetAttributeValuesRequest = (input, context) => {
350
- return {
351
- ...(input.AttributeName != null && { AttributeName: input.AttributeName }),
352
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
353
- ...(input.NextToken != null && { NextToken: input.NextToken }),
354
- ...(input.ServiceCode != null && { ServiceCode: input.ServiceCode }),
355
- };
356
- };
357
- const se_GetPriceListFileUrlRequest = (input, context) => {
358
- return {
359
- ...(input.FileFormat != null && { FileFormat: input.FileFormat }),
360
- ...(input.PriceListArn != null && { PriceListArn: input.PriceListArn }),
361
- };
362
- };
363
- const se_GetProductsRequest = (input, context) => {
364
- return {
365
- ...(input.Filters != null && { Filters: se_Filters(input.Filters, context) }),
366
- ...(input.FormatVersion != null && { FormatVersion: input.FormatVersion }),
367
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
368
- ...(input.NextToken != null && { NextToken: input.NextToken }),
369
- ...(input.ServiceCode != null && { ServiceCode: input.ServiceCode }),
370
- };
371
- };
372
322
  const se_ListPriceListsRequest = (input, context) => {
373
- return {
374
- ...(input.CurrencyCode != null && { CurrencyCode: input.CurrencyCode }),
375
- ...(input.EffectiveDate != null && { EffectiveDate: Math.round(input.EffectiveDate.getTime() / 1000) }),
376
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
377
- ...(input.NextToken != null && { NextToken: input.NextToken }),
378
- ...(input.RegionCode != null && { RegionCode: input.RegionCode }),
379
- ...(input.ServiceCode != null && { ServiceCode: input.ServiceCode }),
380
- };
381
- };
382
- const de_AccessDeniedException = (output, context) => {
383
- return {
384
- Message: (0, smithy_client_1.expectString)(output.Message),
385
- };
386
- };
387
- const de_AttributeNameList = (output, context) => {
388
- const retVal = (output || [])
389
- .filter((e) => e != null)
390
- .map((entry) => {
391
- if (entry === null) {
392
- return null;
393
- }
394
- return (0, smithy_client_1.expectString)(entry);
395
- });
396
- return retVal;
397
- };
398
- const de_AttributeValue = (output, context) => {
399
- return {
400
- Value: (0, smithy_client_1.expectString)(output.Value),
401
- };
402
- };
403
- const de_AttributeValueList = (output, context) => {
404
- const retVal = (output || [])
405
- .filter((e) => e != null)
406
- .map((entry) => {
407
- if (entry === null) {
408
- return null;
409
- }
410
- return de_AttributeValue(entry, context);
411
- });
412
- return retVal;
413
- };
414
- const de_DescribeServicesResponse = (output, context) => {
415
- return {
416
- FormatVersion: (0, smithy_client_1.expectString)(output.FormatVersion),
417
- NextToken: (0, smithy_client_1.expectString)(output.NextToken),
418
- Services: output.Services != null ? de_ServiceList(output.Services, context) : undefined,
419
- };
420
- };
421
- const de_ExpiredNextTokenException = (output, context) => {
422
- return {
423
- Message: (0, smithy_client_1.expectString)(output.Message),
424
- };
425
- };
426
- const de_FileFormats = (output, context) => {
427
- const retVal = (output || [])
428
- .filter((e) => e != null)
429
- .map((entry) => {
430
- if (entry === null) {
431
- return null;
432
- }
433
- return (0, smithy_client_1.expectString)(entry);
323
+ return (0, smithy_client_1.take)(input, {
324
+ CurrencyCode: [],
325
+ EffectiveDate: (_) => Math.round(_.getTime() / 1000),
326
+ MaxResults: [],
327
+ NextToken: [],
328
+ RegionCode: [],
329
+ ServiceCode: [],
434
330
  });
435
- return retVal;
436
- };
437
- const de_GetAttributeValuesResponse = (output, context) => {
438
- return {
439
- AttributeValues: output.AttributeValues != null ? de_AttributeValueList(output.AttributeValues, context) : undefined,
440
- NextToken: (0, smithy_client_1.expectString)(output.NextToken),
441
- };
442
- };
443
- const de_GetPriceListFileUrlResponse = (output, context) => {
444
- return {
445
- Url: (0, smithy_client_1.expectString)(output.Url),
446
- };
447
331
  };
448
332
  const de_GetProductsResponse = (output, context) => {
449
- return {
450
- FormatVersion: (0, smithy_client_1.expectString)(output.FormatVersion),
451
- NextToken: (0, smithy_client_1.expectString)(output.NextToken),
452
- PriceList: output.PriceList != null ? de_PriceListJsonItems(output.PriceList, context) : undefined,
453
- };
454
- };
455
- const de_InternalErrorException = (output, context) => {
456
- return {
457
- Message: (0, smithy_client_1.expectString)(output.Message),
458
- };
459
- };
460
- const de_InvalidNextTokenException = (output, context) => {
461
- return {
462
- Message: (0, smithy_client_1.expectString)(output.Message),
463
- };
464
- };
465
- const de_InvalidParameterException = (output, context) => {
466
- return {
467
- Message: (0, smithy_client_1.expectString)(output.Message),
468
- };
469
- };
470
- const de_ListPriceListsResponse = (output, context) => {
471
- return {
472
- NextToken: (0, smithy_client_1.expectString)(output.NextToken),
473
- PriceLists: output.PriceLists != null ? de_PriceLists(output.PriceLists, context) : undefined,
474
- };
475
- };
476
- const de_NotFoundException = (output, context) => {
477
- return {
478
- Message: (0, smithy_client_1.expectString)(output.Message),
479
- };
480
- };
481
- const de_PriceList = (output, context) => {
482
- return {
483
- CurrencyCode: (0, smithy_client_1.expectString)(output.CurrencyCode),
484
- FileFormats: output.FileFormats != null ? de_FileFormats(output.FileFormats, context) : undefined,
485
- PriceListArn: (0, smithy_client_1.expectString)(output.PriceListArn),
486
- RegionCode: (0, smithy_client_1.expectString)(output.RegionCode),
487
- };
333
+ return (0, smithy_client_1.take)(output, {
334
+ FormatVersion: smithy_client_1.expectString,
335
+ NextToken: smithy_client_1.expectString,
336
+ PriceList: (_) => de_PriceListJsonItems(_, context),
337
+ });
488
338
  };
489
339
  const de_PriceListJsonItems = (output, context) => {
490
340
  const retVal = (output || [])
491
341
  .filter((e) => e != null)
492
342
  .map((entry) => {
493
- if (entry === null) {
494
- return null;
495
- }
496
343
  return new smithy_client_1.LazyJsonString(entry);
497
344
  });
498
345
  return retVal;
499
346
  };
500
- const de_PriceLists = (output, context) => {
501
- const retVal = (output || [])
502
- .filter((e) => e != null)
503
- .map((entry) => {
504
- if (entry === null) {
505
- return null;
506
- }
507
- return de_PriceList(entry, context);
508
- });
509
- return retVal;
510
- };
511
- const de_Service = (output, context) => {
512
- return {
513
- AttributeNames: output.AttributeNames != null ? de_AttributeNameList(output.AttributeNames, context) : undefined,
514
- ServiceCode: (0, smithy_client_1.expectString)(output.ServiceCode),
515
- };
516
- };
517
- const de_ServiceList = (output, context) => {
518
- const retVal = (output || [])
519
- .filter((e) => e != null)
520
- .map((entry) => {
521
- if (entry === null) {
522
- return null;
523
- }
524
- return de_Service(entry, context);
525
- });
526
- return retVal;
527
- };
528
347
  const deserializeMetadata = (output) => ({
529
348
  httpStatusCode: output.statusCode,
530
349
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -538,6 +357,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
538
357
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
539
358
  };
540
359
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
360
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(PricingServiceException_1.PricingServiceException);
541
361
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
542
362
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
543
363
  const contents = {
@@ -1,29 +1,29 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectString as __expectString, LazyJsonString as __LazyJsonString, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectString as __expectString, LazyJsonString as __LazyJsonString, take, withBaseException, } from "@aws-sdk/smithy-client";
3
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 se_DescribeServicesCommand = async (input, context) => {
6
6
  const headers = sharedHeaders("DescribeServices");
7
7
  let body;
8
- body = JSON.stringify(se_DescribeServicesRequest(input, context));
8
+ body = JSON.stringify(_json(input));
9
9
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
10
10
  };
11
11
  export const se_GetAttributeValuesCommand = async (input, context) => {
12
12
  const headers = sharedHeaders("GetAttributeValues");
13
13
  let body;
14
- body = JSON.stringify(se_GetAttributeValuesRequest(input, context));
14
+ body = JSON.stringify(_json(input));
15
15
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
16
16
  };
17
17
  export const se_GetPriceListFileUrlCommand = async (input, context) => {
18
18
  const headers = sharedHeaders("GetPriceListFileUrl");
19
19
  let body;
20
- body = JSON.stringify(se_GetPriceListFileUrlRequest(input, context));
20
+ body = JSON.stringify(_json(input));
21
21
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
22
  };
23
23
  export const se_GetProductsCommand = async (input, context) => {
24
24
  const headers = sharedHeaders("GetProducts");
25
25
  let body;
26
- body = JSON.stringify(se_GetProductsRequest(input, context));
26
+ body = JSON.stringify(_json(input));
27
27
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
28
28
  };
29
29
  export const se_ListPriceListsCommand = async (input, context) => {
@@ -38,12 +38,12 @@ export const de_DescribeServicesCommand = async (output, context) => {
38
38
  }
39
39
  const data = await parseBody(output.body, context);
40
40
  let contents = {};
41
- contents = de_DescribeServicesResponse(data, context);
41
+ contents = _json(data);
42
42
  const response = {
43
43
  $metadata: deserializeMetadata(output),
44
44
  ...contents,
45
45
  };
46
- return Promise.resolve(response);
46
+ return response;
47
47
  };
48
48
  const de_DescribeServicesCommandError = async (output, context) => {
49
49
  const parsedOutput = {
@@ -69,10 +69,9 @@ const de_DescribeServicesCommandError = async (output, context) => {
69
69
  throw await de_NotFoundExceptionRes(parsedOutput, context);
70
70
  default:
71
71
  const parsedBody = parsedOutput.body;
72
- throwDefaultError({
72
+ return throwDefaultError({
73
73
  output,
74
74
  parsedBody,
75
- exceptionCtor: __BaseException,
76
75
  errorCode,
77
76
  });
78
77
  }
@@ -83,12 +82,12 @@ export const de_GetAttributeValuesCommand = async (output, context) => {
83
82
  }
84
83
  const data = await parseBody(output.body, context);
85
84
  let contents = {};
86
- contents = de_GetAttributeValuesResponse(data, context);
85
+ contents = _json(data);
87
86
  const response = {
88
87
  $metadata: deserializeMetadata(output),
89
88
  ...contents,
90
89
  };
91
- return Promise.resolve(response);
90
+ return response;
92
91
  };
93
92
  const de_GetAttributeValuesCommandError = async (output, context) => {
94
93
  const parsedOutput = {
@@ -114,10 +113,9 @@ const de_GetAttributeValuesCommandError = async (output, context) => {
114
113
  throw await de_NotFoundExceptionRes(parsedOutput, context);
115
114
  default:
116
115
  const parsedBody = parsedOutput.body;
117
- throwDefaultError({
116
+ return throwDefaultError({
118
117
  output,
119
118
  parsedBody,
120
- exceptionCtor: __BaseException,
121
119
  errorCode,
122
120
  });
123
121
  }
@@ -128,12 +126,12 @@ export const de_GetPriceListFileUrlCommand = async (output, context) => {
128
126
  }
129
127
  const data = await parseBody(output.body, context);
130
128
  let contents = {};
131
- contents = de_GetPriceListFileUrlResponse(data, context);
129
+ contents = _json(data);
132
130
  const response = {
133
131
  $metadata: deserializeMetadata(output),
134
132
  ...contents,
135
133
  };
136
- return Promise.resolve(response);
134
+ return response;
137
135
  };
138
136
  const de_GetPriceListFileUrlCommandError = async (output, context) => {
139
137
  const parsedOutput = {
@@ -156,10 +154,9 @@ const de_GetPriceListFileUrlCommandError = async (output, context) => {
156
154
  throw await de_NotFoundExceptionRes(parsedOutput, context);
157
155
  default:
158
156
  const parsedBody = parsedOutput.body;
159
- throwDefaultError({
157
+ return throwDefaultError({
160
158
  output,
161
159
  parsedBody,
162
- exceptionCtor: __BaseException,
163
160
  errorCode,
164
161
  });
165
162
  }
@@ -175,7 +172,7 @@ export const de_GetProductsCommand = async (output, context) => {
175
172
  $metadata: deserializeMetadata(output),
176
173
  ...contents,
177
174
  };
178
- return Promise.resolve(response);
175
+ return response;
179
176
  };
180
177
  const de_GetProductsCommandError = async (output, context) => {
181
178
  const parsedOutput = {
@@ -201,10 +198,9 @@ const de_GetProductsCommandError = async (output, context) => {
201
198
  throw await de_NotFoundExceptionRes(parsedOutput, context);
202
199
  default:
203
200
  const parsedBody = parsedOutput.body;
204
- throwDefaultError({
201
+ return throwDefaultError({
205
202
  output,
206
203
  parsedBody,
207
- exceptionCtor: __BaseException,
208
204
  errorCode,
209
205
  });
210
206
  }
@@ -215,12 +211,12 @@ export const de_ListPriceListsCommand = async (output, context) => {
215
211
  }
216
212
  const data = await parseBody(output.body, context);
217
213
  let contents = {};
218
- contents = de_ListPriceListsResponse(data, context);
214
+ contents = _json(data);
219
215
  const response = {
220
216
  $metadata: deserializeMetadata(output),
221
217
  ...contents,
222
218
  };
223
- return Promise.resolve(response);
219
+ return response;
224
220
  };
225
221
  const de_ListPriceListsCommandError = async (output, context) => {
226
222
  const parsedOutput = {
@@ -249,17 +245,16 @@ const de_ListPriceListsCommandError = async (output, context) => {
249
245
  throw await de_NotFoundExceptionRes(parsedOutput, context);
250
246
  default:
251
247
  const parsedBody = parsedOutput.body;
252
- throwDefaultError({
248
+ return throwDefaultError({
253
249
  output,
254
250
  parsedBody,
255
- exceptionCtor: __BaseException,
256
251
  errorCode,
257
252
  });
258
253
  }
259
254
  };
260
255
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
261
256
  const body = parsedOutput.body;
262
- const deserialized = de_AccessDeniedException(body, context);
257
+ const deserialized = _json(body);
263
258
  const exception = new AccessDeniedException({
264
259
  $metadata: deserializeMetadata(parsedOutput),
265
260
  ...deserialized,
@@ -268,7 +263,7 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
268
263
  };
269
264
  const de_ExpiredNextTokenExceptionRes = async (parsedOutput, context) => {
270
265
  const body = parsedOutput.body;
271
- const deserialized = de_ExpiredNextTokenException(body, context);
266
+ const deserialized = _json(body);
272
267
  const exception = new ExpiredNextTokenException({
273
268
  $metadata: deserializeMetadata(parsedOutput),
274
269
  ...deserialized,
@@ -277,7 +272,7 @@ const de_ExpiredNextTokenExceptionRes = async (parsedOutput, context) => {
277
272
  };
278
273
  const de_InternalErrorExceptionRes = async (parsedOutput, context) => {
279
274
  const body = parsedOutput.body;
280
- const deserialized = de_InternalErrorException(body, context);
275
+ const deserialized = _json(body);
281
276
  const exception = new InternalErrorException({
282
277
  $metadata: deserializeMetadata(parsedOutput),
283
278
  ...deserialized,
@@ -286,7 +281,7 @@ const de_InternalErrorExceptionRes = async (parsedOutput, context) => {
286
281
  };
287
282
  const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
288
283
  const body = parsedOutput.body;
289
- const deserialized = de_InvalidNextTokenException(body, context);
284
+ const deserialized = _json(body);
290
285
  const exception = new InvalidNextTokenException({
291
286
  $metadata: deserializeMetadata(parsedOutput),
292
287
  ...deserialized,
@@ -295,7 +290,7 @@ const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
295
290
  };
296
291
  const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
297
292
  const body = parsedOutput.body;
298
- const deserialized = de_InvalidParameterException(body, context);
293
+ const deserialized = _json(body);
299
294
  const exception = new InvalidParameterException({
300
295
  $metadata: deserializeMetadata(parsedOutput),
301
296
  ...deserialized,
@@ -304,214 +299,38 @@ const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
304
299
  };
305
300
  const de_NotFoundExceptionRes = async (parsedOutput, context) => {
306
301
  const body = parsedOutput.body;
307
- const deserialized = de_NotFoundException(body, context);
302
+ const deserialized = _json(body);
308
303
  const exception = new NotFoundException({
309
304
  $metadata: deserializeMetadata(parsedOutput),
310
305
  ...deserialized,
311
306
  });
312
307
  return __decorateServiceException(exception, body);
313
308
  };
314
- const se_DescribeServicesRequest = (input, context) => {
315
- return {
316
- ...(input.FormatVersion != null && { FormatVersion: input.FormatVersion }),
317
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
318
- ...(input.NextToken != null && { NextToken: input.NextToken }),
319
- ...(input.ServiceCode != null && { ServiceCode: input.ServiceCode }),
320
- };
321
- };
322
- const se_Filter = (input, context) => {
323
- return {
324
- ...(input.Field != null && { Field: input.Field }),
325
- ...(input.Type != null && { Type: input.Type }),
326
- ...(input.Value != null && { Value: input.Value }),
327
- };
328
- };
329
- const se_Filters = (input, context) => {
330
- return input
331
- .filter((e) => e != null)
332
- .map((entry) => {
333
- return se_Filter(entry, context);
334
- });
335
- };
336
- const se_GetAttributeValuesRequest = (input, context) => {
337
- return {
338
- ...(input.AttributeName != null && { AttributeName: input.AttributeName }),
339
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
340
- ...(input.NextToken != null && { NextToken: input.NextToken }),
341
- ...(input.ServiceCode != null && { ServiceCode: input.ServiceCode }),
342
- };
343
- };
344
- const se_GetPriceListFileUrlRequest = (input, context) => {
345
- return {
346
- ...(input.FileFormat != null && { FileFormat: input.FileFormat }),
347
- ...(input.PriceListArn != null && { PriceListArn: input.PriceListArn }),
348
- };
349
- };
350
- const se_GetProductsRequest = (input, context) => {
351
- return {
352
- ...(input.Filters != null && { Filters: se_Filters(input.Filters, context) }),
353
- ...(input.FormatVersion != null && { FormatVersion: input.FormatVersion }),
354
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
355
- ...(input.NextToken != null && { NextToken: input.NextToken }),
356
- ...(input.ServiceCode != null && { ServiceCode: input.ServiceCode }),
357
- };
358
- };
359
309
  const se_ListPriceListsRequest = (input, context) => {
360
- return {
361
- ...(input.CurrencyCode != null && { CurrencyCode: input.CurrencyCode }),
362
- ...(input.EffectiveDate != null && { EffectiveDate: Math.round(input.EffectiveDate.getTime() / 1000) }),
363
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
364
- ...(input.NextToken != null && { NextToken: input.NextToken }),
365
- ...(input.RegionCode != null && { RegionCode: input.RegionCode }),
366
- ...(input.ServiceCode != null && { ServiceCode: input.ServiceCode }),
367
- };
368
- };
369
- const de_AccessDeniedException = (output, context) => {
370
- return {
371
- Message: __expectString(output.Message),
372
- };
373
- };
374
- const de_AttributeNameList = (output, context) => {
375
- const retVal = (output || [])
376
- .filter((e) => e != null)
377
- .map((entry) => {
378
- if (entry === null) {
379
- return null;
380
- }
381
- return __expectString(entry);
382
- });
383
- return retVal;
384
- };
385
- const de_AttributeValue = (output, context) => {
386
- return {
387
- Value: __expectString(output.Value),
388
- };
389
- };
390
- const de_AttributeValueList = (output, context) => {
391
- const retVal = (output || [])
392
- .filter((e) => e != null)
393
- .map((entry) => {
394
- if (entry === null) {
395
- return null;
396
- }
397
- return de_AttributeValue(entry, context);
398
- });
399
- return retVal;
400
- };
401
- const de_DescribeServicesResponse = (output, context) => {
402
- return {
403
- FormatVersion: __expectString(output.FormatVersion),
404
- NextToken: __expectString(output.NextToken),
405
- Services: output.Services != null ? de_ServiceList(output.Services, context) : undefined,
406
- };
407
- };
408
- const de_ExpiredNextTokenException = (output, context) => {
409
- return {
410
- Message: __expectString(output.Message),
411
- };
412
- };
413
- const de_FileFormats = (output, context) => {
414
- const retVal = (output || [])
415
- .filter((e) => e != null)
416
- .map((entry) => {
417
- if (entry === null) {
418
- return null;
419
- }
420
- return __expectString(entry);
310
+ return take(input, {
311
+ CurrencyCode: [],
312
+ EffectiveDate: (_) => Math.round(_.getTime() / 1000),
313
+ MaxResults: [],
314
+ NextToken: [],
315
+ RegionCode: [],
316
+ ServiceCode: [],
421
317
  });
422
- return retVal;
423
- };
424
- const de_GetAttributeValuesResponse = (output, context) => {
425
- return {
426
- AttributeValues: output.AttributeValues != null ? de_AttributeValueList(output.AttributeValues, context) : undefined,
427
- NextToken: __expectString(output.NextToken),
428
- };
429
- };
430
- const de_GetPriceListFileUrlResponse = (output, context) => {
431
- return {
432
- Url: __expectString(output.Url),
433
- };
434
318
  };
435
319
  const de_GetProductsResponse = (output, context) => {
436
- return {
437
- FormatVersion: __expectString(output.FormatVersion),
438
- NextToken: __expectString(output.NextToken),
439
- PriceList: output.PriceList != null ? de_PriceListJsonItems(output.PriceList, context) : undefined,
440
- };
441
- };
442
- const de_InternalErrorException = (output, context) => {
443
- return {
444
- Message: __expectString(output.Message),
445
- };
446
- };
447
- const de_InvalidNextTokenException = (output, context) => {
448
- return {
449
- Message: __expectString(output.Message),
450
- };
451
- };
452
- const de_InvalidParameterException = (output, context) => {
453
- return {
454
- Message: __expectString(output.Message),
455
- };
456
- };
457
- const de_ListPriceListsResponse = (output, context) => {
458
- return {
459
- NextToken: __expectString(output.NextToken),
460
- PriceLists: output.PriceLists != null ? de_PriceLists(output.PriceLists, context) : undefined,
461
- };
462
- };
463
- const de_NotFoundException = (output, context) => {
464
- return {
465
- Message: __expectString(output.Message),
466
- };
467
- };
468
- const de_PriceList = (output, context) => {
469
- return {
470
- CurrencyCode: __expectString(output.CurrencyCode),
471
- FileFormats: output.FileFormats != null ? de_FileFormats(output.FileFormats, context) : undefined,
472
- PriceListArn: __expectString(output.PriceListArn),
473
- RegionCode: __expectString(output.RegionCode),
474
- };
320
+ return take(output, {
321
+ FormatVersion: __expectString,
322
+ NextToken: __expectString,
323
+ PriceList: (_) => de_PriceListJsonItems(_, context),
324
+ });
475
325
  };
476
326
  const de_PriceListJsonItems = (output, context) => {
477
327
  const retVal = (output || [])
478
328
  .filter((e) => e != null)
479
329
  .map((entry) => {
480
- if (entry === null) {
481
- return null;
482
- }
483
330
  return new __LazyJsonString(entry);
484
331
  });
485
332
  return retVal;
486
333
  };
487
- const de_PriceLists = (output, context) => {
488
- const retVal = (output || [])
489
- .filter((e) => e != null)
490
- .map((entry) => {
491
- if (entry === null) {
492
- return null;
493
- }
494
- return de_PriceList(entry, context);
495
- });
496
- return retVal;
497
- };
498
- const de_Service = (output, context) => {
499
- return {
500
- AttributeNames: output.AttributeNames != null ? de_AttributeNameList(output.AttributeNames, context) : undefined,
501
- ServiceCode: __expectString(output.ServiceCode),
502
- };
503
- };
504
- const de_ServiceList = (output, context) => {
505
- const retVal = (output || [])
506
- .filter((e) => e != null)
507
- .map((entry) => {
508
- if (entry === null) {
509
- return null;
510
- }
511
- return de_Service(entry, context);
512
- });
513
- return retVal;
514
- };
515
334
  const deserializeMetadata = (output) => ({
516
335
  httpStatusCode: output.statusCode,
517
336
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -525,6 +344,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
525
344
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
526
345
  };
527
346
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
347
+ const throwDefaultError = withBaseException(__BaseException);
528
348
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
529
349
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
530
350
  const contents = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-pricing",
3
3
  "description": "AWS SDK for JavaScript Pricing Client for Node.js, Browser and React Native",
4
- "version": "3.312.0",
4
+ "version": "3.315.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -21,9 +21,9 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "3.0.0",
23
23
  "@aws-crypto/sha256-js": "3.0.0",
24
- "@aws-sdk/client-sts": "3.312.0",
24
+ "@aws-sdk/client-sts": "3.315.0",
25
25
  "@aws-sdk/config-resolver": "3.310.0",
26
- "@aws-sdk/credential-provider-node": "3.310.0",
26
+ "@aws-sdk/credential-provider-node": "3.315.0",
27
27
  "@aws-sdk/fetch-http-handler": "3.310.0",
28
28
  "@aws-sdk/hash-node": "3.310.0",
29
29
  "@aws-sdk/invalid-dependency": "3.310.0",
@@ -40,14 +40,14 @@
40
40
  "@aws-sdk/node-config-provider": "3.310.0",
41
41
  "@aws-sdk/node-http-handler": "3.310.0",
42
42
  "@aws-sdk/protocol-http": "3.310.0",
43
- "@aws-sdk/smithy-client": "3.310.0",
43
+ "@aws-sdk/smithy-client": "3.315.0",
44
44
  "@aws-sdk/types": "3.310.0",
45
45
  "@aws-sdk/url-parser": "3.310.0",
46
46
  "@aws-sdk/util-base64": "3.310.0",
47
47
  "@aws-sdk/util-body-length-browser": "3.310.0",
48
48
  "@aws-sdk/util-body-length-node": "3.310.0",
49
- "@aws-sdk/util-defaults-mode-browser": "3.310.0",
50
- "@aws-sdk/util-defaults-mode-node": "3.310.0",
49
+ "@aws-sdk/util-defaults-mode-browser": "3.315.0",
50
+ "@aws-sdk/util-defaults-mode-node": "3.315.0",
51
51
  "@aws-sdk/util-endpoints": "3.310.0",
52
52
  "@aws-sdk/util-retry": "3.310.0",
53
53
  "@aws-sdk/util-user-agent-browser": "3.310.0",