@aws-sdk/client-rbin 3.180.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 +20 -0
- package/dist-cjs/protocols/Aws_restJson1.js +14 -8
- package/dist-es/Rbin.js +34 -41
- package/dist-es/RbinClient.js +22 -28
- package/dist-es/commands/CreateRuleCommand.js +21 -28
- package/dist-es/commands/DeleteRuleCommand.js +21 -28
- package/dist-es/commands/GetRuleCommand.js +21 -28
- package/dist-es/commands/ListRulesCommand.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/commands/UpdateRuleCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/RbinServiceException.js +5 -10
- package/dist-es/models/models_0.js +111 -72
- package/dist-es/pagination/ListRulesPaginator.js +25 -68
- package/dist-es/protocols/Aws_restJson1.js +627 -848
- 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,847 +1,631 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ValidationException, } from "../models/models_0";
|
|
5
4
|
import { RbinServiceException as __BaseException } from "../models/RbinServiceException";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
33
|
-
}); };
|
|
34
|
-
export var serializeAws_restJson1DeleteRuleCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
35
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
36
|
-
return __generator(this, function (_c) {
|
|
37
|
-
switch (_c.label) {
|
|
38
|
-
case 0: return [4, context.endpoint()];
|
|
39
|
-
case 1:
|
|
40
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
41
|
-
headers = {};
|
|
42
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/rules/{Identifier}";
|
|
43
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "Identifier", function () { return input.Identifier; }, "{Identifier}", false);
|
|
44
|
-
return [2, new __HttpRequest({
|
|
45
|
-
protocol: protocol,
|
|
46
|
-
hostname: hostname,
|
|
47
|
-
port: port,
|
|
48
|
-
method: "DELETE",
|
|
49
|
-
headers: headers,
|
|
50
|
-
path: resolvedPath,
|
|
51
|
-
body: body,
|
|
52
|
-
})];
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}); };
|
|
56
|
-
export var serializeAws_restJson1GetRuleCommand = 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
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/rules/{Identifier}";
|
|
65
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "Identifier", function () { return input.Identifier; }, "{Identifier}", false);
|
|
66
|
-
return [2, new __HttpRequest({
|
|
67
|
-
protocol: protocol,
|
|
68
|
-
hostname: hostname,
|
|
69
|
-
port: port,
|
|
70
|
-
method: "GET",
|
|
71
|
-
headers: headers,
|
|
72
|
-
path: resolvedPath,
|
|
73
|
-
body: body,
|
|
74
|
-
})];
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
}); };
|
|
78
|
-
export var serializeAws_restJson1ListRulesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
79
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
80
|
-
return __generator(this, function (_c) {
|
|
81
|
-
switch (_c.label) {
|
|
82
|
-
case 0: return [4, context.endpoint()];
|
|
83
|
-
case 1:
|
|
84
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
85
|
-
headers = {
|
|
86
|
-
"content-type": "application/json",
|
|
87
|
-
};
|
|
88
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/list-rules";
|
|
89
|
-
body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.ResourceTags != null && {
|
|
90
|
-
ResourceTags: serializeAws_restJson1ResourceTags(input.ResourceTags, context),
|
|
91
|
-
})), (input.ResourceType != null && { ResourceType: input.ResourceType })));
|
|
92
|
-
return [2, new __HttpRequest({
|
|
93
|
-
protocol: protocol,
|
|
94
|
-
hostname: hostname,
|
|
95
|
-
port: port,
|
|
96
|
-
method: "POST",
|
|
97
|
-
headers: headers,
|
|
98
|
-
path: resolvedPath,
|
|
99
|
-
body: body,
|
|
100
|
-
})];
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}); };
|
|
104
|
-
export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
105
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
106
|
-
return __generator(this, function (_c) {
|
|
107
|
-
switch (_c.label) {
|
|
108
|
-
case 0: return [4, context.endpoint()];
|
|
109
|
-
case 1:
|
|
110
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
111
|
-
headers = {};
|
|
112
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
|
|
113
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
|
|
114
|
-
return [2, new __HttpRequest({
|
|
115
|
-
protocol: protocol,
|
|
116
|
-
hostname: hostname,
|
|
117
|
-
port: port,
|
|
118
|
-
method: "GET",
|
|
119
|
-
headers: headers,
|
|
120
|
-
path: resolvedPath,
|
|
121
|
-
body: body,
|
|
122
|
-
})];
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
}); };
|
|
126
|
-
export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
127
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
128
|
-
return __generator(this, function (_c) {
|
|
129
|
-
switch (_c.label) {
|
|
130
|
-
case 0: return [4, context.endpoint()];
|
|
131
|
-
case 1:
|
|
132
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
133
|
-
headers = {
|
|
134
|
-
"content-type": "application/json",
|
|
135
|
-
};
|
|
136
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
|
|
137
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
|
|
138
|
-
body = JSON.stringify(__assign({}, (input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) })));
|
|
139
|
-
return [2, new __HttpRequest({
|
|
140
|
-
protocol: protocol,
|
|
141
|
-
hostname: hostname,
|
|
142
|
-
port: port,
|
|
143
|
-
method: "POST",
|
|
144
|
-
headers: headers,
|
|
145
|
-
path: resolvedPath,
|
|
146
|
-
body: body,
|
|
147
|
-
})];
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
}); };
|
|
151
|
-
export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
152
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
153
|
-
return __generator(this, function (_c) {
|
|
154
|
-
switch (_c.label) {
|
|
155
|
-
case 0: return [4, context.endpoint()];
|
|
156
|
-
case 1:
|
|
157
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
158
|
-
headers = {};
|
|
159
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
|
|
160
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
|
|
161
|
-
query = map({
|
|
162
|
-
tagKeys: [function () { return input.TagKeys !== void 0; }, function () { return (input.TagKeys || []).map(function (_entry) { return _entry; }); }],
|
|
163
|
-
});
|
|
164
|
-
return [2, new __HttpRequest({
|
|
165
|
-
protocol: protocol,
|
|
166
|
-
hostname: hostname,
|
|
167
|
-
port: port,
|
|
168
|
-
method: "DELETE",
|
|
169
|
-
headers: headers,
|
|
170
|
-
path: resolvedPath,
|
|
171
|
-
query: query,
|
|
172
|
-
body: body,
|
|
173
|
-
})];
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
}); };
|
|
177
|
-
export var serializeAws_restJson1UpdateRuleCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
178
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
179
|
-
return __generator(this, function (_c) {
|
|
180
|
-
switch (_c.label) {
|
|
181
|
-
case 0: return [4, context.endpoint()];
|
|
182
|
-
case 1:
|
|
183
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
184
|
-
headers = {
|
|
185
|
-
"content-type": "application/json",
|
|
186
|
-
};
|
|
187
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/rules/{Identifier}";
|
|
188
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "Identifier", function () { return input.Identifier; }, "{Identifier}", false);
|
|
189
|
-
body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.Description != null && { Description: input.Description })), (input.ResourceTags != null && {
|
|
190
|
-
ResourceTags: serializeAws_restJson1ResourceTags(input.ResourceTags, context),
|
|
191
|
-
})), (input.ResourceType != null && { ResourceType: input.ResourceType })), (input.RetentionPeriod != null && {
|
|
192
|
-
RetentionPeriod: serializeAws_restJson1RetentionPeriod(input.RetentionPeriod, context),
|
|
193
|
-
})));
|
|
194
|
-
return [2, new __HttpRequest({
|
|
195
|
-
protocol: protocol,
|
|
196
|
-
hostname: hostname,
|
|
197
|
-
port: port,
|
|
198
|
-
method: "PATCH",
|
|
199
|
-
headers: headers,
|
|
200
|
-
path: resolvedPath,
|
|
201
|
-
body: body,
|
|
202
|
-
})];
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
}); };
|
|
206
|
-
export var deserializeAws_restJson1CreateRuleCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
207
|
-
var contents, data, _a, _b;
|
|
208
|
-
return __generator(this, function (_c) {
|
|
209
|
-
switch (_c.label) {
|
|
210
|
-
case 0:
|
|
211
|
-
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
212
|
-
return [2, deserializeAws_restJson1CreateRuleCommandError(output, context)];
|
|
213
|
-
}
|
|
214
|
-
contents = map({
|
|
215
|
-
$metadata: deserializeMetadata(output),
|
|
216
|
-
});
|
|
217
|
-
_a = __expectNonNull;
|
|
218
|
-
_b = __expectObject;
|
|
219
|
-
return [4, parseBody(output.body, context)];
|
|
220
|
-
case 1:
|
|
221
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
222
|
-
if (data.Description != null) {
|
|
223
|
-
contents.Description = __expectString(data.Description);
|
|
224
|
-
}
|
|
225
|
-
if (data.Identifier != null) {
|
|
226
|
-
contents.Identifier = __expectString(data.Identifier);
|
|
227
|
-
}
|
|
228
|
-
if (data.ResourceTags != null) {
|
|
229
|
-
contents.ResourceTags = deserializeAws_restJson1ResourceTags(data.ResourceTags, context);
|
|
230
|
-
}
|
|
231
|
-
if (data.ResourceType != null) {
|
|
232
|
-
contents.ResourceType = __expectString(data.ResourceType);
|
|
233
|
-
}
|
|
234
|
-
if (data.RetentionPeriod != null) {
|
|
235
|
-
contents.RetentionPeriod = deserializeAws_restJson1RetentionPeriod(data.RetentionPeriod, context);
|
|
236
|
-
}
|
|
237
|
-
if (data.Status != null) {
|
|
238
|
-
contents.Status = __expectString(data.Status);
|
|
239
|
-
}
|
|
240
|
-
if (data.Tags != null) {
|
|
241
|
-
contents.Tags = deserializeAws_restJson1TagList(data.Tags, context);
|
|
242
|
-
}
|
|
243
|
-
return [2, contents];
|
|
244
|
-
}
|
|
5
|
+
export const serializeAws_restJson1CreateRuleCommand = async (input, context) => {
|
|
6
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
7
|
+
const headers = {
|
|
8
|
+
"content-type": "application/json",
|
|
9
|
+
};
|
|
10
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/rules";
|
|
11
|
+
let body;
|
|
12
|
+
body = JSON.stringify({
|
|
13
|
+
...(input.Description != null && { Description: input.Description }),
|
|
14
|
+
...(input.ResourceTags != null && {
|
|
15
|
+
ResourceTags: serializeAws_restJson1ResourceTags(input.ResourceTags, context),
|
|
16
|
+
}),
|
|
17
|
+
...(input.ResourceType != null && { ResourceType: input.ResourceType }),
|
|
18
|
+
...(input.RetentionPeriod != null && {
|
|
19
|
+
RetentionPeriod: serializeAws_restJson1RetentionPeriod(input.RetentionPeriod, context),
|
|
20
|
+
}),
|
|
21
|
+
...(input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }),
|
|
22
|
+
});
|
|
23
|
+
return new __HttpRequest({
|
|
24
|
+
protocol,
|
|
25
|
+
hostname,
|
|
26
|
+
port,
|
|
27
|
+
method: "POST",
|
|
28
|
+
headers,
|
|
29
|
+
path: resolvedPath,
|
|
30
|
+
body,
|
|
245
31
|
});
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
case "InternalServerException": return [3, 2];
|
|
262
|
-
case "com.amazonaws.rbin#InternalServerException": return [3, 2];
|
|
263
|
-
case "ServiceQuotaExceededException": return [3, 4];
|
|
264
|
-
case "com.amazonaws.rbin#ServiceQuotaExceededException": return [3, 4];
|
|
265
|
-
case "ValidationException": return [3, 6];
|
|
266
|
-
case "com.amazonaws.rbin#ValidationException": return [3, 6];
|
|
267
|
-
}
|
|
268
|
-
return [3, 8];
|
|
269
|
-
case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
270
|
-
case 3: throw _d.sent();
|
|
271
|
-
case 4: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
|
|
272
|
-
case 5: throw _d.sent();
|
|
273
|
-
case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
274
|
-
case 7: throw _d.sent();
|
|
275
|
-
case 8:
|
|
276
|
-
parsedBody = parsedOutput.body;
|
|
277
|
-
throwDefaultError({
|
|
278
|
-
output: output,
|
|
279
|
-
parsedBody: parsedBody,
|
|
280
|
-
exceptionCtor: __BaseException,
|
|
281
|
-
errorCode: errorCode,
|
|
282
|
-
});
|
|
283
|
-
_d.label = 9;
|
|
284
|
-
case 9: return [2];
|
|
285
|
-
}
|
|
32
|
+
};
|
|
33
|
+
export const serializeAws_restJson1DeleteRuleCommand = async (input, context) => {
|
|
34
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
35
|
+
const headers = {};
|
|
36
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/rules/{Identifier}";
|
|
37
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
|
|
38
|
+
let body;
|
|
39
|
+
return new __HttpRequest({
|
|
40
|
+
protocol,
|
|
41
|
+
hostname,
|
|
42
|
+
port,
|
|
43
|
+
method: "DELETE",
|
|
44
|
+
headers,
|
|
45
|
+
path: resolvedPath,
|
|
46
|
+
body,
|
|
286
47
|
});
|
|
287
|
-
}
|
|
288
|
-
export
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
return [2, contents];
|
|
303
|
-
}
|
|
48
|
+
};
|
|
49
|
+
export const serializeAws_restJson1GetRuleCommand = async (input, context) => {
|
|
50
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
51
|
+
const headers = {};
|
|
52
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/rules/{Identifier}";
|
|
53
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
|
|
54
|
+
let body;
|
|
55
|
+
return new __HttpRequest({
|
|
56
|
+
protocol,
|
|
57
|
+
hostname,
|
|
58
|
+
port,
|
|
59
|
+
method: "GET",
|
|
60
|
+
headers,
|
|
61
|
+
path: resolvedPath,
|
|
62
|
+
body,
|
|
304
63
|
});
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
case 3: throw _d.sent();
|
|
330
|
-
case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
331
|
-
case 5: throw _d.sent();
|
|
332
|
-
case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
333
|
-
case 7: throw _d.sent();
|
|
334
|
-
case 8:
|
|
335
|
-
parsedBody = parsedOutput.body;
|
|
336
|
-
throwDefaultError({
|
|
337
|
-
output: output,
|
|
338
|
-
parsedBody: parsedBody,
|
|
339
|
-
exceptionCtor: __BaseException,
|
|
340
|
-
errorCode: errorCode,
|
|
341
|
-
});
|
|
342
|
-
_d.label = 9;
|
|
343
|
-
case 9: return [2];
|
|
344
|
-
}
|
|
64
|
+
};
|
|
65
|
+
export const serializeAws_restJson1ListRulesCommand = async (input, context) => {
|
|
66
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
67
|
+
const headers = {
|
|
68
|
+
"content-type": "application/json",
|
|
69
|
+
};
|
|
70
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/list-rules";
|
|
71
|
+
let body;
|
|
72
|
+
body = JSON.stringify({
|
|
73
|
+
...(input.MaxResults != null && { MaxResults: input.MaxResults }),
|
|
74
|
+
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
75
|
+
...(input.ResourceTags != null && {
|
|
76
|
+
ResourceTags: serializeAws_restJson1ResourceTags(input.ResourceTags, context),
|
|
77
|
+
}),
|
|
78
|
+
...(input.ResourceType != null && { ResourceType: input.ResourceType }),
|
|
79
|
+
});
|
|
80
|
+
return new __HttpRequest({
|
|
81
|
+
protocol,
|
|
82
|
+
hostname,
|
|
83
|
+
port,
|
|
84
|
+
method: "POST",
|
|
85
|
+
headers,
|
|
86
|
+
path: resolvedPath,
|
|
87
|
+
body,
|
|
345
88
|
});
|
|
346
|
-
}
|
|
347
|
-
export
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
case 1:
|
|
362
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
363
|
-
if (data.Description != null) {
|
|
364
|
-
contents.Description = __expectString(data.Description);
|
|
365
|
-
}
|
|
366
|
-
if (data.Identifier != null) {
|
|
367
|
-
contents.Identifier = __expectString(data.Identifier);
|
|
368
|
-
}
|
|
369
|
-
if (data.ResourceTags != null) {
|
|
370
|
-
contents.ResourceTags = deserializeAws_restJson1ResourceTags(data.ResourceTags, context);
|
|
371
|
-
}
|
|
372
|
-
if (data.ResourceType != null) {
|
|
373
|
-
contents.ResourceType = __expectString(data.ResourceType);
|
|
374
|
-
}
|
|
375
|
-
if (data.RetentionPeriod != null) {
|
|
376
|
-
contents.RetentionPeriod = deserializeAws_restJson1RetentionPeriod(data.RetentionPeriod, context);
|
|
377
|
-
}
|
|
378
|
-
if (data.Status != null) {
|
|
379
|
-
contents.Status = __expectString(data.Status);
|
|
380
|
-
}
|
|
381
|
-
return [2, contents];
|
|
382
|
-
}
|
|
89
|
+
};
|
|
90
|
+
export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
|
|
91
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
92
|
+
const headers = {};
|
|
93
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
|
|
94
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
|
|
95
|
+
let body;
|
|
96
|
+
return new __HttpRequest({
|
|
97
|
+
protocol,
|
|
98
|
+
hostname,
|
|
99
|
+
port,
|
|
100
|
+
method: "GET",
|
|
101
|
+
headers,
|
|
102
|
+
path: resolvedPath,
|
|
103
|
+
body,
|
|
383
104
|
});
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
case "com.amazonaws.rbin#ValidationException": return [3, 6];
|
|
405
|
-
}
|
|
406
|
-
return [3, 8];
|
|
407
|
-
case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
408
|
-
case 3: throw _d.sent();
|
|
409
|
-
case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
410
|
-
case 5: throw _d.sent();
|
|
411
|
-
case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
412
|
-
case 7: throw _d.sent();
|
|
413
|
-
case 8:
|
|
414
|
-
parsedBody = parsedOutput.body;
|
|
415
|
-
throwDefaultError({
|
|
416
|
-
output: output,
|
|
417
|
-
parsedBody: parsedBody,
|
|
418
|
-
exceptionCtor: __BaseException,
|
|
419
|
-
errorCode: errorCode,
|
|
420
|
-
});
|
|
421
|
-
_d.label = 9;
|
|
422
|
-
case 9: return [2];
|
|
423
|
-
}
|
|
105
|
+
};
|
|
106
|
+
export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
|
|
107
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
108
|
+
const headers = {
|
|
109
|
+
"content-type": "application/json",
|
|
110
|
+
};
|
|
111
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
|
|
112
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
|
|
113
|
+
let body;
|
|
114
|
+
body = JSON.stringify({
|
|
115
|
+
...(input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }),
|
|
116
|
+
});
|
|
117
|
+
return new __HttpRequest({
|
|
118
|
+
protocol,
|
|
119
|
+
hostname,
|
|
120
|
+
port,
|
|
121
|
+
method: "POST",
|
|
122
|
+
headers,
|
|
123
|
+
path: resolvedPath,
|
|
124
|
+
body,
|
|
424
125
|
});
|
|
425
|
-
}
|
|
426
|
-
export
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}
|
|
445
|
-
if (data.Rules != null) {
|
|
446
|
-
contents.Rules = deserializeAws_restJson1RuleSummaryList(data.Rules, context);
|
|
447
|
-
}
|
|
448
|
-
return [2, contents];
|
|
449
|
-
}
|
|
126
|
+
};
|
|
127
|
+
export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
|
|
128
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
129
|
+
const headers = {};
|
|
130
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
|
|
131
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
|
|
132
|
+
const query = map({
|
|
133
|
+
tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
|
|
134
|
+
});
|
|
135
|
+
let body;
|
|
136
|
+
return new __HttpRequest({
|
|
137
|
+
protocol,
|
|
138
|
+
hostname,
|
|
139
|
+
port,
|
|
140
|
+
method: "DELETE",
|
|
141
|
+
headers,
|
|
142
|
+
path: resolvedPath,
|
|
143
|
+
query,
|
|
144
|
+
body,
|
|
450
145
|
});
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
throwDefaultError({
|
|
479
|
-
output: output,
|
|
480
|
-
parsedBody: parsedBody,
|
|
481
|
-
exceptionCtor: __BaseException,
|
|
482
|
-
errorCode: errorCode,
|
|
483
|
-
});
|
|
484
|
-
_d.label = 7;
|
|
485
|
-
case 7: return [2];
|
|
486
|
-
}
|
|
146
|
+
};
|
|
147
|
+
export const serializeAws_restJson1UpdateRuleCommand = async (input, context) => {
|
|
148
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
149
|
+
const headers = {
|
|
150
|
+
"content-type": "application/json",
|
|
151
|
+
};
|
|
152
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/rules/{Identifier}";
|
|
153
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
|
|
154
|
+
let body;
|
|
155
|
+
body = JSON.stringify({
|
|
156
|
+
...(input.Description != null && { Description: input.Description }),
|
|
157
|
+
...(input.ResourceTags != null && {
|
|
158
|
+
ResourceTags: serializeAws_restJson1ResourceTags(input.ResourceTags, context),
|
|
159
|
+
}),
|
|
160
|
+
...(input.ResourceType != null && { ResourceType: input.ResourceType }),
|
|
161
|
+
...(input.RetentionPeriod != null && {
|
|
162
|
+
RetentionPeriod: serializeAws_restJson1RetentionPeriod(input.RetentionPeriod, context),
|
|
163
|
+
}),
|
|
164
|
+
});
|
|
165
|
+
return new __HttpRequest({
|
|
166
|
+
protocol,
|
|
167
|
+
hostname,
|
|
168
|
+
port,
|
|
169
|
+
method: "PATCH",
|
|
170
|
+
headers,
|
|
171
|
+
path: resolvedPath,
|
|
172
|
+
body,
|
|
487
173
|
});
|
|
488
|
-
}
|
|
489
|
-
export
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
|
|
496
|
-
}
|
|
497
|
-
contents = map({
|
|
498
|
-
$metadata: deserializeMetadata(output),
|
|
499
|
-
});
|
|
500
|
-
_a = __expectNonNull;
|
|
501
|
-
_b = __expectObject;
|
|
502
|
-
return [4, parseBody(output.body, context)];
|
|
503
|
-
case 1:
|
|
504
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
505
|
-
if (data.Tags != null) {
|
|
506
|
-
contents.Tags = deserializeAws_restJson1TagList(data.Tags, context);
|
|
507
|
-
}
|
|
508
|
-
return [2, contents];
|
|
509
|
-
}
|
|
174
|
+
};
|
|
175
|
+
export const deserializeAws_restJson1CreateRuleCommand = async (output, context) => {
|
|
176
|
+
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
177
|
+
return deserializeAws_restJson1CreateRuleCommandError(output, context);
|
|
178
|
+
}
|
|
179
|
+
const contents = map({
|
|
180
|
+
$metadata: deserializeMetadata(output),
|
|
510
181
|
});
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
182
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
183
|
+
if (data.Description != null) {
|
|
184
|
+
contents.Description = __expectString(data.Description);
|
|
185
|
+
}
|
|
186
|
+
if (data.Identifier != null) {
|
|
187
|
+
contents.Identifier = __expectString(data.Identifier);
|
|
188
|
+
}
|
|
189
|
+
if (data.ResourceTags != null) {
|
|
190
|
+
contents.ResourceTags = deserializeAws_restJson1ResourceTags(data.ResourceTags, context);
|
|
191
|
+
}
|
|
192
|
+
if (data.ResourceType != null) {
|
|
193
|
+
contents.ResourceType = __expectString(data.ResourceType);
|
|
194
|
+
}
|
|
195
|
+
if (data.RetentionPeriod != null) {
|
|
196
|
+
contents.RetentionPeriod = deserializeAws_restJson1RetentionPeriod(data.RetentionPeriod, context);
|
|
197
|
+
}
|
|
198
|
+
if (data.Status != null) {
|
|
199
|
+
contents.Status = __expectString(data.Status);
|
|
200
|
+
}
|
|
201
|
+
if (data.Tags != null) {
|
|
202
|
+
contents.Tags = deserializeAws_restJson1TagList(data.Tags, context);
|
|
203
|
+
}
|
|
204
|
+
return contents;
|
|
205
|
+
};
|
|
206
|
+
const deserializeAws_restJson1CreateRuleCommandError = async (output, context) => {
|
|
207
|
+
const parsedOutput = {
|
|
208
|
+
...output,
|
|
209
|
+
body: await parseErrorBody(output.body, context),
|
|
210
|
+
};
|
|
211
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
212
|
+
switch (errorCode) {
|
|
213
|
+
case "InternalServerException":
|
|
214
|
+
case "com.amazonaws.rbin#InternalServerException":
|
|
215
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
216
|
+
case "ServiceQuotaExceededException":
|
|
217
|
+
case "com.amazonaws.rbin#ServiceQuotaExceededException":
|
|
218
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
219
|
+
case "ValidationException":
|
|
220
|
+
case "com.amazonaws.rbin#ValidationException":
|
|
221
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
222
|
+
default:
|
|
223
|
+
const parsedBody = parsedOutput.body;
|
|
224
|
+
throwDefaultError({
|
|
225
|
+
output,
|
|
226
|
+
parsedBody,
|
|
227
|
+
exceptionCtor: __BaseException,
|
|
228
|
+
errorCode,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
export const deserializeAws_restJson1DeleteRuleCommand = async (output, context) => {
|
|
233
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
234
|
+
return deserializeAws_restJson1DeleteRuleCommandError(output, context);
|
|
235
|
+
}
|
|
236
|
+
const contents = map({
|
|
237
|
+
$metadata: deserializeMetadata(output),
|
|
551
238
|
});
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
239
|
+
await collectBody(output.body, context);
|
|
240
|
+
return contents;
|
|
241
|
+
};
|
|
242
|
+
const deserializeAws_restJson1DeleteRuleCommandError = async (output, context) => {
|
|
243
|
+
const parsedOutput = {
|
|
244
|
+
...output,
|
|
245
|
+
body: await parseErrorBody(output.body, context),
|
|
246
|
+
};
|
|
247
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
248
|
+
switch (errorCode) {
|
|
249
|
+
case "InternalServerException":
|
|
250
|
+
case "com.amazonaws.rbin#InternalServerException":
|
|
251
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
252
|
+
case "ResourceNotFoundException":
|
|
253
|
+
case "com.amazonaws.rbin#ResourceNotFoundException":
|
|
254
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
255
|
+
case "ValidationException":
|
|
256
|
+
case "com.amazonaws.rbin#ValidationException":
|
|
257
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
258
|
+
default:
|
|
259
|
+
const parsedBody = parsedOutput.body;
|
|
260
|
+
throwDefaultError({
|
|
261
|
+
output,
|
|
262
|
+
parsedBody,
|
|
263
|
+
exceptionCtor: __BaseException,
|
|
264
|
+
errorCode,
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
export const deserializeAws_restJson1GetRuleCommand = async (output, context) => {
|
|
269
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
270
|
+
return deserializeAws_restJson1GetRuleCommandError(output, context);
|
|
271
|
+
}
|
|
272
|
+
const contents = map({
|
|
273
|
+
$metadata: deserializeMetadata(output),
|
|
569
274
|
});
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
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
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
275
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
276
|
+
if (data.Description != null) {
|
|
277
|
+
contents.Description = __expectString(data.Description);
|
|
278
|
+
}
|
|
279
|
+
if (data.Identifier != null) {
|
|
280
|
+
contents.Identifier = __expectString(data.Identifier);
|
|
281
|
+
}
|
|
282
|
+
if (data.ResourceTags != null) {
|
|
283
|
+
contents.ResourceTags = deserializeAws_restJson1ResourceTags(data.ResourceTags, context);
|
|
284
|
+
}
|
|
285
|
+
if (data.ResourceType != null) {
|
|
286
|
+
contents.ResourceType = __expectString(data.ResourceType);
|
|
287
|
+
}
|
|
288
|
+
if (data.RetentionPeriod != null) {
|
|
289
|
+
contents.RetentionPeriod = deserializeAws_restJson1RetentionPeriod(data.RetentionPeriod, context);
|
|
290
|
+
}
|
|
291
|
+
if (data.Status != null) {
|
|
292
|
+
contents.Status = __expectString(data.Status);
|
|
293
|
+
}
|
|
294
|
+
return contents;
|
|
295
|
+
};
|
|
296
|
+
const deserializeAws_restJson1GetRuleCommandError = async (output, context) => {
|
|
297
|
+
const parsedOutput = {
|
|
298
|
+
...output,
|
|
299
|
+
body: await parseErrorBody(output.body, context),
|
|
300
|
+
};
|
|
301
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
302
|
+
switch (errorCode) {
|
|
303
|
+
case "InternalServerException":
|
|
304
|
+
case "com.amazonaws.rbin#InternalServerException":
|
|
305
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
306
|
+
case "ResourceNotFoundException":
|
|
307
|
+
case "com.amazonaws.rbin#ResourceNotFoundException":
|
|
308
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
309
|
+
case "ValidationException":
|
|
310
|
+
case "com.amazonaws.rbin#ValidationException":
|
|
311
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
312
|
+
default:
|
|
313
|
+
const parsedBody = parsedOutput.body;
|
|
314
|
+
throwDefaultError({
|
|
315
|
+
output,
|
|
316
|
+
parsedBody,
|
|
317
|
+
exceptionCtor: __BaseException,
|
|
318
|
+
errorCode,
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
export const deserializeAws_restJson1ListRulesCommand = async (output, context) => {
|
|
323
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
324
|
+
return deserializeAws_restJson1ListRulesCommandError(output, context);
|
|
325
|
+
}
|
|
326
|
+
const contents = map({
|
|
327
|
+
$metadata: deserializeMetadata(output),
|
|
614
328
|
});
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
329
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
330
|
+
if (data.NextToken != null) {
|
|
331
|
+
contents.NextToken = __expectString(data.NextToken);
|
|
332
|
+
}
|
|
333
|
+
if (data.Rules != null) {
|
|
334
|
+
contents.Rules = deserializeAws_restJson1RuleSummaryList(data.Rules, context);
|
|
335
|
+
}
|
|
336
|
+
return contents;
|
|
337
|
+
};
|
|
338
|
+
const deserializeAws_restJson1ListRulesCommandError = async (output, context) => {
|
|
339
|
+
const parsedOutput = {
|
|
340
|
+
...output,
|
|
341
|
+
body: await parseErrorBody(output.body, context),
|
|
342
|
+
};
|
|
343
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
344
|
+
switch (errorCode) {
|
|
345
|
+
case "InternalServerException":
|
|
346
|
+
case "com.amazonaws.rbin#InternalServerException":
|
|
347
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
348
|
+
case "ValidationException":
|
|
349
|
+
case "com.amazonaws.rbin#ValidationException":
|
|
350
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
351
|
+
default:
|
|
352
|
+
const parsedBody = parsedOutput.body;
|
|
353
|
+
throwDefaultError({
|
|
354
|
+
output,
|
|
355
|
+
parsedBody,
|
|
356
|
+
exceptionCtor: __BaseException,
|
|
357
|
+
errorCode,
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
|
|
362
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
363
|
+
return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
|
|
364
|
+
}
|
|
365
|
+
const contents = map({
|
|
366
|
+
$metadata: deserializeMetadata(output),
|
|
632
367
|
});
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
return
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
case 9: return [2];
|
|
672
|
-
}
|
|
368
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
369
|
+
if (data.Tags != null) {
|
|
370
|
+
contents.Tags = deserializeAws_restJson1TagList(data.Tags, context);
|
|
371
|
+
}
|
|
372
|
+
return contents;
|
|
373
|
+
};
|
|
374
|
+
const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
|
|
375
|
+
const parsedOutput = {
|
|
376
|
+
...output,
|
|
377
|
+
body: await parseErrorBody(output.body, context),
|
|
378
|
+
};
|
|
379
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
380
|
+
switch (errorCode) {
|
|
381
|
+
case "InternalServerException":
|
|
382
|
+
case "com.amazonaws.rbin#InternalServerException":
|
|
383
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
384
|
+
case "ResourceNotFoundException":
|
|
385
|
+
case "com.amazonaws.rbin#ResourceNotFoundException":
|
|
386
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
387
|
+
case "ValidationException":
|
|
388
|
+
case "com.amazonaws.rbin#ValidationException":
|
|
389
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
390
|
+
default:
|
|
391
|
+
const parsedBody = parsedOutput.body;
|
|
392
|
+
throwDefaultError({
|
|
393
|
+
output,
|
|
394
|
+
parsedBody,
|
|
395
|
+
exceptionCtor: __BaseException,
|
|
396
|
+
errorCode,
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
|
|
401
|
+
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
402
|
+
return deserializeAws_restJson1TagResourceCommandError(output, context);
|
|
403
|
+
}
|
|
404
|
+
const contents = map({
|
|
405
|
+
$metadata: deserializeMetadata(output),
|
|
673
406
|
});
|
|
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
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
407
|
+
await collectBody(output.body, context);
|
|
408
|
+
return contents;
|
|
409
|
+
};
|
|
410
|
+
const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
|
|
411
|
+
const parsedOutput = {
|
|
412
|
+
...output,
|
|
413
|
+
body: await parseErrorBody(output.body, context),
|
|
414
|
+
};
|
|
415
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
416
|
+
switch (errorCode) {
|
|
417
|
+
case "InternalServerException":
|
|
418
|
+
case "com.amazonaws.rbin#InternalServerException":
|
|
419
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
420
|
+
case "ResourceNotFoundException":
|
|
421
|
+
case "com.amazonaws.rbin#ResourceNotFoundException":
|
|
422
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
423
|
+
case "ServiceQuotaExceededException":
|
|
424
|
+
case "com.amazonaws.rbin#ServiceQuotaExceededException":
|
|
425
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
426
|
+
case "ValidationException":
|
|
427
|
+
case "com.amazonaws.rbin#ValidationException":
|
|
428
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
429
|
+
default:
|
|
430
|
+
const parsedBody = parsedOutput.body;
|
|
431
|
+
throwDefaultError({
|
|
432
|
+
output,
|
|
433
|
+
parsedBody,
|
|
434
|
+
exceptionCtor: __BaseException,
|
|
435
|
+
errorCode,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
|
|
440
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
441
|
+
return deserializeAws_restJson1UntagResourceCommandError(output, context);
|
|
442
|
+
}
|
|
443
|
+
const contents = map({
|
|
444
|
+
$metadata: deserializeMetadata(output),
|
|
711
445
|
});
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
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
|
-
errorCode: errorCode,
|
|
748
|
-
});
|
|
749
|
-
_d.label = 9;
|
|
750
|
-
case 9: return [2];
|
|
751
|
-
}
|
|
446
|
+
await collectBody(output.body, context);
|
|
447
|
+
return contents;
|
|
448
|
+
};
|
|
449
|
+
const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
|
|
450
|
+
const parsedOutput = {
|
|
451
|
+
...output,
|
|
452
|
+
body: await parseErrorBody(output.body, context),
|
|
453
|
+
};
|
|
454
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
455
|
+
switch (errorCode) {
|
|
456
|
+
case "InternalServerException":
|
|
457
|
+
case "com.amazonaws.rbin#InternalServerException":
|
|
458
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
459
|
+
case "ResourceNotFoundException":
|
|
460
|
+
case "com.amazonaws.rbin#ResourceNotFoundException":
|
|
461
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
462
|
+
case "ValidationException":
|
|
463
|
+
case "com.amazonaws.rbin#ValidationException":
|
|
464
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
465
|
+
default:
|
|
466
|
+
const parsedBody = parsedOutput.body;
|
|
467
|
+
throwDefaultError({
|
|
468
|
+
output,
|
|
469
|
+
parsedBody,
|
|
470
|
+
exceptionCtor: __BaseException,
|
|
471
|
+
errorCode,
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
export const deserializeAws_restJson1UpdateRuleCommand = async (output, context) => {
|
|
476
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
477
|
+
return deserializeAws_restJson1UpdateRuleCommandError(output, context);
|
|
478
|
+
}
|
|
479
|
+
const contents = map({
|
|
480
|
+
$metadata: deserializeMetadata(output),
|
|
752
481
|
});
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
contents =
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
482
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
483
|
+
if (data.Description != null) {
|
|
484
|
+
contents.Description = __expectString(data.Description);
|
|
485
|
+
}
|
|
486
|
+
if (data.Identifier != null) {
|
|
487
|
+
contents.Identifier = __expectString(data.Identifier);
|
|
488
|
+
}
|
|
489
|
+
if (data.ResourceTags != null) {
|
|
490
|
+
contents.ResourceTags = deserializeAws_restJson1ResourceTags(data.ResourceTags, context);
|
|
491
|
+
}
|
|
492
|
+
if (data.ResourceType != null) {
|
|
493
|
+
contents.ResourceType = __expectString(data.ResourceType);
|
|
494
|
+
}
|
|
495
|
+
if (data.RetentionPeriod != null) {
|
|
496
|
+
contents.RetentionPeriod = deserializeAws_restJson1RetentionPeriod(data.RetentionPeriod, context);
|
|
497
|
+
}
|
|
498
|
+
if (data.Status != null) {
|
|
499
|
+
contents.Status = __expectString(data.Status);
|
|
500
|
+
}
|
|
501
|
+
return contents;
|
|
502
|
+
};
|
|
503
|
+
const deserializeAws_restJson1UpdateRuleCommandError = async (output, context) => {
|
|
504
|
+
const parsedOutput = {
|
|
505
|
+
...output,
|
|
506
|
+
body: await parseErrorBody(output.body, context),
|
|
507
|
+
};
|
|
508
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
509
|
+
switch (errorCode) {
|
|
510
|
+
case "InternalServerException":
|
|
511
|
+
case "com.amazonaws.rbin#InternalServerException":
|
|
512
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
513
|
+
case "ResourceNotFoundException":
|
|
514
|
+
case "com.amazonaws.rbin#ResourceNotFoundException":
|
|
515
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
516
|
+
case "ValidationException":
|
|
517
|
+
case "com.amazonaws.rbin#ValidationException":
|
|
518
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
519
|
+
default:
|
|
520
|
+
const parsedBody = parsedOutput.body;
|
|
521
|
+
throwDefaultError({
|
|
522
|
+
output,
|
|
523
|
+
parsedBody,
|
|
524
|
+
exceptionCtor: __BaseException,
|
|
525
|
+
errorCode,
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
};
|
|
529
|
+
const map = __map;
|
|
530
|
+
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
531
|
+
const contents = map({});
|
|
532
|
+
const data = parsedOutput.body;
|
|
533
|
+
if (data.Message != null) {
|
|
534
|
+
contents.Message = __expectString(data.Message);
|
|
535
|
+
}
|
|
536
|
+
const exception = new InternalServerException({
|
|
537
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
538
|
+
...contents,
|
|
765
539
|
});
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
540
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
541
|
+
};
|
|
542
|
+
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
543
|
+
const contents = map({});
|
|
544
|
+
const data = parsedOutput.body;
|
|
545
|
+
if (data.Message != null) {
|
|
546
|
+
contents.Message = __expectString(data.Message);
|
|
547
|
+
}
|
|
548
|
+
if (data.Reason != null) {
|
|
549
|
+
contents.Reason = __expectString(data.Reason);
|
|
550
|
+
}
|
|
551
|
+
const exception = new ResourceNotFoundException({
|
|
552
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
553
|
+
...contents,
|
|
780
554
|
});
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
555
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
556
|
+
};
|
|
557
|
+
const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
|
|
558
|
+
const contents = map({});
|
|
559
|
+
const data = parsedOutput.body;
|
|
560
|
+
if (data.Message != null) {
|
|
561
|
+
contents.Message = __expectString(data.Message);
|
|
562
|
+
}
|
|
563
|
+
if (data.Reason != null) {
|
|
564
|
+
contents.Reason = __expectString(data.Reason);
|
|
565
|
+
}
|
|
566
|
+
const exception = new ServiceQuotaExceededException({
|
|
567
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
568
|
+
...contents,
|
|
795
569
|
});
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
570
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
571
|
+
};
|
|
572
|
+
const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
573
|
+
const contents = map({});
|
|
574
|
+
const data = parsedOutput.body;
|
|
575
|
+
if (data.Message != null) {
|
|
576
|
+
contents.Message = __expectString(data.Message);
|
|
577
|
+
}
|
|
578
|
+
if (data.Reason != null) {
|
|
579
|
+
contents.Reason = __expectString(data.Reason);
|
|
580
|
+
}
|
|
581
|
+
const exception = new ValidationException({
|
|
582
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
583
|
+
...contents,
|
|
810
584
|
});
|
|
811
|
-
|
|
812
|
-
var serializeAws_restJson1ResourceTag = function (input, context) {
|
|
813
|
-
return __assign(__assign({}, (input.ResourceTagKey != null && { ResourceTagKey: input.ResourceTagKey })), (input.ResourceTagValue != null && { ResourceTagValue: input.ResourceTagValue }));
|
|
585
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
814
586
|
};
|
|
815
|
-
|
|
587
|
+
const serializeAws_restJson1ResourceTag = (input, context) => {
|
|
588
|
+
return {
|
|
589
|
+
...(input.ResourceTagKey != null && { ResourceTagKey: input.ResourceTagKey }),
|
|
590
|
+
...(input.ResourceTagValue != null && { ResourceTagValue: input.ResourceTagValue }),
|
|
591
|
+
};
|
|
592
|
+
};
|
|
593
|
+
const serializeAws_restJson1ResourceTags = (input, context) => {
|
|
816
594
|
return input
|
|
817
|
-
.filter(
|
|
818
|
-
.map(
|
|
595
|
+
.filter((e) => e != null)
|
|
596
|
+
.map((entry) => {
|
|
819
597
|
return serializeAws_restJson1ResourceTag(entry, context);
|
|
820
598
|
});
|
|
821
599
|
};
|
|
822
|
-
|
|
823
|
-
return
|
|
600
|
+
const serializeAws_restJson1RetentionPeriod = (input, context) => {
|
|
601
|
+
return {
|
|
602
|
+
...(input.RetentionPeriodUnit != null && { RetentionPeriodUnit: input.RetentionPeriodUnit }),
|
|
603
|
+
...(input.RetentionPeriodValue != null && { RetentionPeriodValue: input.RetentionPeriodValue }),
|
|
604
|
+
};
|
|
824
605
|
};
|
|
825
|
-
|
|
826
|
-
return
|
|
606
|
+
const serializeAws_restJson1Tag = (input, context) => {
|
|
607
|
+
return {
|
|
608
|
+
...(input.Key != null && { Key: input.Key }),
|
|
609
|
+
...(input.Value != null && { Value: input.Value }),
|
|
610
|
+
};
|
|
827
611
|
};
|
|
828
|
-
|
|
612
|
+
const serializeAws_restJson1TagList = (input, context) => {
|
|
829
613
|
return input
|
|
830
|
-
.filter(
|
|
831
|
-
.map(
|
|
614
|
+
.filter((e) => e != null)
|
|
615
|
+
.map((entry) => {
|
|
832
616
|
return serializeAws_restJson1Tag(entry, context);
|
|
833
617
|
});
|
|
834
618
|
};
|
|
835
|
-
|
|
619
|
+
const deserializeAws_restJson1ResourceTag = (output, context) => {
|
|
836
620
|
return {
|
|
837
621
|
ResourceTagKey: __expectString(output.ResourceTagKey),
|
|
838
622
|
ResourceTagValue: __expectString(output.ResourceTagValue),
|
|
839
623
|
};
|
|
840
624
|
};
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
.filter(
|
|
844
|
-
.map(
|
|
625
|
+
const deserializeAws_restJson1ResourceTags = (output, context) => {
|
|
626
|
+
const retVal = (output || [])
|
|
627
|
+
.filter((e) => e != null)
|
|
628
|
+
.map((entry) => {
|
|
845
629
|
if (entry === null) {
|
|
846
630
|
return null;
|
|
847
631
|
}
|
|
@@ -849,13 +633,13 @@ var deserializeAws_restJson1ResourceTags = function (output, context) {
|
|
|
849
633
|
});
|
|
850
634
|
return retVal;
|
|
851
635
|
};
|
|
852
|
-
|
|
636
|
+
const deserializeAws_restJson1RetentionPeriod = (output, context) => {
|
|
853
637
|
return {
|
|
854
638
|
RetentionPeriodUnit: __expectString(output.RetentionPeriodUnit),
|
|
855
639
|
RetentionPeriodValue: __expectInt32(output.RetentionPeriodValue),
|
|
856
640
|
};
|
|
857
641
|
};
|
|
858
|
-
|
|
642
|
+
const deserializeAws_restJson1RuleSummary = (output, context) => {
|
|
859
643
|
return {
|
|
860
644
|
Description: __expectString(output.Description),
|
|
861
645
|
Identifier: __expectString(output.Identifier),
|
|
@@ -864,10 +648,10 @@ var deserializeAws_restJson1RuleSummary = function (output, context) {
|
|
|
864
648
|
: undefined,
|
|
865
649
|
};
|
|
866
650
|
};
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
.filter(
|
|
870
|
-
.map(
|
|
651
|
+
const deserializeAws_restJson1RuleSummaryList = (output, context) => {
|
|
652
|
+
const retVal = (output || [])
|
|
653
|
+
.filter((e) => e != null)
|
|
654
|
+
.map((entry) => {
|
|
871
655
|
if (entry === null) {
|
|
872
656
|
return null;
|
|
873
657
|
}
|
|
@@ -875,16 +659,16 @@ var deserializeAws_restJson1RuleSummaryList = function (output, context) {
|
|
|
875
659
|
});
|
|
876
660
|
return retVal;
|
|
877
661
|
};
|
|
878
|
-
|
|
662
|
+
const deserializeAws_restJson1Tag = (output, context) => {
|
|
879
663
|
return {
|
|
880
664
|
Key: __expectString(output.Key),
|
|
881
665
|
Value: __expectString(output.Value),
|
|
882
666
|
};
|
|
883
667
|
};
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
.filter(
|
|
887
|
-
.map(
|
|
668
|
+
const deserializeAws_restJson1TagList = (output, context) => {
|
|
669
|
+
const retVal = (output || [])
|
|
670
|
+
.filter((e) => e != null)
|
|
671
|
+
.map((entry) => {
|
|
888
672
|
if (entry === null) {
|
|
889
673
|
return null;
|
|
890
674
|
}
|
|
@@ -892,44 +676,39 @@ var deserializeAws_restJson1TagList = function (output, context) {
|
|
|
892
676
|
});
|
|
893
677
|
return retVal;
|
|
894
678
|
};
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
});
|
|
903
|
-
};
|
|
904
|
-
var collectBody = function (streamBody, context) {
|
|
905
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
679
|
+
const deserializeMetadata = (output) => ({
|
|
680
|
+
httpStatusCode: output.statusCode,
|
|
681
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
682
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
683
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
684
|
+
});
|
|
685
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
906
686
|
if (streamBody instanceof Uint8Array) {
|
|
907
687
|
return Promise.resolve(streamBody);
|
|
908
688
|
}
|
|
909
689
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
910
690
|
};
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
});
|
|
691
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
692
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
693
|
+
value !== null &&
|
|
694
|
+
value !== "" &&
|
|
695
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
696
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
697
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
698
|
+
if (encoded.length) {
|
|
699
|
+
return JSON.parse(encoded);
|
|
700
|
+
}
|
|
701
|
+
return {};
|
|
702
|
+
});
|
|
703
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
704
|
+
const value = await parseBody(errorBody, context);
|
|
705
|
+
value.message = value.message ?? value.Message;
|
|
706
|
+
return value;
|
|
928
707
|
};
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
708
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
709
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
710
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
711
|
+
let cleanValue = rawValue;
|
|
933
712
|
if (typeof cleanValue === "number") {
|
|
934
713
|
cleanValue = cleanValue.toString();
|
|
935
714
|
}
|
|
@@ -944,7 +723,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
944
723
|
}
|
|
945
724
|
return cleanValue;
|
|
946
725
|
};
|
|
947
|
-
|
|
726
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
948
727
|
if (headerKey !== undefined) {
|
|
949
728
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
950
729
|
}
|