@aws-sdk/client-grafana 3.141.0 → 3.150.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, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseEpochTimestamp as __parseEpochTimestamp, strictParseInt32 as __strictParseInt32, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, 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 { GrafanaServiceException as __BaseException } from "../models/GrafanaServiceException";
6
6
  import { AccessDeniedException, ConflictException, IdpMetadata, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
7
7
  export var serializeAws_restJson1AssociateLicenseCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
8
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
8
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
9
9
  return __generator(this, function (_c) {
10
10
  switch (_c.label) {
11
11
  case 0: return [4, context.endpoint()];
@@ -14,26 +14,8 @@ export var serializeAws_restJson1AssociateLicenseCommand = function (input, cont
14
14
  headers = {};
15
15
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
16
16
  "/workspaces/{workspaceId}/licenses/{licenseType}";
17
- if (input.workspaceId !== undefined) {
18
- labelValue = input.workspaceId;
19
- if (labelValue.length <= 0) {
20
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
21
- }
22
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
23
- }
24
- else {
25
- throw new Error("No value provided for input HTTP label: workspaceId.");
26
- }
27
- if (input.licenseType !== undefined) {
28
- labelValue = input.licenseType;
29
- if (labelValue.length <= 0) {
30
- throw new Error("Empty value provided for input HTTP label: licenseType.");
31
- }
32
- resolvedPath = resolvedPath.replace("{licenseType}", __extendedEncodeURIComponent(labelValue));
33
- }
34
- else {
35
- throw new Error("No value provided for input HTTP label: licenseType.");
36
- }
17
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
18
+ resolvedPath = __resolvedPath(resolvedPath, input, "licenseType", function () { return input.licenseType; }, "{licenseType}", false);
37
19
  return [2, new __HttpRequest({
38
20
  protocol: protocol,
39
21
  hostname: hostname,
@@ -80,7 +62,7 @@ export var serializeAws_restJson1CreateWorkspaceCommand = function (input, conte
80
62
  });
81
63
  }); };
82
64
  export var serializeAws_restJson1CreateWorkspaceApiKeyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
83
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
65
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
84
66
  return __generator(this, function (_c) {
85
67
  switch (_c.label) {
86
68
  case 0: return [4, context.endpoint()];
@@ -90,16 +72,7 @@ export var serializeAws_restJson1CreateWorkspaceApiKeyCommand = function (input,
90
72
  "content-type": "application/json",
91
73
  };
92
74
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}/apikeys";
93
- if (input.workspaceId !== undefined) {
94
- labelValue = input.workspaceId;
95
- if (labelValue.length <= 0) {
96
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
97
- }
98
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
99
- }
100
- else {
101
- throw new Error("No value provided for input HTTP label: workspaceId.");
102
- }
75
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
103
76
  body = JSON.stringify(__assign(__assign(__assign({}, (input.keyName != null && { keyName: input.keyName })), (input.keyRole != null && { keyRole: input.keyRole })), (input.secondsToLive != null && { secondsToLive: input.secondsToLive })));
104
77
  return [2, new __HttpRequest({
105
78
  protocol: protocol,
@@ -114,7 +87,7 @@ export var serializeAws_restJson1CreateWorkspaceApiKeyCommand = function (input,
114
87
  });
115
88
  }); };
116
89
  export var serializeAws_restJson1DeleteWorkspaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
117
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
90
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
118
91
  return __generator(this, function (_c) {
119
92
  switch (_c.label) {
120
93
  case 0: return [4, context.endpoint()];
@@ -122,16 +95,7 @@ export var serializeAws_restJson1DeleteWorkspaceCommand = function (input, conte
122
95
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
123
96
  headers = {};
124
97
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}";
125
- if (input.workspaceId !== undefined) {
126
- labelValue = input.workspaceId;
127
- if (labelValue.length <= 0) {
128
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
129
- }
130
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
131
- }
132
- else {
133
- throw new Error("No value provided for input HTTP label: workspaceId.");
134
- }
98
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
135
99
  return [2, new __HttpRequest({
136
100
  protocol: protocol,
137
101
  hostname: hostname,
@@ -145,7 +109,7 @@ export var serializeAws_restJson1DeleteWorkspaceCommand = function (input, conte
145
109
  });
146
110
  }); };
147
111
  export var serializeAws_restJson1DeleteWorkspaceApiKeyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
148
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
112
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
149
113
  return __generator(this, function (_c) {
150
114
  switch (_c.label) {
151
115
  case 0: return [4, context.endpoint()];
@@ -154,26 +118,8 @@ export var serializeAws_restJson1DeleteWorkspaceApiKeyCommand = function (input,
154
118
  headers = {};
155
119
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
156
120
  "/workspaces/{workspaceId}/apikeys/{keyName}";
157
- if (input.keyName !== undefined) {
158
- labelValue = input.keyName;
159
- if (labelValue.length <= 0) {
160
- throw new Error("Empty value provided for input HTTP label: keyName.");
161
- }
162
- resolvedPath = resolvedPath.replace("{keyName}", __extendedEncodeURIComponent(labelValue));
163
- }
164
- else {
165
- throw new Error("No value provided for input HTTP label: keyName.");
166
- }
167
- if (input.workspaceId !== undefined) {
168
- labelValue = input.workspaceId;
169
- if (labelValue.length <= 0) {
170
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
171
- }
172
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
173
- }
174
- else {
175
- throw new Error("No value provided for input HTTP label: workspaceId.");
176
- }
121
+ resolvedPath = __resolvedPath(resolvedPath, input, "keyName", function () { return input.keyName; }, "{keyName}", false);
122
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
177
123
  return [2, new __HttpRequest({
178
124
  protocol: protocol,
179
125
  hostname: hostname,
@@ -187,7 +133,7 @@ export var serializeAws_restJson1DeleteWorkspaceApiKeyCommand = function (input,
187
133
  });
188
134
  }); };
189
135
  export var serializeAws_restJson1DescribeWorkspaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
190
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
136
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
191
137
  return __generator(this, function (_c) {
192
138
  switch (_c.label) {
193
139
  case 0: return [4, context.endpoint()];
@@ -195,16 +141,7 @@ export var serializeAws_restJson1DescribeWorkspaceCommand = function (input, con
195
141
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
196
142
  headers = {};
197
143
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}";
198
- if (input.workspaceId !== undefined) {
199
- labelValue = input.workspaceId;
200
- if (labelValue.length <= 0) {
201
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
202
- }
203
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
204
- }
205
- else {
206
- throw new Error("No value provided for input HTTP label: workspaceId.");
207
- }
144
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
208
145
  return [2, new __HttpRequest({
209
146
  protocol: protocol,
210
147
  hostname: hostname,
@@ -218,7 +155,7 @@ export var serializeAws_restJson1DescribeWorkspaceCommand = function (input, con
218
155
  });
219
156
  }); };
220
157
  export var serializeAws_restJson1DescribeWorkspaceAuthenticationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
221
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
158
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
222
159
  return __generator(this, function (_c) {
223
160
  switch (_c.label) {
224
161
  case 0: return [4, context.endpoint()];
@@ -226,16 +163,7 @@ export var serializeAws_restJson1DescribeWorkspaceAuthenticationCommand = functi
226
163
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
227
164
  headers = {};
228
165
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}/authentication";
229
- if (input.workspaceId !== undefined) {
230
- labelValue = input.workspaceId;
231
- if (labelValue.length <= 0) {
232
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
233
- }
234
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
235
- }
236
- else {
237
- throw new Error("No value provided for input HTTP label: workspaceId.");
238
- }
166
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
239
167
  return [2, new __HttpRequest({
240
168
  protocol: protocol,
241
169
  hostname: hostname,
@@ -249,7 +177,7 @@ export var serializeAws_restJson1DescribeWorkspaceAuthenticationCommand = functi
249
177
  });
250
178
  }); };
251
179
  export var serializeAws_restJson1DisassociateLicenseCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
252
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
180
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
253
181
  return __generator(this, function (_c) {
254
182
  switch (_c.label) {
255
183
  case 0: return [4, context.endpoint()];
@@ -258,26 +186,8 @@ export var serializeAws_restJson1DisassociateLicenseCommand = function (input, c
258
186
  headers = {};
259
187
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
260
188
  "/workspaces/{workspaceId}/licenses/{licenseType}";
261
- if (input.workspaceId !== undefined) {
262
- labelValue = input.workspaceId;
263
- if (labelValue.length <= 0) {
264
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
265
- }
266
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
267
- }
268
- else {
269
- throw new Error("No value provided for input HTTP label: workspaceId.");
270
- }
271
- if (input.licenseType !== undefined) {
272
- labelValue = input.licenseType;
273
- if (labelValue.length <= 0) {
274
- throw new Error("Empty value provided for input HTTP label: licenseType.");
275
- }
276
- resolvedPath = resolvedPath.replace("{licenseType}", __extendedEncodeURIComponent(labelValue));
277
- }
278
- else {
279
- throw new Error("No value provided for input HTTP label: licenseType.");
280
- }
189
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
190
+ resolvedPath = __resolvedPath(resolvedPath, input, "licenseType", function () { return input.licenseType; }, "{licenseType}", false);
281
191
  return [2, new __HttpRequest({
282
192
  protocol: protocol,
283
193
  hostname: hostname,
@@ -291,7 +201,7 @@ export var serializeAws_restJson1DisassociateLicenseCommand = function (input, c
291
201
  });
292
202
  }); };
293
203
  export var serializeAws_restJson1ListPermissionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
294
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
204
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
295
205
  return __generator(this, function (_c) {
296
206
  switch (_c.label) {
297
207
  case 0: return [4, context.endpoint()];
@@ -299,17 +209,14 @@ export var serializeAws_restJson1ListPermissionsCommand = function (input, conte
299
209
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
300
210
  headers = {};
301
211
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}/permissions";
302
- if (input.workspaceId !== undefined) {
303
- labelValue = input.workspaceId;
304
- if (labelValue.length <= 0) {
305
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
306
- }
307
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
308
- }
309
- else {
310
- throw new Error("No value provided for input HTTP label: workspaceId.");
311
- }
312
- query = __assign(__assign(__assign(__assign(__assign({}, (input.maxResults !== undefined && { maxResults: input.maxResults.toString() })), (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.userType !== undefined && { userType: input.userType })), (input.userId !== undefined && { userId: input.userId })), (input.groupId !== undefined && { groupId: input.groupId }));
212
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
213
+ query = map({
214
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
215
+ nextToken: [, input.nextToken],
216
+ userType: [, input.userType],
217
+ userId: [, input.userId],
218
+ groupId: [, input.groupId],
219
+ });
313
220
  return [2, new __HttpRequest({
314
221
  protocol: protocol,
315
222
  hostname: hostname,
@@ -324,7 +231,7 @@ export var serializeAws_restJson1ListPermissionsCommand = function (input, conte
324
231
  });
325
232
  }); };
326
233
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
327
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
234
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
328
235
  return __generator(this, function (_c) {
329
236
  switch (_c.label) {
330
237
  case 0: return [4, context.endpoint()];
@@ -332,16 +239,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
332
239
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
333
240
  headers = {};
334
241
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
335
- if (input.resourceArn !== undefined) {
336
- labelValue = input.resourceArn;
337
- if (labelValue.length <= 0) {
338
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
339
- }
340
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
341
- }
342
- else {
343
- throw new Error("No value provided for input HTTP label: resourceArn.");
344
- }
242
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
345
243
  return [2, new __HttpRequest({
346
244
  protocol: protocol,
347
245
  hostname: hostname,
@@ -363,7 +261,10 @@ export var serializeAws_restJson1ListWorkspacesCommand = function (input, contex
363
261
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
364
262
  headers = {};
365
263
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces";
366
- query = __assign(__assign({}, (input.maxResults !== undefined && { maxResults: input.maxResults.toString() })), (input.nextToken !== undefined && { nextToken: input.nextToken }));
264
+ query = map({
265
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
266
+ nextToken: [, input.nextToken],
267
+ });
367
268
  return [2, new __HttpRequest({
368
269
  protocol: protocol,
369
270
  hostname: hostname,
@@ -378,7 +279,7 @@ export var serializeAws_restJson1ListWorkspacesCommand = function (input, contex
378
279
  });
379
280
  }); };
380
281
  export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
381
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
282
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
382
283
  return __generator(this, function (_c) {
383
284
  switch (_c.label) {
384
285
  case 0: return [4, context.endpoint()];
@@ -388,16 +289,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
388
289
  "content-type": "application/json",
389
290
  };
390
291
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
391
- if (input.resourceArn !== undefined) {
392
- labelValue = input.resourceArn;
393
- if (labelValue.length <= 0) {
394
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
395
- }
396
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
397
- }
398
- else {
399
- throw new Error("No value provided for input HTTP label: resourceArn.");
400
- }
292
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
401
293
  body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
402
294
  return [2, new __HttpRequest({
403
295
  protocol: protocol,
@@ -412,7 +304,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
412
304
  });
413
305
  }); };
414
306
  export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
415
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
307
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
416
308
  return __generator(this, function (_c) {
417
309
  switch (_c.label) {
418
310
  case 0: return [4, context.endpoint()];
@@ -420,17 +312,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
420
312
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
421
313
  headers = {};
422
314
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
423
- if (input.resourceArn !== undefined) {
424
- labelValue = input.resourceArn;
425
- if (labelValue.length <= 0) {
426
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
427
- }
428
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
429
- }
430
- else {
431
- throw new Error("No value provided for input HTTP label: resourceArn.");
432
- }
433
- query = __assign({}, (input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map(function (_entry) { return _entry; }) }));
315
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
316
+ query = map({
317
+ tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
318
+ });
434
319
  return [2, new __HttpRequest({
435
320
  protocol: protocol,
436
321
  hostname: hostname,
@@ -445,7 +330,7 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
445
330
  });
446
331
  }); };
447
332
  export var serializeAws_restJson1UpdatePermissionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
448
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
333
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
449
334
  return __generator(this, function (_c) {
450
335
  switch (_c.label) {
451
336
  case 0: return [4, context.endpoint()];
@@ -455,16 +340,7 @@ export var serializeAws_restJson1UpdatePermissionsCommand = function (input, con
455
340
  "content-type": "application/json",
456
341
  };
457
342
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}/permissions";
458
- if (input.workspaceId !== undefined) {
459
- labelValue = input.workspaceId;
460
- if (labelValue.length <= 0) {
461
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
462
- }
463
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
464
- }
465
- else {
466
- throw new Error("No value provided for input HTTP label: workspaceId.");
467
- }
343
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
468
344
  body = JSON.stringify(__assign({}, (input.updateInstructionBatch != null && {
469
345
  updateInstructionBatch: serializeAws_restJson1UpdateInstructionBatch(input.updateInstructionBatch, context),
470
346
  })));
@@ -481,7 +357,7 @@ export var serializeAws_restJson1UpdatePermissionsCommand = function (input, con
481
357
  });
482
358
  }); };
483
359
  export var serializeAws_restJson1UpdateWorkspaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
484
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
360
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
485
361
  return __generator(this, function (_c) {
486
362
  switch (_c.label) {
487
363
  case 0: return [4, context.endpoint()];
@@ -491,16 +367,7 @@ export var serializeAws_restJson1UpdateWorkspaceCommand = function (input, conte
491
367
  "content-type": "application/json",
492
368
  };
493
369
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}";
494
- if (input.workspaceId !== undefined) {
495
- labelValue = input.workspaceId;
496
- if (labelValue.length <= 0) {
497
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
498
- }
499
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
500
- }
501
- else {
502
- throw new Error("No value provided for input HTTP label: workspaceId.");
503
- }
370
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
504
371
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.accountAccessType != null && { accountAccessType: input.accountAccessType })), (input.organizationRoleName != null && { organizationRoleName: input.organizationRoleName })), (input.permissionType != null && { permissionType: input.permissionType })), (input.stackSetName != null && { stackSetName: input.stackSetName })), (input.workspaceDataSources != null && {
505
372
  workspaceDataSources: serializeAws_restJson1DataSourceTypesList(input.workspaceDataSources, context),
506
373
  })), (input.workspaceDescription != null && { workspaceDescription: input.workspaceDescription })), (input.workspaceName != null && { workspaceName: input.workspaceName })), (input.workspaceNotificationDestinations != null && {
@@ -521,7 +388,7 @@ export var serializeAws_restJson1UpdateWorkspaceCommand = function (input, conte
521
388
  });
522
389
  }); };
523
390
  export var serializeAws_restJson1UpdateWorkspaceAuthenticationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
524
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
391
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
525
392
  return __generator(this, function (_c) {
526
393
  switch (_c.label) {
527
394
  case 0: return [4, context.endpoint()];
@@ -531,16 +398,7 @@ export var serializeAws_restJson1UpdateWorkspaceAuthenticationCommand = function
531
398
  "content-type": "application/json",
532
399
  };
533
400
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}/authentication";
534
- if (input.workspaceId !== undefined) {
535
- labelValue = input.workspaceId;
536
- if (labelValue.length <= 0) {
537
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
538
- }
539
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
540
- }
541
- else {
542
- throw new Error("No value provided for input HTTP label: workspaceId.");
543
- }
401
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
544
402
  body = JSON.stringify(__assign(__assign({}, (input.authenticationProviders != null && {
545
403
  authenticationProviders: serializeAws_restJson1AuthenticationProviders(input.authenticationProviders, context),
546
404
  })), (input.samlConfiguration != null && {
@@ -566,24 +424,23 @@ export var deserializeAws_restJson1AssociateLicenseCommand = function (output, c
566
424
  if (output.statusCode !== 202 && output.statusCode >= 300) {
567
425
  return [2, deserializeAws_restJson1AssociateLicenseCommandError(output, context)];
568
426
  }
569
- contents = {
427
+ contents = map({
570
428
  $metadata: deserializeMetadata(output),
571
- workspace: undefined,
572
- };
429
+ });
573
430
  _a = __expectNonNull;
574
431
  _b = __expectObject;
575
432
  return [4, parseBody(output.body, context)];
576
433
  case 1:
577
434
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
578
- if (data.workspace !== undefined && data.workspace !== null) {
435
+ if (data.workspace != null) {
579
436
  contents.workspace = deserializeAws_restJson1WorkspaceDescription(data.workspace, context);
580
437
  }
581
- return [2, Promise.resolve(contents)];
438
+ return [2, contents];
582
439
  }
583
440
  });
584
441
  }); };
585
442
  var deserializeAws_restJson1AssociateLicenseCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
586
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
443
+ var parsedOutput, _a, errorCode, _b, parsedBody;
587
444
  var _c;
588
445
  return __generator(this, function (_d) {
589
446
  switch (_d.label) {
@@ -620,14 +477,14 @@ var deserializeAws_restJson1AssociateLicenseCommandError = function (output, con
620
477
  case 11: throw _d.sent();
621
478
  case 12:
622
479
  parsedBody = parsedOutput.body;
623
- $metadata = deserializeMetadata(output);
624
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
625
- response = new __BaseException({
626
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
627
- $fault: "client",
628
- $metadata: $metadata,
480
+ throwDefaultError({
481
+ output: output,
482
+ parsedBody: parsedBody,
483
+ exceptionCtor: __BaseException,
484
+ errorCode: errorCode,
629
485
  });
630
- throw __decorateServiceException(response, parsedBody);
486
+ _d.label = 13;
487
+ case 13: return [2];
631
488
  }
632
489
  });
633
490
  }); };
@@ -639,24 +496,23 @@ export var deserializeAws_restJson1CreateWorkspaceCommand = function (output, co
639
496
  if (output.statusCode !== 202 && output.statusCode >= 300) {
640
497
  return [2, deserializeAws_restJson1CreateWorkspaceCommandError(output, context)];
641
498
  }
642
- contents = {
499
+ contents = map({
643
500
  $metadata: deserializeMetadata(output),
644
- workspace: undefined,
645
- };
501
+ });
646
502
  _a = __expectNonNull;
647
503
  _b = __expectObject;
648
504
  return [4, parseBody(output.body, context)];
649
505
  case 1:
650
506
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
651
- if (data.workspace !== undefined && data.workspace !== null) {
507
+ if (data.workspace != null) {
652
508
  contents.workspace = deserializeAws_restJson1WorkspaceDescription(data.workspace, context);
653
509
  }
654
- return [2, Promise.resolve(contents)];
510
+ return [2, contents];
655
511
  }
656
512
  });
657
513
  }); };
658
514
  var deserializeAws_restJson1CreateWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
659
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
515
+ var parsedOutput, _a, errorCode, _b, parsedBody;
660
516
  var _c;
661
517
  return __generator(this, function (_d) {
662
518
  switch (_d.label) {
@@ -697,14 +553,14 @@ var deserializeAws_restJson1CreateWorkspaceCommandError = function (output, cont
697
553
  case 13: throw _d.sent();
698
554
  case 14:
699
555
  parsedBody = parsedOutput.body;
700
- $metadata = deserializeMetadata(output);
701
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
702
- response = new __BaseException({
703
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
704
- $fault: "client",
705
- $metadata: $metadata,
556
+ throwDefaultError({
557
+ output: output,
558
+ parsedBody: parsedBody,
559
+ exceptionCtor: __BaseException,
560
+ errorCode: errorCode,
706
561
  });
707
- throw __decorateServiceException(response, parsedBody);
562
+ _d.label = 15;
563
+ case 15: return [2];
708
564
  }
709
565
  });
710
566
  }); };
@@ -716,32 +572,29 @@ export var deserializeAws_restJson1CreateWorkspaceApiKeyCommand = function (outp
716
572
  if (output.statusCode !== 200 && output.statusCode >= 300) {
717
573
  return [2, deserializeAws_restJson1CreateWorkspaceApiKeyCommandError(output, context)];
718
574
  }
719
- contents = {
575
+ contents = map({
720
576
  $metadata: deserializeMetadata(output),
721
- key: undefined,
722
- keyName: undefined,
723
- workspaceId: undefined,
724
- };
577
+ });
725
578
  _a = __expectNonNull;
726
579
  _b = __expectObject;
727
580
  return [4, parseBody(output.body, context)];
728
581
  case 1:
729
582
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
730
- if (data.key !== undefined && data.key !== null) {
583
+ if (data.key != null) {
731
584
  contents.key = __expectString(data.key);
732
585
  }
733
- if (data.keyName !== undefined && data.keyName !== null) {
586
+ if (data.keyName != null) {
734
587
  contents.keyName = __expectString(data.keyName);
735
588
  }
736
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
589
+ if (data.workspaceId != null) {
737
590
  contents.workspaceId = __expectString(data.workspaceId);
738
591
  }
739
- return [2, Promise.resolve(contents)];
592
+ return [2, contents];
740
593
  }
741
594
  });
742
595
  }); };
743
596
  var deserializeAws_restJson1CreateWorkspaceApiKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
744
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
597
+ var parsedOutput, _a, errorCode, _b, parsedBody;
745
598
  var _c;
746
599
  return __generator(this, function (_d) {
747
600
  switch (_d.label) {
@@ -786,14 +639,14 @@ var deserializeAws_restJson1CreateWorkspaceApiKeyCommandError = function (output
786
639
  case 15: throw _d.sent();
787
640
  case 16:
788
641
  parsedBody = parsedOutput.body;
789
- $metadata = deserializeMetadata(output);
790
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
791
- response = new __BaseException({
792
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
793
- $fault: "client",
794
- $metadata: $metadata,
642
+ throwDefaultError({
643
+ output: output,
644
+ parsedBody: parsedBody,
645
+ exceptionCtor: __BaseException,
646
+ errorCode: errorCode,
795
647
  });
796
- throw __decorateServiceException(response, parsedBody);
648
+ _d.label = 17;
649
+ case 17: return [2];
797
650
  }
798
651
  });
799
652
  }); };
@@ -805,24 +658,23 @@ export var deserializeAws_restJson1DeleteWorkspaceCommand = function (output, co
805
658
  if (output.statusCode !== 202 && output.statusCode >= 300) {
806
659
  return [2, deserializeAws_restJson1DeleteWorkspaceCommandError(output, context)];
807
660
  }
808
- contents = {
661
+ contents = map({
809
662
  $metadata: deserializeMetadata(output),
810
- workspace: undefined,
811
- };
663
+ });
812
664
  _a = __expectNonNull;
813
665
  _b = __expectObject;
814
666
  return [4, parseBody(output.body, context)];
815
667
  case 1:
816
668
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
817
- if (data.workspace !== undefined && data.workspace !== null) {
669
+ if (data.workspace != null) {
818
670
  contents.workspace = deserializeAws_restJson1WorkspaceDescription(data.workspace, context);
819
671
  }
820
- return [2, Promise.resolve(contents)];
672
+ return [2, contents];
821
673
  }
822
674
  });
823
675
  }); };
824
676
  var deserializeAws_restJson1DeleteWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
825
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
677
+ var parsedOutput, _a, errorCode, _b, parsedBody;
826
678
  var _c;
827
679
  return __generator(this, function (_d) {
828
680
  switch (_d.label) {
@@ -863,14 +715,14 @@ var deserializeAws_restJson1DeleteWorkspaceCommandError = function (output, cont
863
715
  case 13: throw _d.sent();
864
716
  case 14:
865
717
  parsedBody = parsedOutput.body;
866
- $metadata = deserializeMetadata(output);
867
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
868
- response = new __BaseException({
869
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
870
- $fault: "client",
871
- $metadata: $metadata,
718
+ throwDefaultError({
719
+ output: output,
720
+ parsedBody: parsedBody,
721
+ exceptionCtor: __BaseException,
722
+ errorCode: errorCode,
872
723
  });
873
- throw __decorateServiceException(response, parsedBody);
724
+ _d.label = 15;
725
+ case 15: return [2];
874
726
  }
875
727
  });
876
728
  }); };
@@ -882,28 +734,26 @@ export var deserializeAws_restJson1DeleteWorkspaceApiKeyCommand = function (outp
882
734
  if (output.statusCode !== 200 && output.statusCode >= 300) {
883
735
  return [2, deserializeAws_restJson1DeleteWorkspaceApiKeyCommandError(output, context)];
884
736
  }
885
- contents = {
737
+ contents = map({
886
738
  $metadata: deserializeMetadata(output),
887
- keyName: undefined,
888
- workspaceId: undefined,
889
- };
739
+ });
890
740
  _a = __expectNonNull;
891
741
  _b = __expectObject;
892
742
  return [4, parseBody(output.body, context)];
893
743
  case 1:
894
744
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
895
- if (data.keyName !== undefined && data.keyName !== null) {
745
+ if (data.keyName != null) {
896
746
  contents.keyName = __expectString(data.keyName);
897
747
  }
898
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
748
+ if (data.workspaceId != null) {
899
749
  contents.workspaceId = __expectString(data.workspaceId);
900
750
  }
901
- return [2, Promise.resolve(contents)];
751
+ return [2, contents];
902
752
  }
903
753
  });
904
754
  }); };
