@aws-sdk/client-amp 3.137.0 → 3.145.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseEpochTimestamp as __parseEpochTimestamp, strictParseInt32 as __strictParseInt32, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, strictParseInt32 as __strictParseInt32, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { v4 as generateIdempotencyToken } from "uuid";
5
5
  import { AmpServiceException as __BaseException } from "../models/AmpServiceException";
6
6
  import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
7
7
  export var serializeAws_restJson1CreateAlertManagerDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
8
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
8
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
9
9
  var _c;
10
10
  return __generator(this, function (_d) {
11
11
  switch (_d.label) {
@@ -17,16 +17,7 @@ export var serializeAws_restJson1CreateAlertManagerDefinitionCommand = function
17
17
  };
18
18
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
19
19
  "/workspaces/{workspaceId}/alertmanager/definition";
20
- if (input.workspaceId !== undefined) {
21
- labelValue = input.workspaceId;
22
- if (labelValue.length <= 0) {
23
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
24
- }
25
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
26
- }
27
- else {
28
- throw new Error("No value provided for input HTTP label: workspaceId.");
29
- }
20
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
30
21
  body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.data != null && { data: context.base64Encoder(input.data) })));
31
22
  return [2, new __HttpRequest({
32
23
  protocol: protocol,
@@ -41,7 +32,7 @@ export var serializeAws_restJson1CreateAlertManagerDefinitionCommand = function
41
32
  });
42
33
  }); };
43
34
  export var serializeAws_restJson1CreateRuleGroupsNamespaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
44
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
35
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
45
36
  var _c;
