@aws-sdk/client-savingsplans 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/Savingsplans.js +38 -45
- package/dist-es/SavingsplansClient.js +22 -28
- package/dist-es/commands/CreateSavingsPlanCommand.js +21 -28
- package/dist-es/commands/DeleteQueuedSavingsPlanCommand.js +21 -28
- package/dist-es/commands/DescribeSavingsPlanRatesCommand.js +21 -28
- package/dist-es/commands/DescribeSavingsPlansCommand.js +21 -28
- package/dist-es/commands/DescribeSavingsPlansOfferingRatesCommand.js +21 -28
- package/dist-es/commands/DescribeSavingsPlansOfferingsCommand.js +21 -28
- package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
- package/dist-es/commands/TagResourceCommand.js +21 -28
- package/dist-es/commands/UntagResourceCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/SavingsplansServiceException.js +5 -10
- package/dist-es/models/models_0.js +134 -75
- package/dist-es/protocols/Aws_restJson1.js +798 -1022
- 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,1063 +1,856 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator, __read } from "tslib";
|
|
2
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
import { decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { v4 as generateIdempotencyToken } from "uuid";
|
|
5
4
|
import { InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ValidationException, } from "../models/models_0";
|
|
6
5
|
import { SavingsplansServiceException as __BaseException } from "../models/SavingsplansServiceException";
|
|
7
|
-
export
|
|
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
|
-
export var serializeAws_restJson1DeleteQueuedSavingsPlanCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
33
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
34
|
-
return __generator(this, function (_c) {
|
|
35
|
-
switch (_c.label) {
|
|
36
|
-
case 0: return [4, context.endpoint()];
|
|
37
|
-
case 1:
|
|
38
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
39
|
-
headers = {
|
|
40
|
-
"content-type": "application/json",
|
|
41
|
-
};
|
|
42
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/DeleteQueuedSavingsPlan";
|
|
43
|
-
body = JSON.stringify(__assign({}, (input.savingsPlanId != null && { savingsPlanId: input.savingsPlanId })));
|
|
44
|
-
return [2, new __HttpRequest({
|
|
45
|
-
protocol: protocol,
|
|
46
|
-
hostname: hostname,
|
|
47
|
-
port: port,
|
|
48
|
-
method: "POST",
|
|
49
|
-
headers: headers,
|
|
50
|
-
path: resolvedPath,
|
|
51
|
-
body: body,
|
|
52
|
-
})];
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}); };
|
|
56
|
-
export var serializeAws_restJson1DescribeSavingsPlanRatesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
57
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
58
|
-
return __generator(this, function (_c) {
|
|
59
|
-
switch (_c.label) {
|
|
60
|
-
case 0: return [4, context.endpoint()];
|
|
61
|
-
case 1:
|
|
62
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
63
|
-
headers = {
|
|
64
|
-
"content-type": "application/json",
|
|
65
|
-
};
|
|
66
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/DescribeSavingsPlanRates";
|
|
67
|
-
body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.filters != null && { filters: serializeAws_restJson1SavingsPlanRateFilterList(input.filters, context) })), (input.maxResults != null && { maxResults: input.maxResults })), (input.nextToken != null && { nextToken: input.nextToken })), (input.savingsPlanId != null && { savingsPlanId: input.savingsPlanId })));
|
|
68
|
-
return [2, new __HttpRequest({
|
|
69
|
-
protocol: protocol,
|
|
70
|
-
hostname: hostname,
|
|
71
|
-
port: port,
|
|
72
|
-
method: "POST",
|
|
73
|
-
headers: headers,
|
|
74
|
-
path: resolvedPath,
|
|
75
|
-
body: body,
|
|
76
|
-
})];
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}); };
|
|
80
|
-
export var serializeAws_restJson1DescribeSavingsPlansCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
81
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
82
|
-
return __generator(this, function (_c) {
|
|
83
|
-
switch (_c.label) {
|
|
84
|
-
case 0: return [4, context.endpoint()];
|
|
85
|
-
case 1:
|
|
86
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
87
|
-
headers = {
|
|
88
|
-
"content-type": "application/json",
|
|
89
|
-
};
|
|
90
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/DescribeSavingsPlans";
|
|
91
|
-
body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.filters != null && { filters: serializeAws_restJson1SavingsPlanFilterList(input.filters, context) })), (input.maxResults != null && { maxResults: input.maxResults })), (input.nextToken != null && { nextToken: input.nextToken })), (input.savingsPlanArns != null && {
|
|
92
|
-
savingsPlanArns: serializeAws_restJson1SavingsPlanArnList(input.savingsPlanArns, context),
|
|
93
|
-
})), (input.savingsPlanIds != null && {
|
|
94
|
-
savingsPlanIds: serializeAws_restJson1SavingsPlanIdList(input.savingsPlanIds, context),
|
|
95
|
-
})), (input.states != null && { states: serializeAws_restJson1SavingsPlanStateList(input.states, context) })));
|
|
96
|
-
return [2, new __HttpRequest({
|
|
97
|
-
protocol: protocol,
|
|
98
|
-
hostname: hostname,
|
|
99
|
-
port: port,
|
|
100
|
-
method: "POST",
|
|
101
|
-
headers: headers,
|
|
102
|
-
path: resolvedPath,
|
|
103
|
-
body: body,
|
|
104
|
-
})];
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}); };
|
|
108
|
-
export var serializeAws_restJson1DescribeSavingsPlansOfferingRatesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
109
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
110
|
-
return __generator(this, function (_c) {
|
|
111
|
-
switch (_c.label) {
|
|
112
|
-
case 0: return [4, context.endpoint()];
|
|
113
|
-
case 1:
|
|
114
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
115
|
-
headers = {
|
|
116
|
-
"content-type": "application/json",
|
|
117
|
-
};
|
|
118
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/DescribeSavingsPlansOfferingRates";
|
|
119
|
-
body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.filters != null && {
|
|
120
|
-
filters: serializeAws_restJson1SavingsPlanOfferingRateFiltersList(input.filters, context),
|
|
121
|
-
})), (input.maxResults != null && { maxResults: input.maxResults })), (input.nextToken != null && { nextToken: input.nextToken })), (input.operations != null && {
|
|
122
|
-
operations: serializeAws_restJson1SavingsPlanRateOperationList(input.operations, context),
|
|
123
|
-
})), (input.products != null && {
|
|
124
|
-
products: serializeAws_restJson1SavingsPlanProductTypeList(input.products, context),
|
|
125
|
-
})), (input.savingsPlanOfferingIds != null && {
|
|
126
|
-
savingsPlanOfferingIds: serializeAws_restJson1UUIDs(input.savingsPlanOfferingIds, context),
|
|
127
|
-
})), (input.savingsPlanPaymentOptions != null && {
|
|
128
|
-
savingsPlanPaymentOptions: serializeAws_restJson1SavingsPlanPaymentOptionList(input.savingsPlanPaymentOptions, context),
|
|
129
|
-
})), (input.savingsPlanTypes != null && {
|
|
130
|
-
savingsPlanTypes: serializeAws_restJson1SavingsPlanTypeList(input.savingsPlanTypes, context),
|
|
131
|
-
})), (input.serviceCodes != null && {
|
|
132
|
-
serviceCodes: serializeAws_restJson1SavingsPlanRateServiceCodeList(input.serviceCodes, context),
|
|
133
|
-
})), (input.usageTypes != null && {
|
|
134
|
-
usageTypes: serializeAws_restJson1SavingsPlanRateUsageTypeList(input.usageTypes, context),
|
|
135
|
-
})));
|
|
136
|
-
return [2, new __HttpRequest({
|
|
137
|
-
protocol: protocol,
|
|
138
|
-
hostname: hostname,
|
|
139
|
-
port: port,
|
|
140
|
-
method: "POST",
|
|
141
|
-
headers: headers,
|
|
142
|
-
path: resolvedPath,
|
|
143
|
-
body: body,
|
|
144
|
-
})];
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
}); };
|
|
148
|
-
export var serializeAws_restJson1DescribeSavingsPlansOfferingsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
149
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
150
|
-
return __generator(this, function (_c) {
|
|
151
|
-
switch (_c.label) {
|
|
152
|
-
case 0: return [4, context.endpoint()];
|
|
153
|
-
case 1:
|
|
154
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
155
|
-
headers = {
|
|
156
|
-
"content-type": "application/json",
|
|
157
|
-
};
|
|
158
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/DescribeSavingsPlansOfferings";
|
|
159
|
-
body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.currencies != null && { currencies: serializeAws_restJson1CurrencyList(input.currencies, context) })), (input.descriptions != null && {
|
|
160
|
-
descriptions: serializeAws_restJson1SavingsPlanDescriptionsList(input.descriptions, context),
|
|
161
|
-
})), (input.durations != null && { durations: serializeAws_restJson1DurationsList(input.durations, context) })), (input.filters != null && {
|
|
162
|
-
filters: serializeAws_restJson1SavingsPlanOfferingFiltersList(input.filters, context),
|
|
163
|
-
})), (input.maxResults != null && { maxResults: input.maxResults })), (input.nextToken != null && { nextToken: input.nextToken })), (input.offeringIds != null && { offeringIds: serializeAws_restJson1UUIDs(input.offeringIds, context) })), (input.operations != null && {
|
|
164
|
-
operations: serializeAws_restJson1SavingsPlanOperationList(input.operations, context),
|
|
165
|
-
})), (input.paymentOptions != null && {
|
|
166
|
-
paymentOptions: serializeAws_restJson1SavingsPlanPaymentOptionList(input.paymentOptions, context),
|
|
167
|
-
})), (input.planTypes != null && { planTypes: serializeAws_restJson1SavingsPlanTypeList(input.planTypes, context) })), (input.productType != null && { productType: input.productType })), (input.serviceCodes != null && {
|
|
168
|
-
serviceCodes: serializeAws_restJson1SavingsPlanServiceCodeList(input.serviceCodes, context),
|
|
169
|
-
})), (input.usageTypes != null && {
|
|
170
|
-
usageTypes: serializeAws_restJson1SavingsPlanUsageTypeList(input.usageTypes, context),
|
|
171
|
-
})));
|
|
172
|
-
return [2, new __HttpRequest({
|
|
173
|
-
protocol: protocol,
|
|
174
|
-
hostname: hostname,
|
|
175
|
-
port: port,
|
|
176
|
-
method: "POST",
|
|
177
|
-
headers: headers,
|
|
178
|
-
path: resolvedPath,
|
|
179
|
-
body: body,
|
|
180
|
-
})];
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
}); };
|
|
184
|
-
export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
185
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
186
|
-
return __generator(this, function (_c) {
|
|
187
|
-
switch (_c.label) {
|
|
188
|
-
case 0: return [4, context.endpoint()];
|
|
189
|
-
case 1:
|
|
190
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
191
|
-
headers = {
|
|
192
|
-
"content-type": "application/json",
|
|
193
|
-
};
|
|
194
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/ListTagsForResource";
|
|
195
|
-
body = JSON.stringify(__assign({}, (input.resourceArn != null && { resourceArn: input.resourceArn })));
|
|
196
|
-
return [2, new __HttpRequest({
|
|
197
|
-
protocol: protocol,
|
|
198
|
-
hostname: hostname,
|
|
199
|
-
port: port,
|
|
200
|
-
method: "POST",
|
|
201
|
-
headers: headers,
|
|
202
|
-
path: resolvedPath,
|
|
203
|
-
body: body,
|
|
204
|
-
})];
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
}); };
|
|
208
|
-
export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
209
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
210
|
-
return __generator(this, function (_c) {
|
|
211
|
-
switch (_c.label) {
|
|
212
|
-
case 0: return [4, context.endpoint()];
|
|
213
|
-
case 1:
|
|
214
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
215
|
-
headers = {
|
|
216
|
-
"content-type": "application/json",
|
|
217
|
-
};
|
|
218
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/TagResource";
|
|
219
|
-
body = JSON.stringify(__assign(__assign({}, (input.resourceArn != null && { resourceArn: input.resourceArn })), (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
|
|
220
|
-
return [2, new __HttpRequest({
|
|
221
|
-
protocol: protocol,
|
|
222
|
-
hostname: hostname,
|
|
223
|
-
port: port,
|
|
224
|
-
method: "POST",
|
|
225
|
-
headers: headers,
|
|
226
|
-
path: resolvedPath,
|
|
227
|
-
body: body,
|
|
228
|
-
})];
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
}); };
|
|
232
|
-
export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
233
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
234
|
-
return __generator(this, function (_c) {
|
|
235
|
-
switch (_c.label) {
|
|
236
|
-
case 0: return [4, context.endpoint()];
|
|
237
|
-
case 1:
|
|
238
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
239
|
-
headers = {
|
|
240
|
-
"content-type": "application/json",
|
|
241
|
-
};
|
|
242
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/UntagResource";
|
|
243
|
-
body = JSON.stringify(__assign(__assign({}, (input.resourceArn != null && { resourceArn: input.resourceArn })), (input.tagKeys != null && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) })));
|
|
244
|
-
return [2, new __HttpRequest({
|
|
245
|
-
protocol: protocol,
|
|
246
|
-
hostname: hostname,
|
|
247
|
-
port: port,
|
|
248
|
-
method: "POST",
|
|
249
|
-
headers: headers,
|
|
250
|
-
path: resolvedPath,
|
|
251
|
-
body: body,
|
|
252
|
-
})];
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
}); };
|
|
256
|
-
export var deserializeAws_restJson1CreateSavingsPlanCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
257
|
-
var contents, data, _a, _b;
|
|
258
|
-
return __generator(this, function (_c) {
|
|
259
|
-
switch (_c.label) {
|
|
260
|
-
case 0:
|
|
261
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
262
|
-
return [2, deserializeAws_restJson1CreateSavingsPlanCommandError(output, context)];
|
|
263
|
-
}
|
|
264
|
-
contents = map({
|
|
265
|
-
$metadata: deserializeMetadata(output),
|
|
266
|
-
});
|
|
267
|
-
_a = __expectNonNull;
|
|
268
|
-
_b = __expectObject;
|
|
269
|
-
return [4, parseBody(output.body, context)];
|
|
270
|
-
case 1:
|
|
271
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
272
|
-
if (data.savingsPlanId != null) {
|
|
273
|
-
contents.savingsPlanId = __expectString(data.savingsPlanId);
|
|
274
|
-
}
|
|
275
|
-
return [2, contents];
|
|
276
|
-
}
|
|
6
|
+
export const serializeAws_restJson1CreateSavingsPlanCommand = async (input, context) => {
|
|
7
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
8
|
+
const headers = {
|
|
9
|
+
"content-type": "application/json",
|
|
10
|
+
};
|
|
11
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/CreateSavingsPlan";
|
|
12
|
+
let body;
|
|
13
|
+
body = JSON.stringify({
|
|
14
|
+
clientToken: input.clientToken ?? generateIdempotencyToken(),
|
|
15
|
+
...(input.commitment != null && { commitment: input.commitment }),
|
|
16
|
+
...(input.purchaseTime != null && { purchaseTime: Math.round(input.purchaseTime.getTime() / 1000) }),
|
|
17
|
+
...(input.savingsPlanOfferingId != null && { savingsPlanOfferingId: input.savingsPlanOfferingId }),
|
|
18
|
+
...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
|
|
19
|
+
...(input.upfrontPaymentAmount != null && { upfrontPaymentAmount: input.upfrontPaymentAmount }),
|
|
20
|
+
});
|
|
21
|
+
return new __HttpRequest({
|
|
22
|
+
protocol,
|
|
23
|
+
hostname,
|
|
24
|
+
port,
|
|
25
|
+
method: "POST",
|
|
26
|
+
headers,
|
|
27
|
+
path: resolvedPath,
|
|
28
|
+
body,
|
|
277
29
|
});
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
case "ServiceQuotaExceededException": return [3, 6];
|
|
298
|
-
case "com.amazonaws.savingsplans#ServiceQuotaExceededException": return [3, 6];
|
|
299
|
-
case "ValidationException": return [3, 8];
|
|
300
|
-
case "com.amazonaws.savingsplans#ValidationException": return [3, 8];
|
|
301
|
-
}
|
|
302
|
-
return [3, 10];
|
|
303
|
-
case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
304
|
-
case 3: throw _d.sent();
|
|
305
|
-
case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
306
|
-
case 5: throw _d.sent();
|
|
307
|
-
case 6: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
|
|
308
|
-
case 7: throw _d.sent();
|
|
309
|
-
case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
310
|
-
case 9: throw _d.sent();
|
|
311
|
-
case 10:
|
|
312
|
-
parsedBody = parsedOutput.body;
|
|
313
|
-
throwDefaultError({
|
|
314
|
-
output: output,
|
|
315
|
-
parsedBody: parsedBody,
|
|
316
|
-
exceptionCtor: __BaseException,
|
|
317
|
-
errorCode: errorCode,
|
|
318
|
-
});
|
|
319
|
-
_d.label = 11;
|
|
320
|
-
case 11: return [2];
|
|
321
|
-
}
|
|
30
|
+
};
|
|
31
|
+
export const serializeAws_restJson1DeleteQueuedSavingsPlanCommand = async (input, context) => {
|
|
32
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
33
|
+
const headers = {
|
|
34
|
+
"content-type": "application/json",
|
|
35
|
+
};
|
|
36
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteQueuedSavingsPlan";
|
|
37
|
+
let body;
|
|
38
|
+
body = JSON.stringify({
|
|
39
|
+
...(input.savingsPlanId != null && { savingsPlanId: input.savingsPlanId }),
|
|
40
|
+
});
|
|
41
|
+
return new __HttpRequest({
|
|
42
|
+
protocol,
|
|
43
|
+
hostname,
|
|
44
|
+
port,
|
|
45
|
+
method: "POST",
|
|
46
|
+
headers,
|
|
47
|
+
path: resolvedPath,
|
|
48
|
+
body,
|
|
322
49
|
});
|
|
323
|
-
}
|
|
324
|
-
export
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
50
|
+
};
|
|
51
|
+
export const serializeAws_restJson1DescribeSavingsPlanRatesCommand = async (input, context) => {
|
|
52
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
53
|
+
const headers = {
|
|
54
|
+
"content-type": "application/json",
|
|
55
|
+
};
|
|
56
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DescribeSavingsPlanRates";
|
|
57
|
+
let body;
|
|
58
|
+
body = JSON.stringify({
|
|
59
|
+
...(input.filters != null && { filters: serializeAws_restJson1SavingsPlanRateFilterList(input.filters, context) }),
|
|
60
|
+
...(input.maxResults != null && { maxResults: input.maxResults }),
|
|
61
|
+
...(input.nextToken != null && { nextToken: input.nextToken }),
|
|
62
|
+
...(input.savingsPlanId != null && { savingsPlanId: input.savingsPlanId }),
|
|
63
|
+
});
|
|
64
|
+
return new __HttpRequest({
|
|
65
|
+
protocol,
|
|
66
|
+
hostname,
|
|
67
|
+
port,
|
|
68
|
+
method: "POST",
|
|
69
|
+
headers,
|
|
70
|
+
path: resolvedPath,
|
|
71
|
+
body,
|
|
340
72
|
});
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
case 5: throw _d.sent();
|
|
370
|
-
case 6: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
|
|
371
|
-
case 7: throw _d.sent();
|
|
372
|
-
case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
373
|
-
case 9: throw _d.sent();
|
|
374
|
-
case 10:
|
|
375
|
-
parsedBody = parsedOutput.body;
|
|
376
|
-
throwDefaultError({
|
|
377
|
-
output: output,
|
|
378
|
-
parsedBody: parsedBody,
|
|
379
|
-
exceptionCtor: __BaseException,
|
|
380
|
-
errorCode: errorCode,
|
|
381
|
-
});
|
|
382
|
-
_d.label = 11;
|
|
383
|
-
case 11: return [2];
|
|
384
|
-
}
|
|
73
|
+
};
|
|
74
|
+
export const serializeAws_restJson1DescribeSavingsPlansCommand = async (input, context) => {
|
|
75
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
76
|
+
const headers = {
|
|
77
|
+
"content-type": "application/json",
|
|
78
|
+
};
|
|
79
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DescribeSavingsPlans";
|
|
80
|
+
let body;
|
|
81
|
+
body = JSON.stringify({
|
|
82
|
+
...(input.filters != null && { filters: serializeAws_restJson1SavingsPlanFilterList(input.filters, context) }),
|
|
83
|
+
...(input.maxResults != null && { maxResults: input.maxResults }),
|
|
84
|
+
...(input.nextToken != null && { nextToken: input.nextToken }),
|
|
85
|
+
...(input.savingsPlanArns != null && {
|
|
86
|
+
savingsPlanArns: serializeAws_restJson1SavingsPlanArnList(input.savingsPlanArns, context),
|
|
87
|
+
}),
|
|
88
|
+
...(input.savingsPlanIds != null && {
|
|
89
|
+
savingsPlanIds: serializeAws_restJson1SavingsPlanIdList(input.savingsPlanIds, context),
|
|
90
|
+
}),
|
|
91
|
+
...(input.states != null && { states: serializeAws_restJson1SavingsPlanStateList(input.states, context) }),
|
|
92
|
+
});
|
|
93
|
+
return new __HttpRequest({
|
|
94
|
+
protocol,
|
|
95
|
+
hostname,
|
|
96
|
+
port,
|
|
97
|
+
method: "POST",
|
|
98
|
+
headers,
|
|
99
|
+
path: resolvedPath,
|
|
100
|
+
body,
|
|
385
101
|
});
|
|
386
|
-
}
|
|
387
|
-
export
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
102
|
+
};
|
|
103
|
+
export const serializeAws_restJson1DescribeSavingsPlansOfferingRatesCommand = async (input, context) => {
|
|
104
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
105
|
+
const headers = {
|
|
106
|
+
"content-type": "application/json",
|
|
107
|
+
};
|
|
108
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DescribeSavingsPlansOfferingRates";
|
|
109
|
+
let body;
|
|
110
|
+
body = JSON.stringify({
|
|
111
|
+
...(input.filters != null && {
|
|
112
|
+
filters: serializeAws_restJson1SavingsPlanOfferingRateFiltersList(input.filters, context),
|
|
113
|
+
}),
|
|
114
|
+
...(input.maxResults != null && { maxResults: input.maxResults }),
|
|
115
|
+
...(input.nextToken != null && { nextToken: input.nextToken }),
|
|
116
|
+
...(input.operations != null && {
|
|
117
|
+
operations: serializeAws_restJson1SavingsPlanRateOperationList(input.operations, context),
|
|
118
|
+
}),
|
|
119
|
+
...(input.products != null && {
|
|
120
|
+
products: serializeAws_restJson1SavingsPlanProductTypeList(input.products, context),
|
|
121
|
+
}),
|
|
122
|
+
...(input.savingsPlanOfferingIds != null && {
|
|
123
|
+
savingsPlanOfferingIds: serializeAws_restJson1UUIDs(input.savingsPlanOfferingIds, context),
|
|
124
|
+
}),
|
|
125
|
+
...(input.savingsPlanPaymentOptions != null && {
|
|
126
|
+
savingsPlanPaymentOptions: serializeAws_restJson1SavingsPlanPaymentOptionList(input.savingsPlanPaymentOptions, context),
|
|
127
|
+
}),
|
|
128
|
+
...(input.savingsPlanTypes != null && {
|
|
129
|
+
savingsPlanTypes: serializeAws_restJson1SavingsPlanTypeList(input.savingsPlanTypes, context),
|
|
130
|
+
}),
|
|
131
|
+
...(input.serviceCodes != null && {
|
|
132
|
+
serviceCodes: serializeAws_restJson1SavingsPlanRateServiceCodeList(input.serviceCodes, context),
|
|
133
|
+
}),
|
|
134
|
+
...(input.usageTypes != null && {
|
|
135
|
+
usageTypes: serializeAws_restJson1SavingsPlanRateUsageTypeList(input.usageTypes, context),
|
|
136
|
+
}),
|
|
137
|
+
});
|
|
138
|
+
return new __HttpRequest({
|
|
139
|
+
protocol,
|
|
140
|
+
hostname,
|
|
141
|
+
port,
|
|
142
|
+
method: "POST",
|
|
143
|
+
headers,
|
|
144
|
+
path: resolvedPath,
|
|
145
|
+
body,
|
|
414
146
|
});
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
147
|
+
};
|
|
148
|
+
export const serializeAws_restJson1DescribeSavingsPlansOfferingsCommand = async (input, context) => {
|
|
149
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
150
|
+
const headers = {
|
|
151
|
+
"content-type": "application/json",
|
|
152
|
+
};
|
|
153
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DescribeSavingsPlansOfferings";
|
|
154
|
+
let body;
|
|
155
|
+
body = JSON.stringify({
|
|
156
|
+
...(input.currencies != null && { currencies: serializeAws_restJson1CurrencyList(input.currencies, context) }),
|
|
157
|
+
...(input.descriptions != null && {
|
|
158
|
+
descriptions: serializeAws_restJson1SavingsPlanDescriptionsList(input.descriptions, context),
|
|
159
|
+
}),
|
|
160
|
+
...(input.durations != null && { durations: serializeAws_restJson1DurationsList(input.durations, context) }),
|
|
161
|
+
...(input.filters != null && {
|
|
162
|
+
filters: serializeAws_restJson1SavingsPlanOfferingFiltersList(input.filters, context),
|
|
163
|
+
}),
|
|
164
|
+
...(input.maxResults != null && { maxResults: input.maxResults }),
|
|
165
|
+
...(input.nextToken != null && { nextToken: input.nextToken }),
|
|
166
|
+
...(input.offeringIds != null && { offeringIds: serializeAws_restJson1UUIDs(input.offeringIds, context) }),
|
|
167
|
+
...(input.operations != null && {
|
|
168
|
+
operations: serializeAws_restJson1SavingsPlanOperationList(input.operations, context),
|
|
169
|
+
}),
|
|
170
|
+
...(input.paymentOptions != null && {
|
|
171
|
+
paymentOptions: serializeAws_restJson1SavingsPlanPaymentOptionList(input.paymentOptions, context),
|
|
172
|
+
}),
|
|
173
|
+
...(input.planTypes != null && { planTypes: serializeAws_restJson1SavingsPlanTypeList(input.planTypes, context) }),
|
|
174
|
+
...(input.productType != null && { productType: input.productType }),
|
|
175
|
+
...(input.serviceCodes != null && {
|
|
176
|
+
serviceCodes: serializeAws_restJson1SavingsPlanServiceCodeList(input.serviceCodes, context),
|
|
177
|
+
}),
|
|
178
|
+
...(input.usageTypes != null && {
|
|
179
|
+
usageTypes: serializeAws_restJson1SavingsPlanUsageTypeList(input.usageTypes, context),
|
|
180
|
+
}),
|
|
181
|
+
});
|
|
182
|
+
return new __HttpRequest({
|
|
183
|
+
protocol,
|
|
184
|
+
hostname,
|
|
185
|
+
port,
|
|
186
|
+
method: "POST",
|
|
187
|
+
headers,
|
|
188
|
+
path: resolvedPath,
|
|
189
|
+
body,
|
|
451
190
|
});
|
|
452
|
-
}
|
|
453
|
-
export
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
}
|
|
472
|
-
if (data.savingsPlans != null) {
|
|
473
|
-
contents.savingsPlans = deserializeAws_restJson1SavingsPlanList(data.savingsPlans, context);
|
|
474
|
-
}
|
|
475
|
-
return [2, contents];
|
|
476
|
-
}
|
|
191
|
+
};
|
|
192
|
+
export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
|
|
193
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
194
|
+
const headers = {
|
|
195
|
+
"content-type": "application/json",
|
|
196
|
+
};
|
|
197
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListTagsForResource";
|
|
198
|
+
let body;
|
|
199
|
+
body = JSON.stringify({
|
|
200
|
+
...(input.resourceArn != null && { resourceArn: input.resourceArn }),
|
|
201
|
+
});
|
|
202
|
+
return new __HttpRequest({
|
|
203
|
+
protocol,
|
|
204
|
+
hostname,
|
|
205
|
+
port,
|
|
206
|
+
method: "POST",
|
|
207
|
+
headers,
|
|
208
|
+
path: resolvedPath,
|
|
209
|
+
body,
|
|
477
210
|
});
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
return [3, 6];
|
|
499
|
-
case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
500
|
-
case 3: throw _d.sent();
|
|
501
|
-
case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
502
|
-
case 5: throw _d.sent();
|
|
503
|
-
case 6:
|
|
504
|
-
parsedBody = parsedOutput.body;
|
|
505
|
-
throwDefaultError({
|
|
506
|
-
output: output,
|
|
507
|
-
parsedBody: parsedBody,
|
|
508
|
-
exceptionCtor: __BaseException,
|
|
509
|
-
errorCode: errorCode,
|
|
510
|
-
});
|
|
511
|
-
_d.label = 7;
|
|
512
|
-
case 7: return [2];
|
|
513
|
-
}
|
|
211
|
+
};
|
|
212
|
+
export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
|
|
213
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
214
|
+
const headers = {
|
|
215
|
+
"content-type": "application/json",
|
|
216
|
+
};
|
|
217
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/TagResource";
|
|
218
|
+
let body;
|
|
219
|
+
body = JSON.stringify({
|
|
220
|
+
...(input.resourceArn != null && { resourceArn: input.resourceArn }),
|
|
221
|
+
...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
|
|
222
|
+
});
|
|
223
|
+
return new __HttpRequest({
|
|
224
|
+
protocol,
|
|
225
|
+
hostname,
|
|
226
|
+
port,
|
|
227
|
+
method: "POST",
|
|
228
|
+
headers,
|
|
229
|
+
path: resolvedPath,
|
|
230
|
+
body,
|
|
514
231
|
});
|
|
515
|
-
}
|
|
516
|
-
export
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
if (data.searchResults != null) {
|
|
536
|
-
contents.searchResults = deserializeAws_restJson1SavingsPlanOfferingRatesList(data.searchResults, context);
|
|
537
|
-
}
|
|
538
|
-
return [2, contents];
|
|
539
|
-
}
|
|
232
|
+
};
|
|
233
|
+
export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
|
|
234
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
235
|
+
const headers = {
|
|
236
|
+
"content-type": "application/json",
|
|
237
|
+
};
|
|
238
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/UntagResource";
|
|
239
|
+
let body;
|
|
240
|
+
body = JSON.stringify({
|
|
241
|
+
...(input.resourceArn != null && { resourceArn: input.resourceArn }),
|
|
242
|
+
...(input.tagKeys != null && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) }),
|
|
243
|
+
});
|
|
244
|
+
return new __HttpRequest({
|
|
245
|
+
protocol,
|
|
246
|
+
hostname,
|
|
247
|
+
port,
|
|
248
|
+
method: "POST",
|
|
249
|
+
headers,
|
|
250
|
+
path: resolvedPath,
|
|
251
|
+
body,
|
|
540
252
|
});
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
_a = [__assign({}, output)];
|
|
549
|
-
_c = {};
|
|
550
|
-
return [4, parseErrorBody(output.body, context)];
|
|
551
|
-
case 1:
|
|
552
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
553
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
554
|
-
_b = errorCode;
|
|
555
|
-
switch (_b) {
|
|
556
|
-
case "InternalServerException": return [3, 2];
|
|
557
|
-
case "com.amazonaws.savingsplans#InternalServerException": return [3, 2];
|
|
558
|
-
case "ValidationException": return [3, 4];
|
|
559
|
-
case "com.amazonaws.savingsplans#ValidationException": return [3, 4];
|
|
560
|
-
}
|
|
561
|
-
return [3, 6];
|
|
562
|
-
case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
563
|
-
case 3: throw _d.sent();
|
|
564
|
-
case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
565
|
-
case 5: throw _d.sent();
|
|
566
|
-
case 6:
|
|
567
|
-
parsedBody = parsedOutput.body;
|
|
568
|
-
throwDefaultError({
|
|
569
|
-
output: output,
|
|
570
|
-
parsedBody: parsedBody,
|
|
571
|
-
exceptionCtor: __BaseException,
|
|
572
|
-
errorCode: errorCode,
|
|
573
|
-
});
|
|
574
|
-
_d.label = 7;
|
|
575
|
-
case 7: return [2];
|
|
576
|
-
}
|
|
253
|
+
};
|
|
254
|
+
export const deserializeAws_restJson1CreateSavingsPlanCommand = async (output, context) => {
|
|
255
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
256
|
+
return deserializeAws_restJson1CreateSavingsPlanCommandError(output, context);
|
|
257
|
+
}
|
|
258
|
+
const contents = map({
|
|
259
|
+
$metadata: deserializeMetadata(output),
|
|
577
260
|
});
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
261
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
262
|
+
if (data.savingsPlanId != null) {
|
|
263
|
+
contents.savingsPlanId = __expectString(data.savingsPlanId);
|
|
264
|
+
}
|
|
265
|
+
return contents;
|
|
266
|
+
};
|
|
267
|
+
const deserializeAws_restJson1CreateSavingsPlanCommandError = async (output, context) => {
|
|
268
|
+
const parsedOutput = {
|
|
269
|
+
...output,
|
|
270
|
+
body: await parseErrorBody(output.body, context),
|
|
271
|
+
};
|
|
272
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
273
|
+
switch (errorCode) {
|
|
274
|
+
case "InternalServerException":
|
|
275
|
+
case "com.amazonaws.savingsplans#InternalServerException":
|
|
276
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
277
|
+
case "ResourceNotFoundException":
|
|
278
|
+
case "com.amazonaws.savingsplans#ResourceNotFoundException":
|
|
279
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
280
|
+
case "ServiceQuotaExceededException":
|
|
281
|
+
case "com.amazonaws.savingsplans#ServiceQuotaExceededException":
|
|
282
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
283
|
+
case "ValidationException":
|
|
284
|
+
case "com.amazonaws.savingsplans#ValidationException":
|
|
285
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
286
|
+
default:
|
|
287
|
+
const parsedBody = parsedOutput.body;
|
|
288
|
+
throwDefaultError({
|
|
289
|
+
output,
|
|
290
|
+
parsedBody,
|
|
291
|
+
exceptionCtor: __BaseException,
|
|
292
|
+
errorCode,
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
export const deserializeAws_restJson1DeleteQueuedSavingsPlanCommand = async (output, context) => {
|
|
297
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
298
|
+
return deserializeAws_restJson1DeleteQueuedSavingsPlanCommandError(output, context);
|
|
299
|
+
}
|
|
300
|
+
const contents = map({
|
|
301
|
+
$metadata: deserializeMetadata(output),
|
|
603
302
|
});
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
parsedBody
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
303
|
+
await collectBody(output.body, context);
|
|
304
|
+
return contents;
|
|
305
|
+
};
|
|
306
|
+
const deserializeAws_restJson1DeleteQueuedSavingsPlanCommandError = async (output, context) => {
|
|
307
|
+
const parsedOutput = {
|
|
308
|
+
...output,
|
|
309
|
+
body: await parseErrorBody(output.body, context),
|
|
310
|
+
};
|
|
311
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
312
|
+
switch (errorCode) {
|
|
313
|
+
case "InternalServerException":
|
|
314
|
+
case "com.amazonaws.savingsplans#InternalServerException":
|
|
315
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
316
|
+
case "ResourceNotFoundException":
|
|
317
|
+
case "com.amazonaws.savingsplans#ResourceNotFoundException":
|
|
318
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
319
|
+
case "ServiceQuotaExceededException":
|
|
320
|
+
case "com.amazonaws.savingsplans#ServiceQuotaExceededException":
|
|
321
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
322
|
+
case "ValidationException":
|
|
323
|
+
case "com.amazonaws.savingsplans#ValidationException":
|
|
324
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
325
|
+
default:
|
|
326
|
+
const parsedBody = parsedOutput.body;
|
|
327
|
+
throwDefaultError({
|
|
328
|
+
output,
|
|
329
|
+
parsedBody,
|
|
330
|
+
exceptionCtor: __BaseException,
|
|
331
|
+
errorCode,
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
export const deserializeAws_restJson1DescribeSavingsPlanRatesCommand = async (output, context) => {
|
|
336
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
337
|
+
return deserializeAws_restJson1DescribeSavingsPlanRatesCommandError(output, context);
|
|
338
|
+
}
|
|
339
|
+
const contents = map({
|
|
340
|
+
$metadata: deserializeMetadata(output),
|
|
640
341
|
});
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
342
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
343
|
+
if (data.nextToken != null) {
|
|
344
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
345
|
+
}
|
|
346
|
+
if (data.savingsPlanId != null) {
|
|
347
|
+
contents.savingsPlanId = __expectString(data.savingsPlanId);
|
|
348
|
+
}
|
|
349
|
+
if (data.searchResults != null) {
|
|
350
|
+
contents.searchResults = deserializeAws_restJson1SavingsPlanRateList(data.searchResults, context);
|
|
351
|
+
}
|
|
352
|
+
return contents;
|
|
353
|
+
};
|
|
354
|
+
const deserializeAws_restJson1DescribeSavingsPlanRatesCommandError = async (output, context) => {
|
|
355
|
+
const parsedOutput = {
|
|
356
|
+
...output,
|
|
357
|
+
body: await parseErrorBody(output.body, context),
|
|
358
|
+
};
|
|
359
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
360
|
+
switch (errorCode) {
|
|
361
|
+
case "ResourceNotFoundException":
|
|
362
|
+
case "com.amazonaws.savingsplans#ResourceNotFoundException":
|
|
363
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
364
|
+
case "ValidationException":
|
|
365
|
+
case "com.amazonaws.savingsplans#ValidationException":
|
|
366
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
367
|
+
default:
|
|
368
|
+
const parsedBody = parsedOutput.body;
|
|
369
|
+
throwDefaultError({
|
|
370
|
+
output,
|
|
371
|
+
parsedBody,
|
|
372
|
+
exceptionCtor: __BaseException,
|
|
373
|
+
errorCode,
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
export const deserializeAws_restJson1DescribeSavingsPlansCommand = async (output, context) => {
|
|
378
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
379
|
+
return deserializeAws_restJson1DescribeSavingsPlansCommandError(output, context);
|
|
380
|
+
}
|
|
381
|
+
const contents = map({
|
|
382
|
+
$metadata: deserializeMetadata(output),
|
|
663
383
|
});
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
case 9: return [2];
|
|
703
|
-
}
|
|
384
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
385
|
+
if (data.nextToken != null) {
|
|
386
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
387
|
+
}
|
|
388
|
+
if (data.savingsPlans != null) {
|
|
389
|
+
contents.savingsPlans = deserializeAws_restJson1SavingsPlanList(data.savingsPlans, context);
|
|
390
|
+
}
|
|
391
|
+
return contents;
|
|
392
|
+
};
|
|
393
|
+
const deserializeAws_restJson1DescribeSavingsPlansCommandError = async (output, context) => {
|
|
394
|
+
const parsedOutput = {
|
|
395
|
+
...output,
|
|
396
|
+
body: await parseErrorBody(output.body, context),
|
|
397
|
+
};
|
|
398
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
399
|
+
switch (errorCode) {
|
|
400
|
+
case "InternalServerException":
|
|
401
|
+
case "com.amazonaws.savingsplans#InternalServerException":
|
|
402
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
403
|
+
case "ValidationException":
|
|
404
|
+
case "com.amazonaws.savingsplans#ValidationException":
|
|
405
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
406
|
+
default:
|
|
407
|
+
const parsedBody = parsedOutput.body;
|
|
408
|
+
throwDefaultError({
|
|
409
|
+
output,
|
|
410
|
+
parsedBody,
|
|
411
|
+
exceptionCtor: __BaseException,
|
|
412
|
+
errorCode,
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
export const deserializeAws_restJson1DescribeSavingsPlansOfferingRatesCommand = async (output, context) => {
|
|
417
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
418
|
+
return deserializeAws_restJson1DescribeSavingsPlansOfferingRatesCommandError(output, context);
|
|
419
|
+
}
|
|
420
|
+
const contents = map({
|
|
421
|
+
$metadata: deserializeMetadata(output),
|
|
704
422
|
});
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
423
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
424
|
+
if (data.nextToken != null) {
|
|
425
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
426
|
+
}
|
|
427
|
+
if (data.searchResults != null) {
|
|
428
|
+
contents.searchResults = deserializeAws_restJson1SavingsPlanOfferingRatesList(data.searchResults, context);
|
|
429
|
+
}
|
|
430
|
+
return contents;
|
|
431
|
+
};
|
|
432
|
+
const deserializeAws_restJson1DescribeSavingsPlansOfferingRatesCommandError = async (output, context) => {
|
|
433
|
+
const parsedOutput = {
|
|
434
|
+
...output,
|
|
435
|
+
body: await parseErrorBody(output.body, context),
|
|
436
|
+
};
|
|
437
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
438
|
+
switch (errorCode) {
|
|
439
|
+
case "InternalServerException":
|
|
440
|
+
case "com.amazonaws.savingsplans#InternalServerException":
|
|
441
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
442
|
+
case "ValidationException":
|
|
443
|
+
case "com.amazonaws.savingsplans#ValidationException":
|
|
444
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
445
|
+
default:
|
|
446
|
+
const parsedBody = parsedOutput.body;
|
|
447
|
+
throwDefaultError({
|
|
448
|
+
output,
|
|
449
|
+
parsedBody,
|
|
450
|
+
exceptionCtor: __BaseException,
|
|
451
|
+
errorCode,
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
export const deserializeAws_restJson1DescribeSavingsPlansOfferingsCommand = async (output, context) => {
|
|
456
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
457
|
+
return deserializeAws_restJson1DescribeSavingsPlansOfferingsCommandError(output, context);
|
|
458
|
+
}
|
|
459
|
+
const contents = map({
|
|
460
|
+
$metadata: deserializeMetadata(output),
|
|
722
461
|
});
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
exceptionCtor: __BaseException,
|
|
762
|
-
errorCode: errorCode,
|
|
763
|
-
});
|
|
764
|
-
_d.label = 11;
|
|
765
|
-
case 11: return [2];
|
|
766
|
-
}
|
|
462
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
463
|
+
if (data.nextToken != null) {
|
|
464
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
465
|
+
}
|
|
466
|
+
if (data.searchResults != null) {
|
|
467
|
+
contents.searchResults = deserializeAws_restJson1SavingsPlanOfferingsList(data.searchResults, context);
|
|
468
|
+
}
|
|
469
|
+
return contents;
|
|
470
|
+
};
|
|
471
|
+
const deserializeAws_restJson1DescribeSavingsPlansOfferingsCommandError = async (output, context) => {
|
|
472
|
+
const parsedOutput = {
|
|
473
|
+
...output,
|
|
474
|
+
body: await parseErrorBody(output.body, context),
|
|
475
|
+
};
|
|
476
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
477
|
+
switch (errorCode) {
|
|
478
|
+
case "InternalServerException":
|
|
479
|
+
case "com.amazonaws.savingsplans#InternalServerException":
|
|
480
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
481
|
+
case "ValidationException":
|
|
482
|
+
case "com.amazonaws.savingsplans#ValidationException":
|
|
483
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
484
|
+
default:
|
|
485
|
+
const parsedBody = parsedOutput.body;
|
|
486
|
+
throwDefaultError({
|
|
487
|
+
output,
|
|
488
|
+
parsedBody,
|
|
489
|
+
exceptionCtor: __BaseException,
|
|
490
|
+
errorCode,
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
|
|
495
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
496
|
+
return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
|
|
497
|
+
}
|
|
498
|
+
const contents = map({
|
|
499
|
+
$metadata: deserializeMetadata(output),
|
|
767
500
|
});
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
501
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
502
|
+
if (data.tags != null) {
|
|
503
|
+
contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
|
|
504
|
+
}
|
|
505
|
+
return contents;
|
|
506
|
+
};
|
|
507
|
+
const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
|
|
508
|
+
const parsedOutput = {
|
|
509
|
+
...output,
|
|
510
|
+
body: await parseErrorBody(output.body, context),
|
|
511
|
+
};
|
|
512
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
513
|
+
switch (errorCode) {
|
|
514
|
+
case "InternalServerException":
|
|
515
|
+
case "com.amazonaws.savingsplans#InternalServerException":
|
|
516
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
517
|
+
case "ResourceNotFoundException":
|
|
518
|
+
case "com.amazonaws.savingsplans#ResourceNotFoundException":
|
|
519
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
520
|
+
case "ValidationException":
|
|
521
|
+
case "com.amazonaws.savingsplans#ValidationException":
|
|
522
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
523
|
+
default:
|
|
524
|
+
const parsedBody = parsedOutput.body;
|
|
525
|
+
throwDefaultError({
|
|
526
|
+
output,
|
|
527
|
+
parsedBody,
|
|
528
|
+
exceptionCtor: __BaseException,
|
|
529
|
+
errorCode,
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
|
|
534
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
535
|
+
return deserializeAws_restJson1TagResourceCommandError(output, context);
|
|
536
|
+
}
|
|
537
|
+
const contents = map({
|
|
538
|
+
$metadata: deserializeMetadata(output),
|
|
785
539
|
});
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
case 9: return [2];
|
|
825
|
-
}
|
|
540
|
+
await collectBody(output.body, context);
|
|
541
|
+
return contents;
|
|
542
|
+
};
|
|
543
|
+
const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
|
|
544
|
+
const parsedOutput = {
|
|
545
|
+
...output,
|
|
546
|
+
body: await parseErrorBody(output.body, context),
|
|
547
|
+
};
|
|
548
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
549
|
+
switch (errorCode) {
|
|
550
|
+
case "InternalServerException":
|
|
551
|
+
case "com.amazonaws.savingsplans#InternalServerException":
|
|
552
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
553
|
+
case "ResourceNotFoundException":
|
|
554
|
+
case "com.amazonaws.savingsplans#ResourceNotFoundException":
|
|
555
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
556
|
+
case "ServiceQuotaExceededException":
|
|
557
|
+
case "com.amazonaws.savingsplans#ServiceQuotaExceededException":
|
|
558
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
559
|
+
case "ValidationException":
|
|
560
|
+
case "com.amazonaws.savingsplans#ValidationException":
|
|
561
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
562
|
+
default:
|
|
563
|
+
const parsedBody = parsedOutput.body;
|
|
564
|
+
throwDefaultError({
|
|
565
|
+
output,
|
|
566
|
+
parsedBody,
|
|
567
|
+
exceptionCtor: __BaseException,
|
|
568
|
+
errorCode,
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
|
|
573
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
574
|
+
return deserializeAws_restJson1UntagResourceCommandError(output, context);
|
|
575
|
+
}
|
|
576
|
+
const contents = map({
|
|
577
|
+
$metadata: deserializeMetadata(output),
|
|
826
578
|
});
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
579
|
+
await collectBody(output.body, context);
|
|
580
|
+
return contents;
|
|
581
|
+
};
|
|
582
|
+
const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
|
|
583
|
+
const parsedOutput = {
|
|
584
|
+
...output,
|
|
585
|
+
body: await parseErrorBody(output.body, context),
|
|
586
|
+
};
|
|
587
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
588
|
+
switch (errorCode) {
|
|
589
|
+
case "InternalServerException":
|
|
590
|
+
case "com.amazonaws.savingsplans#InternalServerException":
|
|
591
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
592
|
+
case "ResourceNotFoundException":
|
|
593
|
+
case "com.amazonaws.savingsplans#ResourceNotFoundException":
|
|
594
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
595
|
+
case "ValidationException":
|
|
596
|
+
case "com.amazonaws.savingsplans#ValidationException":
|
|
597
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
598
|
+
default:
|
|
599
|
+
const parsedBody = parsedOutput.body;
|
|
600
|
+
throwDefaultError({
|
|
601
|
+
output,
|
|
602
|
+
parsedBody,
|
|
603
|
+
exceptionCtor: __BaseException,
|
|
604
|
+
errorCode,
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
const map = __map;
|
|
609
|
+
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
610
|
+
const contents = map({});
|
|
611
|
+
const data = parsedOutput.body;
|
|
612
|
+
if (data.message != null) {
|
|
613
|
+
contents.message = __expectString(data.message);
|
|
614
|
+
}
|
|
615
|
+
const exception = new InternalServerException({
|
|
616
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
617
|
+
...contents,
|
|
839
618
|
});
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
619
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
620
|
+
};
|
|
621
|
+
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
622
|
+
const contents = map({});
|
|
623
|
+
const data = parsedOutput.body;
|
|
624
|
+
if (data.message != null) {
|
|
625
|
+
contents.message = __expectString(data.message);
|
|
626
|
+
}
|
|
627
|
+
const exception = new ResourceNotFoundException({
|
|
628
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
629
|
+
...contents,
|
|
851
630
|
});
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
631
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
632
|
+
};
|
|
633
|
+
const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
|
|
634
|
+
const contents = map({});
|
|
635
|
+
const data = parsedOutput.body;
|
|
636
|
+
if (data.message != null) {
|
|
637
|
+
contents.message = __expectString(data.message);
|
|
638
|
+
}
|
|
639
|
+
const exception = new ServiceQuotaExceededException({
|
|
640
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
641
|
+
...contents,
|
|
863
642
|
});
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
643
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
644
|
+
};
|
|
645
|
+
const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
646
|
+
const contents = map({});
|
|
647
|
+
const data = parsedOutput.body;
|
|
648
|
+
if (data.message != null) {
|
|
649
|
+
contents.message = __expectString(data.message);
|
|
650
|
+
}
|
|
651
|
+
const exception = new ValidationException({
|
|
652
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
653
|
+
...contents,
|
|
875
654
|
});
|
|
876
|
-
|
|
877
|
-
|
|
655
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
656
|
+
};
|
|
657
|
+
const serializeAws_restJson1CurrencyList = (input, context) => {
|
|
878
658
|
return input
|
|
879
|
-
.filter(
|
|
880
|
-
.map(
|
|
659
|
+
.filter((e) => e != null)
|
|
660
|
+
.map((entry) => {
|
|
881
661
|
return entry;
|
|
882
662
|
});
|
|
883
663
|
};
|
|
884
|
-
|
|
664
|
+
const serializeAws_restJson1DurationsList = (input, context) => {
|
|
885
665
|
return input
|
|
886
|
-
.filter(
|
|
887
|
-
.map(
|
|
666
|
+
.filter((e) => e != null)
|
|
667
|
+
.map((entry) => {
|
|
888
668
|
return entry;
|
|
889
669
|
});
|
|
890
670
|
};
|
|
891
|
-
|
|
671
|
+
const serializeAws_restJson1FilterValuesList = (input, context) => {
|
|
892
672
|
return input
|
|
893
|
-
.filter(
|
|
894
|
-
.map(
|
|
673
|
+
.filter((e) => e != null)
|
|
674
|
+
.map((entry) => {
|
|
895
675
|
return entry;
|
|
896
676
|
});
|
|
897
677
|
};
|
|
898
|
-
|
|
678
|
+
const serializeAws_restJson1ListOfStrings = (input, context) => {
|
|
899
679
|
return input
|
|
900
|
-
.filter(
|
|
901
|
-
.map(
|
|
680
|
+
.filter((e) => e != null)
|
|
681
|
+
.map((entry) => {
|
|
902
682
|
return entry;
|
|
903
683
|
});
|
|
904
684
|
};
|
|
905
|
-
|
|
685
|
+
const serializeAws_restJson1SavingsPlanArnList = (input, context) => {
|
|
906
686
|
return input
|
|
907
|
-
.filter(
|
|
908
|
-
.map(
|
|
687
|
+
.filter((e) => e != null)
|
|
688
|
+
.map((entry) => {
|
|
909
689
|
return entry;
|
|
910
690
|
});
|
|
911
691
|
};
|
|
912
|
-
|
|
692
|
+
const serializeAws_restJson1SavingsPlanDescriptionsList = (input, context) => {
|
|
913
693
|
return input
|
|
914
|
-
.filter(
|
|
915
|
-
.map(
|
|
694
|
+
.filter((e) => e != null)
|
|
695
|
+
.map((entry) => {
|
|
916
696
|
return entry;
|
|
917
697
|
});
|
|
918
698
|
};
|
|
919
|
-
|
|
920
|
-
return
|
|
699
|
+
const serializeAws_restJson1SavingsPlanFilter = (input, context) => {
|
|
700
|
+
return {
|
|
701
|
+
...(input.name != null && { name: input.name }),
|
|
702
|
+
...(input.values != null && { values: serializeAws_restJson1ListOfStrings(input.values, context) }),
|
|
703
|
+
};
|
|
921
704
|
};
|
|
922
|
-
|
|
705
|
+
const serializeAws_restJson1SavingsPlanFilterList = (input, context) => {
|
|
923
706
|
return input
|
|
924
|
-
.filter(
|
|
925
|
-
.map(
|
|
707
|
+
.filter((e) => e != null)
|
|
708
|
+
.map((entry) => {
|
|
926
709
|
return serializeAws_restJson1SavingsPlanFilter(entry, context);
|
|
927
710
|
});
|
|
928
711
|
};
|
|
929
|
-
|
|
712
|
+
const serializeAws_restJson1SavingsPlanIdList = (input, context) => {
|
|
930
713
|
return input
|
|
931
|
-
.filter(
|
|
932
|
-
.map(
|
|
714
|
+
.filter((e) => e != null)
|
|
715
|
+
.map((entry) => {
|
|
933
716
|
return entry;
|
|
934
717
|
});
|
|
935
718
|
};
|
|
936
|
-
|
|
937
|
-
return
|
|
719
|
+
const serializeAws_restJson1SavingsPlanOfferingFilterElement = (input, context) => {
|
|
720
|
+
return {
|
|
721
|
+
...(input.name != null && { name: input.name }),
|
|
722
|
+
...(input.values != null && { values: serializeAws_restJson1FilterValuesList(input.values, context) }),
|
|
723
|
+
};
|
|
938
724
|
};
|
|
939
|
-
|
|
725
|
+
const serializeAws_restJson1SavingsPlanOfferingFiltersList = (input, context) => {
|
|
940
726
|
return input
|
|
941
|
-
.filter(
|
|
942
|
-
.map(
|
|
727
|
+
.filter((e) => e != null)
|
|
728
|
+
.map((entry) => {
|
|
943
729
|
return serializeAws_restJson1SavingsPlanOfferingFilterElement(entry, context);
|
|
944
730
|
});
|
|
945
731
|
};
|
|
946
|
-
|
|
947
|
-
return
|
|
732
|
+
const serializeAws_restJson1SavingsPlanOfferingRateFilterElement = (input, context) => {
|
|
733
|
+
return {
|
|
734
|
+
...(input.name != null && { name: input.name }),
|
|
735
|
+
...(input.values != null && { values: serializeAws_restJson1FilterValuesList(input.values, context) }),
|
|
736
|
+
};
|
|
948
737
|
};
|
|
949
|
-
|
|
738
|
+
const serializeAws_restJson1SavingsPlanOfferingRateFiltersList = (input, context) => {
|
|
950
739
|
return input
|
|
951
|
-
.filter(
|
|
952
|
-
.map(
|
|
740
|
+
.filter((e) => e != null)
|
|
741
|
+
.map((entry) => {
|
|
953
742
|
return serializeAws_restJson1SavingsPlanOfferingRateFilterElement(entry, context);
|
|
954
743
|
});
|
|
955
744
|
};
|
|
956
|
-
|
|
745
|
+
const serializeAws_restJson1SavingsPlanOperationList = (input, context) => {
|
|
957
746
|
return input
|
|
958
|
-
.filter(
|
|
959
|
-
.map(
|
|
747
|
+
.filter((e) => e != null)
|
|
748
|
+
.map((entry) => {
|
|
960
749
|
return entry;
|
|
961
750
|
});
|
|
962
751
|
};
|
|
963
|
-
|
|
752
|
+
const serializeAws_restJson1SavingsPlanPaymentOptionList = (input, context) => {
|
|
964
753
|
return input
|
|
965
|
-
.filter(
|
|
966
|
-
.map(
|
|
754
|
+
.filter((e) => e != null)
|
|
755
|
+
.map((entry) => {
|
|
967
756
|
return entry;
|
|
968
757
|
});
|
|
969
758
|
};
|
|
970
|
-
|
|
759
|
+
const serializeAws_restJson1SavingsPlanProductTypeList = (input, context) => {
|
|
971
760
|
return input
|
|
972
|
-
.filter(
|
|
973
|
-
.map(
|
|
761
|
+
.filter((e) => e != null)
|
|
762
|
+
.map((entry) => {
|
|
974
763
|
return entry;
|
|
975
764
|
});
|
|
976
765
|
};
|
|
977
|
-
|
|
978
|
-
return
|
|
766
|
+
const serializeAws_restJson1SavingsPlanRateFilter = (input, context) => {
|
|
767
|
+
return {
|
|
768
|
+
...(input.name != null && { name: input.name }),
|
|
769
|
+
...(input.values != null && { values: serializeAws_restJson1ListOfStrings(input.values, context) }),
|
|
770
|
+
};
|
|
979
771
|
};
|
|
980
|
-
|
|
772
|
+
const serializeAws_restJson1SavingsPlanRateFilterList = (input, context) => {
|
|
981
773
|
return input
|
|
982
|
-
.filter(
|
|
983
|
-
.map(
|
|
774
|
+
.filter((e) => e != null)
|
|
775
|
+
.map((entry) => {
|
|
984
776
|
return serializeAws_restJson1SavingsPlanRateFilter(entry, context);
|
|
985
777
|
});
|
|
986
778
|
};
|
|
987
|
-
|
|
779
|
+
const serializeAws_restJson1SavingsPlanRateOperationList = (input, context) => {
|
|
988
780
|
return input
|
|
989
|
-
.filter(
|
|
990
|
-
.map(
|
|
781
|
+
.filter((e) => e != null)
|
|
782
|
+
.map((entry) => {
|
|
991
783
|
return entry;
|
|
992
784
|
});
|
|
993
785
|
};
|
|
994
|
-
|
|
786
|
+
const serializeAws_restJson1SavingsPlanRateServiceCodeList = (input, context) => {
|
|
995
787
|
return input
|
|
996
|
-
.filter(
|
|
997
|
-
.map(
|
|
788
|
+
.filter((e) => e != null)
|
|
789
|
+
.map((entry) => {
|
|
998
790
|
return entry;
|
|
999
791
|
});
|
|
1000
792
|
};
|
|
1001
|
-
|
|
793
|
+
const serializeAws_restJson1SavingsPlanRateUsageTypeList = (input, context) => {
|
|
1002
794
|
return input
|
|
1003
|
-
.filter(
|
|
1004
|
-
.map(
|
|
795
|
+
.filter((e) => e != null)
|
|
796
|
+
.map((entry) => {
|
|
1005
797
|
return entry;
|
|
1006
798
|
});
|
|
1007
799
|
};
|
|
1008
|
-
|
|
800
|
+
const serializeAws_restJson1SavingsPlanServiceCodeList = (input, context) => {
|
|
1009
801
|
return input
|
|
1010
|
-
.filter(
|
|
1011
|
-
.map(
|
|
802
|
+
.filter((e) => e != null)
|
|
803
|
+
.map((entry) => {
|
|
1012
804
|
return entry;
|
|
1013
805
|
});
|
|
1014
806
|
};
|
|
1015
|
-
|
|
807
|
+
const serializeAws_restJson1SavingsPlanStateList = (input, context) => {
|
|
1016
808
|
return input
|
|
1017
|
-
.filter(
|
|
1018
|
-
.map(
|
|
809
|
+
.filter((e) => e != null)
|
|
810
|
+
.map((entry) => {
|
|
1019
811
|
return entry;
|
|
1020
812
|
});
|
|
1021
813
|
};
|
|
1022
|
-
|
|
814
|
+
const serializeAws_restJson1SavingsPlanTypeList = (input, context) => {
|
|
1023
815
|
return input
|
|
1024
|
-
.filter(
|
|
1025
|
-
.map(
|
|
816
|
+
.filter((e) => e != null)
|
|
817
|
+
.map((entry) => {
|
|
1026
818
|
return entry;
|
|
1027
819
|
});
|
|
1028
820
|
};
|
|
1029
|
-
|
|
821
|
+
const serializeAws_restJson1SavingsPlanUsageTypeList = (input, context) => {
|
|
1030
822
|
return input
|
|
1031
|
-
.filter(
|
|
1032
|
-
.map(
|
|
823
|
+
.filter((e) => e != null)
|
|
824
|
+
.map((entry) => {
|
|
1033
825
|
return entry;
|
|
1034
826
|
});
|
|
1035
827
|
};
|
|
1036
|
-
|
|
828
|
+
const serializeAws_restJson1TagKeyList = (input, context) => {
|
|
1037
829
|
return input
|
|
1038
|
-
.filter(
|
|
1039
|
-
.map(
|
|
830
|
+
.filter((e) => e != null)
|
|
831
|
+
.map((entry) => {
|
|
1040
832
|
return entry;
|
|
1041
833
|
});
|
|
1042
834
|
};
|
|
1043
|
-
|
|
1044
|
-
return Object.entries(input).reduce(
|
|
1045
|
-
var _b;
|
|
1046
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
835
|
+
const serializeAws_restJson1TagMap = (input, context) => {
|
|
836
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
1047
837
|
if (value === null) {
|
|
1048
838
|
return acc;
|
|
1049
839
|
}
|
|
1050
|
-
return
|
|
840
|
+
return {
|
|
841
|
+
...acc,
|
|
842
|
+
[key]: value,
|
|
843
|
+
};
|
|
1051
844
|
}, {});
|
|
1052
845
|
};
|
|
1053
|
-
|
|
846
|
+
const serializeAws_restJson1UUIDs = (input, context) => {
|
|
1054
847
|
return input
|
|
1055
|
-
.filter(
|
|
1056
|
-
.map(
|
|
848
|
+
.filter((e) => e != null)
|
|
849
|
+
.map((entry) => {
|
|
1057
850
|
return entry;
|
|
1058
851
|
});
|
|
1059
852
|
};
|
|
1060
|
-
|
|
853
|
+
const deserializeAws_restJson1ParentSavingsPlanOffering = (output, context) => {
|
|
1061
854
|
return {
|
|
1062
855
|
currency: __expectString(output.currency),
|
|
1063
856
|
durationSeconds: __expectLong(output.durationSeconds),
|
|
@@ -1067,7 +860,7 @@ var deserializeAws_restJson1ParentSavingsPlanOffering = function (output, contex
|
|
|
1067
860
|
planType: __expectString(output.planType),
|
|
1068
861
|
};
|
|
1069
862
|
};
|
|
1070
|
-
|
|
863
|
+
const deserializeAws_restJson1SavingsPlan = (output, context) => {
|
|
1071
864
|
return {
|
|
1072
865
|
commitment: __expectString(output.commitment),
|
|
1073
866
|
currency: __expectString(output.currency),
|
|
@@ -1091,10 +884,10 @@ var deserializeAws_restJson1SavingsPlan = function (output, context) {
|
|
|
1091
884
|
upfrontPaymentAmount: __expectString(output.upfrontPaymentAmount),
|
|
1092
885
|
};
|
|
1093
886
|
};
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
.filter(
|
|
1097
|
-
.map(
|
|
887
|
+
const deserializeAws_restJson1SavingsPlanList = (output, context) => {
|
|
888
|
+
const retVal = (output || [])
|
|
889
|
+
.filter((e) => e != null)
|
|
890
|
+
.map((entry) => {
|
|
1098
891
|
if (entry === null) {
|
|
1099
892
|
return null;
|
|
1100
893
|
}
|
|
@@ -1102,7 +895,7 @@ var deserializeAws_restJson1SavingsPlanList = function (output, context) {
|
|
|
1102
895
|
});
|
|
1103
896
|
return retVal;
|
|
1104
897
|
};
|
|
1105
|
-
|
|
898
|
+
const deserializeAws_restJson1SavingsPlanOffering = (output, context) => {
|
|
1106
899
|
return {
|
|
1107
900
|
currency: __expectString(output.currency),
|
|
1108
901
|
description: __expectString(output.description),
|
|
@@ -1121,16 +914,16 @@ var deserializeAws_restJson1SavingsPlanOffering = function (output, context) {
|
|
|
1121
914
|
usageType: __expectString(output.usageType),
|
|
1122
915
|
};
|
|
1123
916
|
};
|
|
1124
|
-
|
|
917
|
+
const deserializeAws_restJson1SavingsPlanOfferingProperty = (output, context) => {
|
|
1125
918
|
return {
|
|
1126
919
|
name: __expectString(output.name),
|
|
1127
920
|
value: __expectString(output.value),
|
|
1128
921
|
};
|
|
1129
922
|
};
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
.filter(
|
|
1133
|
-
.map(
|
|
923
|
+
const deserializeAws_restJson1SavingsPlanOfferingPropertyList = (output, context) => {
|
|
924
|
+
const retVal = (output || [])
|
|
925
|
+
.filter((e) => e != null)
|
|
926
|
+
.map((entry) => {
|
|
1134
927
|
if (entry === null) {
|
|
1135
928
|
return null;
|
|
1136
929
|
}
|
|
@@ -1138,7 +931,7 @@ var deserializeAws_restJson1SavingsPlanOfferingPropertyList = function (output,
|
|
|
1138
931
|
});
|
|
1139
932
|
return retVal;
|
|
1140
933
|
};
|
|
1141
|
-
|
|
934
|
+
const deserializeAws_restJson1SavingsPlanOfferingRate = (output, context) => {
|
|
1142
935
|
return {
|
|
1143
936
|
operation: __expectString(output.operation),
|
|
1144
937
|
productType: __expectString(output.productType),
|
|
@@ -1154,16 +947,16 @@ var deserializeAws_restJson1SavingsPlanOfferingRate = function (output, context)
|
|
|
1154
947
|
usageType: __expectString(output.usageType),
|
|
1155
948
|
};
|
|
1156
949
|
};
|
|
1157
|
-
|
|
950
|
+
const deserializeAws_restJson1SavingsPlanOfferingRateProperty = (output, context) => {
|
|
1158
951
|
return {
|
|
1159
952
|
name: __expectString(output.name),
|
|
1160
953
|
value: __expectString(output.value),
|
|
1161
954
|
};
|
|
1162
955
|
};
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
.filter(
|
|
1166
|
-
.map(
|
|
956
|
+
const deserializeAws_restJson1SavingsPlanOfferingRatePropertyList = (output, context) => {
|
|
957
|
+
const retVal = (output || [])
|
|
958
|
+
.filter((e) => e != null)
|
|
959
|
+
.map((entry) => {
|
|
1167
960
|
if (entry === null) {
|
|
1168
961
|
return null;
|
|
1169
962
|
}
|
|
@@ -1171,10 +964,10 @@ var deserializeAws_restJson1SavingsPlanOfferingRatePropertyList = function (outp
|
|
|
1171
964
|
});
|
|
1172
965
|
return retVal;
|
|
1173
966
|
};
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
.filter(
|
|
1177
|
-
.map(
|
|
967
|
+
const deserializeAws_restJson1SavingsPlanOfferingRatesList = (output, context) => {
|
|
968
|
+
const retVal = (output || [])
|
|
969
|
+
.filter((e) => e != null)
|
|
970
|
+
.map((entry) => {
|
|
1178
971
|
if (entry === null) {
|
|
1179
972
|
return null;
|
|
1180
973
|
}
|
|
@@ -1182,10 +975,10 @@ var deserializeAws_restJson1SavingsPlanOfferingRatesList = function (output, con
|
|
|
1182
975
|
});
|
|
1183
976
|
return retVal;
|
|
1184
977
|
};
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
.filter(
|
|
1188
|
-
.map(
|
|
978
|
+
const deserializeAws_restJson1SavingsPlanOfferingsList = (output, context) => {
|
|
979
|
+
const retVal = (output || [])
|
|
980
|
+
.filter((e) => e != null)
|
|
981
|
+
.map((entry) => {
|
|
1189
982
|
if (entry === null) {
|
|
1190
983
|
return null;
|
|
1191
984
|
}
|
|
@@ -1193,10 +986,10 @@ var deserializeAws_restJson1SavingsPlanOfferingsList = function (output, context
|
|
|
1193
986
|
});
|
|
1194
987
|
return retVal;
|
|
1195
988
|
};
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
.filter(
|
|
1199
|
-
.map(
|
|
989
|
+
const deserializeAws_restJson1SavingsPlanProductTypeList = (output, context) => {
|
|
990
|
+
const retVal = (output || [])
|
|
991
|
+
.filter((e) => e != null)
|
|
992
|
+
.map((entry) => {
|
|
1200
993
|
if (entry === null) {
|
|
1201
994
|
return null;
|
|
1202
995
|
}
|
|
@@ -1204,7 +997,7 @@ var deserializeAws_restJson1SavingsPlanProductTypeList = function (output, conte
|
|
|
1204
997
|
});
|
|
1205
998
|
return retVal;
|
|
1206
999
|
};
|
|
1207
|
-
|
|
1000
|
+
const deserializeAws_restJson1SavingsPlanRate = (output, context) => {
|
|
1208
1001
|
return {
|
|
1209
1002
|
currency: __expectString(output.currency),
|
|
1210
1003
|
operation: __expectString(output.operation),
|
|
@@ -1218,10 +1011,10 @@ var deserializeAws_restJson1SavingsPlanRate = function (output, context) {
|
|
|
1218
1011
|
usageType: __expectString(output.usageType),
|
|
1219
1012
|
};
|
|
1220
1013
|
};
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
.filter(
|
|
1224
|
-
.map(
|
|
1014
|
+
const deserializeAws_restJson1SavingsPlanRateList = (output, context) => {
|
|
1015
|
+
const retVal = (output || [])
|
|
1016
|
+
.filter((e) => e != null)
|
|
1017
|
+
.map((entry) => {
|
|
1225
1018
|
if (entry === null) {
|
|
1226
1019
|
return null;
|
|
1227
1020
|
}
|
|
@@ -1229,16 +1022,16 @@ var deserializeAws_restJson1SavingsPlanRateList = function (output, context) {
|
|
|
1229
1022
|
});
|
|
1230
1023
|
return retVal;
|
|
1231
1024
|
};
|
|
1232
|
-
|
|
1025
|
+
const deserializeAws_restJson1SavingsPlanRateProperty = (output, context) => {
|
|
1233
1026
|
return {
|
|
1234
1027
|
name: __expectString(output.name),
|
|
1235
1028
|
value: __expectString(output.value),
|
|
1236
1029
|
};
|
|
1237
1030
|
};
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
.filter(
|
|
1241
|
-
.map(
|
|
1031
|
+
const deserializeAws_restJson1SavingsPlanRatePropertyList = (output, context) => {
|
|
1032
|
+
const retVal = (output || [])
|
|
1033
|
+
.filter((e) => e != null)
|
|
1034
|
+
.map((entry) => {
|
|
1242
1035
|
if (entry === null) {
|
|
1243
1036
|
return null;
|
|
1244
1037
|
}
|
|
@@ -1246,67 +1039,50 @@ var deserializeAws_restJson1SavingsPlanRatePropertyList = function (output, cont
|
|
|
1246
1039
|
});
|
|
1247
1040
|
return retVal;
|
|
1248
1041
|
};
|
|
1249
|
-
|
|
1250
|
-
return Object.entries(output).reduce(
|
|
1251
|
-
var _b;
|
|
1252
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
1042
|
+
const deserializeAws_restJson1TagMap = (output, context) => {
|
|
1043
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
1253
1044
|
if (value === null) {
|
|
1254
1045
|
return acc;
|
|
1255
1046
|
}
|
|
1256
|
-
return
|
|
1047
|
+
return {
|
|
1048
|
+
...acc,
|
|
1049
|
+
[key]: __expectString(value),
|
|
1050
|
+
};
|
|
1257
1051
|
}, {});
|
|
1258
1052
|
};
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
});
|
|
1267
|
-
};
|
|
1268
|
-
var collectBody = function (streamBody, context) {
|
|
1269
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
1053
|
+
const deserializeMetadata = (output) => ({
|
|
1054
|
+
httpStatusCode: output.statusCode,
|
|
1055
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
1056
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
1057
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
1058
|
+
});
|
|
1059
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
1270
1060
|
if (streamBody instanceof Uint8Array) {
|
|
1271
1061
|
return Promise.resolve(streamBody);
|
|
1272
1062
|
}
|
|
1273
1063
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
1274
1064
|
};
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
});
|
|
1065
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
1066
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
1067
|
+
value !== null &&
|
|
1068
|
+
value !== "" &&
|
|
1069
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
1070
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
1071
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
1072
|
+
if (encoded.length) {
|
|
1073
|
+
return JSON.parse(encoded);
|
|
1074
|
+
}
|
|
1075
|
+
return {};
|
|
1076
|
+
});
|
|
1077
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
1078
|
+
const value = await parseBody(errorBody, context);
|
|
1079
|
+
value.message = value.message ?? value.Message;
|
|
1080
|
+
return value;
|
|
1292
1081
|
};
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
switch (_b.label) {
|
|
1298
|
-
case 0: return [4, parseBody(errorBody, context)];
|
|
1299
|
-
case 1:
|
|
1300
|
-
value = _b.sent();
|
|
1301
|
-
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
1302
|
-
return [2, value];
|
|
1303
|
-
}
|
|
1304
|
-
});
|
|
1305
|
-
}); };
|
|
1306
|
-
var loadRestJsonErrorCode = function (output, data) {
|
|
1307
|
-
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
1308
|
-
var sanitizeErrorCode = function (rawValue) {
|
|
1309
|
-
var cleanValue = rawValue;
|
|
1082
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
1083
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
1084
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
1085
|
+
let cleanValue = rawValue;
|
|
1310
1086
|
if (typeof cleanValue === "number") {
|
|
1311
1087
|
cleanValue = cleanValue.toString();
|
|
1312
1088
|
}
|
|
@@ -1321,7 +1097,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
1321
1097
|
}
|
|
1322
1098
|
return cleanValue;
|
|
1323
1099
|
};
|
|
1324
|
-
|
|
1100
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
1325
1101
|
if (headerKey !== undefined) {
|
|
1326
1102
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
1327
1103
|
}
|