905
755
  var deserializeAws_restJson1DeleteWorkspaceApiKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
906
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
756
+ var parsedOutput, _a, errorCode, _b, parsedBody;
907
757
  var _c;
908
758
  return __generator(this, function (_d) {
909
759
  switch (_d.label) {
@@ -944,14 +794,14 @@ var deserializeAws_restJson1DeleteWorkspaceApiKeyCommandError = function (output
944
794
  case 13: throw _d.sent();
945
795
  case 14:
946
796
  parsedBody = parsedOutput.body;
947
- $metadata = deserializeMetadata(output);
948
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
949
- response = new __BaseException({
950
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
951
- $fault: "client",
952
- $metadata: $metadata,
797
+ throwDefaultError({
798
+ output: output,
799
+ parsedBody: parsedBody,
800
+ exceptionCtor: __BaseException,
801
+ errorCode: errorCode,
953
802
  });
954
- throw __decorateServiceException(response, parsedBody);
803
+ _d.label = 15;
804
+ case 15: return [2];
955
805
  }
956
806
  });
957
807
  }); };
@@ -963,24 +813,23 @@ export var deserializeAws_restJson1DescribeWorkspaceCommand = function (output,
963
813
  if (output.statusCode !== 200 && output.statusCode >= 300) {
964
814
  return [2, deserializeAws_restJson1DescribeWorkspaceCommandError(output, context)];
965
815
  }
966
- contents = {
816
+ contents = map({
967
817
  $metadata: deserializeMetadata(output),
968
- workspace: undefined,
969
- };
818
+ });
970
819
  _a = __expectNonNull;
971
820
  _b = __expectObject;
972
821
  return [4, parseBody(output.body, context)];
973
822
  case 1:
974
823
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
975
- if (data.workspace !== undefined && data.workspace !== null) {
824
+ if (data.workspace != null) {
976
825
  contents.workspace = deserializeAws_restJson1WorkspaceDescription(data.workspace, context);
977
826
  }
978
- return [2, Promise.resolve(contents)];
827
+ return [2, contents];
979
828
  }
980
829
  });