46
37
  return __generator(this, function (_d) {
47
38
  switch (_d.label) {
@@ -53,16 +44,7 @@ export var serializeAws_restJson1CreateRuleGroupsNamespaceCommand = function (in
53
44
  };
54
45
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
55
46
  "/workspaces/{workspaceId}/rulegroupsnamespaces";
56
- if (input.workspaceId !== undefined) {
57
- labelValue = input.workspaceId;
58
- if (labelValue.length <= 0) {
59
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
60
- }
61
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
62
- }
63
- else {
64
- throw new Error("No value provided for input HTTP label: workspaceId.");
65
- }
47
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
66
48
  body = JSON.stringify(__assign(__assign(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.data != null && { data: context.base64Encoder(input.data) })), (input.name != null && { name: input.name })), (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
67
49
  return [2, new __HttpRequest({
68
50
  protocol: protocol,
@@ -102,7 +84,7 @@ export var serializeAws_restJson1CreateWorkspaceCommand = function (input, conte
102
84
  });
103
85
  }); };
104
86
  export var serializeAws_restJson1DeleteAlertManagerDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
105
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
87
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
106
88
  return __generator(this, function (_c) {
107
89
  switch (_c.label) {
108
90
  case 0: return [4, context.endpoint()];
@@ -111,17 +93,10 @@ export var serializeAws_restJson1DeleteAlertManagerDefinitionCommand = function
111
93
  headers = {};
112
94
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
113
95
  "/workspaces/{workspaceId}/alertmanager/definition";
114
- if (input.workspaceId !== undefined) {
115
- labelValue = input.workspaceId;
116
- if (labelValue.length <= 0) {
117
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
118
- }
119
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
120
- }
121
- else {
122
- throw new Error("No value provided for input HTTP label: workspaceId.");
123
- }
124
- query = __assign({}, (input.clientToken !== undefined && { clientToken: input.clientToken }));
96
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
97
+ query = map({
98
+ clientToken: [, input.clientToken],
99
+ });
125
100
  return [2, new __HttpRequest({
126
101
  protocol: protocol,
127
102
  hostname: hostname,
@@ -136,7 +111,7 @@ export var serializeAws_restJson1DeleteAlertManagerDefinitionCommand = function
136
111
  });
137
112
  }); };
138
113
  export var serializeAws_restJson1DeleteRuleGroupsNamespaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
139
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
114
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
140
115
  return __generator(this, function (_c) {
141
116
  switch (_c.label) {
142
117
  case 0: return [4, context.endpoint()];
@@ -145,27 +120,11 @@ export var serializeAws_restJson1DeleteRuleGroupsNamespaceCommand = function (in
145
120
  headers = {};
146
121
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
147
122
  "/workspaces/{workspaceId}/rulegroupsnamespaces/{name}";
148
- if (input.workspaceId !== undefined) {
149
- labelValue = input.workspaceId;
150
- if (labelValue.length <= 0) {
151
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
152
- }
153
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
154
- }
155
- else {
156
- throw new Error("No value provided for input HTTP label: workspaceId.");
157
- }
158
- if (input.name !== undefined) {
159
- labelValue = input.name;
160
- if (labelValue.length <= 0) {
161
- throw new Error("Empty value provided for input HTTP label: name.");
162
- }
163
- resolvedPath = resolvedPath.replace("{name}", __extendedEncodeURIComponent(labelValue));
164
- }
165
- else {
166
- throw new Error("No value provided for input HTTP label: name.");
167
- }
168
- query = __assign({}, (input.clientToken !== undefined && { clientToken: input.clientToken }));
123
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
124
+ resolvedPath = __resolvedPath(resolvedPath, input, "name", function () { return input.name; }, "{name}", false);
125
+ query = map({
126
+ clientToken: [, input.clientToken],
127
+ });
169
128
  return [2, new __HttpRequest({
170
129
  protocol: protocol,
171
130
  hostname: hostname,
@@ -180,7 +139,7 @@ export var serializeAws_restJson1DeleteRuleGroupsNamespaceCommand = function (in
180
139
  });
181
140
  }); };
182
141
  export var serializeAws_restJson1DeleteWorkspaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
183
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
142
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
184
143
  return __generator(this, function (_c) {
185
144
  switch (_c.label) {
186
145
  case 0: return [4, context.endpoint()];
@@ -188,17 +147,10 @@ export var serializeAws_restJson1DeleteWorkspaceCommand = function (input, conte
188
147
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
189
148
  headers = {};
190
149
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}";
191
- if (input.workspaceId !== undefined) {
192
- labelValue = input.workspaceId;
193
- if (labelValue.length <= 0) {
194
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
195
- }
196
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
197
- }
198
- else {
199
- throw new Error("No value provided for input HTTP label: workspaceId.");
200
- }
201
- query = __assign({}, (input.clientToken !== undefined && { clientToken: input.clientToken }));
150
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
151
+ query = map({
152
+ clientToken: [, input.clientToken],
153
+ });
202
154
  return [2, new __HttpRequest({
203
155
  protocol: protocol,
204
156
  hostname: hostname,
@@ -213,7 +165,7 @@ export var serializeAws_restJson1DeleteWorkspaceCommand = function (input, conte
213
165
  });
214
166
  }); };
215
167
  export var serializeAws_restJson1DescribeAlertManagerDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
216
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
168
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
217
169
  return __generator(this, function (_c) {
218
170
  switch (_c.label) {
219
171
  case 0: return [4, context.endpoint()];
@@ -222,16 +174,7 @@ export var serializeAws_restJson1DescribeAlertManagerDefinitionCommand = functio
222
174
  headers = {};
223
175
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
224
176
  "/workspaces/{workspaceId}/alertmanager/definition";
225
- if (input.workspaceId !== undefined) {
226
- labelValue = input.workspaceId;
227
- if (labelValue.length <= 0) {
228
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
229
- }
230
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
231
- }
232
- else {
233
- throw new Error("No value provided for input HTTP label: workspaceId.");
234
- }
177
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
235
178
  return [2, new __HttpRequest({
236
179
  protocol: protocol,
237
180
  hostname: hostname,
@@ -245,7 +188,7 @@ export var serializeAws_restJson1DescribeAlertManagerDefinitionCommand = functio
245
188
  });
246
189
  }); };
247
190
  export var serializeAws_restJson1DescribeRuleGroupsNamespaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
248
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
191
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
249
192
  return __generator(this, function (_c) {
250
193
  switch (_c.label) {
251
194
  case 0: return [4, context.endpoint()];
@@ -254,26 +197,8 @@ export var serializeAws_restJson1DescribeRuleGroupsNamespaceCommand = function (
254
197
  headers = {};
255
198
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
256
199
  "/workspaces/{workspaceId}/rulegroupsnamespaces/{name}";
257
- if (input.workspaceId !== undefined) {
258
- labelValue = input.workspaceId;
259
- if (labelValue.length <= 0) {
260
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
261
- }
262
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
263
- }
264
- else {
265
- throw new Error("No value provided for input HTTP label: workspaceId.");
266
- }
267
- if (input.name !== undefined) {
268
- labelValue = input.name;
269
- if (labelValue.length <= 0) {
270
- throw new Error("Empty value provided for input HTTP label: name.");
271
- }
272
- resolvedPath = resolvedPath.replace("{name}", __extendedEncodeURIComponent(labelValue));
273
- }
274
- else {
275
- throw new Error("No value provided for input HTTP label: name.");
276
- }
200
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
201
+ resolvedPath = __resolvedPath(resolvedPath, input, "name", function () { return input.name; }, "{name}", false);
277
202
  return [2, new __HttpRequest({
278
203
  protocol: protocol,
279
204
  hostname: hostname,
@@ -287,7 +212,7 @@ export var serializeAws_restJson1DescribeRuleGroupsNamespaceCommand = function (
287
212
  });
288
213
  }); };
289
214
  export var serializeAws_restJson1DescribeWorkspaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
290
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
215
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
291
216
  return __generator(this, function (_c) {
292
217
  switch (_c.label) {
293
218
  case 0: return [4, context.endpoint()];
@@ -295,16 +220,7 @@ export var serializeAws_restJson1DescribeWorkspaceCommand = function (input, con
295
220
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
296
221
  headers = {};
297
222
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}";
298
- if (input.workspaceId !== undefined) {
299
- labelValue = input.workspaceId;
300
- if (labelValue.length <= 0) {
301
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
302
- }
303
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
304
- }
305
- else {
306
- throw new Error("No value provided for input HTTP label: workspaceId.");
307
- }
223
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
308
224
  return [2, new __HttpRequest({
309
225
  protocol: protocol,
310
226
  hostname: hostname,
@@ -318,7 +234,7 @@ export var serializeAws_restJson1DescribeWorkspaceCommand = function (input, con
318
234
  });
319
235
  }); };
320
236
  export var serializeAws_restJson1ListRuleGroupsNamespacesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
321
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
237
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
322
238
  return __generator(this, function (_c) {
323
239
  switch (_c.label) {
324
240
  case 0: return [4, context.endpoint()];
@@ -327,17 +243,12 @@ export var serializeAws_restJson1ListRuleGroupsNamespacesCommand = function (inp
327
243
  headers = {};
328
244
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
329
245
  "/workspaces/{workspaceId}/rulegroupsnamespaces";
330
- if (input.workspaceId !== undefined) {
331
- labelValue = input.workspaceId;
332
- if (labelValue.length <= 0) {
333
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
334
- }
335
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
336
- }
337
- else {
338
- throw new Error("No value provided for input HTTP label: workspaceId.");
339
- }
340
- query = __assign(__assign(__assign({}, (input.name !== undefined && { name: input.name })), (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
246
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
247
+ query = map({
248
+ name: [, input.name],
249
+ nextToken: [, input.nextToken],
250
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
251
+ });
341
252
  return [2, new __HttpRequest({
342
253
  protocol: protocol,
343
254
  hostname: hostname,
@@ -352,7 +263,7 @@ export var serializeAws_restJson1ListRuleGroupsNamespacesCommand = function (inp
352
263
  });
353
264
  }); };
354
265
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
355
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
266
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
356
267
  return __generator(this, function (_c) {
357
268
  switch (_c.label) {
358
269
  case 0: return [4, context.endpoint()];
@@ -360,16 +271,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
360
271
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
361
272
  headers = {};
362
273
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
363
- if (input.resourceArn !== undefined) {
364
- labelValue = input.resourceArn;
365
- if (labelValue.length <= 0) {
366
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
367
- }
368
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
369
- }
370
- else {
371
- throw new Error("No value provided for input HTTP label: resourceArn.");
372
- }
274
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
373
275
  return [2, new __HttpRequest({
374
276
  protocol: protocol,
375
277
  hostname: hostname,
@@ -391,7 +293,11 @@ export var serializeAws_restJson1ListWorkspacesCommand = function (input, contex
391
293
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
392
294
  headers = {};
393
295
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces";
394
- query = __assign(__assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.alias !== undefined && { alias: input.alias })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
296
+ query = map({
297
+ nextToken: [, input.nextToken],
298
+ alias: [, input.alias],
299
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
300
+ });
395
301
  return [2, new __HttpRequest({
396
302
  protocol: protocol,
397
303
  hostname: hostname,
@@ -406,7 +312,7 @@ export var serializeAws_restJson1ListWorkspacesCommand = function (input, contex
406
312
  });
407
313
  }); };
408
314
  export var serializeAws_restJson1PutAlertManagerDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
409
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
315
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
410
316
  var _c;
411
317
  return __generator(this, function (_d) {
412
318
  switch (_d.label) {
@@ -418,16 +324,7 @@ export var serializeAws_restJson1PutAlertManagerDefinitionCommand = function (in
418
324
  };
419
325
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
420
326
  "/workspaces/{workspaceId}/alertmanager/definition";
421
- if (input.workspaceId !== undefined) {
422
- labelValue = input.workspaceId;
423
- if (labelValue.length <= 0) {
424
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
425
- }
426
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
427
- }
428
- else {
429
- throw new Error("No value provided for input HTTP label: workspaceId.");
430
- }
327
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
431
328
  body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.data != null && { data: context.base64Encoder(input.data) })));
432
329
  return [2, new __HttpRequest({
433
330
  protocol: protocol,
@@ -442,7 +339,7 @@ export var serializeAws_restJson1PutAlertManagerDefinitionCommand = function (in
442
339
  });
443
340
  }); };
444
341
  export var serializeAws_restJson1PutRuleGroupsNamespaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
445
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
342
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
446
343
  var _c;
447
344
  return __generator(this, function (_d) {
448
345
  switch (_d.label) {
@@ -454,26 +351,8 @@ export var serializeAws_restJson1PutRuleGroupsNamespaceCommand = function (input
454
351
  };
455
352
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
456
353
  "/workspaces/{workspaceId}/rulegroupsnamespaces/{name}";
457
- if (input.workspaceId !== undefined) {
458
- labelValue = input.workspaceId;
459
- if (labelValue.length <= 0) {
460
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
461
- }
462
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
463
- }
464
- else {
465
- throw new Error("No value provided for input HTTP label: workspaceId.");
466
- }
467
- if (input.name !== undefined) {
468
- labelValue = input.name;
469
- if (labelValue.length <= 0) {
470
- throw new Error("Empty value provided for input HTTP label: name.");
471
- }
472
- resolvedPath = resolvedPath.replace("{name}", __extendedEncodeURIComponent(labelValue));
473
- }
474
- else {
475
- throw new Error("No value provided for input HTTP label: name.");
476
- }
354
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
355
+ resolvedPath = __resolvedPath(resolvedPath, input, "name", function () { return input.name; }, "{name}", false);
477
356
  body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.data != null && { data: context.base64Encoder(input.data) })));
478
357
  return [2, new __HttpRequest({
479
358
  protocol: protocol,
@@ -488,7 +367,7 @@ export var serializeAws_restJson1PutRuleGroupsNamespaceCommand = function (input
488
367
  });
489
368
  }); };
490
369
  export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
491
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
370
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
492
371
  return __generator(this, function (_c) {
493
372
  switch (_c.label) {
494
373
  case 0: return [4, context.endpoint()];
@@ -498,16 +377,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
498
377
  "content-type": "application/json",
499
378
  };
500
379
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
501
- if (input.resourceArn !== undefined) {
502
- labelValue = input.resourceArn;
503
- if (labelValue.length <= 0) {
504
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
505
- }
506
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
507
- }
508
- else {
509
- throw new Error("No value provided for input HTTP label: resourceArn.");
510
- }
380
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
511
381
  body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
512
382
  return [2, new __HttpRequest({
513
383
  protocol: protocol,
@@ -522,7 +392,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
522
392
  });
523
393
  }); };
524
394
  export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
525
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
395
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
526
396
  return __generator(this, function (_c) {
527
397
  switch (_c.label) {
528
398
  case 0: return [4, context.endpoint()];
@@ -530,17 +400,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
530
400
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
531
401
  headers = {};
532
402
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
533
- if (input.resourceArn !== undefined) {
534
- labelValue = input.resourceArn;
535
- if (labelValue.length <= 0) {
536
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
537
- }
538
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
539
- }
540
- else {
541
- throw new Error("No value provided for input HTTP label: resourceArn.");
542
- }
543
- query = __assign({}, (input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map(function (_entry) { return _entry; }) }));
403
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
404
+ query = map({
405
+ tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
406
+ });
544
407
  return [2, new __HttpRequest({
545
408
  protocol: protocol,
546
409
  hostname: hostname,
@@ -555,7 +418,7 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
555
418
  });
556
419
  }); };
557
420
  export var serializeAws_restJson1UpdateWorkspaceAliasCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
558
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
421
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
559
422
  var _c;
560
423
  return __generator(this, function (_d) {
561
424
  switch (_d.label) {
@@ -566,16 +429,7 @@ export var serializeAws_restJson1UpdateWorkspaceAliasCommand = function (input,
566
429
  "content-type": "application/json",
567
430
  };
568
431
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}/alias";
569
- if (input.workspaceId !== undefined) {
570
- labelValue = input.workspaceId;
571
- if (labelValue.length <= 0) {
572
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
573
- }
574
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
575
- }
576
- else {
577
- throw new Error("No value provided for input HTTP label: workspaceId.");
578
- }
432
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
579
433
  body = JSON.stringify(__assign(__assign({}, (input.alias != null && { alias: input.alias })), { clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }));
580
434
  return [2, new __HttpRequest({
581
435
  protocol: protocol,
@@ -597,24 +451,23 @@ export var deserializeAws_restJson1CreateAlertManagerDefinitionCommand = functio
597
451
  if (output.statusCode !== 202 && output.statusCode >= 300) {
598
452
  return [2, deserializeAws_restJson1CreateAlertManagerDefinitionCommandError(output, context)];
599
453
  }
600
- contents = {
454
+ contents = map({
601
455
  $metadata: deserializeMetadata(output),
602
- status: undefined,
603
- };
456
+ });
604
457
  _a = __expectNonNull;
605
458
  _b = __expectObject;
606
459
  return [4, parseBody(output.body, context)];
607
460
  case 1:
608
461
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
609
- if (data.status !== undefined && data.status !== null) {
462
+ if (data.status != null) {
610
463
  contents.status = deserializeAws_restJson1AlertManagerDefinitionStatus(data.status, context);
611
464
  }
612
- return [2, Promise.resolve(contents)];
465
+ return [2, contents];
613
466
  }
614
467
  });
615
468
  }); };
616
469
  var deserializeAws_restJson1CreateAlertManagerDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
617
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
470
+ var parsedOutput, _a, errorCode, _b, parsedBody;
618
471
  var _c;
619
472
  return __generator(this, function (_d) {
620
473
  switch (_d.label) {
@@ -659,14 +512,14 @@ var deserializeAws_restJson1CreateAlertManagerDefinitionCommandError = function
659
512
  case 15: throw _d.sent();
660
513
  case 16:
661
514
  parsedBody = parsedOutput.body;
662
- $metadata = deserializeMetadata(output);
663
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
664
- response = new __BaseException({
665
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
666
- $fault: "client",
667
- $metadata: $metadata,
515
+ throwDefaultError({
516
+ output: output,
517
+ parsedBody: parsedBody,
518
+ exceptionCtor: __BaseException,
519
+ errorCode: errorCode,
668
520
  });
669
- throw __decorateServiceException(response, parsedBody);
521
+ _d.label = 17;
522
+ case 17: return [2];
670
523
  }
671
524
  });
672
525
  }); };
@@ -678,36 +531,32 @@ export var deserializeAws_restJson1CreateRuleGroupsNamespaceCommand = function (
678
531
  if (output.statusCode !== 202 && output.statusCode >= 300) {
679
532
  return [2, deserializeAws_restJson1CreateRuleGroupsNamespaceCommandError(output, context)];
680
533
  }
681
- contents = {
534
+ contents = map({
682
535
  $metadata: deserializeMetadata(output),
683
- arn: undefined,
684
- name: undefined,
685
- status: undefined,
686
- tags: undefined,
687
- };
536
+ });
688
537
  _a = __expectNonNull;
689
538
  _b = __expectObject;
690
539
  return [4, parseBody(output.body, context)];
691
540
  case 1:
692
541
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
693
- if (data.arn !== undefined && data.arn !== null) {
542
+ if (data.arn != null) {
694
543
  contents.arn = __expectString(data.arn);
695
544
  }
696
- if (data.name !== undefined && data.name !== null) {
545
+ if (data.name != null) {
697
546
  contents.name = __expectString(data.name);
698
547
  }
699
- if (data.status !== undefined && data.status !== null) {
548
+ if (data.status != null) {
700
549
  contents.status = deserializeAws_restJson1RuleGroupsNamespaceStatus(data.status, context);
701
550
  }
702
- if (data.tags !== undefined && data.tags !== null) {
551
+ if (data.tags != null) {
703
552
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
704
553
  }
705
- return [2, Promise.resolve(contents)];
554
+ return [2, contents];
706
555
  }
707
556
  });
708
557
  }); };
709
558
  var deserializeAws_restJson1CreateRuleGroupsNamespaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
710
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
559
+ var parsedOutput, _a, errorCode, _b, parsedBody;
711
560
  var _c;
712
561
  return __generator(this, function (_d) {
713
562
  switch (_d.label) {
@@ -752,14 +601,14 @@ var deserializeAws_restJson1CreateRuleGroupsNamespaceCommandError = function (ou
752
601
  case 15: throw _d.sent();
753
602
  case 16:
754
603
  parsedBody = parsedOutput.body;
755
- $metadata = deserializeMetadata(output);
756
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
757
- response = new __BaseException({
758
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
759
- $fault: "client",
760
- $metadata: $metadata,
604
+ throwDefaultError({
605
+ output: output,
606
+ parsedBody: parsedBody,
607
+ exceptionCtor: __BaseException,
608
+ errorCode: errorCode,
761
609
  });
762
- throw __decorateServiceException(response, parsedBody);
610
+ _d.label = 17;
611
+ case 17: return [2];
763
612
  }
764
613
  });
765
614
  }); };
@@ -771,36 +620,32 @@ export var deserializeAws_restJson1CreateWorkspaceCommand = function (output, co
771
620
  if (output.statusCode !== 202 && output.statusCode >= 300) {
772
621
  return [2, deserializeAws_restJson1CreateWorkspaceCommandError(output, context)];
773
622
  }
774
- contents = {
623
+ contents = map({
775
624
  $metadata: deserializeMetadata(output),
776
- arn: undefined,
777
- status: undefined,
778
- tags: undefined,
779
- workspaceId: undefined,
780
- };
625
+ });
781
626
  _a = __expectNonNull;
782
627
  _b = __expectObject;
783
628
  return [4, parseBody(output.body, context)];
784
629
  case 1:
785
630
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
786
- if (data.arn !== undefined && data.arn !== null) {
631
+ if (data.arn != null) {
787
632
  contents.arn = __expectString(data.arn);
788
633
  }
789
- if (data.status !== undefined && data.status !== null) {
634
+ if (data.status != null) {
790
635
  contents.status = deserializeAws_restJson1WorkspaceStatus(data.status, context);
791
636
  }
792
- if (data.tags !== undefined && data.tags !== null) {
637
+ if (data.tags != null) {
793
638
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
794
639
  }
795
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
640
+ if (data.workspaceId != null) {
796
641
  contents.workspaceId = __expectString(data.workspaceId);
797
642
  }
798
- return [2, Promise.resolve(contents)];
643
+ return [2, contents];
799
644
  }
800
645
  });
801
646
  }); };
802
647
  var deserializeAws_restJson1CreateWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
803
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
648
+ var parsedOutput, _a, errorCode, _b, parsedBody;
804
649
  var _c;
805
650
  return __generator(this, function (_d) {
806
651
  switch (_d.label) {
@@ -841,14 +686,14 @@ var deserializeAws_restJson1CreateWorkspaceCommandError = function (output, cont
841
686
  case 13: throw _d.sent();
842
687
  case 14:
843
688
  parsedBody = parsedOutput.body;
844
- $metadata = deserializeMetadata(output);
845
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
846
- response = new __BaseException({
847
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
848
- $fault: "client",
849
- $metadata: $metadata,
689
+ throwDefaultError({
690
+ output: output,
691
+ parsedBody: parsedBody,
692
+ exceptionCtor: __BaseException,
693
+ errorCode: errorCode,
850
694
  });
851
- throw __decorateServiceException(response, parsedBody);
695
+ _d.label = 15;
696
+ case 15: return [2];
852
697
  }
853
698
  });
854
699
  }); };
@@ -860,18 +705,18 @@ export var deserializeAws_restJson1DeleteAlertManagerDefinitionCommand = functio
860
705
  if (output.statusCode !== 202 && output.statusCode >= 300) {
861
706
  return [2, deserializeAws_restJson1DeleteAlertManagerDefinitionCommandError(output, context)];
862
707
  }
863
- contents = {
708
+ contents = map({
864
709
  $metadata: deserializeMetadata(output),
865
- };
710
+ });
866
711
  return [4, collectBody(output.body, context)];
867
712
  case 1:
868
713
  _a.sent();
869
- return [2, Promise.resolve(contents)];
714
+ return [2, contents];
870
715
  }
871
716
  });
872
717
  }); };
873
718
  var deserializeAws_restJson1DeleteAlertManagerDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
874
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
719
+ var parsedOutput, _a, errorCode, _b, parsedBody;
875
720
  var _c;
876
721
  return __generator(this, function (_d) {
877
722
  switch (_d.label) {
@@ -912,14 +757,14 @@ var deserializeAws_restJson1DeleteAlertManagerDefinitionCommandError = function
912
757
  case 13: throw _d.sent();
913
758
  case 14:
914
759
  parsedBody = parsedOutput.body;
915
- $metadata = deserializeMetadata(output);
916
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
917
- response = new __BaseException({
918
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
919
- $fault: "client",
920
- $metadata: $metadata,
760
+ throwDefaultError({
761
+ output: output,
762
+ parsedBody: parsedBody,
763
+ exceptionCtor: __BaseException,
764
+ errorCode: errorCode,
921
765
  });
922
- throw __decorateServiceException(response, parsedBody);
766
+ _d.label = 15;
767
+ case 15: return [2];
923
768
  }
924
769
  });
925
770
  }); };
@@ -931,18 +776,18 @@ export var deserializeAws_restJson1DeleteRuleGroupsNamespaceCommand = function (
931
776
  if (output.statusCode !== 202 && output.statusCode >= 300) {
932
777
  return [2, deserializeAws_restJson1DeleteRuleGroupsNamespaceCommandError(output, context)];
933
778
  }
934
- contents = {
779
+ contents = map({
935
780
  $metadata: deserializeMetadata(output),
936
- };
781
+ });
937
782
  return [4, collectBody(output.body, context)];
938
783
  case 1:
939
784
  _a.sent();
940
- return [2, Promise.resolve(contents)];
785
+ return [2, contents];
941
786
  }
942
787
  });
943
788
  }); };
944
789
  var deserializeAws_restJson1DeleteRuleGroupsNamespaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
945
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
790
+ var parsedOutput, _a, errorCode, _b, parsedBody;
946
791
  var _c;
947
792
  return __generator(this, function (_d) {
948
793
  switch (_d.label) {
@@ -983,14 +828,14 @@ var deserializeAws_restJson1DeleteRuleGroupsNamespaceCommandError = function (ou
983
828
  case 13: throw _d.sent();
984
829
  case 14:
985
830
  parsedBody = parsedOutput.body;
986
- $metadata = deserializeMetadata(output);
987
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
988
- response = new __BaseException({
989
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
990
- $fault: "client",
991
- $metadata: $metadata,
831
+ throwDefaultError({
832
+ output: output,
833
+ parsedBody: parsedBody,
834
+ exceptionCtor: __BaseException,
835
+ errorCode: errorCode,
992
836
  });
993
- throw __decorateServiceException(response, parsedBody);
837
+ _d.label = 15;
838
+ case 15: return [2];
994
839
  }
995
840
  });
996
841
  }); };
@@ -1002,18 +847,18 @@ export var deserializeAws_restJson1DeleteWorkspaceCommand = function (output, co
1002
847
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1003
848
  return [2, deserializeAws_restJson1DeleteWorkspaceCommandError(output, context)];
1004
849
  }
1005
- contents = {
850
+ contents = map({
1006
851
  $metadata: deserializeMetadata(output),
1007
- };
852
+ });
1008
853
  return [4, collectBody(output.body, context)];
1009
854
  case 1:
1010
855
  _a.sent();
1011
- return [2, Promise.resolve(contents)];
856
+ return [2, contents];
1012
857
  }
1013
858
  });
1014
859
  }); };
1015
860
  var deserializeAws_restJson1DeleteWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1016
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
861
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1017
862
  var _c;
1018
863
  return __generator(this, function (_d) {
1019
864
  switch (_d.label) {
@@ -1054,14 +899,14 @@ var deserializeAws_restJson1DeleteWorkspaceCommandError = function (output, cont
1054
899
  case 13: throw _d.sent();
1055
900
  case 14:
1056
901
  parsedBody = parsedOutput.body;
1057
- $metadata = deserializeMetadata(output);
1058
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1059
- response = new __BaseException({
1060
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1061
- $fault: "client",
1062
- $metadata: $metadata,
902
+ throwDefaultError({
903
+ output: output,
904
+ parsedBody: parsedBody,
905
+ exceptionCtor: __BaseException,
906
+ errorCode: errorCode,
1063
907
  });
1064
- throw __decorateServiceException(response, parsedBody);
908
+ _d.label = 15;
909
+ case 15: return [2];
1065
910
  }
1066
911
  });
1067
912
  }); };
@@ -1073,24 +918,23 @@ export var deserializeAws_restJson1DescribeAlertManagerDefinitionCommand = funct
1073
918
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1074
919
  return [2, deserializeAws_restJson1DescribeAlertManagerDefinitionCommandError(output, context)];
1075
920
  }
1076
- contents = {
921
+ contents = map({
1077
922
  $metadata: deserializeMetadata(output),
1078
- alertManagerDefinition: undefined,
1079
- };
923
+ });
1080
924
  _a = __expectNonNull;
1081
925
  _b = __expectObject;
1082
926
  return [4, parseBody(output.body, context)];
1083
927
  case 1:
1084
928
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1085
- if (data.alertManagerDefinition !== undefined && data.alertManagerDefinition !== null) {
929
+ if (data.alertManagerDefinition != null) {
1086
930
  contents.alertManagerDefinition = deserializeAws_restJson1AlertManagerDefinitionDescription(data.alertManagerDefinition, context);
1087
931
  }
1088
- return [2, Promise.resolve(contents)];
932
+ return [2, contents];
1089
933
  }
1090
934
  });
