@aws-sdk/client-pricing 3.183.0 → 3.185.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,257 +1,310 @@
1
+ import { __assign, __awaiter, __generator } from "tslib";
1
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
3
  import { decorateServiceException as __decorateServiceException, expectString as __expectString, LazyJsonString as __LazyJsonString, throwDefaultError, } from "@aws-sdk/smithy-client";
3
4
  import { ExpiredNextTokenException, InternalErrorException, InvalidNextTokenException, InvalidParameterException, NotFoundException, } from "../models/models_0";
4
5
  import { PricingServiceException as __BaseException } from "../models/PricingServiceException";
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,
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)];
173
15
  });
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,
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)];
182
26
  });
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,
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)];
191
37
  });
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,
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
+ }
200
55
  });
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,
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
+ }
209
104
  });
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
- };
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)];
247
+ });
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)];
256
+ });
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)];
265
+ });
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)];
274
+ });
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)];
283
+ });
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 }));
219
287
  };
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
- };
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 }));
226
290
  };
227
- const serializeAws_json1_1Filters = (input, context) => {
291
+ var serializeAws_json1_1Filters = function (input, context) {
228
292
  return input
229
- .filter((e) => e != null)
230
- .map((entry) => {
293
+ .filter(function (e) { return e != null; })
294
+ .map(function (entry) {
231
295
  return serializeAws_json1_1Filter(entry, context);
232
296
  });
233
297
  };
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
- };
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 }));
241
300
  };
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
- };
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 }));
250
303
  };