981
830
  }); };
982
831
  var deserializeAws_restJson1DescribeWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
983
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
832
+ var parsedOutput, _a, errorCode, _b, parsedBody;
984
833
  var _c;
985
834
  return __generator(this, function (_d) {
986
835
  switch (_d.label) {
@@ -1017,14 +866,14 @@ var deserializeAws_restJson1DescribeWorkspaceCommandError = function (output, co
1017
866
  case 11: throw _d.sent();
1018
867
  case 12:
1019
868
  parsedBody = parsedOutput.body;
1020
- $metadata = deserializeMetadata(output);
1021
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1022
- response = new __BaseException({
1023
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1024
- $fault: "client",
1025
- $metadata: $metadata,
869
+ throwDefaultError({
870
+ output: output,
871
+ parsedBody: parsedBody,
872
+ exceptionCtor: __BaseException,
873
+ errorCode: errorCode,
1026
874
  });
1027
- throw __decorateServiceException(response, parsedBody);
875
+ _d.label = 13;
876
+ case 13: return [2];
1028
877
  }
1029
878
  });
1030
879
  }); };
@@ -1036,24 +885,23 @@ export var deserializeAws_restJson1DescribeWorkspaceAuthenticationCommand = func
1036
885
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1037
886
  return [2, deserializeAws_restJson1DescribeWorkspaceAuthenticationCommandError(output, context)];