1091
935
  }); };
1092
936
  var deserializeAws_restJson1DescribeAlertManagerDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1093
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
937
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1094
938
  var _c;
1095
939
  return __generator(this, function (_d) {
1096
940
  switch (_d.label) {
@@ -1127,14 +971,14 @@ var deserializeAws_restJson1DescribeAlertManagerDefinitionCommandError = functio
1127
971
  case 11: throw _d.sent();
1128
972
  case 12:
1129
973
  parsedBody = parsedOutput.body;
1130
- $metadata = deserializeMetadata(output);
1131
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1132
- response = new __BaseException({
1133
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1134
- $fault: "client",
1135
- $metadata: $metadata,
974
+ throwDefaultError({
975
+ output: output,
976
+ parsedBody: parsedBody,
977
+ exceptionCtor: __BaseException,
978
+ errorCode: errorCode,
1136
979
  });
1137
- throw __decorateServiceException(response, parsedBody);
980
+ _d.label = 13;
981
+ case 13: return [2];
1138
982
  }
1139
983
  });
1140
984
  }); };
@@ -1146,24 +990,23 @@ export var deserializeAws_restJson1DescribeRuleGroupsNamespaceCommand = function
1146
990
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1147
991
  return [2, deserializeAws_restJson1DescribeRuleGroupsNamespaceCommandError(output, context)];
