@aws-sdk/client-mq 3.131.0 → 3.142.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -1
  3. package/dist-cjs/commands/CreateBrokerCommand.js +2 -2
  4. package/dist-cjs/commands/CreateConfigurationCommand.js +2 -2
  5. package/dist-cjs/commands/CreateTagsCommand.js +1 -1
  6. package/dist-cjs/commands/CreateUserCommand.js +2 -2
  7. package/dist-cjs/commands/DeleteBrokerCommand.js +2 -2
  8. package/dist-cjs/commands/DeleteTagsCommand.js +1 -1
  9. package/dist-cjs/commands/DeleteUserCommand.js +2 -2
  10. package/dist-cjs/commands/DescribeBrokerCommand.js +2 -2
  11. package/dist-cjs/commands/DescribeBrokerEngineTypesCommand.js +2 -2
  12. package/dist-cjs/commands/DescribeBrokerInstanceOptionsCommand.js +2 -2
  13. package/dist-cjs/commands/DescribeConfigurationCommand.js +2 -2
  14. package/dist-cjs/commands/DescribeConfigurationRevisionCommand.js +2 -2
  15. package/dist-cjs/commands/DescribeUserCommand.js +2 -2
  16. package/dist-cjs/commands/ListBrokersCommand.js +2 -2
  17. package/dist-cjs/commands/ListConfigurationRevisionsCommand.js +2 -2
  18. package/dist-cjs/commands/ListConfigurationsCommand.js +2 -2
  19. package/dist-cjs/commands/ListTagsCommand.js +2 -2
  20. package/dist-cjs/commands/ListUsersCommand.js +2 -2
  21. package/dist-cjs/commands/RebootBrokerCommand.js +2 -2
  22. package/dist-cjs/commands/UpdateBrokerCommand.js +2 -2
  23. package/dist-cjs/commands/UpdateConfigurationCommand.js +2 -2
  24. package/dist-cjs/commands/UpdateUserCommand.js +2 -2
  25. package/dist-cjs/models/models_0.js +258 -386
  26. package/dist-cjs/protocols/Aws_restJson1.js +340 -693
  27. package/dist-es/commands/CreateBrokerCommand.js +3 -3
  28. package/dist-es/commands/CreateConfigurationCommand.js +3 -3
  29. package/dist-es/commands/CreateTagsCommand.js +2 -2
  30. package/dist-es/commands/CreateUserCommand.js +3 -3
  31. package/dist-es/commands/DeleteBrokerCommand.js +3 -3
  32. package/dist-es/commands/DeleteTagsCommand.js +2 -2
  33. package/dist-es/commands/DeleteUserCommand.js +3 -3
  34. package/dist-es/commands/DescribeBrokerCommand.js +3 -3
  35. package/dist-es/commands/DescribeBrokerEngineTypesCommand.js +3 -3
  36. package/dist-es/commands/DescribeBrokerInstanceOptionsCommand.js +3 -3
  37. package/dist-es/commands/DescribeConfigurationCommand.js +3 -3
  38. package/dist-es/commands/DescribeConfigurationRevisionCommand.js +3 -3
  39. package/dist-es/commands/DescribeUserCommand.js +3 -3
  40. package/dist-es/commands/ListBrokersCommand.js +3 -3
  41. package/dist-es/commands/ListConfigurationRevisionsCommand.js +3 -3
  42. package/dist-es/commands/ListConfigurationsCommand.js +3 -3
  43. package/dist-es/commands/ListTagsCommand.js +3 -3
  44. package/dist-es/commands/ListUsersCommand.js +3 -3
  45. package/dist-es/commands/RebootBrokerCommand.js +3 -3
  46. package/dist-es/commands/UpdateBrokerCommand.js +3 -3
  47. package/dist-es/commands/UpdateConfigurationCommand.js +3 -3
  48. package/dist-es/commands/UpdateUserCommand.js +3 -3
  49. package/dist-es/models/models_0.js +64 -256
  50. package/dist-es/protocols/Aws_restJson1.js +423 -686
  51. package/dist-types/models/models_0.d.ts +256 -384
  52. package/dist-types/ts3.4/models/models_0.d.ts +128 -256
  53. package/package.json +6 -6
@@ -1,6 +1,6 @@
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, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseRfc3339DateTime as __parseRfc3339DateTime, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, parseRfc3339DateTime as __parseRfc3339DateTime, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { v4 as generateIdempotencyToken } from "uuid";
5
5
  import { BadRequestException, ConflictException, ForbiddenException, InternalServerErrorException, NotFoundException, UnauthorizedException, } from "../models/models_0";
6
6
  import { MqServiceException as __BaseException } from "../models/MqServiceException";
@@ -64,7 +64,7 @@ export var serializeAws_restJson1CreateConfigurationCommand = function (input, c
64
64
  });
65
65
  }); };
66
66
  export var serializeAws_restJson1CreateTagsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
67
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
67
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
68
68
  return __generator(this, function (_c) {
69
69
  switch (_c.label) {
70
70
  case 0: return [4, context.endpoint()];
@@ -74,16 +74,7 @@ export var serializeAws_restJson1CreateTagsCommand = function (input, context) {
74
74
  "content-type": "application/json",
75
75
  };
76
76
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/tags/{ResourceArn}";
77
- if (input.ResourceArn !== undefined) {
78
- labelValue = input.ResourceArn;
79
- if (labelValue.length <= 0) {
80
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
81
- }
82
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
83
- }
84
- else {
85
- throw new Error("No value provided for input HTTP label: ResourceArn.");
86
- }
77
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
87
78
  body = JSON.stringify(__assign({}, (input.Tags != null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) })));
88
79
  return [2, new __HttpRequest({
89
80
  protocol: protocol,
@@ -98,7 +89,7 @@ export var serializeAws_restJson1CreateTagsCommand = function (input, context) {
98
89
  });
99
90
  }); };
100
91
  export var serializeAws_restJson1CreateUserCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
