@aws-sdk/client-pricing 3.181.0 → 3.183.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.
- package/CHANGELOG.md +8 -0
- package/dist-es/Pricing.js +14 -21
- package/dist-es/PricingClient.js +22 -28
- package/dist-es/commands/DescribeServicesCommand.js +21 -28
- package/dist-es/commands/GetAttributeValuesCommand.js +21 -28
- package/dist-es/commands/GetProductsCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/PricingServiceException.js +5 -10
- package/dist-es/models/models_0.js +87 -70
- package/dist-es/pagination/DescribeServicesPaginator.js +25 -68
- package/dist-es/pagination/GetAttributeValuesPaginator.js +25 -68
- package/dist-es/pagination/GetProductsPaginator.js +25 -68
- package/dist-es/protocols/Aws_json1_1.js +300 -376
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/package.json +33 -33
|
@@ -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
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
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
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
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
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
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
|
-
|
|
286
|
-
|
|
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
|
-
|
|
289
|
-
return
|
|
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
|
-
|
|
227
|
+
const serializeAws_json1_1Filters = (input, context) => {
|
|
292
228
|
return input
|
|
293
|
-
.filter(
|
|
294
|
-
.map(
|
|
229
|
+
.filter((e) => e != null)
|
|
230
|
+
.map((entry) => {
|
|
295
231
|
return serializeAws_json1_1Filter(entry, context);
|
|
296
232
|
});
|
|
297
233
|
};
|
|
298
|
-
|
|
299
|
-
return
|
|
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
|
-
|
|
302
|
-
return
|
|
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
|
-
|
|
305
|
-
|
|
306
|
-
.filter(
|
|
307
|
-
.map(
|
|
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
|
-
|
|
262
|
+
const deserializeAws_json1_1AttributeValue = (output, context) => {
|
|
316
263
|
return {
|
|
317
264
|
Value: __expectString(output.Value),
|
|
318
265
|
};
|
|
319
266
|
};
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
.filter(
|
|
323
|
-
.map(
|
|
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
|
-
|
|
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
|
-
|
|
285
|
+
const deserializeAws_json1_1ExpiredNextTokenException = (output, context) => {
|
|
339
286
|
return {
|
|
340
287
|
Message: __expectString(output.Message),
|
|
341
288
|
};
|
|
342
289
|
};
|
|
343
|
-
|
|
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
|
-
|
|
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
|
-
|
|
305
|
+
const deserializeAws_json1_1InternalErrorException = (output, context) => {
|
|
359
306
|
return {
|
|
360
307
|
Message: __expectString(output.Message),
|
|
361
308
|
};
|
|
362
309
|
};
|
|
363
|
-
|
|
310
|
+
const deserializeAws_json1_1InvalidNextTokenException = (output, context) => {
|
|
364
311
|
return {
|
|
365
312
|
Message: __expectString(output.Message),
|
|
366
313
|
};
|
|
367
314
|
};
|
|
368
|
-
|
|
315
|
+
const deserializeAws_json1_1InvalidParameterException = (output, context) => {
|
|
369
316
|
return {
|
|
370
317
|
Message: __expectString(output.Message),
|
|
371
318
|
};
|
|
372
319
|
};
|
|
373
|
-
|
|
320
|
+
const deserializeAws_json1_1NotFoundException = (output, context) => {
|
|
374
321
|
return {
|
|
375
322
|
Message: __expectString(output.Message),
|
|
376
323
|
};
|
|
377
324
|
};
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
.filter(
|
|
381
|
-
.map(
|
|
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
|
-
|
|
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
|
-
|
|
398
|
-
|
|
399
|
-
.filter(
|
|
400
|
-
.map(
|
|
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
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
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"],
|
|
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
|
-
|
|
425
|
-
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
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
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
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
|
-
|
|
415
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
492
416
|
if (headerKey !== undefined) {
|
|
493
417
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
494
418
|
}
|