1038
887
  }
1039
- contents = {
888
+ contents = map({
1040
889
  $metadata: deserializeMetadata(output),
1041
- authentication: undefined,
1042
- };
890
+ });
1043
891
  _a = __expectNonNull;
1044
892
  _b = __expectObject;
1045
893
  return [4, parseBody(output.body, context)];
1046
894
  case 1:
1047
895
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1048
- if (data.authentication !== undefined && data.authentication !== null) {
896
+ if (data.authentication != null) {
1049
897
  contents.authentication = deserializeAws_restJson1AuthenticationDescription(data.authentication, context);
1050
898
  }
1051
- return [2, Promise.resolve(contents)];
899
+ return [2, contents];
1052
900
  }
1053
901
  });
1054
902
  }); };
1055
903
  var deserializeAws_restJson1DescribeWorkspaceAuthenticationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1056
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
904
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1057
905
  var _c;
1058
906
  return __generator(this, function (_d) {
1059
907
  switch (_d.label) {
@@ -1090,14 +938,14 @@ var deserializeAws_restJson1DescribeWorkspaceAuthenticationCommandError = functi
1090
938
  case 11: throw _d.sent();
1091
939
  case 12:
1092
940
  parsedBody = parsedOutput.body;
1093
- $metadata = deserializeMetadata(output);
1094
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1095
- response = new __BaseException({
1096
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1097
- $fault: "client",
1098
- $metadata: $metadata,
941
+ throwDefaultError({
942
+ output: output,
943
+ parsedBody: parsedBody,
944
+ exceptionCtor: __BaseException,
945
+ errorCode: errorCode,
1099
946
  });
1100
- throw __decorateServiceException(response, parsedBody);
947
+ _d.label = 13;
948
+ case 13: return [2];
1101
949
  }
1102
950
  });
1103
951
  }); };