1148
992
  }
1149
- contents = {
993
+ contents = map({
1150
994
  $metadata: deserializeMetadata(output),
1151
- ruleGroupsNamespace: undefined,
1152
- };
995
+ });
1153
996
  _a = __expectNonNull;
1154
997
  _b = __expectObject;
1155
998
  return [4, parseBody(output.body, context)];
1156
999
  case 1:
1157
1000
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1158
- if (data.ruleGroupsNamespace !== undefined && data.ruleGroupsNamespace !== null) {
1001
+ if (data.ruleGroupsNamespace != null) {
1159
1002
  contents.ruleGroupsNamespace = deserializeAws_restJson1RuleGroupsNamespaceDescription(data.ruleGroupsNamespace, context);
1160
1003
  }
1161
- return [2, Promise.resolve(contents)];
1004
+ return [2, contents];
1162
1005
  }
1163
1006
  });
1164
1007
  }); };
1165
1008
  var deserializeAws_restJson1DescribeRuleGroupsNamespaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1166
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1009
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1167
1010
  var _c;
1168
1011
  return __generator(this, function (_d) {
1169
1012
  switch (_d.label) {
@@ -1200,14 +1043,14 @@ var deserializeAws_restJson1DescribeRuleGroupsNamespaceCommandError = function (
1200
1043
  case 11: throw _d.sent();
1201
1044
  case 12:
1202
1045
  parsedBody = parsedOutput.body;
1203
- $metadata = deserializeMetadata(output);
1204
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1205
- response = new __BaseException({
1206
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1207
- $fault: "client",
1208
- $metadata: $metadata,
1046
+ throwDefaultError({
1047
+ output: output,
1048
+ parsedBody: parsedBody,
1049
+ exceptionCtor: __BaseException,
1050
+ errorCode: errorCode,
1209
1051
  });
1210
- throw __decorateServiceException(response, parsedBody);
1052
+ _d.label = 13;
1053
+ case 13: return [2];
1211
1054
  }
1212
1055
  });
1213
1056
  }); };
