@aws-sdk/client-pricing 3.185.0 → 3.188.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.
@@ -1,310 +1,257 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectString as __expectString, LazyJsonString as __LazyJsonString, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { ExpiredNextTokenException, InternalErrorException, InvalidNextTokenException, InvalidParameterException, NotFoundException, } from "../models/models_0";
5
4
  import { PricingServiceException as __BaseException } from "../models/PricingServiceException";
6
- export var serializeAws_json1_1DescribeServicesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var headers, body;
8
- return __generator(this, function (_a) {
9
- headers = {
10
- "content-type": "application/x-amz-json-1.1",
11
- "x-amz-target": "AWSPriceListService.DescribeServices",
12
- };
13
- body = JSON.stringify(serializeAws_json1_1DescribeServicesRequest(input, context));
14
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
15
- });
16
- }); };
17
- export var serializeAws_json1_1GetAttributeValuesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
18
- var headers, body;
19
- return __generator(this, function (_a) {
20
- headers = {
21
- "content-type": "application/x-amz-json-1.1",
22
- "x-amz-target": "AWSPriceListService.GetAttributeValues",
23
- };
24
- body = JSON.stringify(serializeAws_json1_1GetAttributeValuesRequest(input, context));
25
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
26
- });
27
- }); };
28
- export var serializeAws_json1_1GetProductsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
29
- var headers, body;
30
- return __generator(this, function (_a) {
31
- headers = {
32
- "content-type": "application/x-amz-json-1.1",
33
- "x-amz-target": "AWSPriceListService.GetProducts",
34
- };
35
- body = JSON.stringify(serializeAws_json1_1GetProductsRequest(input, context));
36
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
37
- });
38
- }); };
39
- export var deserializeAws_json1_1DescribeServicesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
40
- var data, contents, response;
41
- return __generator(this, function (_a) {
42
- switch (_a.label) {
43
- case 0:
44
- if (output.statusCode >= 300) {
45
- return [2, deserializeAws_json1_1DescribeServicesCommandError(output, context)];
46
- }
47
- return [4, parseBody(output.body, context)];
48
- case 1:
49
- data = _a.sent();
50
- contents = {};
51
- contents = deserializeAws_json1_1DescribeServicesResponse(data, context);
52
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
53
- return [2, Promise.resolve(response)];
54
- }
55
- });
56
- }); };
57
- var deserializeAws_json1_1DescribeServicesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
58
- var parsedOutput, _a, errorCode, _b, parsedBody;
59
- var _c;
60
- return __generator(this, function (_d) {
61
- switch (_d.label) {
62
- case 0:
63
- _a = [__assign({}, output)];
64
- _c = {};
65
- return [4, parseErrorBody(output.body, context)];
66
- case 1:
67
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
68
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
69
- _b = errorCode;
70
- switch (_b) {
71
- case "ExpiredNextTokenException": return [3, 2];
72
- case "com.amazonaws.pricing#ExpiredNextTokenException": return [3, 2];
73
- case "InternalErrorException": return [3, 4];
74
- case "com.amazonaws.pricing#InternalErrorException": return [3, 4];
75
- case "InvalidNextTokenException": return [3, 6];
76
- case "com.amazonaws.pricing#InvalidNextTokenException": return [3, 6];
77
- case "InvalidParameterException": return [3, 8];
78
- case "com.amazonaws.pricing#InvalidParameterException": return [3, 8];
79
- case "NotFoundException": return [3, 10];
80
- case "com.amazonaws.pricing#NotFoundException": return [3, 10];
81
- }
82
- return [3, 12];
83
- case 2: return [4, deserializeAws_json1_1ExpiredNextTokenExceptionResponse(parsedOutput, context)];
84
- case 3: throw _d.sent();
85
- case 4: return [4, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];
86
- case 5: throw _d.sent();
87
- case 6: return [4, deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)];
88
- case 7: throw _d.sent();
89
- case 8: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
90
- case 9: throw _d.sent();
91
- case 10: return [4, deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)];
92
- case 11: throw _d.sent();
93
- case 12:
94
- parsedBody = parsedOutput.body;
95
- throwDefaultError({
96
- output: output,
97
- parsedBody: parsedBody,
98
- exceptionCtor: __BaseException,
99
- errorCode: errorCode,
100
- });
101
- _d.label = 13;
102
- case 13: return [2];
103
- }
104
- });
105
- }); };
106
- export var deserializeAws_json1_1GetAttributeValuesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
107
- var data, contents, response;
108
- return __generator(this, function (_a) {
109
- switch (_a.label) {
110
- case 0:
111
- if (output.statusCode >= 300) {
112
- return [2, deserializeAws_json1_1GetAttributeValuesCommandError(output, context)];
113
- }
114
- return [4, parseBody(output.body, context)];
115
- case 1:
116
- data = _a.sent();
117
- contents = {};
118
- contents = deserializeAws_json1_1GetAttributeValuesResponse(data, context);
119
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
120
- return [2, Promise.resolve(response)];
121
- }
122
- });
123
- }); };
124
- var deserializeAws_json1_1GetAttributeValuesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
125
- var parsedOutput, _a, errorCode, _b, parsedBody;
126
- var _c;
127
- return __generator(this, function (_d) {
128
- switch (_d.label) {
129
- case 0:
130
- _a = [__assign({}, output)];
131
- _c = {};
132
- return [4, parseErrorBody(output.body, context)];
133
- case 1:
134
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
135
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
136
- _b = errorCode;
137
- switch (_b) {
138
- case "ExpiredNextTokenException": return [3, 2];
139
- case "com.amazonaws.pricing#ExpiredNextTokenException": return [3, 2];
140
- case "InternalErrorException": return [3, 4];
141
- case "com.amazonaws.pricing#InternalErrorException": return [3, 4];
142
- case "InvalidNextTokenException": return [3, 6];
143
- case "com.amazonaws.pricing#InvalidNextTokenException": return [3, 6];
144
- case "InvalidParameterException": return [3, 8];
145
- case "com.amazonaws.pricing#InvalidParameterException": return [3, 8];
146
- case "NotFoundException": return [3, 10];
147
- case "com.amazonaws.pricing#NotFoundException": return [3, 10];
148
- }
149
- return [3, 12];
150
- case 2: return [4, deserializeAws_json1_1ExpiredNextTokenExceptionResponse(parsedOutput, context)];
151
- case 3: throw _d.sent();
152
- case 4: return [4, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];
153
- case 5: throw _d.sent();
154
- case 6: return [4, deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)];
155
- case 7: throw _d.sent();
156
- case 8: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
157
- case 9: throw _d.sent();
158
- case 10: return [4, deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)];
159
- case 11: throw _d.sent();
160
- case 12:
161
- parsedBody = parsedOutput.body;
162
- throwDefaultError({
163
- output: output,
164
- parsedBody: parsedBody,
165
- exceptionCtor: __BaseException,
166
- errorCode: errorCode,
167
- });
168
- _d.label = 13;
169
- case 13: return [2];
170
- }
171
- });
172
- }); };
173
- export var deserializeAws_json1_1GetProductsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
174
- var data, contents, response;
175
- return __generator(this, function (_a) {
176
- switch (_a.label) {
177
- case 0:
178
- if (output.statusCode >= 300) {
179
- return [2, deserializeAws_json1_1GetProductsCommandError(output, context)];
180
- }
181
- return [4, parseBody(output.body, context)];
182
- case 1:
183
- data = _a.sent();
184
- contents = {};
185
- contents = deserializeAws_json1_1GetProductsResponse(data, context);
186
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
187
- return [2, Promise.resolve(response)];
188
- }
189
- });
190
- }); };
191
- var deserializeAws_json1_1GetProductsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
192
- var parsedOutput, _a, errorCode, _b, parsedBody;
193
- var _c;
194
- return __generator(this, function (_d) {
195
- switch (_d.label) {
196
- case 0:
197
- _a = [__assign({}, output)];
198
- _c = {};
199
- return [4, parseErrorBody(output.body, context)];
200
- case 1:
201
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
202
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
203
- _b = errorCode;
204
- switch (_b) {
205
- case "ExpiredNextTokenException": return [3, 2];
206
- case "com.amazonaws.pricing#ExpiredNextTokenException": return [3, 2];
207
- case "InternalErrorException": return [3, 4];
208
- case "com.amazonaws.pricing#InternalErrorException": return [3, 4];
209
- case "InvalidNextTokenException": return [3, 6];
210
- case "com.amazonaws.pricing#InvalidNextTokenException": return [3, 6];
211
- case "InvalidParameterException": return [3, 8];
212
- case "com.amazonaws.pricing#InvalidParameterException": return [3, 8];
213
- case "NotFoundException": return [3, 10];
214
- case "com.amazonaws.pricing#NotFoundException": return [3, 10];
215
- }
216
- return [3, 12];
217
- case 2: return [4, deserializeAws_json1_1ExpiredNextTokenExceptionResponse(parsedOutput, context)];
218
- case 3: throw _d.sent();
219
- case 4: return [4, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];
220
- case 5: throw _d.sent();
221
- case 6: return [4, deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)];
222
- case 7: throw _d.sent();
223
- case 8: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
224
- case 9: throw _d.sent();
225
- case 10: return [4, deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)];
226
- case 11: throw _d.sent();
227
- case 12:
228
- parsedBody = parsedOutput.body;
229
- throwDefaultError({
230
- output: output,
231
- parsedBody: parsedBody,
232
- exceptionCtor: __BaseException,
233
- errorCode: errorCode,
234
- });
235
- _d.label = 13;
236
- case 13: return [2];
237
- }
238
- });
239
- }); };
240
- var deserializeAws_json1_1ExpiredNextTokenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
241
- var body, deserialized, exception;
242
- return __generator(this, function (_a) {
243
- body = parsedOutput.body;
244
- deserialized = deserializeAws_json1_1ExpiredNextTokenException(body, context);
245
- exception = new ExpiredNextTokenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
246
- return [2, __decorateServiceException(exception, body)];
5
+ export const serializeAws_json1_1DescribeServicesCommand = async (input, context) => {
6
+ const headers = {
7
+ "content-type": "application/x-amz-json-1.1",
8
+ "x-amz-target": "AWSPriceListService.DescribeServices",
9
+ };
10
+ let body;
11
+ body = JSON.stringify(serializeAws_json1_1DescribeServicesRequest(input, context));
12
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
+ };
14
+ export const serializeAws_json1_1GetAttributeValuesCommand = async (input, context) => {
15
+ const headers = {
16
+ "content-type": "application/x-amz-json-1.1",
17
+ "x-amz-target": "AWSPriceListService.GetAttributeValues",
18
+ };
19
+ let body;
20
+ body = JSON.stringify(serializeAws_json1_1GetAttributeValuesRequest(input, context));
21
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
+ };
23
+ export const serializeAws_json1_1GetProductsCommand = async (input, context) => {
24
+ const headers = {
25
+ "content-type": "application/x-amz-json-1.1",
26
+ "x-amz-target": "AWSPriceListService.GetProducts",
27
+ };
28
+ let body;
29
+ body = JSON.stringify(serializeAws_json1_1GetProductsRequest(input, context));
30
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
+ };
32
+ export const deserializeAws_json1_1DescribeServicesCommand = async (output, context) => {
33
+ if (output.statusCode >= 300) {
34
+ return deserializeAws_json1_1DescribeServicesCommandError(output, context);
35
+ }
36
+ const data = await parseBody(output.body, context);
37
+ let contents = {};
38
+ contents = deserializeAws_json1_1DescribeServicesResponse(data, context);
39
+ const response = {
40
+ $metadata: deserializeMetadata(output),
41
+ ...contents,
42
+ };
43
+ return Promise.resolve(response);
44
+ };
45
+ const deserializeAws_json1_1DescribeServicesCommandError = async (output, context) => {
46
+ const parsedOutput = {
47
+ ...output,
48
+ body: await parseErrorBody(output.body, context),
49
+ };
50
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
51
+ switch (errorCode) {
52
+ case "ExpiredNextTokenException":
53
+ case "com.amazonaws.pricing#ExpiredNextTokenException":
54
+ throw await deserializeAws_json1_1ExpiredNextTokenExceptionResponse(parsedOutput, context);
55
+ case "InternalErrorException":
56
+ case "com.amazonaws.pricing#InternalErrorException":
57
+ throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context);
58
+ case "InvalidNextTokenException":
59
+ case "com.amazonaws.pricing#InvalidNextTokenException":
60
+ throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
61
+ case "InvalidParameterException":
62
+ case "com.amazonaws.pricing#InvalidParameterException":
63
+ throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
64
+ case "NotFoundException":
65
+ case "com.amazonaws.pricing#NotFoundException":
66
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
67
+ default:
68
+ const parsedBody = parsedOutput.body;
69
+ throwDefaultError({
70
+ output,
71
+ parsedBody,
72
+ exceptionCtor: __BaseException,
73
+ errorCode,
74
+ });
75
+ }
76
+ };
77
+ export const deserializeAws_json1_1GetAttributeValuesCommand = async (output, context) => {
78
+ if (output.statusCode >= 300) {
79
+ return deserializeAws_json1_1GetAttributeValuesCommandError(output, context);
80
+ }
81
+ const data = await parseBody(output.body, context);
82
+ let contents = {};
83
+ contents = deserializeAws_json1_1GetAttributeValuesResponse(data, context);
84
+ const response = {
85
+ $metadata: deserializeMetadata(output),
86
+ ...contents,
87
+ };
88
+ return Promise.resolve(response);
89
+ };
90
+ const deserializeAws_json1_1GetAttributeValuesCommandError = async (output, context) => {
91
+ const parsedOutput = {
92
+ ...output,
93
+ body: await parseErrorBody(output.body, context),
94
+ };
95
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
96
+ switch (errorCode) {
97
+ case "ExpiredNextTokenException":
98
+ case "com.amazonaws.pricing#ExpiredNextTokenException":
99
+ throw await deserializeAws_json1_1ExpiredNextTokenExceptionResponse(parsedOutput, context);
100
+ case "InternalErrorException":
101
+ case "com.amazonaws.pricing#InternalErrorException":
102
+ throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context);
103
+ case "InvalidNextTokenException":
104
+ case "com.amazonaws.pricing#InvalidNextTokenException":
105
+ throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
106
+ case "InvalidParameterException":
107
+ case "com.amazonaws.pricing#InvalidParameterException":
108
+ throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
109
+ case "NotFoundException":
110
+ case "com.amazonaws.pricing#NotFoundException":
111
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
112
+ default:
113
+ const parsedBody = parsedOutput.body;
114
+ throwDefaultError({
115
+ output,
116
+ parsedBody,
117
+ exceptionCtor: __BaseException,
118
+ errorCode,
119
+ });
120
+ }
121
+ };
122
+ export const deserializeAws_json1_1GetProductsCommand = async (output, context) => {
123
+ if (output.statusCode >= 300) {
124
+ return deserializeAws_json1_1GetProductsCommandError(output, context);
125
+ }
126
+ const data = await parseBody(output.body, context);
127
+ let contents = {};
128
+ contents = deserializeAws_json1_1GetProductsResponse(data, context);
129
+ const response = {
130
+ $metadata: deserializeMetadata(output),
131
+ ...contents,
132
+ };
133
+ return Promise.resolve(response);
134
+ };
135
+ const deserializeAws_json1_1GetProductsCommandError = async (output, context) => {
136
+ const parsedOutput = {
137
+ ...output,
138
+ body: await parseErrorBody(output.body, context),
139
+ };
140
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
141
+ switch (errorCode) {
142
+ case "ExpiredNextTokenException":
143
+ case "com.amazonaws.pricing#ExpiredNextTokenException":
144
+ throw await deserializeAws_json1_1ExpiredNextTokenExceptionResponse(parsedOutput, context);
145
+ case "InternalErrorException":
146
+ case "com.amazonaws.pricing#InternalErrorException":
147
+ throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context);
148
+ case "InvalidNextTokenException":
149
+ case "com.amazonaws.pricing#InvalidNextTokenException":
150
+ throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
151
+ case "InvalidParameterException":
152
+ case "com.amazonaws.pricing#InvalidParameterException":
153
+ throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
154
+ case "NotFoundException":
155
+ case "com.amazonaws.pricing#NotFoundException":
156
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
157
+ default:
158
+ const parsedBody = parsedOutput.body;
159
+ throwDefaultError({
160
+ output,
161
+ parsedBody,
162
+ exceptionCtor: __BaseException,
163
+ errorCode,
164
+ });
165
+ }
166
+ };
167
+ const deserializeAws_json1_1ExpiredNextTokenExceptionResponse = async (parsedOutput, context) => {
168
+ const body = parsedOutput.body;
169
+ const deserialized = deserializeAws_json1_1ExpiredNextTokenException(body, context);
170
+ const exception = new ExpiredNextTokenException({
171
+ $metadata: deserializeMetadata(parsedOutput),
172
+ ...deserialized,
247
173
  });
248
- }); };
249
- var deserializeAws_json1_1InternalErrorExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
250
- var body, deserialized, exception;
251
- return __generator(this, function (_a) {
252
- body = parsedOutput.body;
253
- deserialized = deserializeAws_json1_1InternalErrorException(body, context);
254
- exception = new InternalErrorException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
255
- return [2, __decorateServiceException(exception, body)];
174
+ return __decorateServiceException(exception, body);
175
+ };
176
+ const deserializeAws_json1_1InternalErrorExceptionResponse = async (parsedOutput, context) => {
177
+ const body = parsedOutput.body;
178
+ const deserialized = deserializeAws_json1_1InternalErrorException(body, context);
179
+ const exception = new InternalErrorException({
180
+ $metadata: deserializeMetadata(parsedOutput),
181
+ ...deserialized,
256
182
  });
257
- }); };
258
- var deserializeAws_json1_1InvalidNextTokenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
259
- var body, deserialized, exception;
260
- return __generator(this, function (_a) {
261
- body = parsedOutput.body;
262
- deserialized = deserializeAws_json1_1InvalidNextTokenException(body, context);
263
- exception = new InvalidNextTokenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
264
- return [2, __decorateServiceException(exception, body)];
183
+ return __decorateServiceException(exception, body);
184
+ };
185
+ const deserializeAws_json1_1InvalidNextTokenExceptionResponse = async (parsedOutput, context) => {
186
+ const body = parsedOutput.body;
187
+ const deserialized = deserializeAws_json1_1InvalidNextTokenException(body, context);
188
+ const exception = new InvalidNextTokenException({
189
+ $metadata: deserializeMetadata(parsedOutput),
190
+ ...deserialized,
265
191
  });
266
- }); };
267
- var deserializeAws_json1_1InvalidParameterExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
268
- var body, deserialized, exception;
269
- return __generator(this, function (_a) {
270
- body = parsedOutput.body;
271
- deserialized = deserializeAws_json1_1InvalidParameterException(body, context);
272
- exception = new InvalidParameterException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
273
- return [2, __decorateServiceException(exception, body)];
192
+ return __decorateServiceException(exception, body);
193
+ };
194
+ const deserializeAws_json1_1InvalidParameterExceptionResponse = async (parsedOutput, context) => {
195
+ const body = parsedOutput.body;
196
+ const deserialized = deserializeAws_json1_1InvalidParameterException(body, context);
197
+ const exception = new InvalidParameterException({
198
+ $metadata: deserializeMetadata(parsedOutput),
199
+ ...deserialized,
274
200
  });
275
- }); };
276
- var deserializeAws_json1_1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
277
- var body, deserialized, exception;
278
- return __generator(this, function (_a) {
279
- body = parsedOutput.body;
280
- deserialized = deserializeAws_json1_1NotFoundException(body, context);
281
- exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
282
- return [2, __decorateServiceException(exception, body)];
201
+ return __decorateServiceException(exception, body);
202
+ };
203
+ const deserializeAws_json1_1NotFoundExceptionResponse = async (parsedOutput, context) => {
204
+ const body = parsedOutput.body;
205
+ const deserialized = deserializeAws_json1_1NotFoundException(body, context);
206
+ const exception = new NotFoundException({
207
+ $metadata: deserializeMetadata(parsedOutput),
208
+ ...deserialized,
283
209
  });
284
- }); };
285
- var serializeAws_json1_1DescribeServicesRequest = function (input, context) {
286
- return __assign(__assign(__assign(__assign({}, (input.FormatVersion != null && { FormatVersion: input.FormatVersion })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.ServiceCode != null && { ServiceCode: input.ServiceCode }));
210
+ return __decorateServiceException(exception, body);
211
+ };
212
+ const serializeAws_json1_1DescribeServicesRequest = (input, context) => {
213
+ return {
214
+ ...(input.FormatVersion != null && { FormatVersion: input.FormatVersion }),
215
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
216
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
217
+ ...(input.ServiceCode != null && { ServiceCode: input.ServiceCode }),
218
+ };
287
219
  };
288
- var serializeAws_json1_1Filter = function (input, context) {
289
- return __assign(__assign(__assign({}, (input.Field != null && { Field: input.Field })), (input.Type != null && { Type: input.Type })), (input.Value != null && { Value: input.Value }));
220
+ const serializeAws_json1_1Filter = (input, context) => {
221
+ return {
222
+ ...(input.Field != null && { Field: input.Field }),
223
+ ...(input.Type != null && { Type: input.Type }),
224
+ ...(input.Value != null && { Value: input.Value }),
225
+ };
290
226
  };
291
- var serializeAws_json1_1Filters = function (input, context) {
227
+ const serializeAws_json1_1Filters = (input, context) => {
292
228
  return input
293
- .filter(function (e) { return e != null; })
294
- .map(function (entry) {
229
+ .filter((e) => e != null)
230
+ .map((entry) => {
295
231
  return serializeAws_json1_1Filter(entry, context);
296
232
  });
297
233
  };
298
- var serializeAws_json1_1GetAttributeValuesRequest = function (input, context) {
299
- return __assign(__assign(__assign(__assign({}, (input.AttributeName != null && { AttributeName: input.AttributeName })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.ServiceCode != null && { ServiceCode: input.ServiceCode }));
234
+ const serializeAws_json1_1GetAttributeValuesRequest = (input, context) => {
235
+ return {
236
+ ...(input.AttributeName != null && { AttributeName: input.AttributeName }),
237
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
238
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
239
+ ...(input.ServiceCode != null && { ServiceCode: input.ServiceCode }),
240
+ };
300
241
  };
301
- var serializeAws_json1_1GetProductsRequest = function (input, context) {
302
- return __assign(__assign(__assign(__assign(__assign({}, (input.Filters != null && { Filters: serializeAws_json1_1Filters(input.Filters, context) })), (input.FormatVersion != null && { FormatVersion: input.FormatVersion })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.ServiceCode != null && { ServiceCode: input.ServiceCode }));
242
+ const serializeAws_json1_1GetProductsRequest = (input, context) => {
243
+ return {
244
+ ...(input.Filters != null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }),
245
+ ...(input.FormatVersion != null && { FormatVersion: input.FormatVersion }),
246
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
247
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
248
+ ...(input.ServiceCode != null && { ServiceCode: input.ServiceCode }),
249
+ };
303
250
  };
304
- var deserializeAws_json1_1AttributeNameList = function (output, context) {
305
- var retVal = (output || [])
306
- .filter(function (e) { return e != null; })
307
- .map(function (entry) {
251
+ const deserializeAws_json1_1AttributeNameList = (output, context) => {
252
+ const retVal = (output || [])
253
+ .filter((e) => e != null)
254
+ .map((entry) => {
308
255
  if (entry === null) {
309
256
  return null;
310
257
  }
@@ -312,15 +259,15 @@ var deserializeAws_json1_1AttributeNameList = function (output, context) {
312
259
  });
313
260
  return retVal;
314
261
  };
315
- var deserializeAws_json1_1AttributeValue = function (output, context) {
262
+ const deserializeAws_json1_1AttributeValue = (output, context) => {
316
263
  return {
317
264
  Value: __expectString(output.Value),
318
265
  };
319
266
  };
320
- var deserializeAws_json1_1AttributeValueList = function (output, context) {
321
- var retVal = (output || [])
322
- .filter(function (e) { return e != null; })
323
- .map(function (entry) {
267
+ const deserializeAws_json1_1AttributeValueList = (output, context) => {
268
+ const retVal = (output || [])
269
+ .filter((e) => e != null)
270
+ .map((entry) => {
324
271
  if (entry === null) {
325
272
  return null;
326
273
  }
@@ -328,19 +275,19 @@ var deserializeAws_json1_1AttributeValueList = function (output, context) {
328
275
  });
329
276
  return retVal;
330
277
  };
331
- var deserializeAws_json1_1DescribeServicesResponse = function (output, context) {
278
+ const deserializeAws_json1_1DescribeServicesResponse = (output, context) => {
332
279
  return {
333
280
  FormatVersion: __expectString(output.FormatVersion),
334
281
  NextToken: __expectString(output.NextToken),
335
282
  Services: output.Services != null ? deserializeAws_json1_1ServiceList(output.Services, context) : undefined,
336
283
  };
337
284
  };
338
- var deserializeAws_json1_1ExpiredNextTokenException = function (output, context) {
285
+ const deserializeAws_json1_1ExpiredNextTokenException = (output, context) => {
339
286
  return {
340
287
  Message: __expectString(output.Message),
341
288
  };
342
289
  };
343
- var deserializeAws_json1_1GetAttributeValuesResponse = function (output, context) {
290
+ const deserializeAws_json1_1GetAttributeValuesResponse = (output, context) => {
344
291
  return {
345
292
  AttributeValues: output.AttributeValues != null
346
293
  ? deserializeAws_json1_1AttributeValueList(output.AttributeValues, context)
@@ -348,37 +295,37 @@ var deserializeAws_json1_1GetAttributeValuesResponse = function (output, context
348
295
  NextToken: __expectString(output.NextToken),
349
296
  };
350
297
  };
351
- var deserializeAws_json1_1GetProductsResponse = function (output, context) {
298
+ const deserializeAws_json1_1GetProductsResponse = (output, context) => {
352
299
  return {
353
300
  FormatVersion: __expectString(output.FormatVersion),
354
301
  NextToken: __expectString(output.NextToken),
355
302
  PriceList: output.PriceList != null ? deserializeAws_json1_1PriceListJsonItems(output.PriceList, context) : undefined,
356
303
  };
357
304
  };
358
- var deserializeAws_json1_1InternalErrorException = function (output, context) {
305
+ const deserializeAws_json1_1InternalErrorException = (output, context) => {
359
306
  return {
360
307
  Message: __expectString(output.Message),
361
308
  };
362
309
  };
363
- var deserializeAws_json1_1InvalidNextTokenException = function (output, context) {
310
+ const deserializeAws_json1_1InvalidNextTokenException = (output, context) => {
364
311
  return {
365
312
  Message: __expectString(output.Message),
366
313
  };
367
314
  };
368
- var deserializeAws_json1_1InvalidParameterException = function (output, context) {
315
+ const deserializeAws_json1_1InvalidParameterException = (output, context) => {
369
316
  return {
370
317
  Message: __expectString(output.Message),
371
318
  };
372
319
  };
373
- var deserializeAws_json1_1NotFoundException = function (output, context) {
320
+ const deserializeAws_json1_1NotFoundException = (output, context) => {
374
321
  return {
375
322
  Message: __expectString(output.Message),
376
323
  };
377
324
  };
378
- var deserializeAws_json1_1PriceListJsonItems = function (output, context) {
379
- var retVal = (output || [])
380
- .filter(function (e) { return e != null; })
381
- .map(function (entry) {
325
+ const deserializeAws_json1_1PriceListJsonItems = (output, context) => {
326
+ const retVal = (output || [])
327
+ .filter((e) => e != null)
328
+ .map((entry) => {
382
329
  if (entry === null) {
383
330
  return null;
384
331
  }
@@ -386,7 +333,7 @@ var deserializeAws_json1_1PriceListJsonItems = function (output, context) {
386
333
  });
387
334
  return retVal;
388
335
  };
389
- var deserializeAws_json1_1Service = function (output, context) {
336
+ const deserializeAws_json1_1Service = (output, context) => {
390
337
  return {
391
338
  AttributeNames: output.AttributeNames != null
392
339
  ? deserializeAws_json1_1AttributeNameList(output.AttributeNames, context)
@@ -394,10 +341,10 @@ var deserializeAws_json1_1Service = function (output, context) {
394
341
  ServiceCode: __expectString(output.ServiceCode),
395
342
  };
396
343
  };
397
- var deserializeAws_json1_1ServiceList = function (output, context) {
398
- var retVal = (output || [])
399
- .filter(function (e) { return e != null; })
400
- .map(function (entry) {
344
+ const deserializeAws_json1_1ServiceList = (output, context) => {
345
+ const retVal = (output || [])
346
+ .filter((e) => e != null)
347
+ .map((entry) => {
401
348
  if (entry === null) {
402
349
  return null;
403
350
  }
@@ -405,75 +352,52 @@ var deserializeAws_json1_1ServiceList = function (output, context) {
405
352
  });
406
353
  return retVal;
407
354
  };
408
- var deserializeMetadata = function (output) {
409
- var _a, _b;
410
- return ({
411
- httpStatusCode: output.statusCode,
412
- requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
413
- extendedRequestId: output.headers["x-amz-id-2"],
414
- cfId: output.headers["x-amz-cf-id"],
415
- });
416
- };
417
- var collectBody = function (streamBody, context) {
418
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
355
+ const deserializeMetadata = (output) => ({
356
+ httpStatusCode: output.statusCode,
357
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
358
+ extendedRequestId: output.headers["x-amz-id-2"],
359
+ cfId: output.headers["x-amz-cf-id"],
360
+ });
361
+ const collectBody = (streamBody = new Uint8Array(), context) => {
419
362
  if (streamBody instanceof Uint8Array) {
420
363
  return Promise.resolve(streamBody);
421
364
  }
422
365
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
423
366
  };
424
- var collectBodyString = function (streamBody, context) {
425
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
426
- };
427
- var buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {
428
- var _a, hostname, _b, protocol, port, basePath, contents;
429
- return __generator(this, function (_c) {
430
- switch (_c.label) {
431
- case 0: return [4, context.endpoint()];
432
- case 1:
433
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
434
- contents = {
435
- protocol: protocol,
436
- hostname: hostname,
437
- port: port,
438
- method: "POST",
439
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
440
- headers: headers,
441
- };
442
- if (resolvedHostname !== undefined) {
443
- contents.hostname = resolvedHostname;
444
- }
445
- if (body !== undefined) {
446
- contents.body = body;
447
- }
448
- return [2, new __HttpRequest(contents)];
449
- }
450
- });
451
- }); };
452
- var parseBody = function (streamBody, context) {
453
- return collectBodyString(streamBody, context).then(function (encoded) {
454
- if (encoded.length) {
455
- return JSON.parse(encoded);
456
- }
457
- return {};
458
- });
367
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
368
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
369
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
370
+ const contents = {
371
+ protocol,
372
+ hostname,
373
+ port,
374
+ method: "POST",
375
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
376
+ headers,
377
+ };
378
+ if (resolvedHostname !== undefined) {
379
+ contents.hostname = resolvedHostname;
380
+ }
381
+ if (body !== undefined) {
382
+ contents.body = body;
383
+ }
384
+ return new __HttpRequest(contents);
459
385
  };
460
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
461
- var value;
462
- var _a;
463
- return __generator(this, function (_b) {
464
- switch (_b.label) {
465
- case 0: return [4, parseBody(errorBody, context)];
466
- case 1:
467
- value = _b.sent();
468
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
469
- return [2, value];
470
- }
471
- });
472
- }); };
473
- var loadRestJsonErrorCode = function (output, data) {
474
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
475
- var sanitizeErrorCode = function (rawValue) {
476
- var cleanValue = rawValue;
386
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
387
+ if (encoded.length) {
388
+ return JSON.parse(encoded);
389
+ }
390
+ return {};
391
+ });
392
+ const parseErrorBody = async (errorBody, context) => {
393
+ const value = await parseBody(errorBody, context);
394
+ value.message = value.message ?? value.Message;
395
+ return value;
396
+ };
397
+ const loadRestJsonErrorCode = (output, data) => {
398
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
399
+ const sanitizeErrorCode = (rawValue) => {
400
+ let cleanValue = rawValue;
477
401
  if (typeof cleanValue === "number") {
478
402
  cleanValue = cleanValue.toString();
479
403
  }
@@ -488,7 +412,7 @@ var loadRestJsonErrorCode = function (output, data) {
488
412
  }
489
413
  return cleanValue;
490
414
  };
491
- var headerKey = findKey(output.headers, "x-amzn-errortype");
415
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
492
416
  if (headerKey !== undefined) {
493
417
  return sanitizeErrorCode(output.headers[headerKey]);
494
418
  }