101
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
92
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
102
93
  return __generator(this, function (_c) {
103
94
  switch (_c.label) {
104
95
  case 0: return [4, context.endpoint()];
@@ -108,26 +99,8 @@ export var serializeAws_restJson1CreateUserCommand = function (input, context) {
108
99
  "content-type": "application/json",
109
100
  };
110
101
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}/users/{Username}";
111
- if (input.BrokerId !== undefined) {
112
- labelValue = input.BrokerId;
113
- if (labelValue.length <= 0) {
114
- throw new Error("Empty value provided for input HTTP label: BrokerId.");
115
- }
116
- resolvedPath = resolvedPath.replace("{BrokerId}", __extendedEncodeURIComponent(labelValue));
117
- }
118
- else {
119
- throw new Error("No value provided for input HTTP label: BrokerId.");
120
- }
121
- if (input.Username !== undefined) {
122
- labelValue = input.Username;
123
- if (labelValue.length <= 0) {
124
- throw new Error("Empty value provided for input HTTP label: Username.");
125
- }
126
- resolvedPath = resolvedPath.replace("{Username}", __extendedEncodeURIComponent(labelValue));
127
- }
128
- else {
129
- throw new Error("No value provided for input HTTP label: Username.");
130
- }
102
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
103
+ resolvedPath = __resolvedPath(resolvedPath, input, "Username", function () { return input.Username; }, "{Username}", false);
131
104
  body = JSON.stringify(__assign(__assign(__assign({}, (input.ConsoleAccess != null && { consoleAccess: input.ConsoleAccess })), (input.Groups != null && { groups: serializeAws_restJson1__listOf__string(input.Groups, context) })), (input.Password != null && { password: input.Password })));
132
105
  return [2, new __HttpRequest({
133
106
  protocol: protocol,
@@ -142,7 +115,7 @@ export var serializeAws_restJson1CreateUserCommand = function (input, context) {
142
115
  });
143
116
  }); };
144
117
  export var serializeAws_restJson1DeleteBrokerCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
145
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
118
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
146
119
  return __generator(this, function (_c) {
147
120
  switch (_c.label) {
148
121
  case 0: return [4, context.endpoint()];
@@ -150,16 +123,7 @@ export var serializeAws_restJson1DeleteBrokerCommand = function (input, context)
150
123
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
151
124
  headers = {};
152
125
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}";
153
- if (input.BrokerId !== undefined) {
154
- labelValue = input.BrokerId;
155
- if (labelValue.length <= 0) {
156
- throw new Error("Empty value provided for input HTTP label: BrokerId.");
157
- }
158
- resolvedPath = resolvedPath.replace("{BrokerId}", __extendedEncodeURIComponent(labelValue));
159
- }
160
- else {
161
- throw new Error("No value provided for input HTTP label: BrokerId.");
162
- }
126
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
163
127
  return [2, new __HttpRequest({
164
128
  protocol: protocol,
165
129
  hostname: hostname,
@@ -173,7 +137,7 @@ export var serializeAws_restJson1DeleteBrokerCommand = function (input, context)
173
137
  });
174
138
  }); };
175
139
  export var serializeAws_restJson1DeleteTagsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
176
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
140
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
177
141
  return __generator(this, function (_c) {
178
142
  switch (_c.label) {
179
143
  case 0: return [4, context.endpoint()];
@@ -181,17 +145,10 @@ export var serializeAws_restJson1DeleteTagsCommand = function (input, context) {
181
145
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
182
146
  headers = {};
183
147
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/tags/{ResourceArn}";
184
- if (input.ResourceArn !== undefined) {
185
- labelValue = input.ResourceArn;
186
- if (labelValue.length <= 0) {
187
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
188
- }
189
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
190
- }
191
- else {
192
- throw new Error("No value provided for input HTTP label: ResourceArn.");
193
- }
194
- query = __assign({}, (input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map(function (_entry) { return _entry; }) }));
148
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
149
+ query = map({
150
+ tagKeys: [function () { return input.TagKeys !== void 0; }, function () { return (input.TagKeys || []).map(function (_entry) { return _entry; }); }],
151
+ });
195
152
  return [2, new __HttpRequest({
196
153
  protocol: protocol,
197
154
  hostname: hostname,
@@ -206,7 +163,7 @@ export var serializeAws_restJson1DeleteTagsCommand = function (input, context) {
206
163
  });
207
164
  }); };
208
165
  export var serializeAws_restJson1DeleteUserCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
209
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
166
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
210
167
  return __generator(this, function (_c) {
211
168
  switch (_c.label) {
212
169
  case 0: return [4, context.endpoint()];
@@ -214,26 +171,8 @@ export var serializeAws_restJson1DeleteUserCommand = function (input, context) {
214
171
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
215
172
  headers = {};
216
173
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}/users/{Username}";
217
- if (input.BrokerId !== undefined) {
218
- labelValue = input.BrokerId;
219
- if (labelValue.length <= 0) {
220
- throw new Error("Empty value provided for input HTTP label: BrokerId.");
221
- }
222
- resolvedPath = resolvedPath.replace("{BrokerId}", __extendedEncodeURIComponent(labelValue));
223
- }
224
- else {
225
- throw new Error("No value provided for input HTTP label: BrokerId.");
226
- }
227
- if (input.Username !== undefined) {
228
- labelValue = input.Username;
229
- if (labelValue.length <= 0) {
230
- throw new Error("Empty value provided for input HTTP label: Username.");
231
- }
232
- resolvedPath = resolvedPath.replace("{Username}", __extendedEncodeURIComponent(labelValue));
233
- }
234
- else {
235
- throw new Error("No value provided for input HTTP label: Username.");
236
- }
174
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
175
+ resolvedPath = __resolvedPath(resolvedPath, input, "Username", function () { return input.Username; }, "{Username}", false);
237
176
  return [2, new __HttpRequest({
238
177
  protocol: protocol,
239
178
  hostname: hostname,
@@ -247,7 +186,7 @@ export var serializeAws_restJson1DeleteUserCommand = function (input, context) {
247
186
  });
248
187
  }); };
249
188
  export var serializeAws_restJson1DescribeBrokerCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
250
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
189
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
251
190
  return __generator(this, function (_c) {
252
191
  switch (_c.label) {
253
192
  case 0: return [4, context.endpoint()];
@@ -255,16 +194,7 @@ export var serializeAws_restJson1DescribeBrokerCommand = function (input, contex
255
194
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
256
195
  headers = {};
257
196
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}";
258
- if (input.BrokerId !== undefined) {
259
- labelValue = input.BrokerId;
260
- if (labelValue.length <= 0) {
261
- throw new Error("Empty value provided for input HTTP label: BrokerId.");
262
- }
263
- resolvedPath = resolvedPath.replace("{BrokerId}", __extendedEncodeURIComponent(labelValue));
264
- }
265
- else {
266
- throw new Error("No value provided for input HTTP label: BrokerId.");
267
- }
197
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
268
198
  return [2, new __HttpRequest({
269
199
  protocol: protocol,
270
200
  hostname: hostname,
@@ -286,7 +216,11 @@ export var serializeAws_restJson1DescribeBrokerEngineTypesCommand = function (in
286
216
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
287
217
  headers = {};
288
218
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/broker-engine-types";
289
- query = __assign(__assign(__assign({}, (input.EngineType !== undefined && { engineType: input.EngineType })), (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
219
+ query = map({
220
+ engineType: [, input.EngineType],
221
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
222
+ nextToken: [, input.NextToken],
223
+ });
290
224
  return [2, new __HttpRequest({
291
225
  protocol: protocol,
292
226
  hostname: hostname,
@@ -309,7 +243,13 @@ export var serializeAws_restJson1DescribeBrokerInstanceOptionsCommand = function
309
243
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
310
244
  headers = {};
311
245
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/broker-instance-options";
312
- query = __assign(__assign(__assign(__assign(__assign({}, (input.EngineType !== undefined && { engineType: input.EngineType })), (input.HostInstanceType !== undefined && { hostInstanceType: input.HostInstanceType })), (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken })), (input.StorageType !== undefined && { storageType: input.StorageType }));
246
+ query = map({
247
+ engineType: [, input.EngineType],
248
+ hostInstanceType: [, input.HostInstanceType],
249
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
250
+ nextToken: [, input.NextToken],
251
+ storageType: [, input.StorageType],
252
+ });
313
253
  return [2, new __HttpRequest({
314
254
  protocol: protocol,
315
255
  hostname: hostname,
@@ -324,7 +264,7 @@ export var serializeAws_restJson1DescribeBrokerInstanceOptionsCommand = function
324
264
  });
325
265
  }); };
326
266
  export var serializeAws_restJson1DescribeConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
327
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
267
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
328
268
  return __generator(this, function (_c) {
329
269
  switch (_c.label) {
330
270
  case 0: return [4, context.endpoint()];
@@ -332,16 +272,7 @@ export var serializeAws_restJson1DescribeConfigurationCommand = function (input,
332
272
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
333
273
  headers = {};
334
274
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/configurations/{ConfigurationId}";
335
- if (input.ConfigurationId !== undefined) {
336
- labelValue = input.ConfigurationId;
337
- if (labelValue.length <= 0) {
338
- throw new Error("Empty value provided for input HTTP label: ConfigurationId.");
339
- }
340
- resolvedPath = resolvedPath.replace("{ConfigurationId}", __extendedEncodeURIComponent(labelValue));
341
- }
342
- else {
343
- throw new Error("No value provided for input HTTP label: ConfigurationId.");
344
- }
275
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationId", function () { return input.ConfigurationId; }, "{ConfigurationId}", false);
345
276
  return [2, new __HttpRequest({
346
277
  protocol: protocol,
347
278
  hostname: hostname,
@@ -355,7 +286,7 @@ export var serializeAws_restJson1DescribeConfigurationCommand = function (input,
355
286
  });
356
287
  }); };
357
288
  export var serializeAws_restJson1DescribeConfigurationRevisionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
358
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
289
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
359
290
  return __generator(this, function (_c) {
360
291
  switch (_c.label) {
361
292
  case 0: return [4, context.endpoint()];
@@ -364,26 +295,8 @@ export var serializeAws_restJson1DescribeConfigurationRevisionCommand = function
364
295
  headers = {};
365
296
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
366
297
  "/v1/configurations/{ConfigurationId}/revisions/{ConfigurationRevision}";
367
- if (input.ConfigurationId !== undefined) {
368
- labelValue = input.ConfigurationId;
369
- if (labelValue.length <= 0) {
370
- throw new Error("Empty value provided for input HTTP label: ConfigurationId.");
371
- }
372
- resolvedPath = resolvedPath.replace("{ConfigurationId}", __extendedEncodeURIComponent(labelValue));
373
- }
374
- else {
375
- throw new Error("No value provided for input HTTP label: ConfigurationId.");
376
- }
377
- if (input.ConfigurationRevision !== undefined) {
378
- labelValue = input.ConfigurationRevision;
379
- if (labelValue.length <= 0) {
380
- throw new Error("Empty value provided for input HTTP label: ConfigurationRevision.");
381
- }
382
- resolvedPath = resolvedPath.replace("{ConfigurationRevision}", __extendedEncodeURIComponent(labelValue));
383
- }
384
- else {
385
- throw new Error("No value provided for input HTTP label: ConfigurationRevision.");
386
- }
298
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationId", function () { return input.ConfigurationId; }, "{ConfigurationId}", false);
299
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationRevision", function () { return input.ConfigurationRevision; }, "{ConfigurationRevision}", false);
387
300
  return [2, new __HttpRequest({
388
301
  protocol: protocol,
389
302
  hostname: hostname,
@@ -397,7 +310,7 @@ export var serializeAws_restJson1DescribeConfigurationRevisionCommand = function
397
310
  });
398
311
  }); };
399
312
  export var serializeAws_restJson1DescribeUserCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
400
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
313
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
401
314
  return __generator(this, function (_c) {
402
315
  switch (_c.label) {
403
316
  case 0: return [4, context.endpoint()];
@@ -405,26 +318,8 @@ export var serializeAws_restJson1DescribeUserCommand = function (input, context)
405
318
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
406
319
  headers = {};
407
320
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}/users/{Username}";
408
- if (input.BrokerId !== undefined) {
409
- labelValue = input.BrokerId;
410
- if (labelValue.length <= 0) {
411
- throw new Error("Empty value provided for input HTTP label: BrokerId.");
412
- }
413
- resolvedPath = resolvedPath.replace("{BrokerId}", __extendedEncodeURIComponent(labelValue));
414
- }
415
- else {
416
- throw new Error("No value provided for input HTTP label: BrokerId.");
417
- }
418
- if (input.Username !== undefined) {
419
- labelValue = input.Username;
420
- if (labelValue.length <= 0) {
421
- throw new Error("Empty value provided for input HTTP label: Username.");
422
- }
423
- resolvedPath = resolvedPath.replace("{Username}", __extendedEncodeURIComponent(labelValue));
424
- }
425
- else {
426
- throw new Error("No value provided for input HTTP label: Username.");
427
- }
321
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
322
+ resolvedPath = __resolvedPath(resolvedPath, input, "Username", function () { return input.Username; }, "{Username}", false);
428
323
  return [2, new __HttpRequest({
429
324
  protocol: protocol,
430
325
  hostname: hostname,
@@ -446,7 +341,10 @@ export var serializeAws_restJson1ListBrokersCommand = function (input, context)
446
341
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
447
342
  headers = {};
448
343
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers";
449
- query = __assign(__assign({}, (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
344
+ query = map({
345
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
346
+ nextToken: [, input.NextToken],
347
+ });
450
348
  return [2, new __HttpRequest({
451
349
  protocol: protocol,
452
350
  hostname: hostname,
@@ -461,7 +359,7 @@ export var serializeAws_restJson1ListBrokersCommand = function (input, context)
461
359
  });
462
360
  }); };
463
361
  export var serializeAws_restJson1ListConfigurationRevisionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
464
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
362
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
465
363
  return __generator(this, function (_c) {
466
364
  switch (_c.label) {
467
365
  case 0: return [4, context.endpoint()];
@@ -470,17 +368,11 @@ export var serializeAws_restJson1ListConfigurationRevisionsCommand = function (i
470
368
  headers = {};
471
369
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
472
370
  "/v1/configurations/{ConfigurationId}/revisions";
473
- if (input.ConfigurationId !== undefined) {
474
- labelValue = input.ConfigurationId;
475
- if (labelValue.length <= 0) {
476
- throw new Error("Empty value provided for input HTTP label: ConfigurationId.");
477
- }
478
- resolvedPath = resolvedPath.replace("{ConfigurationId}", __extendedEncodeURIComponent(labelValue));
479
- }
480
- else {
481
- throw new Error("No value provided for input HTTP label: ConfigurationId.");
482
- }
483
- query = __assign(__assign({}, (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
371
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationId", function () { return input.ConfigurationId; }, "{ConfigurationId}", false);
372
+ query = map({
373
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
374
+ nextToken: [, input.NextToken],
375
+ });
484
376
  return [2, new __HttpRequest({
485
377
  protocol: protocol,
486
378
  hostname: hostname,
@@ -503,7 +395,10 @@ export var serializeAws_restJson1ListConfigurationsCommand = function (input, co
503
395
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
504
396
  headers = {};
505
397
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/configurations";
506
- query = __assign(__assign({}, (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
398
+ query = map({
399
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
400
+ nextToken: [, input.NextToken],
401
+ });
507
402
  return [2, new __HttpRequest({
508
403
  protocol: protocol,
509
404
  hostname: hostname,
@@ -518,7 +413,7 @@ export var serializeAws_restJson1ListConfigurationsCommand = function (input, co
518
413
  });
519
414
  }); };
520
415
  export var serializeAws_restJson1ListTagsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
521
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
416
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
522
417
  return __generator(this, function (_c) {
523
418
  switch (_c.label) {
524
419
  case 0: return [4, context.endpoint()];
@@ -526,16 +421,7 @@ export var serializeAws_restJson1ListTagsCommand = function (input, context) { r
526
421
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
527
422
  headers = {};
528
423
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/tags/{ResourceArn}";
529
- if (input.ResourceArn !== undefined) {
530
- labelValue = input.ResourceArn;
531
- if (labelValue.length <= 0) {
532
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
533
- }
534
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
535
- }
536
- else {
537
- throw new Error("No value provided for input HTTP label: ResourceArn.");
538
- }
424
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
539
425
  return [2, new __HttpRequest({
540
426
  protocol: protocol,
541
427
  hostname: hostname,
@@ -549,7 +435,7 @@ export var serializeAws_restJson1ListTagsCommand = function (input, context) { r
549
435
  });
550
436
  }); };
551
437
  export var serializeAws_restJson1ListUsersCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
552
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
438
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
553
439
  return __generator(this, function (_c) {
554
440
  switch (_c.label) {
555
441
  case 0: return [4, context.endpoint()];
@@ -557,17 +443,11 @@ export var serializeAws_restJson1ListUsersCommand = function (input, context) {
557
443
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
558
444
  headers = {};
559
445
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}/users";
560
- if (input.BrokerId !== undefined) {
561
- labelValue = input.BrokerId;
562
- if (labelValue.length <= 0) {
563
- throw new Error("Empty value provided for input HTTP label: BrokerId.");
564
- }
565
- resolvedPath = resolvedPath.replace("{BrokerId}", __extendedEncodeURIComponent(labelValue));
566
- }
567
- else {
568
- throw new Error("No value provided for input HTTP label: BrokerId.");
569
- }
570
- query = __assign(__assign({}, (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
446
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
447
+ query = map({
448
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
449
+ nextToken: [, input.NextToken],
450
+ });
571
451
  return [2, new __HttpRequest({
572
452
  protocol: protocol,
573
453
  hostname: hostname,
@@ -582,7 +462,7 @@ export var serializeAws_restJson1ListUsersCommand = function (input, context) {
582
462
  });
583
463
  }); };
584
464
  export var serializeAws_restJson1RebootBrokerCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
585
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
465
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
586
466
  return __generator(this, function (_c) {
587
467
  switch (_c.label) {
588
468
  case 0: return [4, context.endpoint()];
@@ -590,16 +470,7 @@ export var serializeAws_restJson1RebootBrokerCommand = function (input, context)
590
470
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
591
471
  headers = {};
592
472
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}/reboot";
593
- if (input.BrokerId !== undefined) {
594
- labelValue = input.BrokerId;
595
- if (labelValue.length <= 0) {
596
- throw new Error("Empty value provided for input HTTP label: BrokerId.");
597
- }
598
- resolvedPath = resolvedPath.replace("{BrokerId}", __extendedEncodeURIComponent(labelValue));
599
- }
600
- else {
601
- throw new Error("No value provided for input HTTP label: BrokerId.");
602
- }
473
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
603
474
  return [2, new __HttpRequest({
604
475
  protocol: protocol,
605
476
  hostname: hostname,
@@ -613,7 +484,7 @@ export var serializeAws_restJson1RebootBrokerCommand = function (input, context)
613
484
  });
614
485
  }); };
615
486
  export var serializeAws_restJson1UpdateBrokerCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
616
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
487
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
617
488
  return __generator(this, function (_c) {
618
489
  switch (_c.label) {
619
490
  case 0: return [4, context.endpoint()];
@@ -623,16 +494,7 @@ export var serializeAws_restJson1UpdateBrokerCommand = function (input, context)
623
494
  "content-type": "application/json",
624
495
  };
625
496
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}";
626
- if (input.BrokerId !== undefined) {
627
- labelValue = input.BrokerId;
628
- if (labelValue.length <= 0) {
629
- throw new Error("Empty value provided for input HTTP label: BrokerId.");
630
- }
631
- resolvedPath = resolvedPath.replace("{BrokerId}", __extendedEncodeURIComponent(labelValue));
632
- }
633
- else {
634
- throw new Error("No value provided for input HTTP label: BrokerId.");
635
- }
497
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
636
498
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AuthenticationStrategy != null && { authenticationStrategy: input.AuthenticationStrategy })), (input.AutoMinorVersionUpgrade != null && { autoMinorVersionUpgrade: input.AutoMinorVersionUpgrade })), (input.Configuration != null && {
637
499
  configuration: serializeAws_restJson1ConfigurationId(input.Configuration, context),
638
500
  })), (input.EngineVersion != null && { engineVersion: input.EngineVersion })), (input.HostInstanceType != null && { hostInstanceType: input.HostInstanceType })), (input.LdapServerMetadata != null && {
@@ -655,7 +517,7 @@ export var serializeAws_restJson1UpdateBrokerCommand = function (input, context)
655
517
  });
656
518
  }); };
657
519
  export var serializeAws_restJson1UpdateConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
658
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
520
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
659
521
  return __generator(this, function (_c) {
660
522
  switch (_c.label) {
661
523
  case 0: return [4, context.endpoint()];
@@ -665,16 +527,7 @@ export var serializeAws_restJson1UpdateConfigurationCommand = function (input, c
665
527
  "content-type": "application/json",
666
528
  };
667
529
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/configurations/{ConfigurationId}";
668
- if (input.ConfigurationId !== undefined) {
669
- labelValue = input.ConfigurationId;
670
- if (labelValue.length <= 0) {
671
- throw new Error("Empty value provided for input HTTP label: ConfigurationId.");
672
- }
673
- resolvedPath = resolvedPath.replace("{ConfigurationId}", __extendedEncodeURIComponent(labelValue));
674
- }
675
- else {
676
- throw new Error("No value provided for input HTTP label: ConfigurationId.");
677
- }
530
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationId", function () { return input.ConfigurationId; }, "{ConfigurationId}", false);
678
531
  body = JSON.stringify(__assign(__assign({}, (input.Data != null && { data: input.Data })), (input.Description != null && { description: input.Description })));
679
532
  return [2, new __HttpRequest({
680
533
  protocol: protocol,
@@ -689,7 +542,7 @@ export var serializeAws_restJson1UpdateConfigurationCommand = function (input, c
689
542
  });
690
543
  }); };
691
544
  export var serializeAws_restJson1UpdateUserCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
692
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
545
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
693
546
  return __generator(this, function (_c) {
694
547
  switch (_c.label) {
695
548
  case 0: return [4, context.endpoint()];
@@ -699,26 +552,8 @@ export var serializeAws_restJson1UpdateUserCommand = function (input, context) {
699
552
  "content-type": "application/json",
700
553
  };
701
554
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}/users/{Username}";
702
- if (input.BrokerId !== undefined) {
703
- labelValue = input.BrokerId;
704
- if (labelValue.length <= 0) {
705
- throw new Error("Empty value provided for input HTTP label: BrokerId.");
706
- }
707
- resolvedPath = resolvedPath.replace("{BrokerId}", __extendedEncodeURIComponent(labelValue));
708
- }
709
- else {
710
- throw new Error("No value provided for input HTTP label: BrokerId.");
711
- }
712
- if (input.Username !== undefined) {
713
- labelValue = input.Username;
714
- if (labelValue.length <= 0) {
715
- throw new Error("Empty value provided for input HTTP label: Username.");
716
- }
717
- resolvedPath = resolvedPath.replace("{Username}", __extendedEncodeURIComponent(labelValue));
718
- }
719
- else {
720
- throw new Error("No value provided for input HTTP label: Username.");
721
- }
555
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
556
+ resolvedPath = __resolvedPath(resolvedPath, input, "Username", function () { return input.Username; }, "{Username}", false);
722
557
  body = JSON.stringify(__assign(__assign(__assign({}, (input.ConsoleAccess != null && { consoleAccess: input.ConsoleAccess })), (input.Groups != null && { groups: serializeAws_restJson1__listOf__string(input.Groups, context) })), (input.Password != null && { password: input.Password })));
723
558
  return [2, new __HttpRequest({
724
559
  protocol: protocol,
@@ -740,28 +575,26 @@ export var deserializeAws_restJson1CreateBrokerCommand = function (output, conte
740
575
  if (output.statusCode !== 200 && output.statusCode >= 300) {
741
576
  return [2, deserializeAws_restJson1CreateBrokerCommandError(output, context)];
742
577
  }
743
- contents = {
578
+ contents = map({
744
579
  $metadata: deserializeMetadata(output),
745
- BrokerArn: undefined,
746
- BrokerId: undefined,
747
- };
580
+ });
748
581
  _a = __expectNonNull;
749
582
  _b = __expectObject;
750
583
  return [4, parseBody(output.body, context)];
751
584
  case 1:
752
585
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
753
- if (data.brokerArn !== undefined && data.brokerArn !== null) {
586
+ if (data.brokerArn != null) {
754
587
  contents.BrokerArn = __expectString(data.brokerArn);
755
588
  }
756
- if (data.brokerId !== undefined && data.brokerId !== null) {
589
+ if (data.brokerId != null) {
757
590
  contents.BrokerId = __expectString(data.brokerId);
758
591
  }
759
- return [2, Promise.resolve(contents)];
592
+ return [2, contents];
760
593
  }
761
594
  });
762
595
  }); };
763
596
  var deserializeAws_restJson1CreateBrokerCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
764
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
597
+ var parsedOutput, _a, errorCode, _b, parsedBody;
765
598
  var _c;
766
599
  return __generator(this, function (_d) {
767
600
  switch (_d.label) {
@@ -798,14 +631,14 @@ var deserializeAws_restJson1CreateBrokerCommandError = function (output, context
798
631
  case 11: throw _d.sent();
799
632
  case 12:
800
633
  parsedBody = parsedOutput.body;
801
- $metadata = deserializeMetadata(output);
802
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
803
- response = new __BaseException({
804
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
805
- $fault: "client",
806
- $metadata: $metadata,
634
+ throwDefaultError({
635
+ output: output,
636
+ parsedBody: parsedBody,
637
+ exceptionCtor: __BaseException,
638
+ errorCode: errorCode,
807
639
  });
808
- throw __decorateServiceException(response, parsedBody);
640
+ _d.label = 13;
641
+ case 13: return [2];
809
642
  }
810
643
  });
811
644
  }); };
@@ -817,44 +650,38 @@ export var deserializeAws_restJson1CreateConfigurationCommand = function (output
817
650
  if (output.statusCode !== 200 && output.statusCode >= 300) {
818
651
  return [2, deserializeAws_restJson1CreateConfigurationCommandError(output, context)];
819
652
  }
820
- contents = {
653
+ contents = map({
821
654
  $metadata: deserializeMetadata(output),
822
- Arn: undefined,
823
- AuthenticationStrategy: undefined,
824
- Created: undefined,
825
- Id: undefined,
826
- LatestRevision: undefined,
827
- Name: undefined,
828
- };
655
+ });
829
656
  _a = __expectNonNull;
830
657
  _b = __expectObject;
831
658
  return [4, parseBody(output.body, context)];
832
659
  case 1:
833
660
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
834
- if (data.arn !== undefined && data.arn !== null) {
661
+ if (data.arn != null) {
835
662
  contents.Arn = __expectString(data.arn);
836
663
  }
837
- if (data.authenticationStrategy !== undefined && data.authenticationStrategy !== null) {
664
+ if (data.authenticationStrategy != null) {
838
665
  contents.AuthenticationStrategy = __expectString(data.authenticationStrategy);
839
666
  }
840
- if (data.created !== undefined && data.created !== null) {
667
+ if (data.created != null) {
841
668
  contents.Created = __expectNonNull(__parseRfc3339DateTime(data.created));
842
669
  }
843
- if (data.id !== undefined && data.id !== null) {
670
+ if (data.id != null) {
844
671
  contents.Id = __expectString(data.id);
845
672
  }
846
- if (data.latestRevision !== undefined && data.latestRevision !== null) {
673
+ if (data.latestRevision != null) {
847
674
  contents.LatestRevision = deserializeAws_restJson1ConfigurationRevision(data.latestRevision, context);
848
675
  }
849
- if (data.name !== undefined && data.name !== null) {
676
+ if (data.name != null) {
850
677
  contents.Name = __expectString(data.name);
851
678
  }
852
- return [2, Promise.resolve(contents)];
679
+ return [2, contents];
853
680
  }
854
681
  });
855
682
  }); };
856
683
  var deserializeAws_restJson1CreateConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
857
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
684
+ var parsedOutput, _a, errorCode, _b, parsedBody;
858
685
  var _c;
859
686
  return __generator(this, function (_d) {
860
687
  switch (_d.label) {
@@ -887,14 +714,14 @@ var deserializeAws_restJson1CreateConfigurationCommandError = function (output,
887
714
  case 9: throw _d.sent();
888
715
  case 10:
889
716
  parsedBody = parsedOutput.body;
890
- $metadata = deserializeMetadata(output);
891
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
892
- response = new __BaseException({
893
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
894
- $fault: "client",
895
- $metadata: $metadata,
717
+ throwDefaultError({
718
+ output: output,
719
+ parsedBody: parsedBody,
720
+ exceptionCtor: __BaseException,
721
+ errorCode: errorCode,
896
722
  });
897
- throw __decorateServiceException(response, parsedBody);
723
+ _d.label = 11;
724
+ case 11: return [2];
898
725
  }
899
726
  });
900
727
  }); };
@@ -906,18 +733,18 @@ export var deserializeAws_restJson1CreateTagsCommand = function (output, context
906
733
  if (output.statusCode !== 204 && output.statusCode >= 300) {
907
734
  return [2, deserializeAws_restJson1CreateTagsCommandError(output, context)];
908
735
  }
909
- contents = {
736
+ contents = map({
910
737
  $metadata: deserializeMetadata(output),
911
- };
738
+ });
912
739
  return [4, collectBody(output.body, context)];
913
740
  case 1:
914
741
  _a.sent();
915
- return [2, Promise.resolve(contents)];
742
+ return [2, contents];
916
743
  }
917
744
  });
918
745
  }); };
919
746
  var deserializeAws_restJson1CreateTagsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
920
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
747
+ var parsedOutput, _a, errorCode, _b, parsedBody;
921
748
  var _c;
922
749
  return __generator(this, function (_d) {
923
750
  switch (_d.label) {
@@ -950,14 +777,14 @@ var deserializeAws_restJson1CreateTagsCommandError = function (output, context)
950
777
  case 9: throw _d.sent();
951
778
  case 10:
952
779
  parsedBody = parsedOutput.body;
953
- $metadata = deserializeMetadata(output);
954
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
955
- response = new __BaseException({
956
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
957
- $fault: "client",
958
- $metadata: $metadata,
780
+ throwDefaultError({
781
+ output: output,
782
+ parsedBody: parsedBody,
783
+ exceptionCtor: __BaseException,
784
+ errorCode: errorCode,
959
785
  });
960
- throw __decorateServiceException(response, parsedBody);
786
+ _d.label = 11;
787
+ case 11: return [2];
961
788
  }
962
789
  });
963
790
  }); };
@@ -969,18 +796,18 @@ export var deserializeAws_restJson1CreateUserCommand = function (output, context
969
796
  if (output.statusCode !== 200 && output.statusCode >= 300) {
970
797
  return [2, deserializeAws_restJson1CreateUserCommandError(output, context)];
971
798
  }
972
- contents = {
799
+ contents = map({
973
800
  $metadata: deserializeMetadata(output),
974
- };
801
+ });
975
802
  return [4, collectBody(output.body, context)];
976
803
  case 1:
977
804
  _a.sent();
978
- return [2, Promise.resolve(contents)];
805
+ return [2, contents];
979
806
  }
980
807
  });
981
808
  }); };
982
809
  var deserializeAws_restJson1CreateUserCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
983
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
810
+ var parsedOutput, _a, errorCode, _b, parsedBody;
984
811
  var _c;
985
812
  return __generator(this, function (_d) {
986
813
  switch (_d.label) {
@@ -1017,14 +844,14 @@ var deserializeAws_restJson1CreateUserCommandError = function (output, context)
1017
844
  case 11: throw _d.sent();
1018
845
  case 12:
1019
846
  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,
847
+ throwDefaultError({
848
+ output: output,
849
+ parsedBody: parsedBody,
850
+ exceptionCtor: __BaseException,
851
+ errorCode: errorCode,
1026
852
  });
1027
- throw __decorateServiceException(response, parsedBody);
853
+ _d.label = 13;
854
+ case 13: return [2];
1028
855
  }
1029
856
  });
1030
857
  }); };
@@ -1036,24 +863,23 @@ export var deserializeAws_restJson1DeleteBrokerCommand = function (output, conte
1036
863
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1037
864
  return [2, deserializeAws_restJson1DeleteBrokerCommandError(output, context)];
1038
865
  }
1039
- contents = {
866
+ contents = map({
1040
867
  $metadata: deserializeMetadata(output),
1041
- BrokerId: undefined,
1042
- };
868
+ });
1043
869
  _a = __expectNonNull;
1044
870
  _b = __expectObject;
1045
871
  return [4, parseBody(output.body, context)];
1046
872
  case 1:
1047
873
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1048
- if (data.brokerId !== undefined && data.brokerId !== null) {
874
+ if (data.brokerId != null) {
1049
875
  contents.BrokerId = __expectString(data.brokerId);
1050
876
  }
1051
- return [2, Promise.resolve(contents)];
877
+ return [2, contents];
1052
878
  }
1053
879
  });
1054
880
  }); };
1055
881
  var deserializeAws_restJson1DeleteBrokerCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1056
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
882
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1057
883
  var _c;
1058
884
  return __generator(this, function (_d) {
1059
885
  switch (_d.label) {
@@ -1086,14 +912,14 @@ var deserializeAws_restJson1DeleteBrokerCommandError = function (output, context
1086
912
  case 9: throw _d.sent();
1087
913
  case 10:
1088
914
  parsedBody = parsedOutput.body;
1089
- $metadata = deserializeMetadata(output);
1090
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1091
- response = new __BaseException({
1092
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1093
- $fault: "client",
1094
- $metadata: $metadata,
915
+ throwDefaultError({
916
+ output: output,
917
+ parsedBody: parsedBody,
918
+ exceptionCtor: __BaseException,
919
+ errorCode: errorCode,
1095
920
  });
1096
- throw __decorateServiceException(response, parsedBody);
921
+ _d.label = 11;
922
+ case 11: return [2];
1097
923
  }
1098
924
  });
1099
925
  }); };
@@ -1105,18 +931,18 @@ export var deserializeAws_restJson1DeleteTagsCommand = function (output, context
1105
931
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1106
932
  return [2, deserializeAws_restJson1DeleteTagsCommandError(output, context)];
1107
933
  }
1108
- contents = {
934
+ contents = map({
1109
935
  $metadata: deserializeMetadata(output),
1110
- };
936
+ });
1111
937
  return [4, collectBody(output.body, context)];
1112
938
  case 1:
1113
939
  _a.sent();
1114
- return [2, Promise.resolve(contents)];
940
+ return [2, contents];
1115
941
  }
1116
942
  });
1117
943
  }); };
1118
944
  var deserializeAws_restJson1DeleteTagsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1119
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
945
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1120
946
  var _c;
1121
947
  return __generator(this, function (_d) {
1122
948
  switch (_d.label) {
@@ -1149,14 +975,14 @@ var deserializeAws_restJson1DeleteTagsCommandError = function (output, context)
1149
975
  case 9: throw _d.sent();
1150
976
  case 10:
1151
977
  parsedBody = parsedOutput.body;
1152
- $metadata = deserializeMetadata(output);
1153
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1154
- response = new __BaseException({
1155
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1156
- $fault: "client",
1157
- $metadata: $metadata,
978
+ throwDefaultError({
979
+ output: output,
980
+ parsedBody: parsedBody,
981
+ exceptionCtor: __BaseException,
982
+ errorCode: errorCode,
1158
983
  });
1159
- throw __decorateServiceException(response, parsedBody);
984
+ _d.label = 11;
985
+ case 11: return [2];
1160
986
  }
1161
987
  });
1162
988
  }); };
@@ -1168,18 +994,18 @@ export var deserializeAws_restJson1DeleteUserCommand = function (output, context
1168
994
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1169
995
  return [2, deserializeAws_restJson1DeleteUserCommandError(output, context)];
1170
996
  }
1171
- contents = {
997
+ contents = map({
1172
998
  $metadata: deserializeMetadata(output),
1173
- };
999
+ });
1174
1000
  return [4, collectBody(output.body, context)];
1175
1001
  case 1:
1176
1002
  _a.sent();
1177
- return [2, Promise.resolve(contents)];
1003
+ return [2, contents];
1178
1004
  }
1179
1005
  });
1180
1006
  }); };
1181
1007
  var deserializeAws_restJson1DeleteUserCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1182
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1008
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1183
1009
  var _c;
1184
1010
  return __generator(this, function (_d) {
1185
1011
  switch (_d.label) {
@@ -1212,14 +1038,14 @@ var deserializeAws_restJson1DeleteUserCommandError = function (output, context)
1212
1038
  case 9: throw _d.sent();
1213
1039
  case 10:
1214
1040
  parsedBody = parsedOutput.body;
1215
- $metadata = deserializeMetadata(output);
1216
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1217
- response = new __BaseException({
1218
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1219
- $fault: "client",
1220
- $metadata: $metadata,
1041
+ throwDefaultError({
1042
+ output: output,
1043
+ parsedBody: parsedBody,
1044
+ exceptionCtor: __BaseException,
1045
+ errorCode: errorCode,
1221
1046
  });
1222
- throw __decorateServiceException(response, parsedBody);
1047
+ _d.label = 11;
1048
+ case 11: return [2];
1223
1049
  }
1224
1050
  });
1225
1051
  }); };
@@ -1231,136 +1057,107 @@ export var deserializeAws_restJson1DescribeBrokerCommand = function (output, con
1231
1057
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1232
1058
  return [2, deserializeAws_restJson1DescribeBrokerCommandError(output, context)];
1233
1059
  }
1234
- contents = {
1060
+ contents = map({
1235
1061
  $metadata: deserializeMetadata(output),
1236
- ActionsRequired: undefined,
1237
- AuthenticationStrategy: undefined,
1238
- AutoMinorVersionUpgrade: undefined,
1239
- BrokerArn: undefined,
1240
- BrokerId: undefined,
1241
- BrokerInstances: undefined,
1242
- BrokerName: undefined,
1243
- BrokerState: undefined,
1244
- Configurations: undefined,
1245
- Created: undefined,
1246
- DeploymentMode: undefined,
1247
- EncryptionOptions: undefined,
1248
- EngineType: undefined,
1249
- EngineVersion: undefined,
1250
- HostInstanceType: undefined,
1251
- LdapServerMetadata: undefined,
1252
- Logs: undefined,
1253
- MaintenanceWindowStartTime: undefined,
1254
- PendingAuthenticationStrategy: undefined,
1255
- PendingEngineVersion: undefined,
1256
- PendingHostInstanceType: undefined,
1257
- PendingLdapServerMetadata: undefined,
1258
- PendingSecurityGroups: undefined,
1259
- PubliclyAccessible: undefined,
1260
- SecurityGroups: undefined,
1261
- StorageType: undefined,
1262
- SubnetIds: undefined,
1263
- Tags: undefined,
1264
- Users: undefined,
1265
- };
1062
+ });
1266
1063
  _a = __expectNonNull;
1267
1064
  _b = __expectObject;
1268
1065
  return [4, parseBody(output.body, context)];
1269
1066
  case 1:
1270
1067
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1271
- if (data.actionsRequired !== undefined && data.actionsRequired !== null) {
1068
+ if (data.actionsRequired != null) {
1272
1069
  contents.ActionsRequired = deserializeAws_restJson1__listOfActionRequired(data.actionsRequired, context);
1273
1070
  }
1274
- if (data.authenticationStrategy !== undefined && data.authenticationStrategy !== null) {
1071
+ if (data.authenticationStrategy != null) {
1275
1072
  contents.AuthenticationStrategy = __expectString(data.authenticationStrategy);
1276
1073
  }
1277
- if (data.autoMinorVersionUpgrade !== undefined && data.autoMinorVersionUpgrade !== null) {
1074
+ if (data.autoMinorVersionUpgrade != null) {
1278
1075
  contents.AutoMinorVersionUpgrade = __expectBoolean(data.autoMinorVersionUpgrade);
1279
1076
  }
1280
- if (data.brokerArn !== undefined && data.brokerArn !== null) {
1077
+ if (data.brokerArn != null) {
1281
1078
  contents.BrokerArn = __expectString(data.brokerArn);
1282
1079
  }
1283
- if (data.brokerId !== undefined && data.brokerId !== null) {
1080
+ if (data.brokerId != null) {
1284
1081
  contents.BrokerId = __expectString(data.brokerId);
1285
1082
  }
1286
- if (data.brokerInstances !== undefined && data.brokerInstances !== null) {
1083
+ if (data.brokerInstances != null) {
1287
1084
  contents.BrokerInstances = deserializeAws_restJson1__listOfBrokerInstance(data.brokerInstances, context);
1288
1085
  }
1289
- if (data.brokerName !== undefined && data.brokerName !== null) {
1086
+ if (data.brokerName != null) {
1290
1087
  contents.BrokerName = __expectString(data.brokerName);
1291
1088
  }
1292
- if (data.brokerState !== undefined && data.brokerState !== null) {
1089
+ if (data.brokerState != null) {
1293
1090
  contents.BrokerState = __expectString(data.brokerState);
1294
1091
  }
1295
- if (data.configurations !== undefined && data.configurations !== null) {
1092
+ if (data.configurations != null) {
1296
1093
  contents.Configurations = deserializeAws_restJson1Configurations(data.configurations, context);
1297
1094
  }
1298
- if (data.created !== undefined && data.created !== null) {
1095
+ if (data.created != null) {
1299
1096
  contents.Created = __expectNonNull(__parseRfc3339DateTime(data.created));
1300
1097
  }
1301
- if (data.deploymentMode !== undefined && data.deploymentMode !== null) {
1098
+ if (data.deploymentMode != null) {
1302
1099
  contents.DeploymentMode = __expectString(data.deploymentMode);
1303
1100
  }
1304
- if (data.encryptionOptions !== undefined && data.encryptionOptions !== null) {
1101
+ if (data.encryptionOptions != null) {
1305
1102
  contents.EncryptionOptions = deserializeAws_restJson1EncryptionOptions(data.encryptionOptions, context);
1306
1103
  }
1307
- if (data.engineType !== undefined && data.engineType !== null) {
1104
+ if (data.engineType != null) {
1308
1105
  contents.EngineType = __expectString(data.engineType);
1309
1106
  }
1310
- if (data.engineVersion !== undefined && data.engineVersion !== null) {
1107
+ if (data.engineVersion != null) {
1311
1108
  contents.EngineVersion = __expectString(data.engineVersion);
1312
1109
  }
1313
- if (data.hostInstanceType !== undefined && data.hostInstanceType !== null) {
1110
+ if (data.hostInstanceType != null) {
1314
1111
  contents.HostInstanceType = __expectString(data.hostInstanceType);
1315
1112
  }
1316
- if (data.ldapServerMetadata !== undefined && data.ldapServerMetadata !== null) {
1113
+ if (data.ldapServerMetadata != null) {
1317
1114
  contents.LdapServerMetadata = deserializeAws_restJson1LdapServerMetadataOutput(data.ldapServerMetadata, context);
1318
1115
  }
1319
- if (data.logs !== undefined && data.logs !== null) {
1116
+ if (data.logs != null) {
1320
1117
  contents.Logs = deserializeAws_restJson1LogsSummary(data.logs, context);
1321
1118
  }
1322
- if (data.maintenanceWindowStartTime !== undefined && data.maintenanceWindowStartTime !== null) {
1119
+ if (data.maintenanceWindowStartTime != null) {
1323
1120
  contents.MaintenanceWindowStartTime = deserializeAws_restJson1WeeklyStartTime(data.maintenanceWindowStartTime, context);
1324
1121
  }
1325
- if (data.pendingAuthenticationStrategy !== undefined && data.pendingAuthenticationStrategy !== null) {
1122
+ if (data.pendingAuthenticationStrategy != null) {
1326
1123
  contents.PendingAuthenticationStrategy = __expectString(data.pendingAuthenticationStrategy);
1327
1124
  }
1328
- if (data.pendingEngineVersion !== undefined && data.pendingEngineVersion !== null) {
1125
+ if (data.pendingEngineVersion != null) {
1329
1126
  contents.PendingEngineVersion = __expectString(data.pendingEngineVersion);
1330
1127
  }
1331
- if (data.pendingHostInstanceType !== undefined && data.pendingHostInstanceType !== null) {
1128
+ if (data.pendingHostInstanceType != null) {
1332
1129
  contents.PendingHostInstanceType = __expectString(data.pendingHostInstanceType);
1333
1130
  }
1334
- if (data.pendingLdapServerMetadata !== undefined && data.pendingLdapServerMetadata !== null) {
1131
+ if (data.pendingLdapServerMetadata != null) {
1335
1132
  contents.PendingLdapServerMetadata = deserializeAws_restJson1LdapServerMetadataOutput(data.pendingLdapServerMetadata, context);
1336
1133
  }
1337
- if (data.pendingSecurityGroups !== undefined && data.pendingSecurityGroups !== null) {
1134
+ if (data.pendingSecurityGroups != null) {
1338
1135
  contents.PendingSecurityGroups = deserializeAws_restJson1__listOf__string(data.pendingSecurityGroups, context);
1339
1136
  }
1340
- if (data.publiclyAccessible !== undefined && data.publiclyAccessible !== null) {
1137
+ if (data.publiclyAccessible != null) {
1341
1138
  contents.PubliclyAccessible = __expectBoolean(data.publiclyAccessible);
1342
1139
  }
1343
- if (data.securityGroups !== undefined && data.securityGroups !== null) {
1140
+ if (data.securityGroups != null) {
1344
1141
  contents.SecurityGroups = deserializeAws_restJson1__listOf__string(data.securityGroups, context);
1345
1142
  }
1346
- if (data.storageType !== undefined && data.storageType !== null) {
1143
+ if (data.storageType != null) {
1347
1144
  contents.StorageType = __expectString(data.storageType);
1348
1145
  }
1349
- if (data.subnetIds !== undefined && data.subnetIds !== null) {
1146
+ if (data.subnetIds != null) {
1350
1147
  contents.SubnetIds = deserializeAws_restJson1__listOf__string(data.subnetIds, context);
1351
1148
  }
1352
- if (data.tags !== undefined && data.tags !== null) {
1149
+ if (data.tags != null) {
1353
1150
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
1354
1151
  }
1355
- if (data.users !== undefined && data.users !== null) {
1152
+ if (data.users != null) {
1356
1153
  contents.Users = deserializeAws_restJson1__listOfUserSummary(data.users, context);
1357
1154
  }
1358
- return [2, Promise.resolve(contents)];
1155
+ return [2, contents];
1359
1156
  }
1360
1157
  });
1361
1158
  }); };
1362
1159
  var deserializeAws_restJson1DescribeBrokerCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1363
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1160
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1364
1161
  var _c;
1365
1162
  return __generator(this, function (_d) {
1366
1163
  switch (_d.label) {
@@ -1393,14 +1190,14 @@ var deserializeAws_restJson1DescribeBrokerCommandError = function (output, conte
1393
1190
  case 9: throw _d.sent();
1394
1191
  case 10:
1395
1192
  parsedBody = parsedOutput.body;
1396
- $metadata = deserializeMetadata(output);
1397
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1398
- response = new __BaseException({
1399
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1400
- $fault: "client",
1401
- $metadata: $metadata,
1193
+ throwDefaultError({
1194
+ output: output,
1195
+ parsedBody: parsedBody,
1196
+ exceptionCtor: __BaseException,
1197
+ errorCode: errorCode,
1402
1198
  });
1403
- throw __decorateServiceException(response, parsedBody);
1199
+ _d.label = 11;
1200
+ case 11: return [2];
1404
1201
  }
1405
1202
  });
1406
1203
  }); };
@@ -1412,32 +1209,29 @@ export var deserializeAws_restJson1DescribeBrokerEngineTypesCommand = function (
1412
1209
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1413
1210
  return [2, deserializeAws_restJson1DescribeBrokerEngineTypesCommandError(output, context)];
1414
1211
  }
1415
- contents = {
1212
+ contents = map({
1416
1213
  $metadata: deserializeMetadata(output),
1417
- BrokerEngineTypes: undefined,
1418
- MaxResults: undefined,
1419
- NextToken: undefined,
1420
- };
1214
+ });
1421
1215
  _a = __expectNonNull;
1422
1216
  _b = __expectObject;
1423
1217
  return [4, parseBody(output.body, context)];
1424
1218
  case 1:
1425
1219
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1426
- if (data.brokerEngineTypes !== undefined && data.brokerEngineTypes !== null) {
1220
+ if (data.brokerEngineTypes != null) {
1427
1221
  contents.BrokerEngineTypes = deserializeAws_restJson1__listOfBrokerEngineType(data.brokerEngineTypes, context);
1428
1222
  }
1429
- if (data.maxResults !== undefined && data.maxResults !== null) {
1223
+ if (data.maxResults != null) {
1430
1224
  contents.MaxResults = __expectInt32(data.maxResults);
1431
1225
  }
1432
- if (data.nextToken !== undefined && data.nextToken !== null) {
1226
+ if (data.nextToken != null) {
1433
1227
  contents.NextToken = __expectString(data.nextToken);
1434
1228
  }
1435
- return [2, Promise.resolve(contents)];
1229
+ return [2, contents];
1436
1230
  }
1437
1231
  });
1438
1232
  }); };
1439
1233
  var deserializeAws_restJson1DescribeBrokerEngineTypesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1440
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1234
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1441
1235
  var _c;
1442
1236
  return __generator(this, function (_d) {
1443
1237
  switch (_d.label) {
@@ -1466,14 +1260,14 @@ var deserializeAws_restJson1DescribeBrokerEngineTypesCommandError = function (ou
1466
1260
  case 7: throw _d.sent();
1467
1261
  case 8:
1468
1262
  parsedBody = parsedOutput.body;
1469
- $metadata = deserializeMetadata(output);
1470
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1471
- response = new __BaseException({
1472
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1473
- $fault: "client",
1474
- $metadata: $metadata,
1263
+ throwDefaultError({
1264
+ output: output,
1265
+ parsedBody: parsedBody,
1266
+ exceptionCtor: __BaseException,
1267
+ errorCode: errorCode,
1475
1268
  });
1476
- throw __decorateServiceException(response, parsedBody);
1269
+ _d.label = 9;
1270
+ case 9: return [2];
1477
1271
  }
1478
1272
  });
1479
1273
  }); };
@@ -1485,32 +1279,29 @@ export var deserializeAws_restJson1DescribeBrokerInstanceOptionsCommand = functi
1485
1279
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1486
1280
  return [2, deserializeAws_restJson1DescribeBrokerInstanceOptionsCommandError(output, context)];
1487
1281
  }
1488
- contents = {
1282
+ contents = map({
1489
1283
  $metadata: deserializeMetadata(output),
1490
- BrokerInstanceOptions: undefined,
1491
- MaxResults: undefined,
1492
- NextToken: undefined,
1493
- };
1284
+ });
1494
1285
  _a = __expectNonNull;
1495
1286
  _b = __expectObject;
1496
1287
  return [4, parseBody(output.body, context)];
1497
1288
  case 1:
1498
1289
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1499
- if (data.brokerInstanceOptions !== undefined && data.brokerInstanceOptions !== null) {
1290
+ if (data.brokerInstanceOptions != null) {
1500
1291
  contents.BrokerInstanceOptions = deserializeAws_restJson1__listOfBrokerInstanceOption(data.brokerInstanceOptions, context);
1501
1292
  }
1502
- if (data.maxResults !== undefined && data.maxResults !== null) {
1293
+ if (data.maxResults != null) {
1503
1294
  contents.MaxResults = __expectInt32(data.maxResults);
1504
1295
  }
1505
- if (data.nextToken !== undefined && data.nextToken !== null) {
1296
+ if (data.nextToken != null) {
1506
1297
  contents.NextToken = __expectString(data.nextToken);
1507
1298
  }
1508
- return [2, Promise.resolve(contents)];
1299
+ return [2, contents];
1509
1300
  }
1510
1301
  });
1511
1302
  }); };
1512
1303
  var deserializeAws_restJson1DescribeBrokerInstanceOptionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1513
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1304
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1514
1305
  var _c;
1515
1306
  return __generator(this, function (_d) {
1516
1307
  switch (_d.label) {
@@ -1539,14 +1330,14 @@ var deserializeAws_restJson1DescribeBrokerInstanceOptionsCommandError = function
1539
1330
  case 7: throw _d.sent();
1540
1331
  case 8:
1541
1332
  parsedBody = parsedOutput.body;
1542
- $metadata = deserializeMetadata(output);
1543
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1544
- response = new __BaseException({
1545
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1546
- $fault: "client",
1547
- $metadata: $metadata,
1333
+ throwDefaultError({
1334
+ output: output,
1335
+ parsedBody: parsedBody,
1336
+ exceptionCtor: __BaseException,
1337
+ errorCode: errorCode,
1548
1338
  });
1549
- throw __decorateServiceException(response, parsedBody);
1339
+ _d.label = 9;
1340
+ case 9: return [2];
1550
1341
  }
1551
1342
  });
1552
1343
  }); };
@@ -1558,60 +1349,50 @@ export var deserializeAws_restJson1DescribeConfigurationCommand = function (outp
1558
1349
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1559
1350
  return [2, deserializeAws_restJson1DescribeConfigurationCommandError(output, context)];
1560
1351
  }
1561
- contents = {
1352
+ contents = map({
1562
1353
  $metadata: deserializeMetadata(output),
1563
- Arn: undefined,
1564
- AuthenticationStrategy: undefined,
1565
- Created: undefined,
1566
- Description: undefined,
1567
- EngineType: undefined,
1568
- EngineVersion: undefined,
1569
- Id: undefined,
1570
- LatestRevision: undefined,
1571
- Name: undefined,
1572
- Tags: undefined,
1573
- };
1354
+ });
1574
1355
  _a = __expectNonNull;
1575
1356
  _b = __expectObject;
1576
1357
  return [4, parseBody(output.body, context)];
1577
1358
  case 1:
1578
1359
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1579
- if (data.arn !== undefined && data.arn !== null) {
1360
+ if (data.arn != null) {
1580
1361
  contents.Arn = __expectString(data.arn);
1581
1362
  }
1582
- if (data.authenticationStrategy !== undefined && data.authenticationStrategy !== null) {
1363
+ if (data.authenticationStrategy != null) {
1583
1364
  contents.AuthenticationStrategy = __expectString(data.authenticationStrategy);
1584
1365
  }
1585
- if (data.created !== undefined && data.created !== null) {
1366
+ if (data.created != null) {
1586
1367
  contents.Created = __expectNonNull(__parseRfc3339DateTime(data.created));
1587
1368
  }
1588
- if (data.description !== undefined && data.description !== null) {
1369
+ if (data.description != null) {
1589
1370
  contents.Description = __expectString(data.description);
1590
1371
  }
1591
- if (data.engineType !== undefined && data.engineType !== null) {
1372
+ if (data.engineType != null) {
1592
1373
  contents.EngineType = __expectString(data.engineType);
1593
1374
  }
1594
- if (data.engineVersion !== undefined && data.engineVersion !== null) {
1375
+ if (data.engineVersion != null) {
1595
1376
  contents.EngineVersion = __expectString(data.engineVersion);
1596
1377
  }
1597
- if (data.id !== undefined && data.id !== null) {
1378
+ if (data.id != null) {
1598
1379
  contents.Id = __expectString(data.id);
1599
1380
  }
1600
- if (data.latestRevision !== undefined && data.latestRevision !== null) {
1381
+ if (data.latestRevision != null) {
1601
1382
  contents.LatestRevision = deserializeAws_restJson1ConfigurationRevision(data.latestRevision, context);
1602
1383
  }
1603
- if (data.name !== undefined && data.name !== null) {
1384
+ if (data.name != null) {
1604
1385
  contents.Name = __expectString(data.name);
1605
1386
  }
1606
- if (data.tags !== undefined && data.tags !== null) {
1387
+ if (data.tags != null) {
1607
1388
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
1608
1389
  }
1609
- return [2, Promise.resolve(contents)];
1390
+ return [2, contents];
1610
1391
  }
1611
1392
  });
1612
1393
  }); };
1613
1394
  var deserializeAws_restJson1DescribeConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1614
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1395
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1615
1396
  var _c;
1616
1397
  return __generator(this, function (_d) {
1617
1398
  switch (_d.label) {
@@ -1644,14 +1425,14 @@ var deserializeAws_restJson1DescribeConfigurationCommandError = function (output
1644
1425
  case 9: throw _d.sent();
1645
1426
  case 10:
1646
1427
  parsedBody = parsedOutput.body;
1647
- $metadata = deserializeMetadata(output);
1648
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1649
- response = new __BaseException({
1650
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1651
- $fault: "client",
1652
- $metadata: $metadata,
1428
+ throwDefaultError({
1429
+ output: output,
1430
+ parsedBody: parsedBody,
1431
+ exceptionCtor: __BaseException,
1432
+ errorCode: errorCode,
1653
1433
  });
1654
- throw __decorateServiceException(response, parsedBody);
1434
+ _d.label = 11;
1435
+ case 11: return [2];
1655
1436
  }
1656
1437
  });
1657
1438
  }); };
@@ -1663,36 +1444,32 @@ export var deserializeAws_restJson1DescribeConfigurationRevisionCommand = functi
1663
1444
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1664
1445
  return [2, deserializeAws_restJson1DescribeConfigurationRevisionCommandError(output, context)];
1665
1446
  }
1666
- contents = {
1447
+ contents = map({
1667
1448
  $metadata: deserializeMetadata(output),
1668
- ConfigurationId: undefined,
1669
- Created: undefined,
1670
- Data: undefined,
1671
- Description: undefined,
1672
- };
1449
+ });
1673
1450
  _a = __expectNonNull;
1674
1451
  _b = __expectObject;
1675
1452
  return [4, parseBody(output.body, context)];
1676
1453
  case 1:
1677
1454
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1678
- if (data.configurationId !== undefined && data.configurationId !== null) {
1455
+ if (data.configurationId != null) {
1679
1456
  contents.ConfigurationId = __expectString(data.configurationId);
1680
1457
  }
1681
- if (data.created !== undefined && data.created !== null) {
1458
+ if (data.created != null) {
1682
1459
  contents.Created = __expectNonNull(__parseRfc3339DateTime(data.created));
1683
1460
  }
1684
- if (data.data !== undefined && data.data !== null) {
1461
+ if (data.data != null) {
1685
1462
  contents.Data = __expectString(data.data);
1686
1463
  }
1687
- if (data.description !== undefined && data.description !== null) {
1464
+ if (data.description != null) {
1688
1465
  contents.Description = __expectString(data.description);
1689
1466
  }
1690
- return [2, Promise.resolve(contents)];
1467
+ return [2, contents];
1691
1468
  }
1692
1469
  });
1693
1470
  }); };
1694
1471
  var deserializeAws_restJson1DescribeConfigurationRevisionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1695
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1472
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1696
1473
  var _c;
1697
1474
  return __generator(this, function (_d) {
1698
1475
  switch (_d.label) {
@@ -1725,14 +1502,14 @@ var deserializeAws_restJson1DescribeConfigurationRevisionCommandError = function
1725
1502
  case 9: throw _d.sent();
1726
1503
  case 10:
1727
1504
  parsedBody = parsedOutput.body;
1728
- $metadata = deserializeMetadata(output);
1729
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1730
- response = new __BaseException({
1731
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1732
- $fault: "client",
1733
- $metadata: $metadata,
1505
+ throwDefaultError({
1506
+ output: output,
1507
+ parsedBody: parsedBody,
1508
+ exceptionCtor: __BaseException,
1509
+ errorCode: errorCode,
1734
1510
  });
1735
- throw __decorateServiceException(response, parsedBody);
1511
+ _d.label = 11;
1512
+ case 11: return [2];
1736
1513
  }
1737
1514
  });
1738
1515
  }); };
@@ -1744,40 +1521,35 @@ export var deserializeAws_restJson1DescribeUserCommand = function (output, conte
1744
1521
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1745
1522
  return [2, deserializeAws_restJson1DescribeUserCommandError(output, context)];
1746
1523
  }
1747
- contents = {
1524
+ contents = map({
1748
1525
  $metadata: deserializeMetadata(output),
1749
- BrokerId: undefined,
1750
- ConsoleAccess: undefined,
1751
- Groups: undefined,
1752
- Pending: undefined,
1753
- Username: undefined,
1754
- };
1526
+ });
1755
1527
  _a = __expectNonNull;
1756
1528
  _b = __expectObject;
1757
1529
  return [4, parseBody(output.body, context)];
1758
1530
  case 1:
1759
1531
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1760
- if (data.brokerId !== undefined && data.brokerId !== null) {
1532
+ if (data.brokerId != null) {
1761
1533
  contents.BrokerId = __expectString(data.brokerId);
1762
1534
  }
1763
- if (data.consoleAccess !== undefined && data.consoleAccess !== null) {
1535
+ if (data.consoleAccess != null) {
1764
1536
  contents.ConsoleAccess = __expectBoolean(data.consoleAccess);
1765
1537
  }
1766
- if (data.groups !== undefined && data.groups !== null) {
1538
+ if (data.groups != null) {
1767
1539
  contents.Groups = deserializeAws_restJson1__listOf__string(data.groups, context);
1768
1540
  }
1769
- if (data.pending !== undefined && data.pending !== null) {
1541
+ if (data.pending != null) {
1770
1542
  contents.Pending = deserializeAws_restJson1UserPendingChanges(data.pending, context);
1771
1543
  }
1772
- if (data.username !== undefined && data.username !== null) {
1544
+ if (data.username != null) {
1773
1545
  contents.Username = __expectString(data.username);
1774
1546
  }
1775
- return [2, Promise.resolve(contents)];
1547
+ return [2, contents];
1776
1548
  }
1777
1549
  });
1778
1550
  }); };
1779
1551
  var deserializeAws_restJson1DescribeUserCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1780
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1552
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1781
1553
  var _c;
1782
1554
  return __generator(this, function (_d) {
1783
1555
  switch (_d.label) {
@@ -1810,14 +1582,14 @@ var deserializeAws_restJson1DescribeUserCommandError = function (output, context
1810
1582
  case 9: throw _d.sent();
1811
1583
  case 10:
1812
1584
  parsedBody = parsedOutput.body;
1813
- $metadata = deserializeMetadata(output);
1814
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1815
- response = new __BaseException({
1816
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1817
- $fault: "client",
1818
- $metadata: $metadata,
1585
+ throwDefaultError({
1586
+ output: output,
1587
+ parsedBody: parsedBody,
1588
+ exceptionCtor: __BaseException,
1589
+ errorCode: errorCode,
1819
1590
  });
1820
- throw __decorateServiceException(response, parsedBody);
1591
+ _d.label = 11;
1592
+ case 11: return [2];
1821
1593
  }
1822
1594
  });
1823
1595
  }); };
@@ -1829,28 +1601,26 @@ export var deserializeAws_restJson1ListBrokersCommand = function (output, contex
1829
1601
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1830
1602
  return [2, deserializeAws_restJson1ListBrokersCommandError(output, context)];
1831
1603
  }
1832
- contents = {
1604
+ contents = map({
1833
1605
  $metadata: deserializeMetadata(output),
1834
- BrokerSummaries: undefined,
1835
- NextToken: undefined,
1836
- };
1606
+ });
1837
1607
  _a = __expectNonNull;
1838
1608
  _b = __expectObject;
1839
1609
  return [4, parseBody(output.body, context)];
1840
1610
  case 1:
1841
1611
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1842
- if (data.brokerSummaries !== undefined && data.brokerSummaries !== null) {
1612
+ if (data.brokerSummaries != null) {
1843
1613
  contents.BrokerSummaries = deserializeAws_restJson1__listOfBrokerSummary(data.brokerSummaries, context);
1844
1614
  }
1845
- if (data.nextToken !== undefined && data.nextToken !== null) {
1615
+ if (data.nextToken != null) {
1846
1616
  contents.NextToken = __expectString(data.nextToken);
1847
1617
  }
1848
- return [2, Promise.resolve(contents)];
1618
+ return [2, contents];
1849
1619
  }
1850
1620
  });
1851
1621
  }); };
1852
1622
  var deserializeAws_restJson1ListBrokersCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1853
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1623
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1854
1624
  var _c;
1855
1625
  return __generator(this, function (_d) {
1856
1626
  switch (_d.label) {
@@ -1879,14 +1649,14 @@ var deserializeAws_restJson1ListBrokersCommandError = function (output, context)
1879
1649
  case 7: throw _d.sent();
1880
1650
  case 8:
1881
1651
  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,
1652
+ throwDefaultError({
1653
+ output: output,
1654
+ parsedBody: parsedBody,
1655
+ exceptionCtor: __BaseException,
1656
+ errorCode: errorCode,
1888
1657
  });
1889
- throw __decorateServiceException(response, parsedBody);
1658
+ _d.label = 9;
1659
+ case 9: return [2];
1890
1660
  }
1891
1661
  });
1892
1662
  }); };
@@ -1898,36 +1668,32 @@ export var deserializeAws_restJson1ListConfigurationRevisionsCommand = function
1898
1668
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1899
1669
  return [2, deserializeAws_restJson1ListConfigurationRevisionsCommandError(output, context)];
1900
1670
  }
1901
- contents = {
1671
+ contents = map({
1902
1672
  $metadata: deserializeMetadata(output),
1903
- ConfigurationId: undefined,
1904
- MaxResults: undefined,
1905
- NextToken: undefined,
1906
- Revisions: undefined,
1907
- };
1673
+ });
1908
1674
  _a = __expectNonNull;
1909
1675
  _b = __expectObject;
1910
1676
  return [4, parseBody(output.body, context)];
1911
1677
  case 1:
1912
1678
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1913
- if (data.configurationId !== undefined && data.configurationId !== null) {
1679
+ if (data.configurationId != null) {
1914
1680
  contents.ConfigurationId = __expectString(data.configurationId);
1915
1681
  }
1916
- if (data.maxResults !== undefined && data.maxResults !== null) {
1682
+ if (data.maxResults != null) {
1917
1683
  contents.MaxResults = __expectInt32(data.maxResults);
1918
1684
  }
1919
- if (data.nextToken !== undefined && data.nextToken !== null) {
1685
+ if (data.nextToken != null) {
1920
1686
  contents.NextToken = __expectString(data.nextToken);
1921
1687
  }
1922
- if (data.revisions !== undefined && data.revisions !== null) {
1688
+ if (data.revisions != null) {
1923
1689
  contents.Revisions = deserializeAws_restJson1__listOfConfigurationRevision(data.revisions, context);
1924
1690
  }
1925
- return [2, Promise.resolve(contents)];
1691
+ return [2, contents];
1926
1692
  }
1927
1693
  });
1928
1694
  }); };
1929
1695
  var deserializeAws_restJson1ListConfigurationRevisionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1930
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1696
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1931
1697
  var _c;
1932
1698
  return __generator(this, function (_d) {
1933
1699
  switch (_d.label) {
@@ -1960,14 +1726,14 @@ var deserializeAws_restJson1ListConfigurationRevisionsCommandError = function (o
1960
1726
  case 9: throw _d.sent();
1961
1727
  case 10:
1962
1728
  parsedBody = parsedOutput.body;
1963
- $metadata = deserializeMetadata(output);
1964
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1965
- response = new __BaseException({
1966
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1967
- $fault: "client",
1968
- $metadata: $metadata,
1729
+ throwDefaultError({
1730
+ output: output,
1731
+ parsedBody: parsedBody,
1732
+ exceptionCtor: __BaseException,
1733
+ errorCode: errorCode,
1969
1734
  });
1970
- throw __decorateServiceException(response, parsedBody);
1735
+ _d.label = 11;
1736
+ case 11: return [2];
1971
1737
  }
1972
1738
  });
1973
1739
  }); };
@@ -1979,32 +1745,29 @@ export var deserializeAws_restJson1ListConfigurationsCommand = function (output,
1979
1745
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1980
1746
  return [2, deserializeAws_restJson1ListConfigurationsCommandError(output, context)];
1981
1747
  }
1982
- contents = {
1748
+ contents = map({
1983
1749
  $metadata: deserializeMetadata(output),
1984
- Configurations: undefined,
1985
- MaxResults: undefined,
1986
- NextToken: undefined,
1987
- };
1750
+ });
1988
1751
  _a = __expectNonNull;
1989
1752
  _b = __expectObject;
1990
1753
  return [4, parseBody(output.body, context)];
1991
1754
  case 1:
1992
1755
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1993
- if (data.configurations !== undefined && data.configurations !== null) {
1756
+ if (data.configurations != null) {
1994
1757
  contents.Configurations = deserializeAws_restJson1__listOfConfiguration(data.configurations, context);
1995
1758
  }
1996
- if (data.maxResults !== undefined && data.maxResults !== null) {
1759
+ if (data.maxResults != null) {
1997
1760
  contents.MaxResults = __expectInt32(data.maxResults);
1998
1761
  }
1999
- if (data.nextToken !== undefined && data.nextToken !== null) {
1762
+ if (data.nextToken != null) {
2000
1763
  contents.NextToken = __expectString(data.nextToken);
2001
1764
  }
2002
- return [2, Promise.resolve(contents)];
1765
+ return [2, contents];
2003
1766
  }
2004
1767
  });
2005
1768
  }); };
2006
1769
  var deserializeAws_restJson1ListConfigurationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2007
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1770
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2008
1771
  var _c;
2009
1772
  return __generator(this, function (_d) {
2010
1773
  switch (_d.label) {
@@ -2033,14 +1796,14 @@ var deserializeAws_restJson1ListConfigurationsCommandError = function (output, c
2033
1796
  case 7: throw _d.sent();
2034
1797
  case 8:
2035
1798
  parsedBody = parsedOutput.body;
2036
- $metadata = deserializeMetadata(output);
2037
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2038
- response = new __BaseException({
2039
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2040
- $fault: "client",
2041
- $metadata: $metadata,
1799
+ throwDefaultError({
1800
+ output: output,
1801
+ parsedBody: parsedBody,
1802
+ exceptionCtor: __BaseException,
1803
+ errorCode: errorCode,
2042
1804
  });
2043
- throw __decorateServiceException(response, parsedBody);
1805
+ _d.label = 9;
1806
+ case 9: return [2];
2044
1807
  }
2045
1808
  });
2046
1809
  }); };
@@ -2052,24 +1815,23 @@ export var deserializeAws_restJson1ListTagsCommand = function (output, context)
2052
1815
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2053
1816
  return [2, deserializeAws_restJson1ListTagsCommandError(output, context)];
2054
1817
  }
2055
- contents = {
1818
+ contents = map({
2056
1819
  $metadata: deserializeMetadata(output),
2057
- Tags: undefined,
2058
- };
1820
+ });
2059
1821
  _a = __expectNonNull;
2060
1822
  _b = __expectObject;
2061
1823
  return [4, parseBody(output.body, context)];
2062
1824
  case 1:
2063
1825
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2064
- if (data.tags !== undefined && data.tags !== null) {
1826
+ if (data.tags != null) {
2065
1827
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
2066
1828
  }
2067
- return [2, Promise.resolve(contents)];
1829
+ return [2, contents];
2068
1830
  }
2069
1831
  });
2070
1832
  }); };
2071
1833
  var deserializeAws_restJson1ListTagsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2072
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1834
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2073
1835
  var _c;
2074
1836
  return __generator(this, function (_d) {
2075
1837
  switch (_d.label) {
@@ -2102,14 +1864,14 @@ var deserializeAws_restJson1ListTagsCommandError = function (output, context) {
2102
1864
  case 9: throw _d.sent();
2103
1865
  case 10:
2104
1866
  parsedBody = parsedOutput.body;
2105
- $metadata = deserializeMetadata(output);
2106
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2107
- response = new __BaseException({
2108
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2109
- $fault: "client",
2110
- $metadata: $metadata,
1867
+ throwDefaultError({
1868
+ output: output,
1869
+ parsedBody: parsedBody,
1870
+ exceptionCtor: __BaseException,
1871
+ errorCode: errorCode,
2111
1872
  });
2112
- throw __decorateServiceException(response, parsedBody);
1873
+ _d.label = 11;
1874
+ case 11: return [2];
2113
1875
  }
2114
1876
  });
2115
1877
  }); };
@@ -2121,36 +1883,32 @@ export var deserializeAws_restJson1ListUsersCommand = function (output, context)
2121
1883
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2122
1884
  return [2, deserializeAws_restJson1ListUsersCommandError(output, context)];
2123
1885
  }
2124
- contents = {
1886
+ contents = map({
2125
1887
  $metadata: deserializeMetadata(output),
2126
- BrokerId: undefined,
2127
- MaxResults: undefined,
2128
- NextToken: undefined,
2129
- Users: undefined,
2130
- };
1888
+ });
2131
1889
  _a = __expectNonNull;
2132
1890
  _b = __expectObject;
2133
1891
  return [4, parseBody(output.body, context)];
2134
1892
  case 1:
2135
1893
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2136
- if (data.brokerId !== undefined && data.brokerId !== null) {
1894
+ if (data.brokerId != null) {
2137
1895
  contents.BrokerId = __expectString(data.brokerId);
2138
1896
  }
2139
- if (data.maxResults !== undefined && data.maxResults !== null) {
1897
+ if (data.maxResults != null) {
2140
1898
  contents.MaxResults = __expectInt32(data.maxResults);
2141
1899
  }
2142
- if (data.nextToken !== undefined && data.nextToken !== null) {
1900
+ if (data.nextToken != null) {
2143
1901
  contents.NextToken = __expectString(data.nextToken);
2144
1902
  }
2145
- if (data.users !== undefined && data.users !== null) {
1903
+ if (data.users != null) {
2146
1904
  contents.Users = deserializeAws_restJson1__listOfUserSummary(data.users, context);
2147
1905
  }
2148
- return [2, Promise.resolve(contents)];
1906
+ return [2, contents];
2149
1907
  }
2150
1908
  });
2151
1909
  }); };
2152
1910
  var deserializeAws_restJson1ListUsersCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2153
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1911
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2154
1912
  var _c;
2155
1913
  return __generator(this, function (_d) {
2156
1914
  switch (_d.label) {
@@ -2183,14 +1941,14 @@ var deserializeAws_restJson1ListUsersCommandError = function (output, context) {
2183
1941
  case 9: throw _d.sent();
2184
1942
  case 10:
2185
1943
  parsedBody = parsedOutput.body;
2186
- $metadata = deserializeMetadata(output);
2187
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2188
- response = new __BaseException({
2189
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2190
- $fault: "client",
2191
- $metadata: $metadata,
1944
+ throwDefaultError({
1945
+ output: output,
1946
+ parsedBody: parsedBody,
1947
+ exceptionCtor: __BaseException,
1948
+ errorCode: errorCode,
2192
1949
  });
2193
- throw __decorateServiceException(response, parsedBody);
1950
+ _d.label = 11;
1951
+ case 11: return [2];
2194
1952
  }
2195
1953
  });
2196
1954
  }); };
@@ -2202,18 +1960,18 @@ export var deserializeAws_restJson1RebootBrokerCommand = function (output, conte
2202
1960
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2203
1961
  return [2, deserializeAws_restJson1RebootBrokerCommandError(output, context)];
2204
1962
  }
2205
- contents = {
1963
+ contents = map({
2206
1964
  $metadata: deserializeMetadata(output),
2207
- };
1965
+ });
2208
1966
  return [4, collectBody(output.body, context)];
2209
1967
  case 1:
2210
1968
  _a.sent();
2211
- return [2, Promise.resolve(contents)];
1969
+ return [2, contents];
2212
1970
  }
2213
1971
  });