251
- const deserializeAws_json1_1AttributeNameList = (output, context) => {
252
- const retVal = (output || [])
253
- .filter((e) => e != null)
254
- .map((entry) => {
304
+ var deserializeAws_json1_1AttributeNameList = function (output, context) {
305
+ var retVal = (output || [])
306
+ .filter(function (e) { return e != null; })
307
+ .map(function (entry) {
255
308
  if (entry === null) {
256
309
  return null;
257
310
  }
@@ -259,15 +312,15 @@ const deserializeAws_json1_1AttributeNameList = (output, context) => {
259
312
  });
260
313
  return retVal;
261
314
  };
262
- const deserializeAws_json1_1AttributeValue = (output, context) => {
315
+ var deserializeAws_json1_1AttributeValue = function (output, context) {
263
316
  return {
264
317
  Value: __expectString(output.Value),
265
318
  };
266
319
  };
267
- const deserializeAws_json1_1AttributeValueList = (output, context) => {
268
- const retVal = (output || [])
269
- .filter((e) => e != null)
270
- .map((entry) => {
320
+ var deserializeAws_json1_1AttributeValueList = function (output, context) {
321
+ var retVal = (output || [])
322
+ .filter(function (e) { return e != null; })
323
+ .map(function (entry) {
271
324
  if (entry === null) {
272
325
  return null;
273
326
  }
@@ -275,19 +328,19 @@ const deserializeAws_json1_1AttributeValueList = (output, context) => {
275
328
  });
276
329
  return retVal;
277
330
  };
278
- const deserializeAws_json1_1DescribeServicesResponse = (output, context) => {
331
+ var deserializeAws_json1_1DescribeServicesResponse = function (output, context) {
279
332
  return {
280
333
  FormatVersion: __expectString(output.FormatVersion),
281
334
  NextToken: __expectString(output.NextToken),
282
335
  Services: output.Services != null ? deserializeAws_json1_1ServiceList(output.Services, context) : undefined,
283
336
  };
284
337
  };
285
- const deserializeAws_json1_1ExpiredNextTokenException = (output, context) => {
338
+ var deserializeAws_json1_1ExpiredNextTokenException = function (output, context) {
286
339
  return {
287
340
  Message: __expectString(output.Message),
288
341
  };
289
342
  };
290
- const deserializeAws_json1_1GetAttributeValuesResponse = (output, context) => {
343
+ var deserializeAws_json1_1GetAttributeValuesResponse = function (output, context) {
291
344
  return {
292
345
  AttributeValues: output.AttributeValues != null
293
346
  ? deserializeAws_json1_1AttributeValueList(output.AttributeValues, context)
@@ -295,37 +348,37 @@ const deserializeAws_json1_1GetAttributeValuesResponse = (output, context) => {
295
348
  NextToken: __expectString(output.NextToken),
296
349
  };
297
350
  };
298
- const deserializeAws_json1_1GetProductsResponse = (output, context) => {
351
+ var deserializeAws_json1_1GetProductsResponse = function (output, context) {
299
352
  return {
300
353
  FormatVersion: __expectString(output.FormatVersion),
301
354
  NextToken: __expectString(output.NextToken),
302
355
  PriceList: output.PriceList != null ? deserializeAws_json1_1PriceListJsonItems(output.PriceList, context) : undefined,
303
356
  };
304
357
  };
305
- const deserializeAws_json1_1InternalErrorException = (output, context) => {
358
+ var deserializeAws_json1_1InternalErrorException = function (output, context) {
306
359
  return {
307
360
  Message: __expectString(output.Message),
308
361
  };
309
362
  };
310
- const deserializeAws_json1_1InvalidNextTokenException = (output, context) => {
363
+ var deserializeAws_json1_1InvalidNextTokenException = function (output, context) {
311
364
  return {
312
365
  Message: __expectString(output.Message),
313
366
  };
314
367
  };
315
- const deserializeAws_json1_1InvalidParameterException = (output, context) => {
368
+ var deserializeAws_json1_1InvalidParameterException = function (output, context) {
316
369
  return {
317
370
  Message: __expectString(output.Message),
318
371
  };
319
372
  };
320
- const deserializeAws_json1_1NotFoundException = (output, context) => {
373
+ var deserializeAws_json1_1NotFoundException = function (output, context) {
321
374
  return {
322
375
  Message: __expectString(output.Message),
323
376
  };
324
377
  };
325
- const deserializeAws_json1_1PriceListJsonItems = (output, context) => {
326
- const retVal = (output || [])
327
- .filter((e) => e != null)
328
- .map((entry) => {
378
+ var deserializeAws_json1_1PriceListJsonItems = function (output, context) {
379
+ var retVal = (output || [])
380
+ .filter(function (e) { return e != null; })
381
+ .map(function (entry) {
329
382
  if (entry === null) {
330
383
  return null;
331
384
  }
@@ -333,7 +386,7 @@ const deserializeAws_json1_1PriceListJsonItems = (output, context) => {
333
386
  });
334
387
  return retVal;
335
388
  };
336
- const deserializeAws_json1_1Service = (output, context) => {
389
+ var deserializeAws_json1_1Service = function (output, context) {
337
390
  return {
338
391
  AttributeNames: output.AttributeNames != null
339
392
  ? deserializeAws_json1_1AttributeNameList(output.AttributeNames, context)
@@ -341,10 +394,10 @@ const deserializeAws_json1_1Service = (output, context) => {
341
394
  ServiceCode: __expectString(output.ServiceCode),
342
395
  };
343
396
  };
344
- const deserializeAws_json1_1ServiceList = (output, context) => {
345
- const retVal = (output || [])
346
- .filter((e) => e != null)
347
- .map((entry) => {
397
+ var deserializeAws_json1_1ServiceList = function (output, context) {
398
+ var retVal = (output || [])
399
+ .filter(function (e) { return e != null; })
400
+ .map(function (entry) {
348
401
  if (entry === null) {
349
402
  return null;
350
403
  }
@@ -352,52 +405,75 @@ const deserializeAws_json1_1ServiceList = (output, context) => {
352
405
  });
353
406
  return retVal;
354
407
  };
355
- const deserializeMetadata = (output) => ({
356
- httpStatusCode: output.statusCode,
357
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-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) => {
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(); }
362
419
  if (streamBody instanceof Uint8Array) {
363
420
  return Promise.resolve(streamBody);
364
421
  }
365
422
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
366
423
  };
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);
385
- };
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;
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
+ });
396
459
  };
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;
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;
401
477
  if (typeof cleanValue === "number") {
402
478
  cleanValue = cleanValue.toString();
403
479
  }
@@ -412,7 +488,7 @@ const loadRestJsonErrorCode = (output, data) => {
412
488
  }
413
489
  return cleanValue;
414
490
  };
415
- const headerKey = findKey(output.headers, "x-amzn-errortype");
491
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
416
492
  if (headerKey !== undefined) {
417
493
  return sanitizeErrorCode(output.headers[headerKey]);
418
494
  }