@@ -1219,24 +1062,23 @@ export var deserializeAws_restJson1DescribeWorkspaceCommand = function (output,
1219
1062
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1220
1063
  return [2, deserializeAws_restJson1DescribeWorkspaceCommandError(output, context)];
1221
1064
  }
1222
- contents = {
1065
+ contents = map({
1223
1066
  $metadata: deserializeMetadata(output),
1224
- workspace: undefined,
1225
- };
1067
+ });
1226
1068
  _a = __expectNonNull;
1227
1069
  _b = __expectObject;
1228
1070
  return [4, parseBody(output.body, context)];
1229
1071
  case 1:
1230
1072
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1231
- if (data.workspace !== undefined && data.workspace !== null) {
1073
+ if (data.workspace != null) {
1232
1074
  contents.workspace = deserializeAws_restJson1WorkspaceDescription(data.workspace, context);
1233
1075
  }
1234
- return [2, Promise.resolve(contents)];
1076
+ return [2, contents];
1235
1077
  }
1236
1078
  });
1237
1079
  }); };
1238
1080
  var deserializeAws_restJson1DescribeWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1239
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1081
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1240
1082
  var _c;
1241
1083
  return __generator(this, function (_d) {
1242
1084
  switch (_d.label) {
@@ -1273,14 +1115,14 @@ var deserializeAws_restJson1DescribeWorkspaceCommandError = function (output, co
1273
1115
  case 11: throw _d.sent();
1274
1116
  case 12:
1275
1117
  parsedBody = parsedOutput.body;
1276
- $metadata = deserializeMetadata(output);
1277
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1278
- response = new __BaseException({
1279
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1280
- $fault: "client",
1281
- $metadata: $metadata,
1118
+ throwDefaultError({
1119
+ output: output,
1120
+ parsedBody: parsedBody,
1121
+ exceptionCtor: __BaseException,
1122
+ errorCode: errorCode,
1282
1123
  });
1283
- throw __decorateServiceException(response, parsedBody);
1124
+ _d.label = 13;
1125
+ case 13: return [2];
1284
1126
  }
1285
1127
  });
1286
1128
  }); };
@@ -1292,28 +1134,26 @@ export var deserializeAws_restJson1ListRuleGroupsNamespacesCommand = function (o
1292
1134
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1293
1135
  return [2, deserializeAws_restJson1ListRuleGroupsNamespacesCommandError(output, context)];
1294
1136
  }