@@ -1109,24 +957,23 @@ export var deserializeAws_restJson1DisassociateLicenseCommand = function (output
1109
957
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1110
958
  return [2, deserializeAws_restJson1DisassociateLicenseCommandError(output, context)];
1111
959
  }
1112
- contents = {
960
+ contents = map({
1113
961
  $metadata: deserializeMetadata(output),
1114
- workspace: undefined,
1115
- };
962
+ });
1116
963
  _a = __expectNonNull;
1117
964
  _b = __expectObject;
1118
965
  return [4, parseBody(output.body, context)];
1119
966
  case 1:
1120
967
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1121
- if (data.workspace !== undefined && data.workspace !== null) {
968
+ if (data.workspace != null) {
1122
969
  contents.workspace = deserializeAws_restJson1WorkspaceDescription(data.workspace, context);
1123
970
  }
1124
- return [2, Promise.resolve(contents)];
971
+ return [2, contents];
1125
972
  }
1126
973
  });
1127
974
  }); };
1128
975
  var deserializeAws_restJson1DisassociateLicenseCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1129
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
976
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1130
977
  var _c;
1131
978
  return __generator(this, function (_d) {
1132
979
  switch (_d.label) {
@@ -1163,14 +1010,14 @@ var deserializeAws_restJson1DisassociateLicenseCommandError = function (output,
1163
1010
  case 11: throw _d.sent();
1164
1011
  case 12:
1165
1012
  parsedBody = parsedOutput.body;
1166
- $metadata = deserializeMetadata(output);
1167
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1168
- response = new __BaseException({
1169
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1170
- $fault: "client",
1171
- $metadata: $metadata,
1013
+ throwDefaultError({
1014
+ output: output,
1015
+ parsedBody: parsedBody,
1016
+ exceptionCtor: __BaseException,
1017
+ errorCode: errorCode,
1172
1018
  });
1173
- throw __decorateServiceException(response, parsedBody);
1019
+ _d.label = 13;
1020
+ case 13: return [2];
1174
1021
  }
1175
1022
  });
1176
1023
  }); };
@@ -1182,28 +1029,26 @@ export var deserializeAws_restJson1ListPermissionsCommand = function (output, co
1182
1029
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1183
1030
  return [2, deserializeAws_restJson1ListPermissionsCommandError(output, context)];
1184
1031
  }
1185
- contents = {
1032
+ contents = map({
1186
1033
  $metadata: deserializeMetadata(output),
1187
- nextToken: undefined,
1188
- permissions: undefined,
1189
- };
1034
+ });
1190
1035
  _a = __expectNonNull;
1191
1036
  _b = __expectObject;
1192
1037
  return [4, parseBody(output.body, context)];
1193
1038
  case 1:
1194
1039
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1195
- if (data.nextToken !== undefined && data.nextToken !== null) {
1040
+ if (data.nextToken != null) {
1196
1041
  contents.nextToken = __expectString(data.nextToken);
1197
1042
  }
1198
- if (data.permissions !== undefined && data.permissions !== null) {
1043
+ if (data.permissions != null) {
1199
1044
  contents.permissions = deserializeAws_restJson1PermissionEntryList(data.permissions, context);
1200
1045
  }
1201
- return [2, Promise.resolve(contents)];
1046
+ return [2, contents];
1202
1047
  }
1203
1048
  });
1204
1049
  }); };
1205
1050
  var deserializeAws_restJson1ListPermissionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1206
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1051
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1207
1052
  var _c;
1208
1053
  return __generator(this, function (_d) {
1209
1054
  switch (_d.label) {
@@ -1240,14 +1085,14 @@ var deserializeAws_restJson1ListPermissionsCommandError = function (output, cont
1240
1085
  case 11: throw _d.sent();
1241
1086
  case 12:
1242
1087
  parsedBody = parsedOutput.body;
1243
- $metadata = deserializeMetadata(output);
1244
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1245
- response = new __BaseException({
1246
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1247
- $fault: "client",
1248
- $metadata: $metadata,
1088
+ throwDefaultError({
1089
+ output: output,
1090
+ parsedBody: parsedBody,
1091
+ exceptionCtor: __BaseException,
1092
+ errorCode: errorCode,
1249
1093
  });
1250
- throw __decorateServiceException(response, parsedBody);
1094
+ _d.label = 13;
1095
+ case 13: return [2];
1251
1096
  }
1252
1097
  });
1253
1098
  }); };
@@ -1259,24 +1104,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
1259
1104
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1260
1105
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1261
1106
  }
1262
- contents = {
1107
+ contents = map({
1263
1108
  $metadata: deserializeMetadata(output),
1264
- tags: undefined,
1265
- };
1109
+ });
1266
1110
  _a = __expectNonNull;
1267
1111
  _b = __expectObject;
1268
1112
  return [4, parseBody(output.body, context)];
1269
1113
  case 1:
