@aws-sdk/client-rbin 3.141.0 → 3.142.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 +11 -0
- package/dist-cjs/protocols/Aws_restJson1.js +107 -212
- package/dist-es/protocols/Aws_restJson1.js +138 -217
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.142.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.141.0...v3.142.0) (2022-08-02)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **codegen:** general data mapping function ([#3830](https://github.com/aws/aws-sdk-js-v3/issues/3830)) ([9417eae](https://github.com/aws/aws-sdk-js-v3/commit/9417eae722806799fb4c15c07921574268c1165c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [3.141.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.140.0...v3.141.0) (2022-08-01)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -38,16 +38,7 @@ const serializeAws_restJson1DeleteRuleCommand = async (input, context) => {
|
|
|
38
38
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
39
39
|
const headers = {};
|
|
40
40
|
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/rules/{Identifier}";
|
|
41
|
-
|
|
42
|
-
const labelValue = input.Identifier;
|
|
43
|
-
if (labelValue.length <= 0) {
|
|
44
|
-
throw new Error("Empty value provided for input HTTP label: Identifier.");
|
|
45
|
-
}
|
|
46
|
-
resolvedPath = resolvedPath.replace("{Identifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
throw new Error("No value provided for input HTTP label: Identifier.");
|
|
50
|
-
}
|
|
41
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
|
|
51
42
|
let body;
|
|
52
43
|
return new protocol_http_1.HttpRequest({
|
|
53
44
|
protocol,
|
|
@@ -64,16 +55,7 @@ const serializeAws_restJson1GetRuleCommand = async (input, context) => {
|
|
|
64
55
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
65
56
|
const headers = {};
|
|
66
57
|
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/rules/{Identifier}";
|
|
67
|
-
|
|
68
|
-
const labelValue = input.Identifier;
|
|
69
|
-
if (labelValue.length <= 0) {
|
|
70
|
-
throw new Error("Empty value provided for input HTTP label: Identifier.");
|
|
71
|
-
}
|
|
72
|
-
resolvedPath = resolvedPath.replace("{Identifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
throw new Error("No value provided for input HTTP label: Identifier.");
|
|
76
|
-
}
|
|
58
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
|
|
77
59
|
let body;
|
|
78
60
|
return new protocol_http_1.HttpRequest({
|
|
79
61
|
protocol,
|
|
@@ -116,16 +98,7 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
|
|
|
116
98
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
117
99
|
const headers = {};
|
|
118
100
|
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
|
|
119
|
-
|
|
120
|
-
const labelValue = input.ResourceArn;
|
|
121
|
-
if (labelValue.length <= 0) {
|
|
122
|
-
throw new Error("Empty value provided for input HTTP label: ResourceArn.");
|
|
123
|
-
}
|
|
124
|
-
resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
throw new Error("No value provided for input HTTP label: ResourceArn.");
|
|
128
|
-
}
|
|
101
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
|
|
129
102
|
let body;
|
|
130
103
|
return new protocol_http_1.HttpRequest({
|
|
131
104
|
protocol,
|
|
@@ -144,16 +117,7 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
|
|
|
144
117
|
"content-type": "application/json",
|
|
145
118
|
};
|
|
146
119
|
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
|
|
147
|
-
|
|
148
|
-
const labelValue = input.ResourceArn;
|
|
149
|
-
if (labelValue.length <= 0) {
|
|
150
|
-
throw new Error("Empty value provided for input HTTP label: ResourceArn.");
|
|
151
|
-
}
|
|
152
|
-
resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
throw new Error("No value provided for input HTTP label: ResourceArn.");
|
|
156
|
-
}
|
|
120
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
|
|
157
121
|
let body;
|
|
158
122
|
body = JSON.stringify({
|
|
159
123
|
...(input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }),
|
|
@@ -173,19 +137,10 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
|
|
|
173
137
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
174
138
|
const headers = {};
|
|
175
139
|
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
throw new Error("No value provided for input HTTP label: ResourceArn.");
|
|
185
|
-
}
|
|
186
|
-
const query = {
|
|
187
|
-
...(input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map((_entry) => _entry) }),
|
|
188
|
-
};
|
|
140
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
|
|
141
|
+
const query = map({
|
|
142
|
+
tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
|
|
143
|
+
});
|
|
189
144
|
let body;
|
|
190
145
|
return new protocol_http_1.HttpRequest({
|
|
191
146
|
protocol,
|
|
@@ -205,16 +160,7 @@ const serializeAws_restJson1UpdateRuleCommand = async (input, context) => {
|
|
|
205
160
|
"content-type": "application/json",
|
|
206
161
|
};
|
|
207
162
|
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/rules/{Identifier}";
|
|
208
|
-
|
|
209
|
-
const labelValue = input.Identifier;
|
|
210
|
-
if (labelValue.length <= 0) {
|
|
211
|
-
throw new Error("Empty value provided for input HTTP label: Identifier.");
|
|
212
|
-
}
|
|
213
|
-
resolvedPath = resolvedPath.replace("{Identifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
214
|
-
}
|
|
215
|
-
else {
|
|
216
|
-
throw new Error("No value provided for input HTTP label: Identifier.");
|
|
217
|
-
}
|
|
163
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
|
|
218
164
|
let body;
|
|
219
165
|
body = JSON.stringify({
|
|
220
166
|
...(input.Description != null && { Description: input.Description }),
|
|
@@ -241,39 +187,32 @@ const deserializeAws_restJson1CreateRuleCommand = async (output, context) => {
|
|
|
241
187
|
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
242
188
|
return deserializeAws_restJson1CreateRuleCommandError(output, context);
|
|
243
189
|
}
|
|
244
|
-
const contents = {
|
|
190
|
+
const contents = map({
|
|
245
191
|
$metadata: deserializeMetadata(output),
|
|
246
|
-
|
|
247
|
-
Identifier: undefined,
|
|
248
|
-
ResourceTags: undefined,
|
|
249
|
-
ResourceType: undefined,
|
|
250
|
-
RetentionPeriod: undefined,
|
|
251
|
-
Status: undefined,
|
|
252
|
-
Tags: undefined,
|
|
253
|
-
};
|
|
192
|
+
});
|
|
254
193
|
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
255
|
-
if (data.Description
|
|
194
|
+
if (data.Description != null) {
|
|
256
195
|
contents.Description = (0, smithy_client_1.expectString)(data.Description);
|
|
257
196
|
}
|
|
258
|
-
if (data.Identifier
|
|
197
|
+
if (data.Identifier != null) {
|
|
259
198
|
contents.Identifier = (0, smithy_client_1.expectString)(data.Identifier);
|
|
260
199
|
}
|
|
261
|
-
if (data.ResourceTags
|
|
200
|
+
if (data.ResourceTags != null) {
|
|
262
201
|
contents.ResourceTags = deserializeAws_restJson1ResourceTags(data.ResourceTags, context);
|
|
263
202
|
}
|
|
264
|
-
if (data.ResourceType
|
|
203
|
+
if (data.ResourceType != null) {
|
|
265
204
|
contents.ResourceType = (0, smithy_client_1.expectString)(data.ResourceType);
|
|
266
205
|
}
|
|
267
|
-
if (data.RetentionPeriod
|
|
206
|
+
if (data.RetentionPeriod != null) {
|
|
268
207
|
contents.RetentionPeriod = deserializeAws_restJson1RetentionPeriod(data.RetentionPeriod, context);
|
|
269
208
|
}
|
|
270
|
-
if (data.Status
|
|
209
|
+
if (data.Status != null) {
|
|
271
210
|
contents.Status = (0, smithy_client_1.expectString)(data.Status);
|
|
272
211
|
}
|
|
273
|
-
if (data.Tags
|
|
212
|
+
if (data.Tags != null) {
|
|
274
213
|
contents.Tags = deserializeAws_restJson1TagList(data.Tags, context);
|
|
275
214
|
}
|
|
276
|
-
return
|
|
215
|
+
return contents;
|
|
277
216
|
};
|
|
278
217
|
exports.deserializeAws_restJson1CreateRuleCommand = deserializeAws_restJson1CreateRuleCommand;
|
|
279
218
|
const deserializeAws_restJson1CreateRuleCommandError = async (output, context) => {
|
|
@@ -281,7 +220,6 @@ const deserializeAws_restJson1CreateRuleCommandError = async (output, context) =
|
|
|
281
220
|
...output,
|
|
282
221
|
body: await parseBody(output.body, context),
|
|
283
222
|
};
|
|
284
|
-
let response;
|
|
285
223
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
286
224
|
switch (errorCode) {
|
|
287
225
|
case "InternalServerException":
|
|
@@ -295,25 +233,23 @@ const deserializeAws_restJson1CreateRuleCommandError = async (output, context) =
|
|
|
295
233
|
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
296
234
|
default:
|
|
297
235
|
const parsedBody = parsedOutput.body;
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
$metadata,
|
|
236
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
237
|
+
output,
|
|
238
|
+
parsedBody,
|
|
239
|
+
exceptionCtor: RbinServiceException_1.RbinServiceException,
|
|
240
|
+
errorCode,
|
|
304
241
|
});
|
|
305
|
-
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
306
242
|
}
|
|
307
243
|
};
|
|
308
244
|
const deserializeAws_restJson1DeleteRuleCommand = async (output, context) => {
|
|
309
245
|
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
310
246
|
return deserializeAws_restJson1DeleteRuleCommandError(output, context);
|
|
311
247
|
}
|
|
312
|
-
const contents = {
|
|
248
|
+
const contents = map({
|
|
313
249
|
$metadata: deserializeMetadata(output),
|
|
314
|
-
};
|
|
250
|
+
});
|
|
315
251
|
await collectBody(output.body, context);
|
|
316
|
-
return
|
|
252
|
+
return contents;
|
|
317
253
|
};
|
|
318
254
|
exports.deserializeAws_restJson1DeleteRuleCommand = deserializeAws_restJson1DeleteRuleCommand;
|
|
319
255
|
const deserializeAws_restJson1DeleteRuleCommandError = async (output, context) => {
|
|
@@ -321,7 +257,6 @@ const deserializeAws_restJson1DeleteRuleCommandError = async (output, context) =
|
|
|
321
257
|
...output,
|
|
322
258
|
body: await parseBody(output.body, context),
|
|
323
259
|
};
|
|
324
|
-
let response;
|
|
325
260
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
326
261
|
switch (errorCode) {
|
|
327
262
|
case "InternalServerException":
|
|
@@ -335,49 +270,41 @@ const deserializeAws_restJson1DeleteRuleCommandError = async (output, context) =
|
|
|
335
270
|
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
336
271
|
default:
|
|
337
272
|
const parsedBody = parsedOutput.body;
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
$metadata,
|
|
273
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
274
|
+
output,
|
|
275
|
+
parsedBody,
|
|
276
|
+
exceptionCtor: RbinServiceException_1.RbinServiceException,
|
|
277
|
+
errorCode,
|
|
344
278
|
});
|
|
345
|
-
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
346
279
|
}
|
|
347
280
|
};
|
|
348
281
|
const deserializeAws_restJson1GetRuleCommand = async (output, context) => {
|
|
349
282
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
350
283
|
return deserializeAws_restJson1GetRuleCommandError(output, context);
|
|
351
284
|
}
|
|
352
|
-
const contents = {
|
|
285
|
+
const contents = map({
|
|
353
286
|
$metadata: deserializeMetadata(output),
|
|
354
|
-
|
|
355
|
-
Identifier: undefined,
|
|
356
|
-
ResourceTags: undefined,
|
|
357
|
-
ResourceType: undefined,
|
|
358
|
-
RetentionPeriod: undefined,
|
|
359
|
-
Status: undefined,
|
|
360
|
-
};
|
|
287
|
+
});
|
|
361
288
|
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
362
|
-
if (data.Description
|
|
289
|
+
if (data.Description != null) {
|
|
363
290
|
contents.Description = (0, smithy_client_1.expectString)(data.Description);
|
|
364
291
|
}
|
|
365
|
-
if (data.Identifier
|
|
292
|
+
if (data.Identifier != null) {
|
|
366
293
|
contents.Identifier = (0, smithy_client_1.expectString)(data.Identifier);
|
|
367
294
|
}
|
|
368
|
-
if (data.ResourceTags
|
|
295
|
+
if (data.ResourceTags != null) {
|
|
369
296
|
contents.ResourceTags = deserializeAws_restJson1ResourceTags(data.ResourceTags, context);
|
|
370
297
|
}
|
|
371
|
-
if (data.ResourceType
|
|
298
|
+
if (data.ResourceType != null) {
|
|
372
299
|
contents.ResourceType = (0, smithy_client_1.expectString)(data.ResourceType);
|
|
373
300
|
}
|
|
374
|
-
if (data.RetentionPeriod
|
|
301
|
+
if (data.RetentionPeriod != null) {
|
|
375
302
|
contents.RetentionPeriod = deserializeAws_restJson1RetentionPeriod(data.RetentionPeriod, context);
|
|
376
303
|
}
|
|
377
|
-
if (data.Status
|
|
304
|
+
if (data.Status != null) {
|
|
378
305
|
contents.Status = (0, smithy_client_1.expectString)(data.Status);
|
|
379
306
|
}
|
|
380
|
-
return
|
|
307
|
+
return contents;
|
|
381
308
|
};
|
|
382
309
|
exports.deserializeAws_restJson1GetRuleCommand = deserializeAws_restJson1GetRuleCommand;
|
|
383
310
|
const deserializeAws_restJson1GetRuleCommandError = async (output, context) => {
|
|
@@ -385,7 +312,6 @@ const deserializeAws_restJson1GetRuleCommandError = async (output, context) => {
|
|
|
385
312
|
...output,
|
|
386
313
|
body: await parseBody(output.body, context),
|
|
387
314
|
};
|
|
388
|
-
let response;
|
|
389
315
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
390
316
|
switch (errorCode) {
|
|
391
317
|
case "InternalServerException":
|
|
@@ -399,33 +325,29 @@ const deserializeAws_restJson1GetRuleCommandError = async (output, context) => {
|
|
|
399
325
|
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
400
326
|
default:
|
|
401
327
|
const parsedBody = parsedOutput.body;
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
$metadata,
|
|
328
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
329
|
+
output,
|
|
330
|
+
parsedBody,
|
|
331
|
+
exceptionCtor: RbinServiceException_1.RbinServiceException,
|
|
332
|
+
errorCode,
|
|
408
333
|
});
|
|
409
|
-
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
410
334
|
}
|
|
411
335
|
};
|
|
412
336
|
const deserializeAws_restJson1ListRulesCommand = async (output, context) => {
|
|
413
337
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
414
338
|
return deserializeAws_restJson1ListRulesCommandError(output, context);
|
|
415
339
|
}
|
|
416
|
-
const contents = {
|
|
340
|
+
const contents = map({
|
|
417
341
|
$metadata: deserializeMetadata(output),
|
|
418
|
-
|
|
419
|
-
Rules: undefined,
|
|
420
|
-
};
|
|
342
|
+
});
|
|
421
343
|
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
422
|
-
if (data.NextToken
|
|
344
|
+
if (data.NextToken != null) {
|
|
423
345
|
contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
|
|
424
346
|
}
|
|
425
|
-
if (data.Rules
|
|
347
|
+
if (data.Rules != null) {
|
|
426
348
|
contents.Rules = deserializeAws_restJson1RuleSummaryList(data.Rules, context);
|
|
427
349
|
}
|
|
428
|
-
return
|
|
350
|
+
return contents;
|
|
429
351
|
};
|
|
430
352
|
exports.deserializeAws_restJson1ListRulesCommand = deserializeAws_restJson1ListRulesCommand;
|
|
431
353
|
const deserializeAws_restJson1ListRulesCommandError = async (output, context) => {
|
|
@@ -433,7 +355,6 @@ const deserializeAws_restJson1ListRulesCommandError = async (output, context) =>
|
|
|
433
355
|
...output,
|
|
434
356
|
body: await parseBody(output.body, context),
|
|
435
357
|
};
|
|
436
|
-
let response;
|
|
437
358
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
438
359
|
switch (errorCode) {
|
|
439
360
|
case "InternalServerException":
|
|
@@ -444,29 +365,26 @@ const deserializeAws_restJson1ListRulesCommandError = async (output, context) =>
|
|
|
444
365
|
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
445
366
|
default:
|
|
446
367
|
const parsedBody = parsedOutput.body;
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
$metadata,
|
|
368
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
369
|
+
output,
|
|
370
|
+
parsedBody,
|
|
371
|
+
exceptionCtor: RbinServiceException_1.RbinServiceException,
|
|
372
|
+
errorCode,
|
|
453
373
|
});
|
|
454
|
-
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
455
374
|
}
|
|
456
375
|
};
|
|
457
376
|
const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
|
|
458
377
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
459
378
|
return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
|
|
460
379
|
}
|
|
461
|
-
const contents = {
|
|
380
|
+
const contents = map({
|
|
462
381
|
$metadata: deserializeMetadata(output),
|
|
463
|
-
|
|
464
|
-
};
|
|
382
|
+
});
|
|
465
383
|
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
466
|
-
if (data.Tags
|
|
384
|
+
if (data.Tags != null) {
|
|
467
385
|
contents.Tags = deserializeAws_restJson1TagList(data.Tags, context);
|
|
468
386
|
}
|
|
469
|
-
return
|
|
387
|
+
return contents;
|
|
470
388
|
};
|
|
471
389
|
exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
|
|
472
390
|
const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
|
|
@@ -474,7 +392,6 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
|
|
|
474
392
|
...output,
|
|
475
393
|
body: await parseBody(output.body, context),
|
|
476
394
|
};
|
|
477
|
-
let response;
|
|
478
395
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
479
396
|
switch (errorCode) {
|
|
480
397
|
case "InternalServerException":
|
|
@@ -488,25 +405,23 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
|
|
|
488
405
|
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
489
406
|
default:
|
|
490
407
|
const parsedBody = parsedOutput.body;
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
$metadata,
|
|
408
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
409
|
+
output,
|
|
410
|
+
parsedBody,
|
|
411
|
+
exceptionCtor: RbinServiceException_1.RbinServiceException,
|
|
412
|
+
errorCode,
|
|
497
413
|
});
|
|
498
|
-
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
499
414
|
}
|
|
500
415
|
};
|
|
501
416
|
const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
|
|
502
417
|
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
503
418
|
return deserializeAws_restJson1TagResourceCommandError(output, context);
|
|
504
419
|
}
|
|
505
|
-
const contents = {
|
|
420
|
+
const contents = map({
|
|
506
421
|
$metadata: deserializeMetadata(output),
|
|
507
|
-
};
|
|
422
|
+
});
|
|
508
423
|
await collectBody(output.body, context);
|
|
509
|
-
return
|
|
424
|
+
return contents;
|
|
510
425
|
};
|
|
511
426
|
exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
|
|
512
427
|
const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
|
|
@@ -514,7 +429,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
|
|
|
514
429
|
...output,
|
|
515
430
|
body: await parseBody(output.body, context),
|
|
516
431
|
};
|
|
517
|
-
let response;
|
|
518
432
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
519
433
|
switch (errorCode) {
|
|
520
434
|
case "InternalServerException":
|
|
@@ -531,25 +445,23 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
|
|
|
531
445
|
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
532
446
|
default:
|
|
533
447
|
const parsedBody = parsedOutput.body;
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
$metadata,
|
|
448
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
449
|
+
output,
|
|
450
|
+
parsedBody,
|
|
451
|
+
exceptionCtor: RbinServiceException_1.RbinServiceException,
|
|
452
|
+
errorCode,
|
|
540
453
|
});
|
|
541
|
-
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
542
454
|
}
|
|
543
455
|
};
|
|
544
456
|
const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
|
|
545
457
|
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
546
458
|
return deserializeAws_restJson1UntagResourceCommandError(output, context);
|
|
547
459
|
}
|
|
548
|
-
const contents = {
|
|
460
|
+
const contents = map({
|
|
549
461
|
$metadata: deserializeMetadata(output),
|
|
550
|
-
};
|
|
462
|
+
});
|
|
551
463
|
await collectBody(output.body, context);
|
|
552
|
-
return
|
|
464
|
+
return contents;
|
|
553
465
|
};
|
|
554
466
|
exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
|
|
555
467
|
const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
|
|
@@ -557,7 +469,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
|
|
|
557
469
|
...output,
|
|
558
470
|
body: await parseBody(output.body, context),
|
|
559
471
|
};
|
|
560
|
-
let response;
|
|
561
472
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
562
473
|
switch (errorCode) {
|
|
563
474
|
case "InternalServerException":
|
|
@@ -571,49 +482,41 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
|
|
|
571
482
|
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
572
483
|
default:
|
|
573
484
|
const parsedBody = parsedOutput.body;
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
$metadata,
|
|
485
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
486
|
+
output,
|
|
487
|
+
parsedBody,
|
|
488
|
+
exceptionCtor: RbinServiceException_1.RbinServiceException,
|
|
489
|
+
errorCode,
|
|
580
490
|
});
|
|
581
|
-
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
582
491
|
}
|
|
583
492
|
};
|
|
584
493
|
const deserializeAws_restJson1UpdateRuleCommand = async (output, context) => {
|
|
585
494
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
586
495
|
return deserializeAws_restJson1UpdateRuleCommandError(output, context);
|
|
587
496
|
}
|
|
588
|
-
const contents = {
|
|
497
|
+
const contents = map({
|
|
589
498
|
$metadata: deserializeMetadata(output),
|
|
590
|
-
|
|
591
|
-
Identifier: undefined,
|
|
592
|
-
ResourceTags: undefined,
|
|
593
|
-
ResourceType: undefined,
|
|
594
|
-
RetentionPeriod: undefined,
|
|
595
|
-
Status: undefined,
|
|
596
|
-
};
|
|
499
|
+
});
|
|
597
500
|
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
598
|
-
if (data.Description
|
|
501
|
+
if (data.Description != null) {
|
|
599
502
|
contents.Description = (0, smithy_client_1.expectString)(data.Description);
|
|
600
503
|
}
|
|
601
|
-
if (data.Identifier
|
|
504
|
+
if (data.Identifier != null) {
|
|
602
505
|
contents.Identifier = (0, smithy_client_1.expectString)(data.Identifier);
|
|
603
506
|
}
|
|
604
|
-
if (data.ResourceTags
|
|
507
|
+
if (data.ResourceTags != null) {
|
|
605
508
|
contents.ResourceTags = deserializeAws_restJson1ResourceTags(data.ResourceTags, context);
|
|
606
509
|
}
|
|
607
|
-
if (data.ResourceType
|
|
510
|
+
if (data.ResourceType != null) {
|
|
608
511
|
contents.ResourceType = (0, smithy_client_1.expectString)(data.ResourceType);
|
|
609
512
|
}
|
|
610
|
-
if (data.RetentionPeriod
|
|
513
|
+
if (data.RetentionPeriod != null) {
|
|
611
514
|
contents.RetentionPeriod = deserializeAws_restJson1RetentionPeriod(data.RetentionPeriod, context);
|
|
612
515
|
}
|
|
613
|
-
if (data.Status
|
|
516
|
+
if (data.Status != null) {
|
|
614
517
|
contents.Status = (0, smithy_client_1.expectString)(data.Status);
|
|
615
518
|
}
|
|
616
|
-
return
|
|
519
|
+
return contents;
|
|
617
520
|
};
|
|
618
521
|
exports.deserializeAws_restJson1UpdateRuleCommand = deserializeAws_restJson1UpdateRuleCommand;
|
|
619
522
|
const deserializeAws_restJson1UpdateRuleCommandError = async (output, context) => {
|
|
@@ -621,7 +524,6 @@ const deserializeAws_restJson1UpdateRuleCommandError = async (output, context) =
|
|
|
621
524
|
...output,
|
|
622
525
|
body: await parseBody(output.body, context),
|
|
623
526
|
};
|
|
624
|
-
let response;
|
|
625
527
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
626
528
|
switch (errorCode) {
|
|
627
529
|
case "InternalServerException":
|
|
@@ -635,20 +537,19 @@ const deserializeAws_restJson1UpdateRuleCommandError = async (output, context) =
|
|
|
635
537
|
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
636
538
|
default:
|
|
637
539
|
const parsedBody = parsedOutput.body;
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
$metadata,
|
|
540
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
541
|
+
output,
|
|
542
|
+
parsedBody,
|
|
543
|
+
exceptionCtor: RbinServiceException_1.RbinServiceException,
|
|
544
|
+
errorCode,
|
|
644
545
|
});
|
|
645
|
-
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
646
546
|
}
|
|
647
547
|
};
|
|
548
|
+
const map = smithy_client_1.map;
|
|
648
549
|
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
649
|
-
const contents = {};
|
|
550
|
+
const contents = map({});
|
|
650
551
|
const data = parsedOutput.body;
|
|
651
|
-
if (data.Message
|
|
552
|
+
if (data.Message != null) {
|
|
652
553
|
contents.Message = (0, smithy_client_1.expectString)(data.Message);
|
|
653
554
|
}
|
|
654
555
|
const exception = new models_0_1.InternalServerException({
|
|
@@ -658,12 +559,12 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
|
|
|
658
559
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
659
560
|
};
|
|
660
561
|
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
661
|
-
const contents = {};
|
|
562
|
+
const contents = map({});
|
|
662
563
|
const data = parsedOutput.body;
|
|
663
|
-
if (data.Message
|
|
564
|
+
if (data.Message != null) {
|
|
664
565
|
contents.Message = (0, smithy_client_1.expectString)(data.Message);
|
|
665
566
|
}
|
|
666
|
-
if (data.Reason
|
|
567
|
+
if (data.Reason != null) {
|
|
667
568
|
contents.Reason = (0, smithy_client_1.expectString)(data.Reason);
|
|
668
569
|
}
|
|
669
570
|
const exception = new models_0_1.ResourceNotFoundException({
|
|
@@ -673,12 +574,12 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
|
|
|
673
574
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
674
575
|
};
|
|
675
576
|
const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
|
|
676
|
-
const contents = {};
|
|
577
|
+
const contents = map({});
|
|
677
578
|
const data = parsedOutput.body;
|
|
678
|
-
if (data.Message
|
|
579
|
+
if (data.Message != null) {
|
|
679
580
|
contents.Message = (0, smithy_client_1.expectString)(data.Message);
|
|
680
581
|
}
|
|
681
|
-
if (data.Reason
|
|
582
|
+
if (data.Reason != null) {
|
|
682
583
|
contents.Reason = (0, smithy_client_1.expectString)(data.Reason);
|
|
683
584
|
}
|
|
684
585
|
const exception = new models_0_1.ServiceQuotaExceededException({
|
|
@@ -688,12 +589,12 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
|
|
|
688
589
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
689
590
|
};
|
|
690
591
|
const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
691
|
-
const contents = {};
|
|
592
|
+
const contents = map({});
|
|
692
593
|
const data = parsedOutput.body;
|
|
693
|
-
if (data.Message
|
|
594
|
+
if (data.Message != null) {
|
|
694
595
|
contents.Message = (0, smithy_client_1.expectString)(data.Message);
|
|
695
596
|
}
|
|
696
|
-
if (data.Reason
|
|
597
|
+
if (data.Reason != null) {
|
|
697
598
|
contents.Reason = (0, smithy_client_1.expectString)(data.Reason);
|
|
698
599
|
}
|
|
699
600
|
const exception = new models_0_1.ValidationException({
|
|
@@ -712,9 +613,6 @@ const serializeAws_restJson1ResourceTags = (input, context) => {
|
|
|
712
613
|
return input
|
|
713
614
|
.filter((e) => e != null)
|
|
714
615
|
.map((entry) => {
|
|
715
|
-
if (entry === null) {
|
|
716
|
-
return null;
|
|
717
|
-
}
|
|
718
616
|
return serializeAws_restJson1ResourceTag(entry, context);
|
|
719
617
|
});
|
|
720
618
|
};
|
|
@@ -734,9 +632,6 @@ const serializeAws_restJson1TagList = (input, context) => {
|
|
|
734
632
|
return input
|
|
735
633
|
.filter((e) => e != null)
|
|
736
634
|
.map((entry) => {
|
|
737
|
-
if (entry === null) {
|
|
738
|
-
return null;
|
|
739
|
-
}
|
|
740
635
|
return serializeAws_restJson1Tag(entry, context);
|
|
741
636
|
});
|
|
742
637
|
};
|