1295
- contents = {
1137
+ contents = map({
1296
1138
  $metadata: deserializeMetadata(output),
1297
- nextToken: undefined,
1298
- ruleGroupsNamespaces: undefined,
1299
- };
1139
+ });
1300
1140
  _a = __expectNonNull;
1301
1141
  _b = __expectObject;
1302
1142
  return [4, parseBody(output.body, context)];
1303
1143
  case 1:
1304
1144
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1305
- if (data.nextToken !== undefined && data.nextToken !== null) {
1145
+ if (data.nextToken != null) {
1306
1146
  contents.nextToken = __expectString(data.nextToken);
1307
1147
  }
1308
- if (data.ruleGroupsNamespaces !== undefined && data.ruleGroupsNamespaces !== null) {
1148
+ if (data.ruleGroupsNamespaces != null) {
1309
1149
  contents.ruleGroupsNamespaces = deserializeAws_restJson1RuleGroupsNamespaceSummaryList(data.ruleGroupsNamespaces, context);
1310
1150
  }
1311
- return [2, Promise.resolve(contents)];
1151
+ return [2, contents];
1312
1152
  }
1313
1153
  });
1314
1154
  }); };
1315
1155
  var deserializeAws_restJson1ListRuleGroupsNamespacesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1316
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1156
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1317
1157
  var _c;
1318
1158
  return __generator(this, function (_d) {
1319
1159
  switch (_d.label) {
@@ -1350,14 +1190,14 @@ var deserializeAws_restJson1ListRuleGroupsNamespacesCommandError = function (out
1350
1190
  case 11: throw _d.sent();
1351
1191
  case 12:
1352
1192
  parsedBody = parsedOutput.body;
1353
- $metadata = deserializeMetadata(output);
1354
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1355
- response = new __BaseException({
1356
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1357
- $fault: "client",
1358
- $metadata: $metadata,
1193
+ throwDefaultError({
1194
+ output: output,
1195
+ parsedBody: parsedBody,
1196
+ exceptionCtor: __BaseException,
1197
+ errorCode: errorCode,
1359
1198
  });
1360
- throw __decorateServiceException(response, parsedBody);
1199
+ _d.label = 13;
1200
+ case 13: return [2];
1361
1201
  }
1362
1202
  });
1363
1203
  }); };
@@ -1369,24 +1209,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
1369
1209
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1370
1210
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1371
1211
  }
1372
- contents = {
1212
+ contents = map({
1373
1213
  $metadata: deserializeMetadata(output),
1374
- tags: undefined,
1375
- };
1214
+ });
1376
1215
  _a = __expectNonNull;
1377
1216
  _b = __expectObject;
1378
1217
  return [4, parseBody(output.body, context)];
1379
1218
  case 1:
1380
1219
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1381
- if (data.tags !== undefined && data.tags !== null) {
1220
+ if (data.tags != null) {
1382
1221
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
1383
1222
  }
1384
- return [2, Promise.resolve(contents)];
1223
+ return [2, contents];
1385
1224
  }
1386
1225
  });
1387
1226
  }); };
1388
1227
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1389
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1228
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1390
1229
  var _c;
1391
1230
  return __generator(this, function (_d) {
1392
1231
  switch (_d.label) {
@@ -1423,14 +1262,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
1423
1262
  case 11: throw _d.sent();
1424
1263
  case 12:
1425
1264
  parsedBody = parsedOutput.body;
1426
- $metadata = deserializeMetadata(output);
1427
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1428
- response = new __BaseException({
1429
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1430
- $fault: "client",
1431
- $metadata: $metadata,
1265
+ throwDefaultError({
1266
+ output: output,
1267
+ parsedBody: parsedBody,
1268
+ exceptionCtor: __BaseException,
1269
+ errorCode: errorCode,
1432
1270
  });
1433
- throw __decorateServiceException(response, parsedBody);
1271
+ _d.label = 13;
1272
+ case 13: return [2];
1434
1273
  }
1435
1274
  });
1436
1275
  }); };
@@ -1442,28 +1281,26 @@ export var deserializeAws_restJson1ListWorkspacesCommand = function (output, con
1442
1281
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1443
1282
  return [2, deserializeAws_restJson1ListWorkspacesCommandError(output, context)];
1444
1283
  }
1445
- contents = {
1284
+ contents = map({
1446
1285
  $metadata: deserializeMetadata(output),
1447
- nextToken: undefined,
1448
- workspaces: undefined,
1449
- };
1286
+ });
1450
1287
  _a = __expectNonNull;
1451
1288
  _b = __expectObject;
1452
1289
  return [4, parseBody(output.body, context)];
1453
1290
  case 1:
1454
1291
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1455
- if (data.nextToken !== undefined && data.nextToken !== null) {
1292
+ if (data.nextToken != null) {
1456
1293
  contents.nextToken = __expectString(data.nextToken);
1457
1294
  }
1458
- if (data.workspaces !== undefined && data.workspaces !== null) {
1295
+ if (data.workspaces != null) {
1459
1296
  contents.workspaces = deserializeAws_restJson1WorkspaceSummaryList(data.workspaces, context);
1460
1297
  }
1461
- return [2, Promise.resolve(contents)];
1298
+ return [2, contents];
1462
1299
  }
1463
1300
  });
1464
1301
  }); };
1465
1302
  var deserializeAws_restJson1ListWorkspacesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1466
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1303
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1467
1304
  var _c;
1468
1305
  return __generator(this, function (_d) {
1469
1306
  switch (_d.label) {
@@ -1496,14 +1333,14 @@ var deserializeAws_restJson1ListWorkspacesCommandError = function (output, conte
1496
1333
  case 9: throw _d.sent();
1497
1334
  case 10:
1498
1335
  parsedBody = parsedOutput.body;
1499
- $metadata = deserializeMetadata(output);
1500
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1501
- response = new __BaseException({
1502
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1503
- $fault: "client",
1504
- $metadata: $metadata,
1336
+ throwDefaultError({
1337
+ output: output,
1338
+ parsedBody: parsedBody,
1339
+ exceptionCtor: __BaseException,
1340
+ errorCode: errorCode,
1505
1341
  });
1506
- throw __decorateServiceException(response, parsedBody);
1342
+ _d.label = 11;
1343
+ case 11: return [2];
1507
1344
  }
1508
1345
  });
1509
1346
  }); };
@@ -1515,24 +1352,23 @@ export var deserializeAws_restJson1PutAlertManagerDefinitionCommand = function (
1515
1352
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1516
1353
  return [2, deserializeAws_restJson1PutAlertManagerDefinitionCommandError(output, context)];
1517
1354
  }
1518
- contents = {
1355
+ contents = map({
1519
1356
  $metadata: deserializeMetadata(output),
1520
- status: undefined,
1521
- };
1357
+ });
1522
1358
  _a = __expectNonNull;
1523
1359
  _b = __expectObject;
1524
1360
  return [4, parseBody(output.body, context)];
1525
1361
  case 1:
1526
1362
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1527
- if (data.status !== undefined && data.status !== null) {
1363
+ if (data.status != null) {
1528
1364
  contents.status = deserializeAws_restJson1AlertManagerDefinitionStatus(data.status, context);
1529
1365
  }
1530
- return [2, Promise.resolve(contents)];
1366
+ return [2, contents];
1531
1367
  }
1532
1368
  });
1533
1369
  }); };
1534
1370
  var deserializeAws_restJson1PutAlertManagerDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1535
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1371
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1536
1372
  var _c;