1270
1114
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1271
- if (data.tags !== undefined && data.tags !== null) {
1115
+ if (data.tags != null) {
1272
1116
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
1273
1117
  }
1274
- return [2, Promise.resolve(contents)];
1118
+ return [2, contents];
1275
1119
  }
1276
1120
  });
1277
1121
  }); };
1278
1122
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1279
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1123
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1280
1124
  var _c;
1281
1125
  return __generator(this, function (_d) {
1282
1126
  switch (_d.label) {
@@ -1313,14 +1157,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
1313
1157
  case 11: throw _d.sent();
1314
1158
  case 12:
1315
1159
  parsedBody = parsedOutput.body;
1316
- $metadata = deserializeMetadata(output);
1317
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1318
- response = new __BaseException({
1319
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1320
- $fault: "client",
1321
- $metadata: $metadata,
1160
+ throwDefaultError({
1161
+ output: output,
1162
+ parsedBody: parsedBody,
1163
+ exceptionCtor: __BaseException,
1164
+ errorCode: errorCode,
1322
1165
  });
1323
- throw __decorateServiceException(response, parsedBody);
1166
+ _d.label = 13;
1167
+ case 13: return [2];
1324
1168
  }
1325
1169
  });
1326
1170
  }); };
@@ -1332,28 +1176,26 @@ export var deserializeAws_restJson1ListWorkspacesCommand = function (output, con
1332
1176
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1333
1177
  return [2, deserializeAws_restJson1ListWorkspacesCommandError(output, context)];
1334
1178
  }
1335
- contents = {
1179
+ contents = map({
1336
1180
  $metadata: deserializeMetadata(output),
1337
- nextToken: undefined,
1338
- workspaces: undefined,
1339
- };
1181
+ });
1340
1182
  _a = __expectNonNull;
1341
1183
  _b = __expectObject;
1342
1184
  return [4, parseBody(output.body, context)];
1343
1185
  case 1:
1344
1186
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1345
- if (data.nextToken !== undefined && data.nextToken !== null) {
1187
+ if (data.nextToken != null) {
1346
1188
  contents.nextToken = __expectString(data.nextToken);
1347
1189
  }
1348
- if (data.workspaces !== undefined && data.workspaces !== null) {
1190
+ if (data.workspaces != null) {
1349
1191
  contents.workspaces = deserializeAws_restJson1WorkspaceList(data.workspaces, context);
1350
1192
  }
1351
- return [2, Promise.resolve(contents)];
1193
+ return [2, contents];
1352
1194
  }
1353
1195
  });
1354
1196
  }); };
1355
1197
  var deserializeAws_restJson1ListWorkspacesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1356
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1198
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1357
1199
  var _c;
1358
1200
  return __generator(this, function (_d) {
1359
1201
  switch (_d.label) {
@@ -1382,14 +1224,14 @@ var deserializeAws_restJson1ListWorkspacesCommandError = function (output, conte
1382
1224
  case 7: throw _d.sent();
1383
1225
  case 8:
1384
1226
  parsedBody = parsedOutput.body;
1385
- $metadata = deserializeMetadata(output);
1386
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1387
- response = new __BaseException({
1388
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1389
- $fault: "client",
1390
- $metadata: $metadata,
1227
+ throwDefaultError({
1228
+ output: output,
1229
+ parsedBody: parsedBody,
1230
+ exceptionCtor: __BaseException,
1231
+ errorCode: errorCode,
1391
1232
  });
1392
- throw __decorateServiceException(response, parsedBody);
1233
+ _d.label = 9;
1234
+ case 9: return [2];
1393
1235
  }
1394
1236
  });
1395
1237
  }); };
@@ -1401,18 +1243,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
1401
1243
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1402
1244
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
1403
1245
  }
1404
- contents = {
1246
+ contents = map({
1405
1247
  $metadata: deserializeMetadata(output),
1406
- };
1248
+ });
1407
1249
  return [4, collectBody(output.body, context)];
1408
1250
  case 1:
1409
1251
  _a.sent();
1410
- return [2, Promise.resolve(contents)];
1252
+ return [2, contents];
1411
1253
  }
1412
1254
  });
1413
1255
  }); };
1414
1256
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1415
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1257
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1416
1258
  var _c;
1417
1259
  return __generator(this, function (_d) {
1418
1260
  switch (_d.label) {
@@ -1449,14 +1291,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
1449
1291
  case 11: throw _d.sent();
1450
1292
  case 12:
1451
1293
  parsedBody = parsedOutput.body;
1452
- $metadata = deserializeMetadata(output);
1453
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1454
- response = new __BaseException({
1455
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1456
- $fault: "client",
1457
- $metadata: $metadata,
1294
+ throwDefaultError({
1295
+ output: output,
1296
+ parsedBody: parsedBody,
1297
+ exceptionCtor: __BaseException,
1298
+ errorCode: errorCode,
1458
1299
  });
1459
- throw __decorateServiceException(response, parsedBody);
1300
+ _d.label = 13;
1301
+ case 13: return [2];
1460
1302
  }
1461
1303
  });
1462
1304
  }); };
@@ -1468,18 +1310,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
1468
1310
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1469
1311
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
1470
1312
  }
1471
- contents = {
1313
+ contents = map({
1472
1314
  $metadata: deserializeMetadata(output),
1473
- };
1315
+ });
1474
1316
  return [4, collectBody(output.body, context)];
1475
1317
  case 1:
1476
1318
  _a.sent();
1477
- return [2, Promise.resolve(contents)];
1319
+ return [2, contents];
1478
1320
  }
1479
1321
  });
1480
1322
  }); };
1481
1323
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1482
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1324
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1483
1325
  var _c;
1484
1326
  return __generator(this, function (_d) {
1485
1327
  switch (_d.label) {
@@ -1516,14 +1358,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
1516
1358
  case 11: throw _d.sent();
1517
1359
  case 12:
1518
1360
  parsedBody = parsedOutput.body;
1519
- $metadata = deserializeMetadata(output);
1520
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1521
- response = new __BaseException({
1522
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1523
- $fault: "client",
1524
- $metadata: $metadata,
1361
+ throwDefaultError({
1362
+ output: output,
1363
+ parsedBody: parsedBody,
1364
+ exceptionCtor: __BaseException,
1365
+ errorCode: errorCode,
1525
1366
  });
1526
- throw __decorateServiceException(response, parsedBody);
1367
+ _d.label = 13;
1368
+ case 13: return [2];
1527
1369
  }
1528
1370
  });
1529
1371
  }); };
@@ -1535,24 +1377,23 @@ export var deserializeAws_restJson1UpdatePermissionsCommand = function (output,
1535
1377
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1536
1378
  return [2, deserializeAws_restJson1UpdatePermissionsCommandError(output, context)];
1537
1379
  }
1538
- contents = {
1380
+ contents = map({
1539
1381
  $metadata: deserializeMetadata(output),
1540
- errors: undefined,
1541
- };
1382
+ });
1542
1383
  _a = __expectNonNull;
1543
1384
  _b = __expectObject;
1544
1385
  return [4, parseBody(output.body, context)];
1545
1386
  case 1:
1546
1387
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1547
- if (data.errors !== undefined && data.errors !== null) {
1388
+ if (data.errors != null) {
1548
1389
  contents.errors = deserializeAws_restJson1UpdateErrorList(data.errors, context);
1549
1390
  }
1550
- return [2, Promise.resolve(contents)];
1391
+ return [2, contents];
1551
1392
  }
1552
1393
  });
1553
1394
  }); };
1554
1395
  var deserializeAws_restJson1UpdatePermissionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1555
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1396
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1556
1397
  var _c;