2214
1972
  }); };
2215
1973
  var deserializeAws_restJson1RebootBrokerCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2216
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1974
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2217
1975
  var _c;
2218
1976
  return __generator(this, function (_d) {
2219
1977
  switch (_d.label) {
@@ -2246,14 +2004,14 @@ var deserializeAws_restJson1RebootBrokerCommandError = function (output, context
2246
2004
  case 9: throw _d.sent();
2247
2005
  case 10:
2248
2006
  parsedBody = parsedOutput.body;
2249
- $metadata = deserializeMetadata(output);
2250
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2251
- response = new __BaseException({
2252
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2253
- $fault: "client",
2254
- $metadata: $metadata,
2007
+ throwDefaultError({
2008
+ output: output,
2009
+ parsedBody: parsedBody,
2010
+ exceptionCtor: __BaseException,
2011
+ errorCode: errorCode,
2255
2012
  });
2256
- throw __decorateServiceException(response, parsedBody);
2013
+ _d.label = 11;
2014
+ case 11: return [2];
2257
2015
  }
2258
2016
  });
2259
2017
  }); };
@@ -2265,60 +2023,50 @@ export var deserializeAws_restJson1UpdateBrokerCommand = function (output, conte
2265
2023
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2266
2024
  return [2, deserializeAws_restJson1UpdateBrokerCommandError(output, context)];
2267
2025
  }