1537
1373
  return __generator(this, function (_d) {
1538
1374
  switch (_d.label) {
@@ -1577,14 +1413,14 @@ var deserializeAws_restJson1PutAlertManagerDefinitionCommandError = function (ou
1577
1413
  case 15: throw _d.sent();
1578
1414
  case 16:
1579
1415
  parsedBody = parsedOutput.body;
1580
- $metadata = deserializeMetadata(output);
1581
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1582
- response = new __BaseException({
1583
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1584
- $fault: "client",
1585
- $metadata: $metadata,
1416
+ throwDefaultError({
1417
+ output: output,
1418
+ parsedBody: parsedBody,
1419
+ exceptionCtor: __BaseException,
1420
+ errorCode: errorCode,
1586
1421
  });
1587
- throw __decorateServiceException(response, parsedBody);
1422
+ _d.label = 17;
1423
+ case 17: return [2];
1588
1424
  }
1589
1425
  });
1590
1426
  }); };
@@ -1596,36 +1432,32 @@ export var deserializeAws_restJson1PutRuleGroupsNamespaceCommand = function (out
1596
1432
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1597
1433
  return [2, deserializeAws_restJson1PutRuleGroupsNamespaceCommandError(output, context)];
1598
1434
  }
1599
- contents = {
1435
+ contents = map({
1600
1436
  $metadata: deserializeMetadata(output),
1601
- arn: undefined,
1602
- name: undefined,
1603
- status: undefined,
1604
- tags: undefined,
1605
- };
1437
+ });
1606
1438
  _a = __expectNonNull;
1607
1439
  _b = __expectObject;
1608
1440
  return [4, parseBody(output.body, context)];
1609
1441
  case 1:
1610
1442
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1611
- if (data.arn !== undefined && data.arn !== null) {
1443
+ if (data.arn != null) {
1612
1444
  contents.arn = __expectString(data.arn);
1613
1445
  }
1614
- if (data.name !== undefined && data.name !== null) {
1446
+ if (data.name != null) {
1615
1447
  contents.name = __expectString(data.name);
1616
1448
  }
1617
- if (data.status !== undefined && data.status !== null) {
1449
+ if (data.status != null) {
1618
1450
  contents.status = deserializeAws_restJson1RuleGroupsNamespaceStatus(data.status, context);
1619
1451
  }
1620
- if (data.tags !== undefined && data.tags !== null) {
1452
+ if (data.tags != null) {
1621
1453
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
1622
1454
  }
1623
- return [2, Promise.resolve(contents)];
1455
+ return [2, contents];
1624
1456
  }
1625
1457
  });
1626
1458
  }); };
1627
1459
  var deserializeAws_restJson1PutRuleGroupsNamespaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1628
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1460
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1629
1461
  var _c;
1630
1462
  return __generator(this, function (_d) {
1631
1463
  switch (_d.label) {
@@ -1670,14 +1502,14 @@ var deserializeAws_restJson1PutRuleGroupsNamespaceCommandError = function (outpu
1670
1502
  case 15: throw _d.sent();
1671
1503
  case 16:
1672
1504
  parsedBody = parsedOutput.body;
1673
- $metadata = deserializeMetadata(output);
1674
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1675
- response = new __BaseException({
1676
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1677
- $fault: "client",
1678
- $metadata: $metadata,
1505
+ throwDefaultError({
1506
+ output: output,
1507
+ parsedBody: parsedBody,
1508
+ exceptionCtor: __BaseException,
1509
+ errorCode: errorCode,
1679
1510
  });
1680
- throw __decorateServiceException(response, parsedBody);
1511
+ _d.label = 17;
1512
+ case 17: return [2];
1681
1513
  }
1682
1514
  });
1683
1515
  }); };
@@ -1689,18 +1521,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
1689
1521
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1690
1522
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
1691
1523
  }
1692
- contents = {
1524
+ contents = map({
1693
1525
  $metadata: deserializeMetadata(output),
1694
- };
1526
+ });
1695
1527
  return [4, collectBody(output.body, context)];
1696
1528
  case 1:
1697
1529
  _a.sent();
1698
- return [2, Promise.resolve(contents)];
1530
+ return [2, contents];
1699
1531
  }
1700
1532
  });
1701
1533
  }); };
1702
1534
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1703
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1535
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1704
1536
  var _c;
1705
1537
  return __generator(this, function (_d) {
1706
1538
  switch (_d.label) {
@@ -1737,14 +1569,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
1737
1569
  case 11: throw _d.sent();
1738
1570
  case 12:
1739
1571
  parsedBody = parsedOutput.body;
1740
- $metadata = deserializeMetadata(output);
1741
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1742
- response = new __BaseException({
1743
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1744
- $fault: "client",
1745
- $metadata: $metadata,
1572
+ throwDefaultError({
1573
+ output: output,
1574
+ parsedBody: parsedBody,
1575
+ exceptionCtor: __BaseException,
1576
+ errorCode: errorCode,
1746
1577
  });
1747
- throw __decorateServiceException(response, parsedBody);
1578
+ _d.label = 13;
1579
+ case 13: return [2];
1748
1580
  }
1749
1581
  });
1750
1582
  }); };
@@ -1756,18 +1588,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
1756
1588
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1757
1589
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
1758
1590
  }
1759
- contents = {
1591
+ contents = map({
1760
1592
  $metadata: deserializeMetadata(output),
1761
- };
1593
+ });
1762
1594
  return [4, collectBody(output.body, context)];
1763
1595
  case 1:
1764
1596
  _a.sent();
1765
- return [2, Promise.resolve(contents)];
1597
+ return [2, contents];
1766
1598
  }
1767
1599
  });
1768
1600
  }); };
1769
1601
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1770
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1602
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1771
1603
  var _c;
1772
1604
  return __generator(this, function (_d) {
1773
1605
  switch (_d.label) {
@@ -1804,14 +1636,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
1804
1636
  case 11: throw _d.sent();
1805
1637
  case 12:
1806
1638
  parsedBody = parsedOutput.body;
1807
- $metadata = deserializeMetadata(output);
1808
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1809
- response = new __BaseException({
1810
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1811
- $fault: "client",
1812
- $metadata: $metadata,
1639
+ throwDefaultError({
1640
+ output: output,
1641
+ parsedBody: parsedBody,
1642
+ exceptionCtor: __BaseException,
1643
+ errorCode: errorCode,
1813
1644
  });
1814
- throw __decorateServiceException(response, parsedBody);
1645
+ _d.label = 13;
1646
+ case 13: return [2];
1815
1647
  }
1816
1648
  });
1817
1649
  }); };
@@ -1823,18 +1655,18 @@ export var deserializeAws_restJson1UpdateWorkspaceAliasCommand = function (outpu
1823
1655
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1824
1656
  return [2, deserializeAws_restJson1UpdateWorkspaceAliasCommandError(output, context)];
1825
1657
  }
1826
- contents = {
1658
+ contents = map({
1827
1659
  $metadata: deserializeMetadata(output),
1828
- };
1660
+ });
1829
1661
  return [4, collectBody(output.body, context)];
1830
1662
  case 1:
1831
1663
  _a.sent();
1832
- return [2, Promise.resolve(contents)];
1664
+ return [2, contents];
1833
1665
  }
1834
1666
  });
1835
1667
  }); };
1836
1668
  var deserializeAws_restJson1UpdateWorkspaceAliasCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1837
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1669
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1838
1670
  var _c;