1557
1398
  return __generator(this, function (_d) {
1558
1399
  switch (_d.label) {
@@ -1589,14 +1430,14 @@ var deserializeAws_restJson1UpdatePermissionsCommandError = function (output, co
1589
1430
  case 11: throw _d.sent();
1590
1431
  case 12:
1591
1432
  parsedBody = parsedOutput.body;
1592
- $metadata = deserializeMetadata(output);
1593
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1594
- response = new __BaseException({
1595
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1596
- $fault: "client",
1597
- $metadata: $metadata,
1433
+ throwDefaultError({
1434
+ output: output,
1435
+ parsedBody: parsedBody,
1436
+ exceptionCtor: __BaseException,
1437
+ errorCode: errorCode,
1598
1438
  });
1599
- throw __decorateServiceException(response, parsedBody);
1439
+ _d.label = 13;
1440
+ case 13: return [2];
1600
1441
  }
1601
1442
  });
1602
1443
  }); };
@@ -1608,24 +1449,23 @@ export var deserializeAws_restJson1UpdateWorkspaceCommand = function (output, co
1608
1449
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1609
1450
  return [2, deserializeAws_restJson1UpdateWorkspaceCommandError(output, context)];
1610
1451
  }
1611
- contents = {
1452
+ contents = map({
1612
1453
  $metadata: deserializeMetadata(output),
1613
- workspace: undefined,
1614
- };
1454
+ });
1615
1455
  _a = __expectNonNull;
1616
1456
  _b = __expectObject;
1617
1457
  return [4, parseBody(output.body, context)];
1618
1458
  case 1:
1619
1459
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1620
- if (data.workspace !== undefined && data.workspace !== null) {
1460
+ if (data.workspace != null) {
1621
1461
  contents.workspace = deserializeAws_restJson1WorkspaceDescription(data.workspace, context);
1622
1462
  }
1623
- return [2, Promise.resolve(contents)];
1463
+ return [2, contents];
1624
1464
  }
1625
1465
  });
1626
1466
  }); };
1627
1467
  var deserializeAws_restJson1UpdateWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1628
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1468
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1629
1469
  var _c;
1630
1470
  return __generator(this, function (_d) {
1631
1471
  switch (_d.label) {
@@ -1666,14 +1506,14 @@ var deserializeAws_restJson1UpdateWorkspaceCommandError = function (output, cont
1666
1506
  case 13: throw _d.sent();
1667
1507
  case 14:
1668
1508
  parsedBody = parsedOutput.body;
1669
- $metadata = deserializeMetadata(output);
1670
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1671
- response = new __BaseException({
1672
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1673
- $fault: "client",
1674
- $metadata: $metadata,
1509
+ throwDefaultError({
1510
+ output: output,
1511
+ parsedBody: parsedBody,
1512
+ exceptionCtor: __BaseException,
1513
+ errorCode: errorCode,
1675
1514
  });
1676
- throw __decorateServiceException(response, parsedBody);
1515
+ _d.label = 15;
1516
+ case 15: return [2];
1677
1517
  }
1678
1518
  });
1679
1519
  }); };
@@ -1685,24 +1525,23 @@ export var deserializeAws_restJson1UpdateWorkspaceAuthenticationCommand = functi
1685
1525
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1686
1526
  return [2, deserializeAws_restJson1UpdateWorkspaceAuthenticationCommandError(output, context)];
1687
1527
  }
1688
- contents = {
1528
+ contents = map({
1689
1529
  $metadata: deserializeMetadata(output),
1690
- authentication: undefined,
1691
- };
1530
+ });
1692
1531
  _a = __expectNonNull;
1693
1532
  _b = __expectObject;
1694
1533
  return [4, parseBody(output.body, context)];
1695
1534
  case 1:
1696
1535
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1697
- if (data.authentication !== undefined && data.authentication !== null) {
1536
+ if (data.authentication != null) {
1698
1537
  contents.authentication = deserializeAws_restJson1AuthenticationDescription(data.authentication, context);
1699
1538
  }
1700
- return [2, Promise.resolve(contents)];
1539
+ return [2, contents];
1701
1540
  }
1702
1541
  });
1703
1542
  }); };
1704
1543
  var deserializeAws_restJson1UpdateWorkspaceAuthenticationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1705
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1544
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1706
1545
  var _c;
1707
1546
  return __generator(this, function (_d) {
1708
1547
  switch (_d.label) {
@@ -1743,23 +1582,24 @@ var deserializeAws_restJson1UpdateWorkspaceAuthenticationCommandError = function
1743
1582
  case 13: throw _d.sent();
1744
1583
  case 14:
1745
1584
  parsedBody = parsedOutput.body;
1746
- $metadata = deserializeMetadata(output);
1747
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1748
- response = new __BaseException({
1749
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1750
- $fault: "client",
1751
- $metadata: $metadata,
1585
+ throwDefaultError({
1586
+ output: output,
1587
+ parsedBody: parsedBody,
1588
+ exceptionCtor: __BaseException,
1589
+ errorCode: errorCode,
1752
1590
  });
1753
- throw __decorateServiceException(response, parsedBody);
1591
+ _d.label = 15;
1592
+ case 15: return [2];
1754
1593
  }
1755
1594
  });
1756
1595
  }); };
1596
+ var map = __map;
1757
1597
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1758
1598
  var contents, data, exception;