2268
- contents = {
2026
+ contents = map({
2269
2027
  $metadata: deserializeMetadata(output),
2270
- AuthenticationStrategy: undefined,
2271
- AutoMinorVersionUpgrade: undefined,
2272
- BrokerId: undefined,
2273
- Configuration: undefined,
2274
- EngineVersion: undefined,
2275
- HostInstanceType: undefined,
2276
- LdapServerMetadata: undefined,
2277
- Logs: undefined,
2278
- MaintenanceWindowStartTime: undefined,
2279
- SecurityGroups: undefined,
2280
- };
2028
+ });
2281
2029
  _a = __expectNonNull;
2282
2030
  _b = __expectObject;
2283
2031
  return [4, parseBody(output.body, context)];
2284
2032
  case 1:
2285
2033
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2286
- if (data.authenticationStrategy !== undefined && data.authenticationStrategy !== null) {
2034
+ if (data.authenticationStrategy != null) {
2287
2035
  contents.AuthenticationStrategy = __expectString(data.authenticationStrategy);
2288
2036
  }
2289
- if (data.autoMinorVersionUpgrade !== undefined && data.autoMinorVersionUpgrade !== null) {
2037
+ if (data.autoMinorVersionUpgrade != null) {
2290
2038
  contents.AutoMinorVersionUpgrade = __expectBoolean(data.autoMinorVersionUpgrade);
2291
2039
  }
2292
- if (data.brokerId !== undefined && data.brokerId !== null) {
2040
+ if (data.brokerId != null) {
2293
2041
  contents.BrokerId = __expectString(data.brokerId);
2294
2042
  }
2295
- if (data.configuration !== undefined && data.configuration !== null) {
2043
+ if (data.configuration != null) {
2296
2044
  contents.Configuration = deserializeAws_restJson1ConfigurationId(data.configuration, context);
2297
2045
  }
2298
- if (data.engineVersion !== undefined && data.engineVersion !== null) {
2046
+ if (data.engineVersion != null) {
2299
2047
  contents.EngineVersion = __expectString(data.engineVersion);
2300
2048
  }
2301
- if (data.hostInstanceType !== undefined && data.hostInstanceType !== null) {
2049
+ if (data.hostInstanceType != null) {
2302
2050
  contents.HostInstanceType = __expectString(data.hostInstanceType);
2303
2051
  }
2304
- if (data.ldapServerMetadata !== undefined && data.ldapServerMetadata !== null) {
2052
+ if (data.ldapServerMetadata != null) {
2305
2053
  contents.LdapServerMetadata = deserializeAws_restJson1LdapServerMetadataOutput(data.ldapServerMetadata, context);
2306
2054
  }
2307
- if (data.logs !== undefined && data.logs !== null) {
2055
+ if (data.logs != null) {
2308
2056
  contents.Logs = deserializeAws_restJson1Logs(data.logs, context);
2309
2057
  }
2310
- if (data.maintenanceWindowStartTime !== undefined && data.maintenanceWindowStartTime !== null) {
2058
+ if (data.maintenanceWindowStartTime != null) {
2311
2059
  contents.MaintenanceWindowStartTime = deserializeAws_restJson1WeeklyStartTime(data.maintenanceWindowStartTime, context);
2312
2060
  }
2313
- if (data.securityGroups !== undefined && data.securityGroups !== null) {
2061
+ if (data.securityGroups != null) {
2314
2062
  contents.SecurityGroups = deserializeAws_restJson1__listOf__string(data.securityGroups, context);
2315
2063
  }
2316
- return [2, Promise.resolve(contents)];
2064
+ return [2, contents];
2317
2065
  }
2318
2066
  });
2319
2067
  }); };
2320
2068
  var deserializeAws_restJson1UpdateBrokerCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2321
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2069
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2322
2070
  var _c;
2323
2071
  return __generator(this, function (_d) {
2324
2072
  switch (_d.label) {
@@ -2355,14 +2103,14 @@ var deserializeAws_restJson1UpdateBrokerCommandError = function (output, context
2355
2103
  case 11: throw _d.sent();
2356
2104
  case 12:
2357
2105
  parsedBody = parsedOutput.body;
2358
- $metadata = deserializeMetadata(output);
2359
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2360
- response = new __BaseException({
2361
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2362
- $fault: "client",
2363
- $metadata: $metadata,
2106
+ throwDefaultError({
2107
+ output: output,
2108
+ parsedBody: parsedBody,
2109
+ exceptionCtor: __BaseException,
2110
+ errorCode: errorCode,
2364
2111
  });
2365
- throw __decorateServiceException(response, parsedBody);
2112
+ _d.label = 13;
2113
+ case 13: return [2];
2366
2114
  }
2367
2115
  });
2368
2116
  }); };
@@ -2374,44 +2122,38 @@ export var deserializeAws_restJson1UpdateConfigurationCommand = function (output
2374
2122
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2375
2123
  return [2, deserializeAws_restJson1UpdateConfigurationCommandError(output, context)];
2376
2124
  }
2377
- contents = {
2125
+ contents = map({
2378
2126
  $metadata: deserializeMetadata(output),
2379
- Arn: undefined,
2380
- Created: undefined,
2381
- Id: undefined,
2382
- LatestRevision: undefined,
2383
- Name: undefined,
2384
- Warnings: undefined,
2385
- };
2127
+ });
2386
2128
  _a = __expectNonNull;
2387
2129
  _b = __expectObject;
2388
2130
  return [4, parseBody(output.body, context)];
2389
2131
  case 1:
2390
2132
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2391
- if (data.arn !== undefined && data.arn !== null) {
2133
+ if (data.arn != null) {
2392
2134
  contents.Arn = __expectString(data.arn);
2393
2135
  }
2394
- if (data.created !== undefined && data.created !== null) {
2136
+ if (data.created != null) {
2395
2137
  contents.Created = __expectNonNull(__parseRfc3339DateTime(data.created));
2396
2138
  }
2397
- if (data.id !== undefined && data.id !== null) {
2139
+ if (data.id != null) {
2398
2140
  contents.Id = __expectString(data.id);
2399
2141
  }
2400
- if (data.latestRevision !== undefined && data.latestRevision !== null) {
2142
+ if (data.latestRevision != null) {
2401
2143
  contents.LatestRevision = deserializeAws_restJson1ConfigurationRevision(data.latestRevision, context);
2402
2144
  }
2403
- if (data.name !== undefined && data.name !== null) {
2145
+ if (data.name != null) {
2404
2146
  contents.Name = __expectString(data.name);
2405
2147
  }
2406
- if (data.warnings !== undefined && data.warnings !== null) {
2148
+ if (data.warnings != null) {
2407
2149
  contents.Warnings = deserializeAws_restJson1__listOfSanitizationWarning(data.warnings, context);
2408
2150
  }
2409
- return [2, Promise.resolve(contents)];
2151
+ return [2, contents];
2410
2152
  }
2411
2153
  });
2412
2154
  }); };
2413
2155
  var deserializeAws_restJson1UpdateConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2414
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2156
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2415
2157
  var _c;
2416
2158
  return __generator(this, function (_d) {
2417
2159
  switch (_d.label) {
@@ -2448,14 +2190,14 @@ var deserializeAws_restJson1UpdateConfigurationCommandError = function (output,
2448
2190
  case 11: throw _d.sent();
2449
2191
  case 12:
2450
2192
  parsedBody = parsedOutput.body;
2451
- $metadata = deserializeMetadata(output);
2452
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2453
- response = new __BaseException({
2454
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2455
- $fault: "client",
2456
- $metadata: $metadata,
2193
+ throwDefaultError({
2194
+ output: output,
2195
+ parsedBody: parsedBody,
2196
+ exceptionCtor: __BaseException,
2197
+ errorCode: errorCode,
2457
2198
  });
2458
- throw __decorateServiceException(response, parsedBody);
2199
+ _d.label = 13;
2200
+ case 13: return [2];
2459
2201
  }
2460
2202
  });
2461
2203
  }); };
@@ -2467,18 +2209,18 @@ export var deserializeAws_restJson1UpdateUserCommand = function (output, context
2467
2209
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2468
2210
  return [2, deserializeAws_restJson1UpdateUserCommandError(output, context)];
2469
2211
  }
2470
- contents = {
2212
+ contents = map({
2471
2213
  $metadata: deserializeMetadata(output),
2472
- };
2214
+ });
2473
2215
  return [4, collectBody(output.body, context)];
2474
2216
  case 1:
2475
2217
  _a.sent();
2476
- return [2, Promise.resolve(contents)];
2218
+ return [2, contents];
2477
2219
  }
2478
2220
  });
2479
2221
  }); };