1839
1671
  return __generator(this, function (_d) {
1840
1672
  switch (_d.label) {
@@ -1879,23 +1711,24 @@ var deserializeAws_restJson1UpdateWorkspaceAliasCommandError = function (output,
1879
1711
  case 15: throw _d.sent();
1880
1712
  case 16:
1881
1713
  parsedBody = parsedOutput.body;
1882
- $metadata = deserializeMetadata(output);
1883
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1884
- response = new __BaseException({
1885
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1886
- $fault: "client",
1887
- $metadata: $metadata,
1714
+ throwDefaultError({
1715
+ output: output,
1716
+ parsedBody: parsedBody,
1717
+ exceptionCtor: __BaseException,
1718
+ errorCode: errorCode,
1888
1719
  });
1889
- throw __decorateServiceException(response, parsedBody);
1720
+ _d.label = 17;
1721
+ case 17: return [2];
1890
1722
  }
1891
1723
  });
1892
1724
  }); };
1725
+ var map = __map;
1893
1726
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1894
1727
  var contents, data, exception;
1895
1728
  return __generator(this, function (_a) {
1896
- contents = {};
1729
+ contents = map({});
1897
1730
  data = parsedOutput.body;
1898
- if (data.message !== undefined && data.message !== null) {
1731
+ if (data.message != null) {
1899
1732
  contents.message = __expectString(data.message);
1900
1733
  }
1901
1734
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1905,15 +1738,15 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
1905
1738
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1906
1739
  var contents, data, exception;
1907
1740
  return __generator(this, function (_a) {
1908
- contents = {};
1741
+ contents = map({});
1909
1742
  data = parsedOutput.body;
1910
- if (data.message !== undefined && data.message !== null) {
1743
+ if (data.message != null) {
1911
1744
  contents.message = __expectString(data.message);
1912
1745
  }
1913
- if (data.resourceId !== undefined && data.resourceId !== null) {
1746
+ if (data.resourceId != null) {
1914
1747
  contents.resourceId = __expectString(data.resourceId);
1915
1748
  }
1916
- if (data.resourceType !== undefined && data.resourceType !== null) {
1749
+ if (data.resourceType != null) {
1917
1750
  contents.resourceType = __expectString(data.resourceType);
1918
1751
  }
1919
1752
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1923,12 +1756,14 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
1923
1756
  var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1924
1757
  var contents, data, exception;
1925
1758
  return __generator(this, function (_a) {
1926
- contents = {};
1927
- if (parsedOutput.headers["retry-after"] !== undefined) {
1928
- contents.retryAfterSeconds = __strictParseInt32(parsedOutput.headers["retry-after"]);
1929
- }
1759
+ contents = map({
1760
+ retryAfterSeconds: [
1761
+ function () { return void 0 !== parsedOutput.headers["retry-after"]; },
1762
+ function () { return __strictParseInt32(parsedOutput.headers["retry-after"]); },
1763
+ ],
1764
+ });
1930
1765
  data = parsedOutput.body;
1931
- if (data.message !== undefined && data.message !== null) {
1766
+ if (data.message != null) {
1932
1767
  contents.message = __expectString(data.message);
1933
1768
  }
1934
1769
  exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1938,15 +1773,15 @@ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOu
1938
1773
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1939
1774
  var contents, data, exception;
1940
1775
  return __generator(this, function (_a) {
1941
- contents = {};
1776
+ contents = map({});
1942
1777
  data = parsedOutput.body;
1943
- if (data.message !== undefined && data.message !== null) {
1778
+ if (data.message != null) {
1944
1779
  contents.message = __expectString(data.message);
1945
1780
  }
1946
- if (data.resourceId !== undefined && data.resourceId !== null) {
1781
+ if (data.resourceId != null) {
1947
1782
  contents.resourceId = __expectString(data.resourceId);
1948
1783
  }
1949
- if (data.resourceType !== undefined && data.resourceType !== null) {
1784
+ if (data.resourceType != null) {
1950
1785
  contents.resourceType = __expectString(data.resourceType);
1951
1786
  }
1952
1787
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1956,21 +1791,21 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
1956
1791
  var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1957
1792
  var contents, data, exception;
1958
1793
  return __generator(this, function (_a) {
1959
- contents = {};
1794
+ contents = map({});
1960
1795
  data = parsedOutput.body;
1961
- if (data.message !== undefined && data.message !== null) {
1796
+ if (data.message != null) {
1962
1797
  contents.message = __expectString(data.message);
1963
1798
  }
1964
- if (data.quotaCode !== undefined && data.quotaCode !== null) {
1799
+ if (data.quotaCode != null) {
1965
1800
  contents.quotaCode = __expectString(data.quotaCode);
1966
1801
  }
1967
- if (data.resourceId !== undefined && data.resourceId !== null) {
1802
+ if (data.resourceId != null) {
1968
1803
  contents.resourceId = __expectString(data.resourceId);
1969
1804
  }
1970
- if (data.resourceType !== undefined && data.resourceType !== null) {
1805
+ if (data.resourceType != null) {
1971
1806
  contents.resourceType = __expectString(data.resourceType);
1972
1807
  }
1973
- if (data.serviceCode !== undefined && data.serviceCode !== null) {
1808
+ if (data.serviceCode != null) {
1974
1809
  contents.serviceCode = __expectString(data.serviceCode);
1975
1810
  }
1976
1811
  exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1980,18 +1815,20 @@ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (pa
1980
1815
  var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1981
1816
  var contents, data, exception;
1982
1817
  return __generator(this, function (_a) {
1983
- contents = {};
1984
- if (parsedOutput.headers["retry-after"] !== undefined) {
1985
- contents.retryAfterSeconds = __strictParseInt32(parsedOutput.headers["retry-after"]);
1986
- }
1818
+ contents = map({
1819
+ retryAfterSeconds: [
1820
+ function () { return void 0 !== parsedOutput.headers["retry-after"]; },
1821
+ function () { return __strictParseInt32(parsedOutput.headers["retry-after"]); },
1822
+ ],
1823
+ });
1987
1824
  data = parsedOutput.body;
1988
- if (data.message !== undefined && data.message !== null) {
1825
+ if (data.message != null) {
1989
1826
  contents.message = __expectString(data.message);
1990
1827
  }
1991
- if (data.quotaCode !== undefined && data.quotaCode !== null) {
1828
+ if (data.quotaCode != null) {
1992
1829
  contents.quotaCode = __expectString(data.quotaCode);
1993
1830
  }
1994
- if (data.serviceCode !== undefined && data.serviceCode !== null) {
1831
+ if (data.serviceCode != null) {
1995
1832
  contents.serviceCode = __expectString(data.serviceCode);
1996
1833
  }
1997
1834
  exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2001,15 +1838,15 @@ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput
2001
1838
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2002
1839
  var contents, data, exception;
2003
1840
  return __generator(this, function (_a) {
2004
- contents = {};
1841
+ contents = map({});
2005
1842
  data = parsedOutput.body;
2006
- if (data.fieldList !== undefined && data.fieldList !== null) {
1843
+ if (data.fieldList != null) {
2007
1844
  contents.fieldList = deserializeAws_restJson1ValidationExceptionFieldList(data.fieldList, context);
2008
1845
  }
2009
- if (data.message !== undefined && data.message !== null) {
1846
+ if (data.message != null) {
2010
1847
  contents.message = __expectString(data.message);
2011
1848
  }
2012
- if (data.reason !== undefined && data.reason !== null) {
1849
+ if (data.reason != null) {
2013
1850
  contents.reason = __expectString(data.reason);
2014
1851
  }
2015
1852
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));