1759
1599
  return __generator(this, function (_a) {
1760
- contents = {};
1600
+ contents = map({});
1761
1601
  data = parsedOutput.body;
1762
- if (data.message !== undefined && data.message !== null) {
1602
+ if (data.message != null) {
1763
1603
  contents.message = __expectString(data.message);
1764
1604
  }
1765
1605
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1769,15 +1609,15 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
1769
1609
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1770
1610
  var contents, data, exception;
1771
1611
  return __generator(this, function (_a) {
1772
- contents = {};
1612
+ contents = map({});
1773
1613
  data = parsedOutput.body;
1774
- if (data.message !== undefined && data.message !== null) {
1614
+ if (data.message != null) {
1775
1615
  contents.message = __expectString(data.message);
1776
1616
  }
1777
- if (data.resourceId !== undefined && data.resourceId !== null) {
1617
+ if (data.resourceId != null) {
1778
1618
  contents.resourceId = __expectString(data.resourceId);
1779
1619
  }
1780
- if (data.resourceType !== undefined && data.resourceType !== null) {
1620
+ if (data.resourceType != null) {
1781
1621
  contents.resourceType = __expectString(data.resourceType);
1782
1622
  }
1783
1623
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1787,12 +1627,14 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
1787
1627
  var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1788
1628
  var contents, data, exception;
1789
1629
  return __generator(this, function (_a) {
1790
- contents = {};
1791
- if (parsedOutput.headers["retry-after"] !== undefined) {
1792
- contents.retryAfterSeconds = __strictParseInt32(parsedOutput.headers["retry-after"]);
1793
- }
1630
+ contents = map({
1631
+ retryAfterSeconds: [
1632
+ function () { return void 0 !== parsedOutput.headers["retry-after"]; },
1633
+ function () { return __strictParseInt32(parsedOutput.headers["retry-after"]); },
1634
+ ],
1635
+ });
1794
1636
  data = parsedOutput.body;
1795
- if (data.message !== undefined && data.message !== null) {
1637
+ if (data.message != null) {
1796
1638
  contents.message = __expectString(data.message);
1797
1639
  }
1798
1640
  exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1802,15 +1644,15 @@ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOu
1802
1644
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1803
1645
  var contents, data, exception;
1804
1646
  return __generator(this, function (_a) {
1805
- contents = {};
1647
+ contents = map({});
1806
1648
  data = parsedOutput.body;
1807
- if (data.message !== undefined && data.message !== null) {
1649
+ if (data.message != null) {
1808
1650
  contents.message = __expectString(data.message);
1809
1651
  }
1810
- if (data.resourceId !== undefined && data.resourceId !== null) {
1652
+ if (data.resourceId != null) {
1811
1653
  contents.resourceId = __expectString(data.resourceId);
1812
1654
  }
1813
- if (data.resourceType !== undefined && data.resourceType !== null) {
1655
+ if (data.resourceType != null) {
1814
1656
  contents.resourceType = __expectString(data.resourceType);
1815
1657
  }
1816
1658
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1820,21 +1662,21 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
1820
1662
  var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1821
1663
  var contents, data, exception;
1822
1664
  return __generator(this, function (_a) {
1823
- contents = {};
1665
+ contents = map({});
1824
1666
  data = parsedOutput.body;
1825
- if (data.message !== undefined && data.message !== null) {
1667
+ if (data.message != null) {
1826
1668
  contents.message = __expectString(data.message);
1827
1669
  }
1828
- if (data.quotaCode !== undefined && data.quotaCode !== null) {
1670
+ if (data.quotaCode != null) {
1829
1671
  contents.quotaCode = __expectString(data.quotaCode);
1830
1672
  }
1831
- if (data.resourceId !== undefined && data.resourceId !== null) {
1673
+ if (data.resourceId != null) {
1832
1674
  contents.resourceId = __expectString(data.resourceId);
1833
1675
  }
1834
- if (data.resourceType !== undefined && data.resourceType !== null) {
1676
+ if (data.resourceType != null) {
1835
1677
  contents.resourceType = __expectString(data.resourceType);
1836
1678
  }
1837
- if (data.serviceCode !== undefined && data.serviceCode !== null) {
1679
+ if (data.serviceCode != null) {
1838
1680
  contents.serviceCode = __expectString(data.serviceCode);
1839
1681
  }
1840
1682
  exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1844,18 +1686,20 @@ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (pa
1844
1686
  var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1845
1687
  var contents, data, exception;
1846
1688
  return __generator(this, function (_a) {
1847
- contents = {};
1848
- if (parsedOutput.headers["retry-after"] !== undefined) {
1849
- contents.retryAfterSeconds = __strictParseInt32(parsedOutput.headers["retry-after"]);
1850
- }
1689
+ contents = map({
1690
+ retryAfterSeconds: [
1691
+ function () { return void 0 !== parsedOutput.headers["retry-after"]; },
1692
+ function () { return __strictParseInt32(parsedOutput.headers["retry-after"]); },
1693
+ ],
1694
+ });
1851
1695
  data = parsedOutput.body;
1852
- if (data.message !== undefined && data.message !== null) {
1696
+ if (data.message != null) {
1853
1697
  contents.message = __expectString(data.message);
1854
1698
  }
1855
- if (data.quotaCode !== undefined && data.quotaCode !== null) {
1699
+ if (data.quotaCode != null) {
1856
1700
  contents.quotaCode = __expectString(data.quotaCode);
1857
1701
  }
1858
- if (data.serviceCode !== undefined && data.serviceCode !== null) {
1702
+ if (data.serviceCode != null) {
1859
1703
  contents.serviceCode = __expectString(data.serviceCode);
1860
1704
  }
1861
1705
  exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1865,15 +1709,15 @@ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput
1865
1709
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1866
1710
  var contents, data, exception;
1867
1711
  return __generator(this, function (_a) {
1868
- contents = {};
1712
+ contents = map({});
1869
1713
  data = parsedOutput.body;
1870
- if (data.fieldList !== undefined && data.fieldList !== null) {
1714
+ if (data.fieldList != null) {
1871
1715
  contents.fieldList = deserializeAws_restJson1ValidationExceptionFieldList(data.fieldList, context);
1872
1716
  }
1873
- if (data.message !== undefined && data.message !== null) {
1717
+ if (data.message != null) {
1874
1718
  contents.message = __expectString(data.message);
1875
1719
  }
1876
- if (data.reason !== undefined && data.reason !== null) {
1720
+ if (data.reason != null) {
1877
1721
  contents.reason = __expectString(data.reason);
1878
1722
  }
1879
1723
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1884,9 +1728,6 @@ var serializeAws_restJson1AllowedOrganizations = function (input, context) {
1884
1728
  return input
1885
1729
  .filter(function (e) { return e != null; })
1886
1730
  .map(function (entry) {
1887
- if (entry === null) {
1888
- return null;
1889
- }
1890
1731
  return entry;
1891
1732
  });
1892
1733
  };
@@ -1897,9 +1738,6 @@ var serializeAws_restJson1AuthenticationProviders = function (input, context) {
1897
1738
  return input
1898
1739
  .filter(function (e) { return e != null; })
1899
1740
  .map(function (entry) {
1900
- if (entry === null) {
1901
- return null;
1902
- }
1903
1741
  return entry;
1904
1742
  });
1905
1743
  };
@@ -1907,9 +1745,6 @@ var serializeAws_restJson1DataSourceTypesList = function (input, context) {
1907
1745
  return input
1908
1746
  .filter(function (e) { return e != null; })
1909
1747
  .map(function (entry) {
1910
- if (entry === null) {
1911
- return null;
1912
- }
1913
1748
  return entry;
1914
1749
  });
1915
1750
  };
@@ -1924,9 +1759,6 @@ var serializeAws_restJson1NotificationDestinationsList = function (input, contex
1924
1759
  return input
1925
1760
  .filter(function (e) { return e != null; })
1926
1761
  .map(function (entry) {
1927
- if (entry === null) {
1928
- return null;
1929
- }
1930
1762
  return entry;
1931
1763
  });
1932
1764
  };
@@ -1934,9 +1766,6 @@ var serializeAws_restJson1OrganizationalUnitList = function (input, context) {
1934
1766
  return input
1935
1767
  .filter(function (e) { return e != null; })
1936
1768
  .map(function (entry) {
1937
- if (entry === null) {
1938
- return null;
1939
- }
1940
1769
  return entry;
1941
1770
  });
1942
1771
  };
@@ -1944,9 +1773,6 @@ var serializeAws_restJson1RoleValueList = function (input, context) {
1944
1773
  return input
1945
1774
  .filter(function (e) { return e != null; })
1946
1775
  .map(function (entry) {
1947
- if (entry === null) {
1948
- return null;
1949
- }
1950
1776
  return entry;
1951
1777
  });
1952
1778
  };
@@ -1977,9 +1803,6 @@ var serializeAws_restJson1UpdateInstructionBatch = function (input, context) {
1977
1803
  return input
1978
1804
  .filter(function (e) { return e != null; })
1979
1805
  .map(function (entry) {
1980
- if (entry === null) {
1981
- return null;
1982
- }
1983
1806
  return serializeAws_restJson1UpdateInstruction(entry, context);
1984
1807
  });
1985
1808
  };
@@ -1990,9 +1813,6 @@ var serializeAws_restJson1UserList = function (input, context) {
1990
1813
  return input
1991
1814
  .filter(function (e) { return e != null; })
1992
1815
  .map(function (entry) {
1993
- if (entry === null) {
1994
- return null;
1995
- }
1996
1816
  return serializeAws_restJson1User(entry, context);
1997
1817
  });
1998
1818
  };