2480
2222
  var deserializeAws_restJson1UpdateUserCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2481
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2223
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2482
2224
  var _c;
2483
2225
  return __generator(this, function (_d) {
2484
2226
  switch (_d.label) {
@@ -2515,26 +2257,27 @@ var deserializeAws_restJson1UpdateUserCommandError = function (output, context)
2515
2257
  case 11: throw _d.sent();
2516
2258
  case 12:
2517
2259
  parsedBody = parsedOutput.body;
2518
- $metadata = deserializeMetadata(output);
2519
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2520
- response = new __BaseException({
2521
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2522
- $fault: "client",
2523
- $metadata: $metadata,
2260
+ throwDefaultError({
2261
+ output: output,
2262
+ parsedBody: parsedBody,
2263
+ exceptionCtor: __BaseException,
2264
+ errorCode: errorCode,
2524
2265
  });
2525
- throw __decorateServiceException(response, parsedBody);
2266
+ _d.label = 13;
2267
+ case 13: return [2];
2526
2268
  }
2527
2269
  });
2528
2270
  }); };
2271
+ var map = __map;
2529
2272
  var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2530
2273
  var contents, data, exception;
2531
2274
  return __generator(this, function (_a) {
2532
- contents = {};
2275
+ contents = map({});
2533
2276
  data = parsedOutput.body;
2534
- if (data.errorAttribute !== undefined && data.errorAttribute !== null) {
2277
+ if (data.errorAttribute != null) {
2535
2278
  contents.ErrorAttribute = __expectString(data.errorAttribute);
2536
2279
  }
2537
- if (data.message !== undefined && data.message !== null) {
2280
+ if (data.message != null) {
2538
2281
  contents.Message = __expectString(data.message);
2539
2282
  }
2540
2283
  exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2544,12 +2287,12 @@ var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput
2544
2287
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2545
2288
  var contents, data, exception;
2546
2289
  return __generator(this, function (_a) {
2547
- contents = {};
2290
+ contents = map({});
2548
2291
  data = parsedOutput.body;
2549
- if (data.errorAttribute !== undefined && data.errorAttribute !== null) {
2292
+ if (data.errorAttribute != null) {
2550
2293
  contents.ErrorAttribute = __expectString(data.errorAttribute);
2551
2294
  }
2552
- if (data.message !== undefined && data.message !== null) {
2295
+ if (data.message != null) {
2553
2296
  contents.Message = __expectString(data.message);
2554
2297
  }
2555
2298
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2559,12 +2302,12 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
2559
2302
  var deserializeAws_restJson1ForbiddenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2560
2303
  var contents, data, exception;
2561
2304
  return __generator(this, function (_a) {
2562
- contents = {};
2305
+ contents = map({});
2563
2306
  data = parsedOutput.body;
2564
- if (data.errorAttribute !== undefined && data.errorAttribute !== null) {
2307
+ if (data.errorAttribute != null) {
2565
2308
  contents.ErrorAttribute = __expectString(data.errorAttribute);
2566
2309
  }
2567
- if (data.message !== undefined && data.message !== null) {
2310
+ if (data.message != null) {
2568
2311
  contents.Message = __expectString(data.message);
2569
2312
  }
2570
2313
  exception = new ForbiddenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2574,12 +2317,12 @@ var deserializeAws_restJson1ForbiddenExceptionResponse = function (parsedOutput,
2574
2317
  var deserializeAws_restJson1InternalServerErrorExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2575
2318
  var contents, data, exception;
2576
2319
  return __generator(this, function (_a) {
2577
- contents = {};
2320
+ contents = map({});
2578
2321
  data = parsedOutput.body;
2579
- if (data.errorAttribute !== undefined && data.errorAttribute !== null) {
2322
+ if (data.errorAttribute != null) {
2580
2323
  contents.ErrorAttribute = __expectString(data.errorAttribute);
2581
2324
  }
2582
- if (data.message !== undefined && data.message !== null) {
2325
+ if (data.message != null) {
2583
2326
  contents.Message = __expectString(data.message);
2584
2327
  }
2585
2328
  exception = new InternalServerErrorException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2589,12 +2332,12 @@ var deserializeAws_restJson1InternalServerErrorExceptionResponse = function (par
2589
2332
  var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2590
2333
  var contents, data, exception;
2591
2334
  return __generator(this, function (_a) {
2592
- contents = {};
2335
+ contents = map({});
2593
2336
  data = parsedOutput.body;
2594
- if (data.errorAttribute !== undefined && data.errorAttribute !== null) {
2337
+ if (data.errorAttribute != null) {
2595
2338
  contents.ErrorAttribute = __expectString(data.errorAttribute);
2596
2339
  }
2597
- if (data.message !== undefined && data.message !== null) {
2340
+ if (data.message != null) {
2598
2341
  contents.Message = __expectString(data.message);
2599
2342
  }
2600
2343
  exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2604,12 +2347,12 @@ var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput,
2604
2347
  var deserializeAws_restJson1UnauthorizedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2605
2348
  var contents, data, exception;
2606
2349
  return __generator(this, function (_a) {
2607
- contents = {};
2350
+ contents = map({});
2608
2351
  data = parsedOutput.body;
2609
- if (data.errorAttribute !== undefined && data.errorAttribute !== null) {
2352
+ if (data.errorAttribute != null) {
2610
2353
  contents.ErrorAttribute = __expectString(data.errorAttribute);
2611
2354
  }
2612
- if (data.message !== undefined && data.message !== null) {
2355
+ if (data.message != null) {
2613
2356
  contents.Message = __expectString(data.message);
2614
2357
  }
2615
2358
  exception = new UnauthorizedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2620,9 +2363,6 @@ var serializeAws_restJson1__listOf__string = function (input, context) {
2620
2363
  return input
2621
2364
  .filter(function (e) { return e != null; })
2622
2365
  .map(function (entry) {
2623
- if (entry === null) {
2624
- return null;
2625
- }
2626
2366
  return entry;
2627
2367
  });
2628
2368
  };
@@ -2630,9 +2370,6 @@ var serializeAws_restJson1__listOfUser = function (input, context) {
2630
2370
  return input
2631
2371
  .filter(function (e) { return e != null; })
2632
2372
  .map(function (entry) {
2633
- if (entry === null) {
2634
- return null;
2635
- }
2636
2373
  return serializeAws_restJson1User(entry, context);
2637
2374
  });
2638
2375
  };