@aws-sdk/client-mq 3.180.0 → 3.183.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist-cjs/protocols/Aws_restJson1.js +28 -22
  3. package/dist-es/Mq.js +90 -97
  4. package/dist-es/MqClient.js +22 -28
  5. package/dist-es/commands/CreateBrokerCommand.js +21 -28
  6. package/dist-es/commands/CreateConfigurationCommand.js +21 -28
  7. package/dist-es/commands/CreateTagsCommand.js +22 -29
  8. package/dist-es/commands/CreateUserCommand.js +21 -28
  9. package/dist-es/commands/DeleteBrokerCommand.js +21 -28
  10. package/dist-es/commands/DeleteTagsCommand.js +22 -29
  11. package/dist-es/commands/DeleteUserCommand.js +21 -28
  12. package/dist-es/commands/DescribeBrokerCommand.js +21 -28
  13. package/dist-es/commands/DescribeBrokerEngineTypesCommand.js +21 -28
  14. package/dist-es/commands/DescribeBrokerInstanceOptionsCommand.js +21 -28
  15. package/dist-es/commands/DescribeConfigurationCommand.js +21 -28
  16. package/dist-es/commands/DescribeConfigurationRevisionCommand.js +21 -28
  17. package/dist-es/commands/DescribeUserCommand.js +21 -28
  18. package/dist-es/commands/ListBrokersCommand.js +21 -28
  19. package/dist-es/commands/ListConfigurationRevisionsCommand.js +21 -28
  20. package/dist-es/commands/ListConfigurationsCommand.js +21 -28
  21. package/dist-es/commands/ListTagsCommand.js +21 -28
  22. package/dist-es/commands/ListUsersCommand.js +21 -28
  23. package/dist-es/commands/RebootBrokerCommand.js +21 -28
  24. package/dist-es/commands/UpdateBrokerCommand.js +21 -28
  25. package/dist-es/commands/UpdateConfigurationCommand.js +21 -28
  26. package/dist-es/commands/UpdateUserCommand.js +21 -28
  27. package/dist-es/endpoints.js +8 -8
  28. package/dist-es/models/MqServiceException.js +5 -10
  29. package/dist-es/models/models_0.js +270 -143
  30. package/dist-es/pagination/ListBrokersPaginator.js +25 -68
  31. package/dist-es/protocols/Aws_restJson1.js +1824 -2443
  32. package/dist-es/runtimeConfig.browser.js +26 -12
  33. package/dist-es/runtimeConfig.js +30 -12
  34. package/dist-es/runtimeConfig.native.js +8 -5
  35. package/dist-es/runtimeConfig.shared.js +8 -11
  36. package/package.json +33 -33
@@ -1,2410 +1,1795 @@
1
- import { __assign, __awaiter, __generator, __read } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  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
3
  import { v4 as generateIdempotencyToken } from "uuid";
5
4
  import { BadRequestException, ConflictException, ForbiddenException, InternalServerErrorException, NotFoundException, UnauthorizedException, } from "../models/models_0";
6
5
  import { MqServiceException as __BaseException } from "../models/MqServiceException";
7
- export var serializeAws_restJson1CreateBrokerCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
8
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
9
- var _c;
10
- return __generator(this, function (_d) {
11
- switch (_d.label) {
12
- case 0: return [4, context.endpoint()];
13
- case 1:
14
- _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
15
- headers = {
16
- "content-type": "application/json",
17
- };
18
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers";
19
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AuthenticationStrategy != null && { authenticationStrategy: input.AuthenticationStrategy })), (input.AutoMinorVersionUpgrade != null && { autoMinorVersionUpgrade: input.AutoMinorVersionUpgrade })), (input.BrokerName != null && { brokerName: input.BrokerName })), (input.Configuration != null && {
20
- configuration: serializeAws_restJson1ConfigurationId(input.Configuration, context),
21
- })), { creatorRequestId: (_c = input.CreatorRequestId) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }), (input.DeploymentMode != null && { deploymentMode: input.DeploymentMode })), (input.EncryptionOptions != null && {
22
- encryptionOptions: serializeAws_restJson1EncryptionOptions(input.EncryptionOptions, context),
23
- })), (input.EngineType != null && { engineType: input.EngineType })), (input.EngineVersion != null && { engineVersion: input.EngineVersion })), (input.HostInstanceType != null && { hostInstanceType: input.HostInstanceType })), (input.LdapServerMetadata != null && {
24
- ldapServerMetadata: serializeAws_restJson1LdapServerMetadataInput(input.LdapServerMetadata, context),
25
- })), (input.Logs != null && { logs: serializeAws_restJson1Logs(input.Logs, context) })), (input.MaintenanceWindowStartTime != null && {
26
- maintenanceWindowStartTime: serializeAws_restJson1WeeklyStartTime(input.MaintenanceWindowStartTime, context),
27
- })), (input.PubliclyAccessible != null && { publiclyAccessible: input.PubliclyAccessible })), (input.SecurityGroups != null && {
28
- securityGroups: serializeAws_restJson1__listOf__string(input.SecurityGroups, context),
29
- })), (input.StorageType != null && { storageType: input.StorageType })), (input.SubnetIds != null && { subnetIds: serializeAws_restJson1__listOf__string(input.SubnetIds, context) })), (input.Tags != null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) })), (input.Users != null && { users: serializeAws_restJson1__listOfUser(input.Users, context) })));
30
- return [2, new __HttpRequest({
31
- protocol: protocol,
32
- hostname: hostname,
33
- port: port,
34
- method: "POST",
35
- headers: headers,
36
- path: resolvedPath,
37
- body: body,
38
- })];
39
- }
40
- });
41
- }); };
42
- export var serializeAws_restJson1CreateConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
43
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
44
- return __generator(this, function (_c) {
45
- switch (_c.label) {
46
- case 0: return [4, context.endpoint()];
47
- case 1:
48
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
49
- headers = {
50
- "content-type": "application/json",
51
- };
52
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/configurations";
53
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.AuthenticationStrategy != null && { authenticationStrategy: input.AuthenticationStrategy })), (input.EngineType != null && { engineType: input.EngineType })), (input.EngineVersion != null && { engineVersion: input.EngineVersion })), (input.Name != null && { name: input.Name })), (input.Tags != null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) })));
54
- return [2, new __HttpRequest({
55
- protocol: protocol,
56
- hostname: hostname,
57
- port: port,
58
- method: "POST",
59
- headers: headers,
60
- path: resolvedPath,
61
- body: body,
62
- })];
63
- }
64
- });
65
- }); };
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, body;
68
- return __generator(this, function (_c) {
69
- switch (_c.label) {
70
- case 0: return [4, context.endpoint()];
71
- case 1:
72
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
73
- headers = {
74
- "content-type": "application/json",
75
- };
76
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/tags/{ResourceArn}";
77
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
78
- body = JSON.stringify(__assign({}, (input.Tags != null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) })));
79
- return [2, new __HttpRequest({
80
- protocol: protocol,
81
- hostname: hostname,
82
- port: port,
83
- method: "POST",
84
- headers: headers,
85
- path: resolvedPath,
86
- body: body,
87
- })];
88
- }
89
- });
90
- }); };
91
- export var serializeAws_restJson1CreateUserCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
92
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
93
- return __generator(this, function (_c) {
94
- switch (_c.label) {
95
- case 0: return [4, context.endpoint()];
96
- case 1:
97
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
98
- headers = {
99
- "content-type": "application/json",
100
- };
101
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}/users/{Username}";
102
- resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
103
- resolvedPath = __resolvedPath(resolvedPath, input, "Username", function () { return input.Username; }, "{Username}", false);
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 })));
105
- return [2, new __HttpRequest({
106
- protocol: protocol,
107
- hostname: hostname,
108
- port: port,
109
- method: "POST",
110
- headers: headers,
111
- path: resolvedPath,
112
- body: body,
113
- })];
114
- }
115
- });
116
- }); };
117
- export var serializeAws_restJson1DeleteBrokerCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
118
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
119
- return __generator(this, function (_c) {
120
- switch (_c.label) {
121
- case 0: return [4, context.endpoint()];
122
- case 1:
123
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
124
- headers = {};
125
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}";
126
- resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
127
- return [2, new __HttpRequest({
128
- protocol: protocol,
129
- hostname: hostname,
130
- port: port,
131
- method: "DELETE",
132
- headers: headers,
133
- path: resolvedPath,
134
- body: body,
135
- })];
136
- }
137
- });
138
- }); };
139
- export var serializeAws_restJson1DeleteTagsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
140
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
141
- return __generator(this, function (_c) {
142
- switch (_c.label) {
143
- case 0: return [4, context.endpoint()];
144
- case 1:
145
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
146
- headers = {};
147
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/tags/{ResourceArn}";
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
- });
152
- return [2, new __HttpRequest({
153
- protocol: protocol,
154
- hostname: hostname,
155
- port: port,
156
- method: "DELETE",
157
- headers: headers,
158
- path: resolvedPath,
159
- query: query,
160
- body: body,
161
- })];
162
- }
163
- });
164
- }); };
165
- export var serializeAws_restJson1DeleteUserCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
166
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
167
- return __generator(this, function (_c) {
168
- switch (_c.label) {
169
- case 0: return [4, context.endpoint()];
170
- case 1:
171
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
172
- headers = {};
173
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}/users/{Username}";
174
- resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
175
- resolvedPath = __resolvedPath(resolvedPath, input, "Username", function () { return input.Username; }, "{Username}", false);
176
- return [2, new __HttpRequest({
177
- protocol: protocol,
178
- hostname: hostname,
179
- port: port,
180
- method: "DELETE",
181
- headers: headers,
182
- path: resolvedPath,
183
- body: body,
184
- })];
185
- }
186
- });
187
- }); };
188
- export var serializeAws_restJson1DescribeBrokerCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
189
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
190
- return __generator(this, function (_c) {
191
- switch (_c.label) {
192
- case 0: return [4, context.endpoint()];
193
- case 1:
194
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
195
- headers = {};
196
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}";
197
- resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
198
- return [2, new __HttpRequest({
199
- protocol: protocol,
200
- hostname: hostname,
201
- port: port,
202
- method: "GET",
203
- headers: headers,
204
- path: resolvedPath,
205
- body: body,
206
- })];
207
- }
208
- });
209
- }); };
210
- export var serializeAws_restJson1DescribeBrokerEngineTypesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
211
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
212
- return __generator(this, function (_c) {
213
- switch (_c.label) {
214
- case 0: return [4, context.endpoint()];
215
- case 1:
216
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
217
- headers = {};
218
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/broker-engine-types";
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
- });
224
- return [2, new __HttpRequest({
225
- protocol: protocol,
226
- hostname: hostname,
227
- port: port,
228
- method: "GET",
229
- headers: headers,
230
- path: resolvedPath,
231
- query: query,
232
- body: body,
233
- })];
234
- }
235
- });
236
- }); };
237
- export var serializeAws_restJson1DescribeBrokerInstanceOptionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
238
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
239
- return __generator(this, function (_c) {
240
- switch (_c.label) {
241
- case 0: return [4, context.endpoint()];
242
- case 1:
243
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
244
- headers = {};
245
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/broker-instance-options";
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
- });
253
- return [2, new __HttpRequest({
254
- protocol: protocol,
255
- hostname: hostname,
256
- port: port,
257
- method: "GET",
258
- headers: headers,
259
- path: resolvedPath,
260
- query: query,
261
- body: body,
262
- })];
263
- }
264
- });
265
- }); };
266
- export var serializeAws_restJson1DescribeConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
267
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
268
- return __generator(this, function (_c) {
269
- switch (_c.label) {
270
- case 0: return [4, context.endpoint()];
271
- case 1:
272
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
273
- headers = {};
274
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/configurations/{ConfigurationId}";
275
- resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationId", function () { return input.ConfigurationId; }, "{ConfigurationId}", false);
276
- return [2, new __HttpRequest({
277
- protocol: protocol,
278
- hostname: hostname,
279
- port: port,
280
- method: "GET",
281
- headers: headers,
282
- path: resolvedPath,
283
- body: body,
284
- })];
285
- }
286
- });
287
- }); };
288
- export var serializeAws_restJson1DescribeConfigurationRevisionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
289
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
290
- return __generator(this, function (_c) {
291
- switch (_c.label) {
292
- case 0: return [4, context.endpoint()];
293
- case 1:
294
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
295
- headers = {};
296
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
297
- "/v1/configurations/{ConfigurationId}/revisions/{ConfigurationRevision}";
298
- resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationId", function () { return input.ConfigurationId; }, "{ConfigurationId}", false);
299
- resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationRevision", function () { return input.ConfigurationRevision; }, "{ConfigurationRevision}", false);
300
- return [2, new __HttpRequest({
301
- protocol: protocol,
302
- hostname: hostname,
303
- port: port,
304
- method: "GET",
305
- headers: headers,
306
- path: resolvedPath,
307
- body: body,
308
- })];
309
- }
310
- });
311
- }); };
312
- export var serializeAws_restJson1DescribeUserCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
313
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
314
- return __generator(this, function (_c) {
315
- switch (_c.label) {
316
- case 0: return [4, context.endpoint()];
317
- case 1:
318
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
319
- headers = {};
320
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}/users/{Username}";
321
- resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
322
- resolvedPath = __resolvedPath(resolvedPath, input, "Username", function () { return input.Username; }, "{Username}", false);
323
- return [2, new __HttpRequest({
324
- protocol: protocol,
325
- hostname: hostname,
326
- port: port,
327
- method: "GET",
328
- headers: headers,
329
- path: resolvedPath,
330
- body: body,
331
- })];
332
- }
333
- });
334
- }); };
335
- export var serializeAws_restJson1ListBrokersCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
336
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
337
- return __generator(this, function (_c) {
338
- switch (_c.label) {
339
- case 0: return [4, context.endpoint()];
340
- case 1:
341
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
342
- headers = {};
343
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers";
344
- query = map({
345
- maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
346
- nextToken: [, input.NextToken],
347
- });
348
- return [2, new __HttpRequest({
349
- protocol: protocol,
350
- hostname: hostname,
351
- port: port,
352
- method: "GET",
353
- headers: headers,
354
- path: resolvedPath,
355
- query: query,
356
- body: body,
357
- })];
358
- }
359
- });
360
- }); };
361
- export var serializeAws_restJson1ListConfigurationRevisionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
362
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
363
- return __generator(this, function (_c) {
364
- switch (_c.label) {
365
- case 0: return [4, context.endpoint()];
366
- case 1:
367
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
368
- headers = {};
369
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
370
- "/v1/configurations/{ConfigurationId}/revisions";
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
- });
376
- return [2, new __HttpRequest({
377
- protocol: protocol,
378
- hostname: hostname,
379
- port: port,
380
- method: "GET",
381
- headers: headers,
382
- path: resolvedPath,
383
- query: query,
384
- body: body,
385
- })];
386
- }
387
- });
388
- }); };
389
- export var serializeAws_restJson1ListConfigurationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
390
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
391
- return __generator(this, function (_c) {
392
- switch (_c.label) {
393
- case 0: return [4, context.endpoint()];
394
- case 1:
395
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
396
- headers = {};
397
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/configurations";
398
- query = map({
399
- maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
400
- nextToken: [, input.NextToken],
401
- });
402
- return [2, new __HttpRequest({
403
- protocol: protocol,
404
- hostname: hostname,
405
- port: port,
406
- method: "GET",
407
- headers: headers,
408
- path: resolvedPath,
409
- query: query,
410
- body: body,
411
- })];
412
- }
413
- });
414
- }); };
415
- export var serializeAws_restJson1ListTagsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
416
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
417
- return __generator(this, function (_c) {
418
- switch (_c.label) {
419
- case 0: return [4, context.endpoint()];
420
- case 1:
421
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
422
- headers = {};
423
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/tags/{ResourceArn}";
424
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
425
- return [2, new __HttpRequest({
426
- protocol: protocol,
427
- hostname: hostname,
428
- port: port,
429
- method: "GET",
430
- headers: headers,
431
- path: resolvedPath,
432
- body: body,
433
- })];
434
- }
435
- });
436
- }); };
437
- export var serializeAws_restJson1ListUsersCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
438
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
439
- return __generator(this, function (_c) {
440
- switch (_c.label) {
441
- case 0: return [4, context.endpoint()];
442
- case 1:
443
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
444
- headers = {};
445
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}/users";
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
- });
451
- return [2, new __HttpRequest({
452
- protocol: protocol,
453
- hostname: hostname,
454
- port: port,
455
- method: "GET",
456
- headers: headers,
457
- path: resolvedPath,
458
- query: query,
459
- body: body,
460
- })];
461
- }
6
+ export const serializeAws_restJson1CreateBrokerCommand = async (input, context) => {
7
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
+ const headers = {
9
+ "content-type": "application/json",
10
+ };
11
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/brokers";
12
+ let body;
13
+ body = JSON.stringify({
14
+ ...(input.AuthenticationStrategy != null && { authenticationStrategy: input.AuthenticationStrategy }),
15
+ ...(input.AutoMinorVersionUpgrade != null && { autoMinorVersionUpgrade: input.AutoMinorVersionUpgrade }),
16
+ ...(input.BrokerName != null && { brokerName: input.BrokerName }),
17
+ ...(input.Configuration != null && {
18
+ configuration: serializeAws_restJson1ConfigurationId(input.Configuration, context),
19
+ }),
20
+ creatorRequestId: input.CreatorRequestId ?? generateIdempotencyToken(),
21
+ ...(input.DeploymentMode != null && { deploymentMode: input.DeploymentMode }),
22
+ ...(input.EncryptionOptions != null && {
23
+ encryptionOptions: serializeAws_restJson1EncryptionOptions(input.EncryptionOptions, context),
24
+ }),
25
+ ...(input.EngineType != null && { engineType: input.EngineType }),
26
+ ...(input.EngineVersion != null && { engineVersion: input.EngineVersion }),
27
+ ...(input.HostInstanceType != null && { hostInstanceType: input.HostInstanceType }),
28
+ ...(input.LdapServerMetadata != null && {
29
+ ldapServerMetadata: serializeAws_restJson1LdapServerMetadataInput(input.LdapServerMetadata, context),
30
+ }),
31
+ ...(input.Logs != null && { logs: serializeAws_restJson1Logs(input.Logs, context) }),
32
+ ...(input.MaintenanceWindowStartTime != null && {
33
+ maintenanceWindowStartTime: serializeAws_restJson1WeeklyStartTime(input.MaintenanceWindowStartTime, context),
34
+ }),
35
+ ...(input.PubliclyAccessible != null && { publiclyAccessible: input.PubliclyAccessible }),
36
+ ...(input.SecurityGroups != null && {
37
+ securityGroups: serializeAws_restJson1__listOf__string(input.SecurityGroups, context),
38
+ }),
39
+ ...(input.StorageType != null && { storageType: input.StorageType }),
40
+ ...(input.SubnetIds != null && { subnetIds: serializeAws_restJson1__listOf__string(input.SubnetIds, context) }),
41
+ ...(input.Tags != null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }),
42
+ ...(input.Users != null && { users: serializeAws_restJson1__listOfUser(input.Users, context) }),
43
+ });
44
+ return new __HttpRequest({
45
+ protocol,
46
+ hostname,
47
+ port,
48
+ method: "POST",
49
+ headers,
50
+ path: resolvedPath,
51
+ body,
462
52
  });
463
- }); };
464
- export var serializeAws_restJson1RebootBrokerCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
465
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
466
- return __generator(this, function (_c) {
467
- switch (_c.label) {
468
- case 0: return [4, context.endpoint()];
469
- case 1:
470
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
471
- headers = {};
472
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}/reboot";
473
- resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
474
- return [2, new __HttpRequest({
475
- protocol: protocol,
476
- hostname: hostname,
477
- port: port,
478
- method: "POST",
479
- headers: headers,
480
- path: resolvedPath,
481
- body: body,
482
- })];
483
- }
53
+ };
54
+ export const serializeAws_restJson1CreateConfigurationCommand = async (input, context) => {
55
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
56
+ const headers = {
57
+ "content-type": "application/json",
58
+ };
59
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/configurations";
60
+ let body;
61
+ body = JSON.stringify({
62
+ ...(input.AuthenticationStrategy != null && { authenticationStrategy: input.AuthenticationStrategy }),
63
+ ...(input.EngineType != null && { engineType: input.EngineType }),
64
+ ...(input.EngineVersion != null && { engineVersion: input.EngineVersion }),
65
+ ...(input.Name != null && { name: input.Name }),
66
+ ...(input.Tags != null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }),
67
+ });
68
+ return new __HttpRequest({
69
+ protocol,
70
+ hostname,
71
+ port,
72
+ method: "POST",
73
+ headers,
74
+ path: resolvedPath,
75
+ body,
484
76
  });
485
- }); };
486
- export var serializeAws_restJson1UpdateBrokerCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
487
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
488
- return __generator(this, function (_c) {
489
- switch (_c.label) {
490
- case 0: return [4, context.endpoint()];
491
- case 1:
492
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
493
- headers = {
494
- "content-type": "application/json",
495
- };
496
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}";
497
- resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
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 && {
499
- configuration: serializeAws_restJson1ConfigurationId(input.Configuration, context),
500
- })), (input.EngineVersion != null && { engineVersion: input.EngineVersion })), (input.HostInstanceType != null && { hostInstanceType: input.HostInstanceType })), (input.LdapServerMetadata != null && {
501
- ldapServerMetadata: serializeAws_restJson1LdapServerMetadataInput(input.LdapServerMetadata, context),
502
- })), (input.Logs != null && { logs: serializeAws_restJson1Logs(input.Logs, context) })), (input.MaintenanceWindowStartTime != null && {
503
- maintenanceWindowStartTime: serializeAws_restJson1WeeklyStartTime(input.MaintenanceWindowStartTime, context),
504
- })), (input.SecurityGroups != null && {
505
- securityGroups: serializeAws_restJson1__listOf__string(input.SecurityGroups, context),
506
- })));
507
- return [2, new __HttpRequest({
508
- protocol: protocol,
509
- hostname: hostname,
510
- port: port,
511
- method: "PUT",
512
- headers: headers,
513
- path: resolvedPath,
514
- body: body,
515
- })];
516
- }
77
+ };
78
+ export const serializeAws_restJson1CreateTagsCommand = async (input, context) => {
79
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
80
+ const headers = {
81
+ "content-type": "application/json",
82
+ };
83
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/tags/{ResourceArn}";
84
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
85
+ let body;
86
+ body = JSON.stringify({
87
+ ...(input.Tags != null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }),
88
+ });
89
+ return new __HttpRequest({
90
+ protocol,
91
+ hostname,
92
+ port,
93
+ method: "POST",
94
+ headers,
95
+ path: resolvedPath,
96
+ body,
517
97
  });
518
- }); };
519
- export var serializeAws_restJson1UpdateConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
520
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
521
- return __generator(this, function (_c) {
522
- switch (_c.label) {
523
- case 0: return [4, context.endpoint()];
524
- case 1:
525
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
526
- headers = {
527
- "content-type": "application/json",
528
- };
529
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/configurations/{ConfigurationId}";
530
- resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationId", function () { return input.ConfigurationId; }, "{ConfigurationId}", false);
531
- body = JSON.stringify(__assign(__assign({}, (input.Data != null && { data: input.Data })), (input.Description != null && { description: input.Description })));
532
- return [2, new __HttpRequest({
533
- protocol: protocol,
534
- hostname: hostname,
535
- port: port,
536
- method: "PUT",
537
- headers: headers,
538
- path: resolvedPath,
539
- body: body,
540
- })];
541
- }
98
+ };
99
+ export const serializeAws_restJson1CreateUserCommand = async (input, context) => {
100
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
101
+ const headers = {
102
+ "content-type": "application/json",
103
+ };
104
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/brokers/{BrokerId}/users/{Username}";
105
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", () => input.BrokerId, "{BrokerId}", false);
106
+ resolvedPath = __resolvedPath(resolvedPath, input, "Username", () => input.Username, "{Username}", false);
107
+ let body;
108
+ body = JSON.stringify({
109
+ ...(input.ConsoleAccess != null && { consoleAccess: input.ConsoleAccess }),
110
+ ...(input.Groups != null && { groups: serializeAws_restJson1__listOf__string(input.Groups, context) }),
111
+ ...(input.Password != null && { password: input.Password }),
112
+ });
113
+ return new __HttpRequest({
114
+ protocol,
115
+ hostname,
116
+ port,
117
+ method: "POST",
118
+ headers,
119
+ path: resolvedPath,
120
+ body,
542
121
  });
543
- }); };
544
- export var serializeAws_restJson1UpdateUserCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
545
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
546
- return __generator(this, function (_c) {
547
- switch (_c.label) {
548
- case 0: return [4, context.endpoint()];
549
- case 1:
550
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
551
- headers = {
552
- "content-type": "application/json",
553
- };
554
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/brokers/{BrokerId}/users/{Username}";
555
- resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", function () { return input.BrokerId; }, "{BrokerId}", false);
556
- resolvedPath = __resolvedPath(resolvedPath, input, "Username", function () { return input.Username; }, "{Username}", false);
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 })));
558
- return [2, new __HttpRequest({
559
- protocol: protocol,
560
- hostname: hostname,
561
- port: port,
562
- method: "PUT",
563
- headers: headers,
564
- path: resolvedPath,
565
- body: body,
566
- })];
567
- }
122
+ };
123
+ export const serializeAws_restJson1DeleteBrokerCommand = async (input, context) => {
124
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
125
+ const headers = {};
126
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/brokers/{BrokerId}";
127
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", () => input.BrokerId, "{BrokerId}", false);
128
+ let body;
129
+ return new __HttpRequest({
130
+ protocol,
131
+ hostname,
132
+ port,
133
+ method: "DELETE",
134
+ headers,
135
+ path: resolvedPath,
136
+ body,
568
137
  });
569
- }); };
570
- export var deserializeAws_restJson1CreateBrokerCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
571
- var contents, data, _a, _b;
572
- return __generator(this, function (_c) {
573
- switch (_c.label) {
574
- case 0:
575
- if (output.statusCode !== 200 && output.statusCode >= 300) {
576
- return [2, deserializeAws_restJson1CreateBrokerCommandError(output, context)];
577
- }
578
- contents = map({
579
- $metadata: deserializeMetadata(output),
580
- });
581
- _a = __expectNonNull;
582
- _b = __expectObject;
583
- return [4, parseBody(output.body, context)];
584
- case 1:
585
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
586
- if (data.brokerArn != null) {
587
- contents.BrokerArn = __expectString(data.brokerArn);
588
- }
589
- if (data.brokerId != null) {
590
- contents.BrokerId = __expectString(data.brokerId);
591
- }
592
- return [2, contents];
593
- }
138
+ };
139
+ export const serializeAws_restJson1DeleteTagsCommand = async (input, context) => {
140
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
141
+ const headers = {};
142
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/tags/{ResourceArn}";
143
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
144
+ const query = map({
145
+ tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
146
+ });
147
+ let body;
148
+ return new __HttpRequest({
149
+ protocol,
150
+ hostname,
151
+ port,
152
+ method: "DELETE",
153
+ headers,
154
+ path: resolvedPath,
155
+ query,
156
+ body,
594
157
  });
595
- }); };
596
- var deserializeAws_restJson1CreateBrokerCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
597
- var parsedOutput, _a, errorCode, _b, parsedBody;
598
- var _c;
599
- return __generator(this, function (_d) {
600
- switch (_d.label) {
601
- case 0:
602
- _a = [__assign({}, output)];
603
- _c = {};
604
- return [4, parseBody(output.body, context)];
605
- case 1:
606
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
607
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
608
- _b = errorCode;
609
- switch (_b) {
610
- case "BadRequestException": return [3, 2];
611
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
612
- case "ConflictException": return [3, 4];
613
- case "com.amazonaws.mq#ConflictException": return [3, 4];
614
- case "ForbiddenException": return [3, 6];
615
- case "com.amazonaws.mq#ForbiddenException": return [3, 6];
616
- case "InternalServerErrorException": return [3, 8];
617
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 8];
618
- case "UnauthorizedException": return [3, 10];
619
- case "com.amazonaws.mq#UnauthorizedException": return [3, 10];
620
- }
621
- return [3, 12];
622
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
623
- case 3: throw _d.sent();
624
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
625
- case 5: throw _d.sent();
626
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
627
- case 7: throw _d.sent();
628
- case 8: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
629
- case 9: throw _d.sent();
630
- case 10: return [4, deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)];
631
- case 11: throw _d.sent();
632
- case 12:
633
- parsedBody = parsedOutput.body;
634
- throwDefaultError({
635
- output: output,
636
- parsedBody: parsedBody,
637
- exceptionCtor: __BaseException,
638
- errorCode: errorCode,
639
- });
640
- _d.label = 13;
641
- case 13: return [2];
642
- }
158
+ };
159
+ export const serializeAws_restJson1DeleteUserCommand = async (input, context) => {
160
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
161
+ const headers = {};
162
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/brokers/{BrokerId}/users/{Username}";
163
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", () => input.BrokerId, "{BrokerId}", false);
164
+ resolvedPath = __resolvedPath(resolvedPath, input, "Username", () => input.Username, "{Username}", false);
165
+ let body;
166
+ return new __HttpRequest({
167
+ protocol,
168
+ hostname,
169
+ port,
170
+ method: "DELETE",
171
+ headers,
172
+ path: resolvedPath,
173
+ body,
643
174
  });
644
- }); };
645
- export var deserializeAws_restJson1CreateConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
646
- var contents, data, _a, _b;
647
- return __generator(this, function (_c) {
648
- switch (_c.label) {
649
- case 0:
650
- if (output.statusCode !== 200 && output.statusCode >= 300) {
651
- return [2, deserializeAws_restJson1CreateConfigurationCommandError(output, context)];
652
- }
653
- contents = map({
654
- $metadata: deserializeMetadata(output),
655
- });
656
- _a = __expectNonNull;
657
- _b = __expectObject;
658
- return [4, parseBody(output.body, context)];
659
- case 1:
660
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
661
- if (data.arn != null) {
662
- contents.Arn = __expectString(data.arn);
663
- }
664
- if (data.authenticationStrategy != null) {
665
- contents.AuthenticationStrategy = __expectString(data.authenticationStrategy);
666
- }
667
- if (data.created != null) {
668
- contents.Created = __expectNonNull(__parseRfc3339DateTime(data.created));
669
- }
670
- if (data.id != null) {
671
- contents.Id = __expectString(data.id);
672
- }
673
- if (data.latestRevision != null) {
674
- contents.LatestRevision = deserializeAws_restJson1ConfigurationRevision(data.latestRevision, context);
675
- }
676
- if (data.name != null) {
677
- contents.Name = __expectString(data.name);
678
- }
679
- return [2, contents];
680
- }
175
+ };
176
+ export const serializeAws_restJson1DescribeBrokerCommand = async (input, context) => {
177
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
178
+ const headers = {};
179
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/brokers/{BrokerId}";
180
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", () => input.BrokerId, "{BrokerId}", false);
181
+ let body;
182
+ return new __HttpRequest({
183
+ protocol,
184
+ hostname,
185
+ port,
186
+ method: "GET",
187
+ headers,
188
+ path: resolvedPath,
189
+ body,
681
190
  });
682
- }); };
683
- var deserializeAws_restJson1CreateConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
684
- var parsedOutput, _a, errorCode, _b, parsedBody;
685
- var _c;
686
- return __generator(this, function (_d) {
687
- switch (_d.label) {
688
- case 0:
689
- _a = [__assign({}, output)];
690
- _c = {};
691
- return [4, parseBody(output.body, context)];
692
- case 1:
693
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
694
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
695
- _b = errorCode;
696
- switch (_b) {
697
- case "BadRequestException": return [3, 2];
698
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
699
- case "ConflictException": return [3, 4];
700
- case "com.amazonaws.mq#ConflictException": return [3, 4];
701
- case "ForbiddenException": return [3, 6];
702
- case "com.amazonaws.mq#ForbiddenException": return [3, 6];
703
- case "InternalServerErrorException": return [3, 8];
704
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 8];
705
- }
706
- return [3, 10];
707
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
708
- case 3: throw _d.sent();
709
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
710
- case 5: throw _d.sent();
711
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
712
- case 7: throw _d.sent();
713
- case 8: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
714
- case 9: throw _d.sent();
715
- case 10:
716
- parsedBody = parsedOutput.body;
717
- throwDefaultError({
718
- output: output,
719
- parsedBody: parsedBody,
720
- exceptionCtor: __BaseException,
721
- errorCode: errorCode,
722
- });
723
- _d.label = 11;
724
- case 11: return [2];
725
- }
191
+ };
192
+ export const serializeAws_restJson1DescribeBrokerEngineTypesCommand = async (input, context) => {
193
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
194
+ const headers = {};
195
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/broker-engine-types";
196
+ const query = map({
197
+ engineType: [, input.EngineType],
198
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
199
+ nextToken: [, input.NextToken],
200
+ });
201
+ let body;
202
+ return new __HttpRequest({
203
+ protocol,
204
+ hostname,
205
+ port,
206
+ method: "GET",
207
+ headers,
208
+ path: resolvedPath,
209
+ query,
210
+ body,
726
211
  });
727
- }); };
728
- export var deserializeAws_restJson1CreateTagsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
729
- var contents;
730
- return __generator(this, function (_a) {
731
- switch (_a.label) {
732
- case 0:
733
- if (output.statusCode !== 204 && output.statusCode >= 300) {
734
- return [2, deserializeAws_restJson1CreateTagsCommandError(output, context)];
735
- }
736
- contents = map({
737
- $metadata: deserializeMetadata(output),
738
- });
739
- return [4, collectBody(output.body, context)];
740
- case 1:
741
- _a.sent();
742
- return [2, contents];
743
- }
212
+ };
213
+ export const serializeAws_restJson1DescribeBrokerInstanceOptionsCommand = async (input, context) => {
214
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
215
+ const headers = {};
216
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/broker-instance-options";
217
+ const query = map({
218
+ engineType: [, input.EngineType],
219
+ hostInstanceType: [, input.HostInstanceType],
220
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
221
+ nextToken: [, input.NextToken],
222
+ storageType: [, input.StorageType],
223
+ });
224
+ let body;
225
+ return new __HttpRequest({
226
+ protocol,
227
+ hostname,
228
+ port,
229
+ method: "GET",
230
+ headers,
231
+ path: resolvedPath,
232
+ query,
233
+ body,
744
234
  });
745
- }); };
746
- var deserializeAws_restJson1CreateTagsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
747
- var parsedOutput, _a, errorCode, _b, parsedBody;
748
- var _c;
749
- return __generator(this, function (_d) {
750
- switch (_d.label) {
751
- case 0:
752
- _a = [__assign({}, output)];
753
- _c = {};
754
- return [4, parseBody(output.body, context)];
755
- case 1:
756
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
757
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
758
- _b = errorCode;
759
- switch (_b) {
760
- case "BadRequestException": return [3, 2];
761
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
762
- case "ForbiddenException": return [3, 4];
763
- case "com.amazonaws.mq#ForbiddenException": return [3, 4];
764
- case "InternalServerErrorException": return [3, 6];
765
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 6];
766
- case "NotFoundException": return [3, 8];
767
- case "com.amazonaws.mq#NotFoundException": return [3, 8];
768
- }
769
- return [3, 10];
770
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
771
- case 3: throw _d.sent();
772
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
773
- case 5: throw _d.sent();
774
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
775
- case 7: throw _d.sent();
776
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
777
- case 9: throw _d.sent();
778
- case 10:
779
- parsedBody = parsedOutput.body;
780
- throwDefaultError({
781
- output: output,
782
- parsedBody: parsedBody,
783
- exceptionCtor: __BaseException,
784
- errorCode: errorCode,
785
- });
786
- _d.label = 11;
787
- case 11: return [2];
788
- }
235
+ };
236
+ export const serializeAws_restJson1DescribeConfigurationCommand = async (input, context) => {
237
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
238
+ const headers = {};
239
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/configurations/{ConfigurationId}";
240
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationId", () => input.ConfigurationId, "{ConfigurationId}", false);
241
+ let body;
242
+ return new __HttpRequest({
243
+ protocol,
244
+ hostname,
245
+ port,
246
+ method: "GET",
247
+ headers,
248
+ path: resolvedPath,
249
+ body,
789
250
  });
790
- }); };
791
- export var deserializeAws_restJson1CreateUserCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
792
- var contents;
793
- return __generator(this, function (_a) {
794
- switch (_a.label) {
795
- case 0:
796
- if (output.statusCode !== 200 && output.statusCode >= 300) {
797
- return [2, deserializeAws_restJson1CreateUserCommandError(output, context)];
798
- }
799
- contents = map({
800
- $metadata: deserializeMetadata(output),
801
- });
802
- return [4, collectBody(output.body, context)];
803
- case 1:
804
- _a.sent();
805
- return [2, contents];
806
- }
251
+ };
252
+ export const serializeAws_restJson1DescribeConfigurationRevisionCommand = async (input, context) => {
253
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
254
+ const headers = {};
255
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
256
+ "/v1/configurations/{ConfigurationId}/revisions/{ConfigurationRevision}";
257
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationId", () => input.ConfigurationId, "{ConfigurationId}", false);
258
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationRevision", () => input.ConfigurationRevision, "{ConfigurationRevision}", false);
259
+ let body;
260
+ return new __HttpRequest({
261
+ protocol,
262
+ hostname,
263
+ port,
264
+ method: "GET",
265
+ headers,
266
+ path: resolvedPath,
267
+ body,
807
268
  });
808
- }); };
809
- var deserializeAws_restJson1CreateUserCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
810
- var parsedOutput, _a, errorCode, _b, parsedBody;
811
- var _c;
812
- return __generator(this, function (_d) {
813
- switch (_d.label) {
814
- case 0:
815
- _a = [__assign({}, output)];
816
- _c = {};
817
- return [4, parseBody(output.body, context)];
818
- case 1:
819
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
820
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
821
- _b = errorCode;
822
- switch (_b) {
823
- case "BadRequestException": return [3, 2];
824
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
825
- case "ConflictException": return [3, 4];
826
- case "com.amazonaws.mq#ConflictException": return [3, 4];
827
- case "ForbiddenException": return [3, 6];
828
- case "com.amazonaws.mq#ForbiddenException": return [3, 6];
829
- case "InternalServerErrorException": return [3, 8];
830
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 8];
831
- case "NotFoundException": return [3, 10];
832
- case "com.amazonaws.mq#NotFoundException": return [3, 10];
833
- }
834
- return [3, 12];
835
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
836
- case 3: throw _d.sent();
837
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
838
- case 5: throw _d.sent();
839
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
840
- case 7: throw _d.sent();
841
- case 8: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
842
- case 9: throw _d.sent();
843
- case 10: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
844
- case 11: throw _d.sent();
845
- case 12:
846
- parsedBody = parsedOutput.body;
847
- throwDefaultError({
848
- output: output,
849
- parsedBody: parsedBody,
850
- exceptionCtor: __BaseException,
851
- errorCode: errorCode,
852
- });
853
- _d.label = 13;
854
- case 13: return [2];
855
- }
269
+ };
270
+ export const serializeAws_restJson1DescribeUserCommand = async (input, context) => {
271
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
272
+ const headers = {};
273
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/brokers/{BrokerId}/users/{Username}";
274
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", () => input.BrokerId, "{BrokerId}", false);
275
+ resolvedPath = __resolvedPath(resolvedPath, input, "Username", () => input.Username, "{Username}", false);
276
+ let body;
277
+ return new __HttpRequest({
278
+ protocol,
279
+ hostname,
280
+ port,
281
+ method: "GET",
282
+ headers,
283
+ path: resolvedPath,
284
+ body,
856
285
  });
857
- }); };
858
- export var deserializeAws_restJson1DeleteBrokerCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
859
- var contents, data, _a, _b;
860
- return __generator(this, function (_c) {
861
- switch (_c.label) {
862
- case 0:
863
- if (output.statusCode !== 200 && output.statusCode >= 300) {
864
- return [2, deserializeAws_restJson1DeleteBrokerCommandError(output, context)];
865
- }
866
- contents = map({
867
- $metadata: deserializeMetadata(output),
868
- });
869
- _a = __expectNonNull;
870
- _b = __expectObject;
871
- return [4, parseBody(output.body, context)];
872
- case 1:
873
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
874
- if (data.brokerId != null) {
875
- contents.BrokerId = __expectString(data.brokerId);
876
- }
877
- return [2, contents];
878
- }
286
+ };
287
+ export const serializeAws_restJson1ListBrokersCommand = async (input, context) => {
288
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
289
+ const headers = {};
290
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/brokers";
291
+ const query = map({
292
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
293
+ nextToken: [, input.NextToken],
294
+ });
295
+ let body;
296
+ return new __HttpRequest({
297
+ protocol,
298
+ hostname,
299
+ port,
300
+ method: "GET",
301
+ headers,
302
+ path: resolvedPath,
303
+ query,
304
+ body,
879
305
  });
880
- }); };
881
- var deserializeAws_restJson1DeleteBrokerCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
882
- var parsedOutput, _a, errorCode, _b, parsedBody;
883
- var _c;
884
- return __generator(this, function (_d) {
885
- switch (_d.label) {
886
- case 0:
887
- _a = [__assign({}, output)];
888
- _c = {};
889
- return [4, parseBody(output.body, context)];
890
- case 1:
891
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
892
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
893
- _b = errorCode;
894
- switch (_b) {
895
- case "BadRequestException": return [3, 2];
896
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
897
- case "ForbiddenException": return [3, 4];
898
- case "com.amazonaws.mq#ForbiddenException": return [3, 4];
899
- case "InternalServerErrorException": return [3, 6];
900
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 6];
901
- case "NotFoundException": return [3, 8];
902
- case "com.amazonaws.mq#NotFoundException": return [3, 8];
903
- }
904
- return [3, 10];
905
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
906
- case 3: throw _d.sent();
907
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
908
- case 5: throw _d.sent();
909
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
910
- case 7: throw _d.sent();
911
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
912
- case 9: throw _d.sent();
913
- case 10:
914
- parsedBody = parsedOutput.body;
915
- throwDefaultError({
916
- output: output,
917
- parsedBody: parsedBody,
918
- exceptionCtor: __BaseException,
919
- errorCode: errorCode,
920
- });
921
- _d.label = 11;
922
- case 11: return [2];
923
- }
306
+ };
307
+ export const serializeAws_restJson1ListConfigurationRevisionsCommand = async (input, context) => {
308
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
309
+ const headers = {};
310
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
311
+ "/v1/configurations/{ConfigurationId}/revisions";
312
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationId", () => input.ConfigurationId, "{ConfigurationId}", false);
313
+ const query = map({
314
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
315
+ nextToken: [, input.NextToken],
316
+ });
317
+ let body;
318
+ return new __HttpRequest({
319
+ protocol,
320
+ hostname,
321
+ port,
322
+ method: "GET",
323
+ headers,
324
+ path: resolvedPath,
325
+ query,
326
+ body,
924
327
  });
925
- }); };
926
- export var deserializeAws_restJson1DeleteTagsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
927
- var contents;
928
- return __generator(this, function (_a) {
929
- switch (_a.label) {
930
- case 0:
931
- if (output.statusCode !== 204 && output.statusCode >= 300) {
932
- return [2, deserializeAws_restJson1DeleteTagsCommandError(output, context)];
933
- }
934
- contents = map({
935
- $metadata: deserializeMetadata(output),
936
- });
937
- return [4, collectBody(output.body, context)];
938
- case 1:
939
- _a.sent();
940
- return [2, contents];
941
- }
328
+ };
329
+ export const serializeAws_restJson1ListConfigurationsCommand = async (input, context) => {
330
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
331
+ const headers = {};
332
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/configurations";
333
+ const query = map({
334
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
335
+ nextToken: [, input.NextToken],
336
+ });
337
+ let body;
338
+ return new __HttpRequest({
339
+ protocol,
340
+ hostname,
341
+ port,
342
+ method: "GET",
343
+ headers,
344
+ path: resolvedPath,
345
+ query,
346
+ body,
942
347
  });
943
- }); };
944
- var deserializeAws_restJson1DeleteTagsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
945
- var parsedOutput, _a, errorCode, _b, parsedBody;
946
- var _c;
947
- return __generator(this, function (_d) {
948
- switch (_d.label) {
949
- case 0:
950
- _a = [__assign({}, output)];
951
- _c = {};
952
- return [4, parseBody(output.body, context)];
953
- case 1:
954
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
955
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
956
- _b = errorCode;
957
- switch (_b) {
958
- case "BadRequestException": return [3, 2];
959
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
960
- case "ForbiddenException": return [3, 4];
961
- case "com.amazonaws.mq#ForbiddenException": return [3, 4];
962
- case "InternalServerErrorException": return [3, 6];
963
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 6];
964
- case "NotFoundException": return [3, 8];
965
- case "com.amazonaws.mq#NotFoundException": return [3, 8];
966
- }
967
- return [3, 10];
968
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
969
- case 3: throw _d.sent();
970
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
971
- case 5: throw _d.sent();
972
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
973
- case 7: throw _d.sent();
974
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
975
- case 9: throw _d.sent();
976
- case 10:
977
- parsedBody = parsedOutput.body;
978
- throwDefaultError({
979
- output: output,
980
- parsedBody: parsedBody,
981
- exceptionCtor: __BaseException,
982
- errorCode: errorCode,
983
- });
984
- _d.label = 11;
985
- case 11: return [2];
986
- }
348
+ };
349
+ export const serializeAws_restJson1ListTagsCommand = async (input, context) => {
350
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
351
+ const headers = {};
352
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/tags/{ResourceArn}";
353
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
354
+ let body;
355
+ return new __HttpRequest({
356
+ protocol,
357
+ hostname,
358
+ port,
359
+ method: "GET",
360
+ headers,
361
+ path: resolvedPath,
362
+ body,
987
363
  });
988
- }); };
989
- export var deserializeAws_restJson1DeleteUserCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
990
- var contents;
991
- return __generator(this, function (_a) {
992
- switch (_a.label) {
993
- case 0:
994
- if (output.statusCode !== 200 && output.statusCode >= 300) {
995
- return [2, deserializeAws_restJson1DeleteUserCommandError(output, context)];
996
- }
997
- contents = map({
998
- $metadata: deserializeMetadata(output),
999
- });
1000
- return [4, collectBody(output.body, context)];
1001
- case 1:
1002
- _a.sent();
1003
- return [2, contents];
1004
- }
364
+ };
365
+ export const serializeAws_restJson1ListUsersCommand = async (input, context) => {
366
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
367
+ const headers = {};
368
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/brokers/{BrokerId}/users";
369
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", () => input.BrokerId, "{BrokerId}", false);
370
+ const query = map({
371
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
372
+ nextToken: [, input.NextToken],
373
+ });
374
+ let body;
375
+ return new __HttpRequest({
376
+ protocol,
377
+ hostname,
378
+ port,
379
+ method: "GET",
380
+ headers,
381
+ path: resolvedPath,
382
+ query,
383
+ body,
1005
384
  });
1006
- }); };
1007
- var deserializeAws_restJson1DeleteUserCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1008
- var parsedOutput, _a, errorCode, _b, parsedBody;
1009
- var _c;
1010
- return __generator(this, function (_d) {
1011
- switch (_d.label) {
1012
- case 0:
1013
- _a = [__assign({}, output)];
1014
- _c = {};
1015
- return [4, parseBody(output.body, context)];
1016
- case 1:
1017
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1018
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1019
- _b = errorCode;
1020
- switch (_b) {
1021
- case "BadRequestException": return [3, 2];
1022
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
1023
- case "ForbiddenException": return [3, 4];
1024
- case "com.amazonaws.mq#ForbiddenException": return [3, 4];
1025
- case "InternalServerErrorException": return [3, 6];
1026
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 6];
1027
- case "NotFoundException": return [3, 8];
1028
- case "com.amazonaws.mq#NotFoundException": return [3, 8];
1029
- }
1030
- return [3, 10];
1031
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1032
- case 3: throw _d.sent();
1033
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1034
- case 5: throw _d.sent();
1035
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1036
- case 7: throw _d.sent();
1037
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1038
- case 9: throw _d.sent();
1039
- case 10:
1040
- parsedBody = parsedOutput.body;
1041
- throwDefaultError({
1042
- output: output,
1043
- parsedBody: parsedBody,
1044
- exceptionCtor: __BaseException,
1045
- errorCode: errorCode,
1046
- });
1047
- _d.label = 11;
1048
- case 11: return [2];
1049
- }
385
+ };
386
+ export const serializeAws_restJson1RebootBrokerCommand = async (input, context) => {
387
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
388
+ const headers = {};
389
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/brokers/{BrokerId}/reboot";
390
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", () => input.BrokerId, "{BrokerId}", false);
391
+ let body;
392
+ return new __HttpRequest({
393
+ protocol,
394
+ hostname,
395
+ port,
396
+ method: "POST",
397
+ headers,
398
+ path: resolvedPath,
399
+ body,
1050
400
  });
1051
- }); };
1052
- export var deserializeAws_restJson1DescribeBrokerCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1053
- var contents, data, _a, _b;
1054
- return __generator(this, function (_c) {
1055
- switch (_c.label) {
1056
- case 0:
1057
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1058
- return [2, deserializeAws_restJson1DescribeBrokerCommandError(output, context)];
1059
- }
1060
- contents = map({
1061
- $metadata: deserializeMetadata(output),
1062
- });
1063
- _a = __expectNonNull;
1064
- _b = __expectObject;
1065
- return [4, parseBody(output.body, context)];
1066
- case 1:
1067
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1068
- if (data.actionsRequired != null) {
1069
- contents.ActionsRequired = deserializeAws_restJson1__listOfActionRequired(data.actionsRequired, context);
1070
- }
1071
- if (data.authenticationStrategy != null) {
1072
- contents.AuthenticationStrategy = __expectString(data.authenticationStrategy);
1073
- }
1074
- if (data.autoMinorVersionUpgrade != null) {
1075
- contents.AutoMinorVersionUpgrade = __expectBoolean(data.autoMinorVersionUpgrade);
1076
- }
1077
- if (data.brokerArn != null) {
1078
- contents.BrokerArn = __expectString(data.brokerArn);
1079
- }
1080
- if (data.brokerId != null) {
1081
- contents.BrokerId = __expectString(data.brokerId);
1082
- }
1083
- if (data.brokerInstances != null) {
1084
- contents.BrokerInstances = deserializeAws_restJson1__listOfBrokerInstance(data.brokerInstances, context);
1085
- }
1086
- if (data.brokerName != null) {
1087
- contents.BrokerName = __expectString(data.brokerName);
1088
- }
1089
- if (data.brokerState != null) {
1090
- contents.BrokerState = __expectString(data.brokerState);
1091
- }
1092
- if (data.configurations != null) {
1093
- contents.Configurations = deserializeAws_restJson1Configurations(data.configurations, context);
1094
- }
1095
- if (data.created != null) {
1096
- contents.Created = __expectNonNull(__parseRfc3339DateTime(data.created));
1097
- }
1098
- if (data.deploymentMode != null) {
1099
- contents.DeploymentMode = __expectString(data.deploymentMode);
1100
- }
1101
- if (data.encryptionOptions != null) {
1102
- contents.EncryptionOptions = deserializeAws_restJson1EncryptionOptions(data.encryptionOptions, context);
1103
- }
1104
- if (data.engineType != null) {
1105
- contents.EngineType = __expectString(data.engineType);
1106
- }
1107
- if (data.engineVersion != null) {
1108
- contents.EngineVersion = __expectString(data.engineVersion);
1109
- }
1110
- if (data.hostInstanceType != null) {
1111
- contents.HostInstanceType = __expectString(data.hostInstanceType);
1112
- }
1113
- if (data.ldapServerMetadata != null) {
1114
- contents.LdapServerMetadata = deserializeAws_restJson1LdapServerMetadataOutput(data.ldapServerMetadata, context);
1115
- }
1116
- if (data.logs != null) {
1117
- contents.Logs = deserializeAws_restJson1LogsSummary(data.logs, context);
1118
- }
1119
- if (data.maintenanceWindowStartTime != null) {
1120
- contents.MaintenanceWindowStartTime = deserializeAws_restJson1WeeklyStartTime(data.maintenanceWindowStartTime, context);
1121
- }
1122
- if (data.pendingAuthenticationStrategy != null) {
1123
- contents.PendingAuthenticationStrategy = __expectString(data.pendingAuthenticationStrategy);
1124
- }
1125
- if (data.pendingEngineVersion != null) {
1126
- contents.PendingEngineVersion = __expectString(data.pendingEngineVersion);
1127
- }
1128
- if (data.pendingHostInstanceType != null) {
1129
- contents.PendingHostInstanceType = __expectString(data.pendingHostInstanceType);
1130
- }
1131
- if (data.pendingLdapServerMetadata != null) {
1132
- contents.PendingLdapServerMetadata = deserializeAws_restJson1LdapServerMetadataOutput(data.pendingLdapServerMetadata, context);
1133
- }
1134
- if (data.pendingSecurityGroups != null) {
1135
- contents.PendingSecurityGroups = deserializeAws_restJson1__listOf__string(data.pendingSecurityGroups, context);
1136
- }
1137
- if (data.publiclyAccessible != null) {
1138
- contents.PubliclyAccessible = __expectBoolean(data.publiclyAccessible);
1139
- }
1140
- if (data.securityGroups != null) {
1141
- contents.SecurityGroups = deserializeAws_restJson1__listOf__string(data.securityGroups, context);
1142
- }
1143
- if (data.storageType != null) {
1144
- contents.StorageType = __expectString(data.storageType);
1145
- }
1146
- if (data.subnetIds != null) {
1147
- contents.SubnetIds = deserializeAws_restJson1__listOf__string(data.subnetIds, context);
1148
- }
1149
- if (data.tags != null) {
1150
- contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
1151
- }
1152
- if (data.users != null) {
1153
- contents.Users = deserializeAws_restJson1__listOfUserSummary(data.users, context);
1154
- }
1155
- return [2, contents];
1156
- }
401
+ };
402
+ export const serializeAws_restJson1UpdateBrokerCommand = async (input, context) => {
403
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
404
+ const headers = {
405
+ "content-type": "application/json",
406
+ };
407
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/brokers/{BrokerId}";
408
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", () => input.BrokerId, "{BrokerId}", false);
409
+ let body;
410
+ body = JSON.stringify({
411
+ ...(input.AuthenticationStrategy != null && { authenticationStrategy: input.AuthenticationStrategy }),
412
+ ...(input.AutoMinorVersionUpgrade != null && { autoMinorVersionUpgrade: input.AutoMinorVersionUpgrade }),
413
+ ...(input.Configuration != null && {
414
+ configuration: serializeAws_restJson1ConfigurationId(input.Configuration, context),
415
+ }),
416
+ ...(input.EngineVersion != null && { engineVersion: input.EngineVersion }),
417
+ ...(input.HostInstanceType != null && { hostInstanceType: input.HostInstanceType }),
418
+ ...(input.LdapServerMetadata != null && {
419
+ ldapServerMetadata: serializeAws_restJson1LdapServerMetadataInput(input.LdapServerMetadata, context),
420
+ }),
421
+ ...(input.Logs != null && { logs: serializeAws_restJson1Logs(input.Logs, context) }),
422
+ ...(input.MaintenanceWindowStartTime != null && {
423
+ maintenanceWindowStartTime: serializeAws_restJson1WeeklyStartTime(input.MaintenanceWindowStartTime, context),
424
+ }),
425
+ ...(input.SecurityGroups != null && {
426
+ securityGroups: serializeAws_restJson1__listOf__string(input.SecurityGroups, context),
427
+ }),
428
+ });
429
+ return new __HttpRequest({
430
+ protocol,
431
+ hostname,
432
+ port,
433
+ method: "PUT",
434
+ headers,
435
+ path: resolvedPath,
436
+ body,
1157
437
  });
1158
- }); };
1159
- var deserializeAws_restJson1DescribeBrokerCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1160
- var parsedOutput, _a, errorCode, _b, parsedBody;
1161
- var _c;
1162
- return __generator(this, function (_d) {
1163
- switch (_d.label) {
1164
- case 0:
1165
- _a = [__assign({}, output)];
1166
- _c = {};
1167
- return [4, parseBody(output.body, context)];
1168
- case 1:
1169
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1170
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1171
- _b = errorCode;
1172
- switch (_b) {
1173
- case "BadRequestException": return [3, 2];
1174
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
1175
- case "ForbiddenException": return [3, 4];
1176
- case "com.amazonaws.mq#ForbiddenException": return [3, 4];
1177
- case "InternalServerErrorException": return [3, 6];
1178
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 6];
1179
- case "NotFoundException": return [3, 8];
1180
- case "com.amazonaws.mq#NotFoundException": return [3, 8];
1181
- }
1182
- return [3, 10];
1183
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1184
- case 3: throw _d.sent();
1185
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1186
- case 5: throw _d.sent();
1187
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1188
- case 7: throw _d.sent();
1189
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1190
- case 9: throw _d.sent();
1191
- case 10:
1192
- parsedBody = parsedOutput.body;
1193
- throwDefaultError({
1194
- output: output,
1195
- parsedBody: parsedBody,
1196
- exceptionCtor: __BaseException,
1197
- errorCode: errorCode,
1198
- });
1199
- _d.label = 11;
1200
- case 11: return [2];
1201
- }
438
+ };
439
+ export const serializeAws_restJson1UpdateConfigurationCommand = async (input, context) => {
440
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
441
+ const headers = {
442
+ "content-type": "application/json",
443
+ };
444
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/configurations/{ConfigurationId}";
445
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationId", () => input.ConfigurationId, "{ConfigurationId}", false);
446
+ let body;
447
+ body = JSON.stringify({
448
+ ...(input.Data != null && { data: input.Data }),
449
+ ...(input.Description != null && { description: input.Description }),
450
+ });
451
+ return new __HttpRequest({
452
+ protocol,
453
+ hostname,
454
+ port,
455
+ method: "PUT",
456
+ headers,
457
+ path: resolvedPath,
458
+ body,
1202
459
  });
1203
- }); };
1204
- export var deserializeAws_restJson1DescribeBrokerEngineTypesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1205
- var contents, data, _a, _b;
1206
- return __generator(this, function (_c) {
1207
- switch (_c.label) {
1208
- case 0:
1209
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1210
- return [2, deserializeAws_restJson1DescribeBrokerEngineTypesCommandError(output, context)];
1211
- }
1212
- contents = map({
1213
- $metadata: deserializeMetadata(output),
1214
- });
1215
- _a = __expectNonNull;
1216
- _b = __expectObject;
1217
- return [4, parseBody(output.body, context)];
1218
- case 1:
1219
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1220
- if (data.brokerEngineTypes != null) {
1221
- contents.BrokerEngineTypes = deserializeAws_restJson1__listOfBrokerEngineType(data.brokerEngineTypes, context);
1222
- }
1223
- if (data.maxResults != null) {
1224
- contents.MaxResults = __expectInt32(data.maxResults);
1225
- }
1226
- if (data.nextToken != null) {
1227
- contents.NextToken = __expectString(data.nextToken);
1228
- }
1229
- return [2, contents];
1230
- }
460
+ };
461
+ export const serializeAws_restJson1UpdateUserCommand = async (input, context) => {
462
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
463
+ const headers = {
464
+ "content-type": "application/json",
465
+ };
466
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/brokers/{BrokerId}/users/{Username}";
467
+ resolvedPath = __resolvedPath(resolvedPath, input, "BrokerId", () => input.BrokerId, "{BrokerId}", false);
468
+ resolvedPath = __resolvedPath(resolvedPath, input, "Username", () => input.Username, "{Username}", false);
469
+ let body;
470
+ body = JSON.stringify({
471
+ ...(input.ConsoleAccess != null && { consoleAccess: input.ConsoleAccess }),
472
+ ...(input.Groups != null && { groups: serializeAws_restJson1__listOf__string(input.Groups, context) }),
473
+ ...(input.Password != null && { password: input.Password }),
474
+ });
475
+ return new __HttpRequest({
476
+ protocol,
477
+ hostname,
478
+ port,
479
+ method: "PUT",
480
+ headers,
481
+ path: resolvedPath,
482
+ body,
1231
483
  });
1232
- }); };
1233
- var deserializeAws_restJson1DescribeBrokerEngineTypesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1234
- var parsedOutput, _a, errorCode, _b, parsedBody;
1235
- var _c;
1236
- return __generator(this, function (_d) {
1237
- switch (_d.label) {
1238
- case 0:
1239
- _a = [__assign({}, output)];
1240
- _c = {};
1241
- return [4, parseBody(output.body, context)];
1242
- case 1:
1243
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1244
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1245
- _b = errorCode;
1246
- switch (_b) {
1247
- case "BadRequestException": return [3, 2];
1248
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
1249
- case "ForbiddenException": return [3, 4];
1250
- case "com.amazonaws.mq#ForbiddenException": return [3, 4];
1251
- case "InternalServerErrorException": return [3, 6];
1252
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 6];
1253
- }
1254
- return [3, 8];
1255
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1256
- case 3: throw _d.sent();
1257
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1258
- case 5: throw _d.sent();
1259
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1260
- case 7: throw _d.sent();
1261
- case 8:
1262
- parsedBody = parsedOutput.body;
1263
- throwDefaultError({
1264
- output: output,
1265
- parsedBody: parsedBody,
1266
- exceptionCtor: __BaseException,
1267
- errorCode: errorCode,
1268
- });
1269
- _d.label = 9;
1270
- case 9: return [2];
1271
- }
484
+ };
485
+ export const deserializeAws_restJson1CreateBrokerCommand = async (output, context) => {
486
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
487
+ return deserializeAws_restJson1CreateBrokerCommandError(output, context);
488
+ }
489
+ const contents = map({
490
+ $metadata: deserializeMetadata(output),
1272
491
  });
1273
- }); };
1274
- export var deserializeAws_restJson1DescribeBrokerInstanceOptionsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1275
- var contents, data, _a, _b;
1276
- return __generator(this, function (_c) {
1277
- switch (_c.label) {
1278
- case 0:
1279
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1280
- return [2, deserializeAws_restJson1DescribeBrokerInstanceOptionsCommandError(output, context)];
1281
- }
1282
- contents = map({
1283
- $metadata: deserializeMetadata(output),
1284
- });
1285
- _a = __expectNonNull;
1286
- _b = __expectObject;
1287
- return [4, parseBody(output.body, context)];
1288
- case 1:
1289
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1290
- if (data.brokerInstanceOptions != null) {
1291
- contents.BrokerInstanceOptions = deserializeAws_restJson1__listOfBrokerInstanceOption(data.brokerInstanceOptions, context);
1292
- }
1293
- if (data.maxResults != null) {
1294
- contents.MaxResults = __expectInt32(data.maxResults);
1295
- }
1296
- if (data.nextToken != null) {
1297
- contents.NextToken = __expectString(data.nextToken);
1298
- }
1299
- return [2, contents];
1300
- }
492
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
493
+ if (data.brokerArn != null) {
494
+ contents.BrokerArn = __expectString(data.brokerArn);
495
+ }
496
+ if (data.brokerId != null) {
497
+ contents.BrokerId = __expectString(data.brokerId);
498
+ }
499
+ return contents;
500
+ };
501
+ const deserializeAws_restJson1CreateBrokerCommandError = async (output, context) => {
502
+ const parsedOutput = {
503
+ ...output,
504
+ body: await parseErrorBody(output.body, context),
505
+ };
506
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
507
+ switch (errorCode) {
508
+ case "BadRequestException":
509
+ case "com.amazonaws.mq#BadRequestException":
510
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
511
+ case "ConflictException":
512
+ case "com.amazonaws.mq#ConflictException":
513
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
514
+ case "ForbiddenException":
515
+ case "com.amazonaws.mq#ForbiddenException":
516
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
517
+ case "InternalServerErrorException":
518
+ case "com.amazonaws.mq#InternalServerErrorException":
519
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
520
+ case "UnauthorizedException":
521
+ case "com.amazonaws.mq#UnauthorizedException":
522
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
523
+ default:
524
+ const parsedBody = parsedOutput.body;
525
+ throwDefaultError({
526
+ output,
527
+ parsedBody,
528
+ exceptionCtor: __BaseException,
529
+ errorCode,
530
+ });
531
+ }
532
+ };
533
+ export const deserializeAws_restJson1CreateConfigurationCommand = async (output, context) => {
534
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
535
+ return deserializeAws_restJson1CreateConfigurationCommandError(output, context);
536
+ }
537
+ const contents = map({
538
+ $metadata: deserializeMetadata(output),
1301
539
  });
1302
- }); };
1303
- var deserializeAws_restJson1DescribeBrokerInstanceOptionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1304
- var parsedOutput, _a, errorCode, _b, parsedBody;
1305
- var _c;
1306
- return __generator(this, function (_d) {
1307
- switch (_d.label) {
1308
- case 0:
1309
- _a = [__assign({}, output)];
1310
- _c = {};
1311
- return [4, parseBody(output.body, context)];
1312
- case 1:
1313
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1314
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1315
- _b = errorCode;
1316
- switch (_b) {
1317
- case "BadRequestException": return [3, 2];
1318
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
1319
- case "ForbiddenException": return [3, 4];
1320
- case "com.amazonaws.mq#ForbiddenException": return [3, 4];
1321
- case "InternalServerErrorException": return [3, 6];
1322
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 6];
1323
- }
1324
- return [3, 8];
1325
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1326
- case 3: throw _d.sent();
1327
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1328
- case 5: throw _d.sent();
1329
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1330
- case 7: throw _d.sent();
1331
- case 8:
1332
- parsedBody = parsedOutput.body;
1333
- throwDefaultError({
1334
- output: output,
1335
- parsedBody: parsedBody,
1336
- exceptionCtor: __BaseException,
1337
- errorCode: errorCode,
1338
- });
1339
- _d.label = 9;
1340
- case 9: return [2];
1341
- }
540
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
541
+ if (data.arn != null) {
542
+ contents.Arn = __expectString(data.arn);
543
+ }
544
+ if (data.authenticationStrategy != null) {
545
+ contents.AuthenticationStrategy = __expectString(data.authenticationStrategy);
546
+ }
547
+ if (data.created != null) {
548
+ contents.Created = __expectNonNull(__parseRfc3339DateTime(data.created));
549
+ }
550
+ if (data.id != null) {
551
+ contents.Id = __expectString(data.id);
552
+ }
553
+ if (data.latestRevision != null) {
554
+ contents.LatestRevision = deserializeAws_restJson1ConfigurationRevision(data.latestRevision, context);
555
+ }
556
+ if (data.name != null) {
557
+ contents.Name = __expectString(data.name);
558
+ }
559
+ return contents;
560
+ };
561
+ const deserializeAws_restJson1CreateConfigurationCommandError = async (output, context) => {
562
+ const parsedOutput = {
563
+ ...output,
564
+ body: await parseErrorBody(output.body, context),
565
+ };
566
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
567
+ switch (errorCode) {
568
+ case "BadRequestException":
569
+ case "com.amazonaws.mq#BadRequestException":
570
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
571
+ case "ConflictException":
572
+ case "com.amazonaws.mq#ConflictException":
573
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
574
+ case "ForbiddenException":
575
+ case "com.amazonaws.mq#ForbiddenException":
576
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
577
+ case "InternalServerErrorException":
578
+ case "com.amazonaws.mq#InternalServerErrorException":
579
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
580
+ default:
581
+ const parsedBody = parsedOutput.body;
582
+ throwDefaultError({
583
+ output,
584
+ parsedBody,
585
+ exceptionCtor: __BaseException,
586
+ errorCode,
587
+ });
588
+ }
589
+ };
590
+ export const deserializeAws_restJson1CreateTagsCommand = async (output, context) => {
591
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
592
+ return deserializeAws_restJson1CreateTagsCommandError(output, context);
593
+ }
594
+ const contents = map({
595
+ $metadata: deserializeMetadata(output),
1342
596
  });
1343
- }); };
1344
- export var deserializeAws_restJson1DescribeConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1345
- var contents, data, _a, _b;
1346
- return __generator(this, function (_c) {
1347
- switch (_c.label) {
1348
- case 0:
1349
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1350
- return [2, deserializeAws_restJson1DescribeConfigurationCommandError(output, context)];
1351
- }
1352
- contents = map({
1353
- $metadata: deserializeMetadata(output),
1354
- });
1355
- _a = __expectNonNull;
1356
- _b = __expectObject;
1357
- return [4, parseBody(output.body, context)];
1358
- case 1:
1359
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1360
- if (data.arn != null) {
1361
- contents.Arn = __expectString(data.arn);
1362
- }
1363
- if (data.authenticationStrategy != null) {
1364
- contents.AuthenticationStrategy = __expectString(data.authenticationStrategy);
1365
- }
1366
- if (data.created != null) {
1367
- contents.Created = __expectNonNull(__parseRfc3339DateTime(data.created));
1368
- }
1369
- if (data.description != null) {
1370
- contents.Description = __expectString(data.description);
1371
- }
1372
- if (data.engineType != null) {
1373
- contents.EngineType = __expectString(data.engineType);
1374
- }
1375
- if (data.engineVersion != null) {
1376
- contents.EngineVersion = __expectString(data.engineVersion);
1377
- }
1378
- if (data.id != null) {
1379
- contents.Id = __expectString(data.id);
1380
- }
1381
- if (data.latestRevision != null) {
1382
- contents.LatestRevision = deserializeAws_restJson1ConfigurationRevision(data.latestRevision, context);
1383
- }
1384
- if (data.name != null) {
1385
- contents.Name = __expectString(data.name);
1386
- }
1387
- if (data.tags != null) {
1388
- contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
1389
- }
1390
- return [2, contents];
1391
- }
597
+ await collectBody(output.body, context);
598
+ return contents;
599
+ };
600
+ const deserializeAws_restJson1CreateTagsCommandError = async (output, context) => {
601
+ const parsedOutput = {
602
+ ...output,
603
+ body: await parseErrorBody(output.body, context),
604
+ };
605
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
606
+ switch (errorCode) {
607
+ case "BadRequestException":
608
+ case "com.amazonaws.mq#BadRequestException":
609
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
610
+ case "ForbiddenException":
611
+ case "com.amazonaws.mq#ForbiddenException":
612
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
613
+ case "InternalServerErrorException":
614
+ case "com.amazonaws.mq#InternalServerErrorException":
615
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
616
+ case "NotFoundException":
617
+ case "com.amazonaws.mq#NotFoundException":
618
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
619
+ default:
620
+ const parsedBody = parsedOutput.body;
621
+ throwDefaultError({
622
+ output,
623
+ parsedBody,
624
+ exceptionCtor: __BaseException,
625
+ errorCode,
626
+ });
627
+ }
628
+ };
629
+ export const deserializeAws_restJson1CreateUserCommand = async (output, context) => {
630
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
631
+ return deserializeAws_restJson1CreateUserCommandError(output, context);
632
+ }
633
+ const contents = map({
634
+ $metadata: deserializeMetadata(output),
1392
635
  });
1393
- }); };
1394
- var deserializeAws_restJson1DescribeConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1395
- var parsedOutput, _a, errorCode, _b, parsedBody;
1396
- var _c;
1397
- return __generator(this, function (_d) {
1398
- switch (_d.label) {
1399
- case 0:
1400
- _a = [__assign({}, output)];
1401
- _c = {};
1402
- return [4, parseBody(output.body, context)];
1403
- case 1:
1404
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1405
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1406
- _b = errorCode;
1407
- switch (_b) {
1408
- case "BadRequestException": return [3, 2];
1409
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
1410
- case "ForbiddenException": return [3, 4];
1411
- case "com.amazonaws.mq#ForbiddenException": return [3, 4];
1412
- case "InternalServerErrorException": return [3, 6];
1413
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 6];
1414
- case "NotFoundException": return [3, 8];
1415
- case "com.amazonaws.mq#NotFoundException": return [3, 8];
1416
- }
1417
- return [3, 10];
1418
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1419
- case 3: throw _d.sent();
1420
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1421
- case 5: throw _d.sent();
1422
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1423
- case 7: throw _d.sent();
1424
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1425
- case 9: throw _d.sent();
1426
- case 10:
1427
- parsedBody = parsedOutput.body;
1428
- throwDefaultError({
1429
- output: output,
1430
- parsedBody: parsedBody,
1431
- exceptionCtor: __BaseException,
1432
- errorCode: errorCode,
1433
- });
1434
- _d.label = 11;
1435
- case 11: return [2];
1436
- }
636
+ await collectBody(output.body, context);
637
+ return contents;
638
+ };
639
+ const deserializeAws_restJson1CreateUserCommandError = async (output, context) => {
640
+ const parsedOutput = {
641
+ ...output,
642
+ body: await parseErrorBody(output.body, context),
643
+ };
644
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
645
+ switch (errorCode) {
646
+ case "BadRequestException":
647
+ case "com.amazonaws.mq#BadRequestException":
648
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
649
+ case "ConflictException":
650
+ case "com.amazonaws.mq#ConflictException":
651
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
652
+ case "ForbiddenException":
653
+ case "com.amazonaws.mq#ForbiddenException":
654
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
655
+ case "InternalServerErrorException":
656
+ case "com.amazonaws.mq#InternalServerErrorException":
657
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
658
+ case "NotFoundException":
659
+ case "com.amazonaws.mq#NotFoundException":
660
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
661
+ default:
662
+ const parsedBody = parsedOutput.body;
663
+ throwDefaultError({
664
+ output,
665
+ parsedBody,
666
+ exceptionCtor: __BaseException,
667
+ errorCode,
668
+ });
669
+ }
670
+ };
671
+ export const deserializeAws_restJson1DeleteBrokerCommand = async (output, context) => {
672
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
673
+ return deserializeAws_restJson1DeleteBrokerCommandError(output, context);
674
+ }
675
+ const contents = map({
676
+ $metadata: deserializeMetadata(output),
1437
677
  });
1438
- }); };
1439
- export var deserializeAws_restJson1DescribeConfigurationRevisionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1440
- var contents, data, _a, _b;
1441
- return __generator(this, function (_c) {
1442
- switch (_c.label) {
1443
- case 0:
1444
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1445
- return [2, deserializeAws_restJson1DescribeConfigurationRevisionCommandError(output, context)];
1446
- }
1447
- contents = map({
1448
- $metadata: deserializeMetadata(output),
1449
- });
1450
- _a = __expectNonNull;
1451
- _b = __expectObject;
1452
- return [4, parseBody(output.body, context)];
1453
- case 1:
1454
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1455
- if (data.configurationId != null) {
1456
- contents.ConfigurationId = __expectString(data.configurationId);
1457
- }
1458
- if (data.created != null) {
1459
- contents.Created = __expectNonNull(__parseRfc3339DateTime(data.created));
1460
- }
1461
- if (data.data != null) {
1462
- contents.Data = __expectString(data.data);
1463
- }
1464
- if (data.description != null) {
1465
- contents.Description = __expectString(data.description);
1466
- }
1467
- return [2, contents];
1468
- }
678
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
679
+ if (data.brokerId != null) {
680
+ contents.BrokerId = __expectString(data.brokerId);
681
+ }
682
+ return contents;
683
+ };
684
+ const deserializeAws_restJson1DeleteBrokerCommandError = async (output, context) => {
685
+ const parsedOutput = {
686
+ ...output,
687
+ body: await parseErrorBody(output.body, context),
688
+ };
689
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
690
+ switch (errorCode) {
691
+ case "BadRequestException":
692
+ case "com.amazonaws.mq#BadRequestException":
693
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
694
+ case "ForbiddenException":
695
+ case "com.amazonaws.mq#ForbiddenException":
696
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
697
+ case "InternalServerErrorException":
698
+ case "com.amazonaws.mq#InternalServerErrorException":
699
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
700
+ case "NotFoundException":
701
+ case "com.amazonaws.mq#NotFoundException":
702
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
703
+ default:
704
+ const parsedBody = parsedOutput.body;
705
+ throwDefaultError({
706
+ output,
707
+ parsedBody,
708
+ exceptionCtor: __BaseException,
709
+ errorCode,
710
+ });
711
+ }
712
+ };
713
+ export const deserializeAws_restJson1DeleteTagsCommand = async (output, context) => {
714
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
715
+ return deserializeAws_restJson1DeleteTagsCommandError(output, context);
716
+ }
717
+ const contents = map({
718
+ $metadata: deserializeMetadata(output),
1469
719
  });
1470
- }); };
1471
- var deserializeAws_restJson1DescribeConfigurationRevisionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1472
- var parsedOutput, _a, errorCode, _b, parsedBody;
1473
- var _c;
1474
- return __generator(this, function (_d) {
1475
- switch (_d.label) {
1476
- case 0:
1477
- _a = [__assign({}, output)];
1478
- _c = {};
1479
- return [4, parseBody(output.body, context)];
1480
- case 1:
1481
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1482
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1483
- _b = errorCode;
1484
- switch (_b) {
1485
- case "BadRequestException": return [3, 2];
1486
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
1487
- case "ForbiddenException": return [3, 4];
1488
- case "com.amazonaws.mq#ForbiddenException": return [3, 4];
1489
- case "InternalServerErrorException": return [3, 6];
1490
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 6];
1491
- case "NotFoundException": return [3, 8];
1492
- case "com.amazonaws.mq#NotFoundException": return [3, 8];
1493
- }
1494
- return [3, 10];
1495
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1496
- case 3: throw _d.sent();
1497
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1498
- case 5: throw _d.sent();
1499
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1500
- case 7: throw _d.sent();
1501
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1502
- case 9: throw _d.sent();
1503
- case 10:
1504
- parsedBody = parsedOutput.body;
1505
- throwDefaultError({
1506
- output: output,
1507
- parsedBody: parsedBody,
1508
- exceptionCtor: __BaseException,
1509
- errorCode: errorCode,
1510
- });
1511
- _d.label = 11;
1512
- case 11: return [2];
1513
- }
720
+ await collectBody(output.body, context);
721
+ return contents;
722
+ };
723
+ const deserializeAws_restJson1DeleteTagsCommandError = async (output, context) => {
724
+ const parsedOutput = {
725
+ ...output,
726
+ body: await parseErrorBody(output.body, context),
727
+ };
728
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
729
+ switch (errorCode) {
730
+ case "BadRequestException":
731
+ case "com.amazonaws.mq#BadRequestException":
732
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
733
+ case "ForbiddenException":
734
+ case "com.amazonaws.mq#ForbiddenException":
735
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
736
+ case "InternalServerErrorException":
737
+ case "com.amazonaws.mq#InternalServerErrorException":
738
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
739
+ case "NotFoundException":
740
+ case "com.amazonaws.mq#NotFoundException":
741
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
742
+ default:
743
+ const parsedBody = parsedOutput.body;
744
+ throwDefaultError({
745
+ output,
746
+ parsedBody,
747
+ exceptionCtor: __BaseException,
748
+ errorCode,
749
+ });
750
+ }
751
+ };
752
+ export const deserializeAws_restJson1DeleteUserCommand = async (output, context) => {
753
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
754
+ return deserializeAws_restJson1DeleteUserCommandError(output, context);
755
+ }
756
+ const contents = map({
757
+ $metadata: deserializeMetadata(output),
1514
758
  });
1515
- }); };
1516
- export var deserializeAws_restJson1DescribeUserCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1517
- var contents, data, _a, _b;
1518
- return __generator(this, function (_c) {
1519
- switch (_c.label) {
1520
- case 0:
1521
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1522
- return [2, deserializeAws_restJson1DescribeUserCommandError(output, context)];
1523
- }
1524
- contents = map({
1525
- $metadata: deserializeMetadata(output),
1526
- });
1527
- _a = __expectNonNull;
1528
- _b = __expectObject;
1529
- return [4, parseBody(output.body, context)];
1530
- case 1:
1531
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1532
- if (data.brokerId != null) {
1533
- contents.BrokerId = __expectString(data.brokerId);
1534
- }
1535
- if (data.consoleAccess != null) {
1536
- contents.ConsoleAccess = __expectBoolean(data.consoleAccess);
1537
- }
1538
- if (data.groups != null) {
1539
- contents.Groups = deserializeAws_restJson1__listOf__string(data.groups, context);
1540
- }
1541
- if (data.pending != null) {
1542
- contents.Pending = deserializeAws_restJson1UserPendingChanges(data.pending, context);
1543
- }
1544
- if (data.username != null) {
1545
- contents.Username = __expectString(data.username);
1546
- }
1547
- return [2, contents];
1548
- }
759
+ await collectBody(output.body, context);
760
+ return contents;
761
+ };
762
+ const deserializeAws_restJson1DeleteUserCommandError = async (output, context) => {
763
+ const parsedOutput = {
764
+ ...output,
765
+ body: await parseErrorBody(output.body, context),
766
+ };
767
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
768
+ switch (errorCode) {
769
+ case "BadRequestException":
770
+ case "com.amazonaws.mq#BadRequestException":
771
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
772
+ case "ForbiddenException":
773
+ case "com.amazonaws.mq#ForbiddenException":
774
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
775
+ case "InternalServerErrorException":
776
+ case "com.amazonaws.mq#InternalServerErrorException":
777
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
778
+ case "NotFoundException":
779
+ case "com.amazonaws.mq#NotFoundException":
780
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
781
+ default:
782
+ const parsedBody = parsedOutput.body;
783
+ throwDefaultError({
784
+ output,
785
+ parsedBody,
786
+ exceptionCtor: __BaseException,
787
+ errorCode,
788
+ });
789
+ }
790
+ };
791
+ export const deserializeAws_restJson1DescribeBrokerCommand = async (output, context) => {
792
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
793
+ return deserializeAws_restJson1DescribeBrokerCommandError(output, context);
794
+ }
795
+ const contents = map({
796
+ $metadata: deserializeMetadata(output),
1549
797
  });
1550
- }); };
1551
- var deserializeAws_restJson1DescribeUserCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1552
- var parsedOutput, _a, errorCode, _b, parsedBody;
1553
- var _c;
1554
- return __generator(this, function (_d) {
1555
- switch (_d.label) {
1556
- case 0:
1557
- _a = [__assign({}, output)];
1558
- _c = {};
1559
- return [4, parseBody(output.body, context)];
1560
- case 1:
1561
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1562
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1563
- _b = errorCode;
1564
- switch (_b) {
1565
- case "BadRequestException": return [3, 2];
1566
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
1567
- case "ForbiddenException": return [3, 4];
1568
- case "com.amazonaws.mq#ForbiddenException": return [3, 4];
1569
- case "InternalServerErrorException": return [3, 6];
1570
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 6];
1571
- case "NotFoundException": return [3, 8];
1572
- case "com.amazonaws.mq#NotFoundException": return [3, 8];
1573
- }
1574
- return [3, 10];
1575
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1576
- case 3: throw _d.sent();
1577
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1578
- case 5: throw _d.sent();
1579
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1580
- case 7: throw _d.sent();
1581
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1582
- case 9: throw _d.sent();
1583
- case 10:
1584
- parsedBody = parsedOutput.body;
1585
- throwDefaultError({
1586
- output: output,
1587
- parsedBody: parsedBody,
1588
- exceptionCtor: __BaseException,
1589
- errorCode: errorCode,
1590
- });
1591
- _d.label = 11;
1592
- case 11: return [2];
1593
- }
798
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
799
+ if (data.actionsRequired != null) {
800
+ contents.ActionsRequired = deserializeAws_restJson1__listOfActionRequired(data.actionsRequired, context);
801
+ }
802
+ if (data.authenticationStrategy != null) {
803
+ contents.AuthenticationStrategy = __expectString(data.authenticationStrategy);
804
+ }
805
+ if (data.autoMinorVersionUpgrade != null) {
806
+ contents.AutoMinorVersionUpgrade = __expectBoolean(data.autoMinorVersionUpgrade);
807
+ }
808
+ if (data.brokerArn != null) {
809
+ contents.BrokerArn = __expectString(data.brokerArn);
810
+ }
811
+ if (data.brokerId != null) {
812
+ contents.BrokerId = __expectString(data.brokerId);
813
+ }
814
+ if (data.brokerInstances != null) {
815
+ contents.BrokerInstances = deserializeAws_restJson1__listOfBrokerInstance(data.brokerInstances, context);
816
+ }
817
+ if (data.brokerName != null) {
818
+ contents.BrokerName = __expectString(data.brokerName);
819
+ }
820
+ if (data.brokerState != null) {
821
+ contents.BrokerState = __expectString(data.brokerState);
822
+ }
823
+ if (data.configurations != null) {
824
+ contents.Configurations = deserializeAws_restJson1Configurations(data.configurations, context);
825
+ }
826
+ if (data.created != null) {
827
+ contents.Created = __expectNonNull(__parseRfc3339DateTime(data.created));
828
+ }
829
+ if (data.deploymentMode != null) {
830
+ contents.DeploymentMode = __expectString(data.deploymentMode);
831
+ }
832
+ if (data.encryptionOptions != null) {
833
+ contents.EncryptionOptions = deserializeAws_restJson1EncryptionOptions(data.encryptionOptions, context);
834
+ }
835
+ if (data.engineType != null) {
836
+ contents.EngineType = __expectString(data.engineType);
837
+ }
838
+ if (data.engineVersion != null) {
839
+ contents.EngineVersion = __expectString(data.engineVersion);
840
+ }
841
+ if (data.hostInstanceType != null) {
842
+ contents.HostInstanceType = __expectString(data.hostInstanceType);
843
+ }
844
+ if (data.ldapServerMetadata != null) {
845
+ contents.LdapServerMetadata = deserializeAws_restJson1LdapServerMetadataOutput(data.ldapServerMetadata, context);
846
+ }
847
+ if (data.logs != null) {
848
+ contents.Logs = deserializeAws_restJson1LogsSummary(data.logs, context);
849
+ }
850
+ if (data.maintenanceWindowStartTime != null) {
851
+ contents.MaintenanceWindowStartTime = deserializeAws_restJson1WeeklyStartTime(data.maintenanceWindowStartTime, context);
852
+ }
853
+ if (data.pendingAuthenticationStrategy != null) {
854
+ contents.PendingAuthenticationStrategy = __expectString(data.pendingAuthenticationStrategy);
855
+ }
856
+ if (data.pendingEngineVersion != null) {
857
+ contents.PendingEngineVersion = __expectString(data.pendingEngineVersion);
858
+ }
859
+ if (data.pendingHostInstanceType != null) {
860
+ contents.PendingHostInstanceType = __expectString(data.pendingHostInstanceType);
861
+ }
862
+ if (data.pendingLdapServerMetadata != null) {
863
+ contents.PendingLdapServerMetadata = deserializeAws_restJson1LdapServerMetadataOutput(data.pendingLdapServerMetadata, context);
864
+ }
865
+ if (data.pendingSecurityGroups != null) {
866
+ contents.PendingSecurityGroups = deserializeAws_restJson1__listOf__string(data.pendingSecurityGroups, context);
867
+ }
868
+ if (data.publiclyAccessible != null) {
869
+ contents.PubliclyAccessible = __expectBoolean(data.publiclyAccessible);
870
+ }
871
+ if (data.securityGroups != null) {
872
+ contents.SecurityGroups = deserializeAws_restJson1__listOf__string(data.securityGroups, context);
873
+ }
874
+ if (data.storageType != null) {
875
+ contents.StorageType = __expectString(data.storageType);
876
+ }
877
+ if (data.subnetIds != null) {
878
+ contents.SubnetIds = deserializeAws_restJson1__listOf__string(data.subnetIds, context);
879
+ }
880
+ if (data.tags != null) {
881
+ contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
882
+ }
883
+ if (data.users != null) {
884
+ contents.Users = deserializeAws_restJson1__listOfUserSummary(data.users, context);
885
+ }
886
+ return contents;
887
+ };
888
+ const deserializeAws_restJson1DescribeBrokerCommandError = async (output, context) => {
889
+ const parsedOutput = {
890
+ ...output,
891
+ body: await parseErrorBody(output.body, context),
892
+ };
893
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
894
+ switch (errorCode) {
895
+ case "BadRequestException":
896
+ case "com.amazonaws.mq#BadRequestException":
897
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
898
+ case "ForbiddenException":
899
+ case "com.amazonaws.mq#ForbiddenException":
900
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
901
+ case "InternalServerErrorException":
902
+ case "com.amazonaws.mq#InternalServerErrorException":
903
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
904
+ case "NotFoundException":
905
+ case "com.amazonaws.mq#NotFoundException":
906
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
907
+ default:
908
+ const parsedBody = parsedOutput.body;
909
+ throwDefaultError({
910
+ output,
911
+ parsedBody,
912
+ exceptionCtor: __BaseException,
913
+ errorCode,
914
+ });
915
+ }
916
+ };
917
+ export const deserializeAws_restJson1DescribeBrokerEngineTypesCommand = async (output, context) => {
918
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
919
+ return deserializeAws_restJson1DescribeBrokerEngineTypesCommandError(output, context);
920
+ }
921
+ const contents = map({
922
+ $metadata: deserializeMetadata(output),
1594
923
  });
1595
- }); };
1596
- export var deserializeAws_restJson1ListBrokersCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1597
- var contents, data, _a, _b;
1598
- return __generator(this, function (_c) {
1599
- switch (_c.label) {
1600
- case 0:
1601
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1602
- return [2, deserializeAws_restJson1ListBrokersCommandError(output, context)];
1603
- }
1604
- contents = map({
1605
- $metadata: deserializeMetadata(output),
1606
- });
1607
- _a = __expectNonNull;
1608
- _b = __expectObject;
1609
- return [4, parseBody(output.body, context)];
1610
- case 1:
1611
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1612
- if (data.brokerSummaries != null) {
1613
- contents.BrokerSummaries = deserializeAws_restJson1__listOfBrokerSummary(data.brokerSummaries, context);
1614
- }
1615
- if (data.nextToken != null) {
1616
- contents.NextToken = __expectString(data.nextToken);
1617
- }
1618
- return [2, contents];
1619
- }
924
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
925
+ if (data.brokerEngineTypes != null) {
926
+ contents.BrokerEngineTypes = deserializeAws_restJson1__listOfBrokerEngineType(data.brokerEngineTypes, context);
927
+ }
928
+ if (data.maxResults != null) {
929
+ contents.MaxResults = __expectInt32(data.maxResults);
930
+ }
931
+ if (data.nextToken != null) {
932
+ contents.NextToken = __expectString(data.nextToken);
933
+ }
934
+ return contents;
935
+ };
936
+ const deserializeAws_restJson1DescribeBrokerEngineTypesCommandError = async (output, context) => {
937
+ const parsedOutput = {
938
+ ...output,
939
+ body: await parseErrorBody(output.body, context),
940
+ };
941
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
942
+ switch (errorCode) {
943
+ case "BadRequestException":
944
+ case "com.amazonaws.mq#BadRequestException":
945
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
946
+ case "ForbiddenException":
947
+ case "com.amazonaws.mq#ForbiddenException":
948
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
949
+ case "InternalServerErrorException":
950
+ case "com.amazonaws.mq#InternalServerErrorException":
951
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
952
+ default:
953
+ const parsedBody = parsedOutput.body;
954
+ throwDefaultError({
955
+ output,
956
+ parsedBody,
957
+ exceptionCtor: __BaseException,
958
+ errorCode,
959
+ });
960
+ }
961
+ };
962
+ export const deserializeAws_restJson1DescribeBrokerInstanceOptionsCommand = async (output, context) => {
963
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
964
+ return deserializeAws_restJson1DescribeBrokerInstanceOptionsCommandError(output, context);
965
+ }
966
+ const contents = map({
967
+ $metadata: deserializeMetadata(output),
1620
968
  });
1621
- }); };
1622
- var deserializeAws_restJson1ListBrokersCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1623
- var parsedOutput, _a, errorCode, _b, parsedBody;
1624
- var _c;
1625
- return __generator(this, function (_d) {
1626
- switch (_d.label) {
1627
- case 0:
1628
- _a = [__assign({}, output)];
1629
- _c = {};
1630
- return [4, parseBody(output.body, context)];
1631
- case 1:
1632
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1633
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1634
- _b = errorCode;
1635
- switch (_b) {
1636
- case "BadRequestException": return [3, 2];
1637
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
1638
- case "ForbiddenException": return [3, 4];
1639
- case "com.amazonaws.mq#ForbiddenException": return [3, 4];
1640
- case "InternalServerErrorException": return [3, 6];
1641
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 6];
1642
- }
1643
- return [3, 8];
1644
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1645
- case 3: throw _d.sent();
1646
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1647
- case 5: throw _d.sent();
1648
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1649
- case 7: throw _d.sent();
1650
- case 8:
1651
- parsedBody = parsedOutput.body;
1652
- throwDefaultError({
1653
- output: output,
1654
- parsedBody: parsedBody,
1655
- exceptionCtor: __BaseException,
1656
- errorCode: errorCode,
1657
- });
1658
- _d.label = 9;
1659
- case 9: return [2];
1660
- }
969
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
970
+ if (data.brokerInstanceOptions != null) {
971
+ contents.BrokerInstanceOptions = deserializeAws_restJson1__listOfBrokerInstanceOption(data.brokerInstanceOptions, context);
972
+ }
973
+ if (data.maxResults != null) {
974
+ contents.MaxResults = __expectInt32(data.maxResults);
975
+ }
976
+ if (data.nextToken != null) {
977
+ contents.NextToken = __expectString(data.nextToken);
978
+ }
979
+ return contents;
980
+ };
981
+ const deserializeAws_restJson1DescribeBrokerInstanceOptionsCommandError = async (output, context) => {
982
+ const parsedOutput = {
983
+ ...output,
984
+ body: await parseErrorBody(output.body, context),
985
+ };
986
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
987
+ switch (errorCode) {
988
+ case "BadRequestException":
989
+ case "com.amazonaws.mq#BadRequestException":
990
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
991
+ case "ForbiddenException":
992
+ case "com.amazonaws.mq#ForbiddenException":
993
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
994
+ case "InternalServerErrorException":
995
+ case "com.amazonaws.mq#InternalServerErrorException":
996
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
997
+ default:
998
+ const parsedBody = parsedOutput.body;
999
+ throwDefaultError({
1000
+ output,
1001
+ parsedBody,
1002
+ exceptionCtor: __BaseException,
1003
+ errorCode,
1004
+ });
1005
+ }
1006
+ };
1007
+ export const deserializeAws_restJson1DescribeConfigurationCommand = async (output, context) => {
1008
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1009
+ return deserializeAws_restJson1DescribeConfigurationCommandError(output, context);
1010
+ }
1011
+ const contents = map({
1012
+ $metadata: deserializeMetadata(output),
1661
1013
  });
1662
- }); };
1663
- export var deserializeAws_restJson1ListConfigurationRevisionsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1664
- var contents, data, _a, _b;
1665
- return __generator(this, function (_c) {
1666
- switch (_c.label) {
1667
- case 0:
1668
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1669
- return [2, deserializeAws_restJson1ListConfigurationRevisionsCommandError(output, context)];
1670
- }
1671
- contents = map({
1672
- $metadata: deserializeMetadata(output),
1673
- });
1674
- _a = __expectNonNull;
1675
- _b = __expectObject;
1676
- return [4, parseBody(output.body, context)];
1677
- case 1:
1678
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1679
- if (data.configurationId != null) {
1680
- contents.ConfigurationId = __expectString(data.configurationId);
1681
- }
1682
- if (data.maxResults != null) {
1683
- contents.MaxResults = __expectInt32(data.maxResults);
1684
- }
1685
- if (data.nextToken != null) {
1686
- contents.NextToken = __expectString(data.nextToken);
1687
- }
1688
- if (data.revisions != null) {
1689
- contents.Revisions = deserializeAws_restJson1__listOfConfigurationRevision(data.revisions, context);
1690
- }
1691
- return [2, contents];
1692
- }
1014
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1015
+ if (data.arn != null) {
1016
+ contents.Arn = __expectString(data.arn);
1017
+ }
1018
+ if (data.authenticationStrategy != null) {
1019
+ contents.AuthenticationStrategy = __expectString(data.authenticationStrategy);
1020
+ }
1021
+ if (data.created != null) {
1022
+ contents.Created = __expectNonNull(__parseRfc3339DateTime(data.created));
1023
+ }
1024
+ if (data.description != null) {
1025
+ contents.Description = __expectString(data.description);
1026
+ }
1027
+ if (data.engineType != null) {
1028
+ contents.EngineType = __expectString(data.engineType);
1029
+ }
1030
+ if (data.engineVersion != null) {
1031
+ contents.EngineVersion = __expectString(data.engineVersion);
1032
+ }
1033
+ if (data.id != null) {
1034
+ contents.Id = __expectString(data.id);
1035
+ }
1036
+ if (data.latestRevision != null) {
1037
+ contents.LatestRevision = deserializeAws_restJson1ConfigurationRevision(data.latestRevision, context);
1038
+ }
1039
+ if (data.name != null) {
1040
+ contents.Name = __expectString(data.name);
1041
+ }
1042
+ if (data.tags != null) {
1043
+ contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
1044
+ }
1045
+ return contents;
1046
+ };
1047
+ const deserializeAws_restJson1DescribeConfigurationCommandError = async (output, context) => {
1048
+ const parsedOutput = {
1049
+ ...output,
1050
+ body: await parseErrorBody(output.body, context),
1051
+ };
1052
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1053
+ switch (errorCode) {
1054
+ case "BadRequestException":
1055
+ case "com.amazonaws.mq#BadRequestException":
1056
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1057
+ case "ForbiddenException":
1058
+ case "com.amazonaws.mq#ForbiddenException":
1059
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1060
+ case "InternalServerErrorException":
1061
+ case "com.amazonaws.mq#InternalServerErrorException":
1062
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1063
+ case "NotFoundException":
1064
+ case "com.amazonaws.mq#NotFoundException":
1065
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1066
+ default:
1067
+ const parsedBody = parsedOutput.body;
1068
+ throwDefaultError({
1069
+ output,
1070
+ parsedBody,
1071
+ exceptionCtor: __BaseException,
1072
+ errorCode,
1073
+ });
1074
+ }
1075
+ };
1076
+ export const deserializeAws_restJson1DescribeConfigurationRevisionCommand = async (output, context) => {
1077
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1078
+ return deserializeAws_restJson1DescribeConfigurationRevisionCommandError(output, context);
1079
+ }
1080
+ const contents = map({
1081
+ $metadata: deserializeMetadata(output),
1693
1082
  });
1694
- }); };
1695
- var deserializeAws_restJson1ListConfigurationRevisionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1696
- var parsedOutput, _a, errorCode, _b, parsedBody;
1697
- var _c;
1698
- return __generator(this, function (_d) {
1699
- switch (_d.label) {
1700
- case 0:
1701
- _a = [__assign({}, output)];
1702
- _c = {};
1703
- return [4, parseBody(output.body, context)];
1704
- case 1:
1705
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1706
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1707
- _b = errorCode;
1708
- switch (_b) {
1709
- case "BadRequestException": return [3, 2];
1710
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
1711
- case "ForbiddenException": return [3, 4];
1712
- case "com.amazonaws.mq#ForbiddenException": return [3, 4];
1713
- case "InternalServerErrorException": return [3, 6];
1714
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 6];
1715
- case "NotFoundException": return [3, 8];
1716
- case "com.amazonaws.mq#NotFoundException": return [3, 8];
1717
- }
1718
- return [3, 10];
1719
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1720
- case 3: throw _d.sent();
1721
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1722
- case 5: throw _d.sent();
1723
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1724
- case 7: throw _d.sent();
1725
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1726
- case 9: throw _d.sent();
1727
- case 10:
1728
- parsedBody = parsedOutput.body;
1729
- throwDefaultError({
1730
- output: output,
1731
- parsedBody: parsedBody,
1732
- exceptionCtor: __BaseException,
1733
- errorCode: errorCode,
1734
- });
1735
- _d.label = 11;
1736
- case 11: return [2];
1737
- }
1083
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1084
+ if (data.configurationId != null) {
1085
+ contents.ConfigurationId = __expectString(data.configurationId);
1086
+ }
1087
+ if (data.created != null) {
1088
+ contents.Created = __expectNonNull(__parseRfc3339DateTime(data.created));
1089
+ }
1090
+ if (data.data != null) {
1091
+ contents.Data = __expectString(data.data);
1092
+ }
1093
+ if (data.description != null) {
1094
+ contents.Description = __expectString(data.description);
1095
+ }
1096
+ return contents;
1097
+ };
1098
+ const deserializeAws_restJson1DescribeConfigurationRevisionCommandError = async (output, context) => {
1099
+ const parsedOutput = {
1100
+ ...output,
1101
+ body: await parseErrorBody(output.body, context),
1102
+ };
1103
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1104
+ switch (errorCode) {
1105
+ case "BadRequestException":
1106
+ case "com.amazonaws.mq#BadRequestException":
1107
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1108
+ case "ForbiddenException":
1109
+ case "com.amazonaws.mq#ForbiddenException":
1110
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1111
+ case "InternalServerErrorException":
1112
+ case "com.amazonaws.mq#InternalServerErrorException":
1113
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1114
+ case "NotFoundException":
1115
+ case "com.amazonaws.mq#NotFoundException":
1116
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1117
+ default:
1118
+ const parsedBody = parsedOutput.body;
1119
+ throwDefaultError({
1120
+ output,
1121
+ parsedBody,
1122
+ exceptionCtor: __BaseException,
1123
+ errorCode,
1124
+ });
1125
+ }
1126
+ };
1127
+ export const deserializeAws_restJson1DescribeUserCommand = async (output, context) => {
1128
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1129
+ return deserializeAws_restJson1DescribeUserCommandError(output, context);
1130
+ }
1131
+ const contents = map({
1132
+ $metadata: deserializeMetadata(output),
1738
1133
  });
1739
- }); };
1740
- export var deserializeAws_restJson1ListConfigurationsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1741
- var contents, data, _a, _b;
1742
- return __generator(this, function (_c) {
1743
- switch (_c.label) {
1744
- case 0:
1745
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1746
- return [2, deserializeAws_restJson1ListConfigurationsCommandError(output, context)];
1747
- }
1748
- contents = map({
1749
- $metadata: deserializeMetadata(output),
1750
- });
1751
- _a = __expectNonNull;
1752
- _b = __expectObject;
1753
- return [4, parseBody(output.body, context)];
1754
- case 1:
1755
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1756
- if (data.configurations != null) {
1757
- contents.Configurations = deserializeAws_restJson1__listOfConfiguration(data.configurations, context);
1758
- }
1759
- if (data.maxResults != null) {
1760
- contents.MaxResults = __expectInt32(data.maxResults);
1761
- }
1762
- if (data.nextToken != null) {
1763
- contents.NextToken = __expectString(data.nextToken);
1764
- }
1765
- return [2, contents];
1766
- }
1134
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1135
+ if (data.brokerId != null) {
1136
+ contents.BrokerId = __expectString(data.brokerId);
1137
+ }
1138
+ if (data.consoleAccess != null) {
1139
+ contents.ConsoleAccess = __expectBoolean(data.consoleAccess);
1140
+ }
1141
+ if (data.groups != null) {
1142
+ contents.Groups = deserializeAws_restJson1__listOf__string(data.groups, context);
1143
+ }
1144
+ if (data.pending != null) {
1145
+ contents.Pending = deserializeAws_restJson1UserPendingChanges(data.pending, context);
1146
+ }
1147
+ if (data.username != null) {
1148
+ contents.Username = __expectString(data.username);
1149
+ }
1150
+ return contents;
1151
+ };
1152
+ const deserializeAws_restJson1DescribeUserCommandError = async (output, context) => {
1153
+ const parsedOutput = {
1154
+ ...output,
1155
+ body: await parseErrorBody(output.body, context),
1156
+ };
1157
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1158
+ switch (errorCode) {
1159
+ case "BadRequestException":
1160
+ case "com.amazonaws.mq#BadRequestException":
1161
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1162
+ case "ForbiddenException":
1163
+ case "com.amazonaws.mq#ForbiddenException":
1164
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1165
+ case "InternalServerErrorException":
1166
+ case "com.amazonaws.mq#InternalServerErrorException":
1167
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1168
+ case "NotFoundException":
1169
+ case "com.amazonaws.mq#NotFoundException":
1170
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1171
+ default:
1172
+ const parsedBody = parsedOutput.body;
1173
+ throwDefaultError({
1174
+ output,
1175
+ parsedBody,
1176
+ exceptionCtor: __BaseException,
1177
+ errorCode,
1178
+ });
1179
+ }
1180
+ };
1181
+ export const deserializeAws_restJson1ListBrokersCommand = async (output, context) => {
1182
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1183
+ return deserializeAws_restJson1ListBrokersCommandError(output, context);
1184
+ }
1185
+ const contents = map({
1186
+ $metadata: deserializeMetadata(output),
1767
1187
  });
1768
- }); };
1769
- var deserializeAws_restJson1ListConfigurationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1770
- var parsedOutput, _a, errorCode, _b, parsedBody;
1771
- var _c;
1772
- return __generator(this, function (_d) {
1773
- switch (_d.label) {
1774
- case 0:
1775
- _a = [__assign({}, output)];
1776
- _c = {};
1777
- return [4, parseBody(output.body, context)];
1778
- case 1:
1779
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1780
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1781
- _b = errorCode;
1782
- switch (_b) {
1783
- case "BadRequestException": return [3, 2];
1784
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
1785
- case "ForbiddenException": return [3, 4];
1786
- case "com.amazonaws.mq#ForbiddenException": return [3, 4];
1787
- case "InternalServerErrorException": return [3, 6];
1788
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 6];
1789
- }
1790
- return [3, 8];
1791
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1792
- case 3: throw _d.sent();
1793
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1794
- case 5: throw _d.sent();
1795
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1796
- case 7: throw _d.sent();
1797
- case 8:
1798
- parsedBody = parsedOutput.body;
1799
- throwDefaultError({
1800
- output: output,
1801
- parsedBody: parsedBody,
1802
- exceptionCtor: __BaseException,
1803
- errorCode: errorCode,
1804
- });
1805
- _d.label = 9;
1806
- case 9: return [2];
1807
- }
1188
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1189
+ if (data.brokerSummaries != null) {
1190
+ contents.BrokerSummaries = deserializeAws_restJson1__listOfBrokerSummary(data.brokerSummaries, context);
1191
+ }
1192
+ if (data.nextToken != null) {
1193
+ contents.NextToken = __expectString(data.nextToken);
1194
+ }
1195
+ return contents;
1196
+ };
1197
+ const deserializeAws_restJson1ListBrokersCommandError = async (output, context) => {
1198
+ const parsedOutput = {
1199
+ ...output,
1200
+ body: await parseErrorBody(output.body, context),
1201
+ };
1202
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1203
+ switch (errorCode) {
1204
+ case "BadRequestException":
1205
+ case "com.amazonaws.mq#BadRequestException":
1206
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1207
+ case "ForbiddenException":
1208
+ case "com.amazonaws.mq#ForbiddenException":
1209
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1210
+ case "InternalServerErrorException":
1211
+ case "com.amazonaws.mq#InternalServerErrorException":
1212
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1213
+ default:
1214
+ const parsedBody = parsedOutput.body;
1215
+ throwDefaultError({
1216
+ output,
1217
+ parsedBody,
1218
+ exceptionCtor: __BaseException,
1219
+ errorCode,
1220
+ });
1221
+ }
1222
+ };
1223
+ export const deserializeAws_restJson1ListConfigurationRevisionsCommand = async (output, context) => {
1224
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1225
+ return deserializeAws_restJson1ListConfigurationRevisionsCommandError(output, context);
1226
+ }
1227
+ const contents = map({
1228
+ $metadata: deserializeMetadata(output),
1808
1229
  });
1809
- }); };
1810
- export var deserializeAws_restJson1ListTagsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1811
- var contents, data, _a, _b;
1812
- return __generator(this, function (_c) {
1813
- switch (_c.label) {
1814
- case 0:
1815
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1816
- return [2, deserializeAws_restJson1ListTagsCommandError(output, context)];
1817
- }
1818
- contents = map({
1819
- $metadata: deserializeMetadata(output),
1820
- });
1821
- _a = __expectNonNull;
1822
- _b = __expectObject;
1823
- return [4, parseBody(output.body, context)];
1824
- case 1:
1825
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1826
- if (data.tags != null) {
1827
- contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
1828
- }
1829
- return [2, contents];
1830
- }
1230
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1231
+ if (data.configurationId != null) {
1232
+ contents.ConfigurationId = __expectString(data.configurationId);
1233
+ }
1234
+ if (data.maxResults != null) {
1235
+ contents.MaxResults = __expectInt32(data.maxResults);
1236
+ }
1237
+ if (data.nextToken != null) {
1238
+ contents.NextToken = __expectString(data.nextToken);
1239
+ }
1240
+ if (data.revisions != null) {
1241
+ contents.Revisions = deserializeAws_restJson1__listOfConfigurationRevision(data.revisions, context);
1242
+ }
1243
+ return contents;
1244
+ };
1245
+ const deserializeAws_restJson1ListConfigurationRevisionsCommandError = async (output, context) => {
1246
+ const parsedOutput = {
1247
+ ...output,
1248
+ body: await parseErrorBody(output.body, context),
1249
+ };
1250
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1251
+ switch (errorCode) {
1252
+ case "BadRequestException":
1253
+ case "com.amazonaws.mq#BadRequestException":
1254
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1255
+ case "ForbiddenException":
1256
+ case "com.amazonaws.mq#ForbiddenException":
1257
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1258
+ case "InternalServerErrorException":
1259
+ case "com.amazonaws.mq#InternalServerErrorException":
1260
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1261
+ case "NotFoundException":
1262
+ case "com.amazonaws.mq#NotFoundException":
1263
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1264
+ default:
1265
+ const parsedBody = parsedOutput.body;
1266
+ throwDefaultError({
1267
+ output,
1268
+ parsedBody,
1269
+ exceptionCtor: __BaseException,
1270
+ errorCode,
1271
+ });
1272
+ }
1273
+ };
1274
+ export const deserializeAws_restJson1ListConfigurationsCommand = async (output, context) => {
1275
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1276
+ return deserializeAws_restJson1ListConfigurationsCommandError(output, context);
1277
+ }
1278
+ const contents = map({
1279
+ $metadata: deserializeMetadata(output),
1831
1280
  });
1832
- }); };
1833
- var deserializeAws_restJson1ListTagsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1834
- var parsedOutput, _a, errorCode, _b, parsedBody;
1835
- var _c;
1836
- return __generator(this, function (_d) {
1837
- switch (_d.label) {
1838
- case 0:
1839
- _a = [__assign({}, output)];
1840
- _c = {};
1841
- return [4, parseBody(output.body, context)];
1842
- case 1:
1843
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1844
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1845
- _b = errorCode;
1846
- switch (_b) {
1847
- case "BadRequestException": return [3, 2];
1848
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
1849
- case "ForbiddenException": return [3, 4];
1850
- case "com.amazonaws.mq#ForbiddenException": return [3, 4];
1851
- case "InternalServerErrorException": return [3, 6];
1852
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 6];
1853
- case "NotFoundException": return [3, 8];
1854
- case "com.amazonaws.mq#NotFoundException": return [3, 8];
1855
- }
1856
- return [3, 10];
1857
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1858
- case 3: throw _d.sent();
1859
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1860
- case 5: throw _d.sent();
1861
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1862
- case 7: throw _d.sent();
1863
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1864
- case 9: throw _d.sent();
1865
- case 10:
1866
- parsedBody = parsedOutput.body;
1867
- throwDefaultError({
1868
- output: output,
1869
- parsedBody: parsedBody,
1870
- exceptionCtor: __BaseException,
1871
- errorCode: errorCode,
1872
- });
1873
- _d.label = 11;
1874
- case 11: return [2];
1875
- }
1281
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1282
+ if (data.configurations != null) {
1283
+ contents.Configurations = deserializeAws_restJson1__listOfConfiguration(data.configurations, context);
1284
+ }
1285
+ if (data.maxResults != null) {
1286
+ contents.MaxResults = __expectInt32(data.maxResults);
1287
+ }
1288
+ if (data.nextToken != null) {
1289
+ contents.NextToken = __expectString(data.nextToken);
1290
+ }
1291
+ return contents;
1292
+ };
1293
+ const deserializeAws_restJson1ListConfigurationsCommandError = async (output, context) => {
1294
+ const parsedOutput = {
1295
+ ...output,
1296
+ body: await parseErrorBody(output.body, context),
1297
+ };
1298
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1299
+ switch (errorCode) {
1300
+ case "BadRequestException":
1301
+ case "com.amazonaws.mq#BadRequestException":
1302
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1303
+ case "ForbiddenException":
1304
+ case "com.amazonaws.mq#ForbiddenException":
1305
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1306
+ case "InternalServerErrorException":
1307
+ case "com.amazonaws.mq#InternalServerErrorException":
1308
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1309
+ default:
1310
+ const parsedBody = parsedOutput.body;
1311
+ throwDefaultError({
1312
+ output,
1313
+ parsedBody,
1314
+ exceptionCtor: __BaseException,
1315
+ errorCode,
1316
+ });
1317
+ }
1318
+ };
1319
+ export const deserializeAws_restJson1ListTagsCommand = async (output, context) => {
1320
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1321
+ return deserializeAws_restJson1ListTagsCommandError(output, context);
1322
+ }
1323
+ const contents = map({
1324
+ $metadata: deserializeMetadata(output),
1876
1325
  });
1877
- }); };
1878
- export var deserializeAws_restJson1ListUsersCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1879
- var contents, data, _a, _b;
1880
- return __generator(this, function (_c) {
1881
- switch (_c.label) {
1882
- case 0:
1883
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1884
- return [2, deserializeAws_restJson1ListUsersCommandError(output, context)];
1885
- }
1886
- contents = map({
1887
- $metadata: deserializeMetadata(output),
1888
- });
1889
- _a = __expectNonNull;
1890
- _b = __expectObject;
1891
- return [4, parseBody(output.body, context)];
1892
- case 1:
1893
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1894
- if (data.brokerId != null) {
1895
- contents.BrokerId = __expectString(data.brokerId);
1896
- }
1897
- if (data.maxResults != null) {
1898
- contents.MaxResults = __expectInt32(data.maxResults);
1899
- }
1900
- if (data.nextToken != null) {
1901
- contents.NextToken = __expectString(data.nextToken);
1902
- }
1903
- if (data.users != null) {
1904
- contents.Users = deserializeAws_restJson1__listOfUserSummary(data.users, context);
1905
- }
1906
- return [2, contents];
1907
- }
1326
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1327
+ if (data.tags != null) {
1328
+ contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
1329
+ }
1330
+ return contents;
1331
+ };
1332
+ const deserializeAws_restJson1ListTagsCommandError = async (output, context) => {
1333
+ const parsedOutput = {
1334
+ ...output,
1335
+ body: await parseErrorBody(output.body, context),
1336
+ };
1337
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1338
+ switch (errorCode) {
1339
+ case "BadRequestException":
1340
+ case "com.amazonaws.mq#BadRequestException":
1341
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1342
+ case "ForbiddenException":
1343
+ case "com.amazonaws.mq#ForbiddenException":
1344
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1345
+ case "InternalServerErrorException":
1346
+ case "com.amazonaws.mq#InternalServerErrorException":
1347
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1348
+ case "NotFoundException":
1349
+ case "com.amazonaws.mq#NotFoundException":
1350
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1351
+ default:
1352
+ const parsedBody = parsedOutput.body;
1353
+ throwDefaultError({
1354
+ output,
1355
+ parsedBody,
1356
+ exceptionCtor: __BaseException,
1357
+ errorCode,
1358
+ });
1359
+ }
1360
+ };
1361
+ export const deserializeAws_restJson1ListUsersCommand = async (output, context) => {
1362
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1363
+ return deserializeAws_restJson1ListUsersCommandError(output, context);
1364
+ }
1365
+ const contents = map({
1366
+ $metadata: deserializeMetadata(output),
1908
1367
  });
1909
- }); };
1910
- var deserializeAws_restJson1ListUsersCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1911
- var parsedOutput, _a, errorCode, _b, parsedBody;
1912
- var _c;
1913
- return __generator(this, function (_d) {
1914
- switch (_d.label) {
1915
- case 0:
1916
- _a = [__assign({}, output)];
1917
- _c = {};
1918
- return [4, parseBody(output.body, context)];
1919
- case 1:
1920
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1921
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1922
- _b = errorCode;
1923
- switch (_b) {
1924
- case "BadRequestException": return [3, 2];
1925
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
1926
- case "ForbiddenException": return [3, 4];
1927
- case "com.amazonaws.mq#ForbiddenException": return [3, 4];
1928
- case "InternalServerErrorException": return [3, 6];
1929
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 6];
1930
- case "NotFoundException": return [3, 8];
1931
- case "com.amazonaws.mq#NotFoundException": return [3, 8];
1932
- }
1933
- return [3, 10];
1934
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1935
- case 3: throw _d.sent();
1936
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1937
- case 5: throw _d.sent();
1938
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1939
- case 7: throw _d.sent();
1940
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1941
- case 9: throw _d.sent();
1942
- case 10:
1943
- parsedBody = parsedOutput.body;
1944
- throwDefaultError({
1945
- output: output,
1946
- parsedBody: parsedBody,
1947
- exceptionCtor: __BaseException,
1948
- errorCode: errorCode,
1949
- });
1950
- _d.label = 11;
1951
- case 11: return [2];
1952
- }
1368
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1369
+ if (data.brokerId != null) {
1370
+ contents.BrokerId = __expectString(data.brokerId);
1371
+ }
1372
+ if (data.maxResults != null) {
1373
+ contents.MaxResults = __expectInt32(data.maxResults);
1374
+ }
1375
+ if (data.nextToken != null) {
1376
+ contents.NextToken = __expectString(data.nextToken);
1377
+ }
1378
+ if (data.users != null) {
1379
+ contents.Users = deserializeAws_restJson1__listOfUserSummary(data.users, context);
1380
+ }
1381
+ return contents;
1382
+ };
1383
+ const deserializeAws_restJson1ListUsersCommandError = async (output, context) => {
1384
+ const parsedOutput = {
1385
+ ...output,
1386
+ body: await parseErrorBody(output.body, context),
1387
+ };
1388
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1389
+ switch (errorCode) {
1390
+ case "BadRequestException":
1391
+ case "com.amazonaws.mq#BadRequestException":
1392
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1393
+ case "ForbiddenException":
1394
+ case "com.amazonaws.mq#ForbiddenException":
1395
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1396
+ case "InternalServerErrorException":
1397
+ case "com.amazonaws.mq#InternalServerErrorException":
1398
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1399
+ case "NotFoundException":
1400
+ case "com.amazonaws.mq#NotFoundException":
1401
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1402
+ default:
1403
+ const parsedBody = parsedOutput.body;
1404
+ throwDefaultError({
1405
+ output,
1406
+ parsedBody,
1407
+ exceptionCtor: __BaseException,
1408
+ errorCode,
1409
+ });
1410
+ }
1411
+ };
1412
+ export const deserializeAws_restJson1RebootBrokerCommand = async (output, context) => {
1413
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1414
+ return deserializeAws_restJson1RebootBrokerCommandError(output, context);
1415
+ }
1416
+ const contents = map({
1417
+ $metadata: deserializeMetadata(output),
1953
1418
  });
1954
- }); };
1955
- export var deserializeAws_restJson1RebootBrokerCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1956
- var contents;
1957
- return __generator(this, function (_a) {
1958
- switch (_a.label) {
1959
- case 0:
1960
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1961
- return [2, deserializeAws_restJson1RebootBrokerCommandError(output, context)];
1962
- }
1963
- contents = map({
1964
- $metadata: deserializeMetadata(output),
1965
- });
1966
- return [4, collectBody(output.body, context)];
1967
- case 1:
1968
- _a.sent();
1969
- return [2, contents];
1970
- }
1419
+ await collectBody(output.body, context);
1420
+ return contents;
1421
+ };
1422
+ const deserializeAws_restJson1RebootBrokerCommandError = async (output, context) => {
1423
+ const parsedOutput = {
1424
+ ...output,
1425
+ body: await parseErrorBody(output.body, context),
1426
+ };
1427
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1428
+ switch (errorCode) {
1429
+ case "BadRequestException":
1430
+ case "com.amazonaws.mq#BadRequestException":
1431
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1432
+ case "ForbiddenException":
1433
+ case "com.amazonaws.mq#ForbiddenException":
1434
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1435
+ case "InternalServerErrorException":
1436
+ case "com.amazonaws.mq#InternalServerErrorException":
1437
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1438
+ case "NotFoundException":
1439
+ case "com.amazonaws.mq#NotFoundException":
1440
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1441
+ default:
1442
+ const parsedBody = parsedOutput.body;
1443
+ throwDefaultError({
1444
+ output,
1445
+ parsedBody,
1446
+ exceptionCtor: __BaseException,
1447
+ errorCode,
1448
+ });
1449
+ }
1450
+ };
1451
+ export const deserializeAws_restJson1UpdateBrokerCommand = async (output, context) => {
1452
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1453
+ return deserializeAws_restJson1UpdateBrokerCommandError(output, context);
1454
+ }
1455
+ const contents = map({
1456
+ $metadata: deserializeMetadata(output),
1971
1457
  });
1972
- }); };
1973
- var deserializeAws_restJson1RebootBrokerCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1974
- var parsedOutput, _a, errorCode, _b, parsedBody;
1975
- var _c;
1976
- return __generator(this, function (_d) {
1977
- switch (_d.label) {
1978
- case 0:
1979
- _a = [__assign({}, output)];
1980
- _c = {};
1981
- return [4, parseBody(output.body, context)];
1982
- case 1:
1983
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1984
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1985
- _b = errorCode;
1986
- switch (_b) {
1987
- case "BadRequestException": return [3, 2];
1988
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
1989
- case "ForbiddenException": return [3, 4];
1990
- case "com.amazonaws.mq#ForbiddenException": return [3, 4];
1991
- case "InternalServerErrorException": return [3, 6];
1992
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 6];
1993
- case "NotFoundException": return [3, 8];
1994
- case "com.amazonaws.mq#NotFoundException": return [3, 8];
1995
- }
1996
- return [3, 10];
1997
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1998
- case 3: throw _d.sent();
1999
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
2000
- case 5: throw _d.sent();
2001
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
2002
- case 7: throw _d.sent();
2003
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
2004
- case 9: throw _d.sent();
2005
- case 10:
2006
- parsedBody = parsedOutput.body;
2007
- throwDefaultError({
2008
- output: output,
2009
- parsedBody: parsedBody,
2010
- exceptionCtor: __BaseException,
2011
- errorCode: errorCode,
2012
- });
2013
- _d.label = 11;
2014
- case 11: return [2];
2015
- }
1458
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1459
+ if (data.authenticationStrategy != null) {
1460
+ contents.AuthenticationStrategy = __expectString(data.authenticationStrategy);
1461
+ }
1462
+ if (data.autoMinorVersionUpgrade != null) {
1463
+ contents.AutoMinorVersionUpgrade = __expectBoolean(data.autoMinorVersionUpgrade);
1464
+ }
1465
+ if (data.brokerId != null) {
1466
+ contents.BrokerId = __expectString(data.brokerId);
1467
+ }
1468
+ if (data.configuration != null) {
1469
+ contents.Configuration = deserializeAws_restJson1ConfigurationId(data.configuration, context);
1470
+ }
1471
+ if (data.engineVersion != null) {
1472
+ contents.EngineVersion = __expectString(data.engineVersion);
1473
+ }
1474
+ if (data.hostInstanceType != null) {
1475
+ contents.HostInstanceType = __expectString(data.hostInstanceType);
1476
+ }
1477
+ if (data.ldapServerMetadata != null) {
1478
+ contents.LdapServerMetadata = deserializeAws_restJson1LdapServerMetadataOutput(data.ldapServerMetadata, context);
1479
+ }
1480
+ if (data.logs != null) {
1481
+ contents.Logs = deserializeAws_restJson1Logs(data.logs, context);
1482
+ }
1483
+ if (data.maintenanceWindowStartTime != null) {
1484
+ contents.MaintenanceWindowStartTime = deserializeAws_restJson1WeeklyStartTime(data.maintenanceWindowStartTime, context);
1485
+ }
1486
+ if (data.securityGroups != null) {
1487
+ contents.SecurityGroups = deserializeAws_restJson1__listOf__string(data.securityGroups, context);
1488
+ }
1489
+ return contents;
1490
+ };
1491
+ const deserializeAws_restJson1UpdateBrokerCommandError = async (output, context) => {
1492
+ const parsedOutput = {
1493
+ ...output,
1494
+ body: await parseErrorBody(output.body, context),
1495
+ };
1496
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1497
+ switch (errorCode) {
1498
+ case "BadRequestException":
1499
+ case "com.amazonaws.mq#BadRequestException":
1500
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1501
+ case "ConflictException":
1502
+ case "com.amazonaws.mq#ConflictException":
1503
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1504
+ case "ForbiddenException":
1505
+ case "com.amazonaws.mq#ForbiddenException":
1506
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1507
+ case "InternalServerErrorException":
1508
+ case "com.amazonaws.mq#InternalServerErrorException":
1509
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1510
+ case "NotFoundException":
1511
+ case "com.amazonaws.mq#NotFoundException":
1512
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1513
+ default:
1514
+ const parsedBody = parsedOutput.body;
1515
+ throwDefaultError({
1516
+ output,
1517
+ parsedBody,
1518
+ exceptionCtor: __BaseException,
1519
+ errorCode,
1520
+ });
1521
+ }
1522
+ };
1523
+ export const deserializeAws_restJson1UpdateConfigurationCommand = async (output, context) => {
1524
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1525
+ return deserializeAws_restJson1UpdateConfigurationCommandError(output, context);
1526
+ }
1527
+ const contents = map({
1528
+ $metadata: deserializeMetadata(output),
2016
1529
  });
2017
- }); };
2018
- export var deserializeAws_restJson1UpdateBrokerCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2019
- var contents, data, _a, _b;
2020
- return __generator(this, function (_c) {
2021
- switch (_c.label) {
2022
- case 0:
2023
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2024
- return [2, deserializeAws_restJson1UpdateBrokerCommandError(output, context)];
2025
- }
2026
- contents = map({
2027
- $metadata: deserializeMetadata(output),
2028
- });
2029
- _a = __expectNonNull;
2030
- _b = __expectObject;
2031
- return [4, parseBody(output.body, context)];
2032
- case 1:
2033
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2034
- if (data.authenticationStrategy != null) {
2035
- contents.AuthenticationStrategy = __expectString(data.authenticationStrategy);
2036
- }
2037
- if (data.autoMinorVersionUpgrade != null) {
2038
- contents.AutoMinorVersionUpgrade = __expectBoolean(data.autoMinorVersionUpgrade);
2039
- }
2040
- if (data.brokerId != null) {
2041
- contents.BrokerId = __expectString(data.brokerId);
2042
- }
2043
- if (data.configuration != null) {
2044
- contents.Configuration = deserializeAws_restJson1ConfigurationId(data.configuration, context);
2045
- }
2046
- if (data.engineVersion != null) {
2047
- contents.EngineVersion = __expectString(data.engineVersion);
2048
- }
2049
- if (data.hostInstanceType != null) {
2050
- contents.HostInstanceType = __expectString(data.hostInstanceType);
2051
- }
2052
- if (data.ldapServerMetadata != null) {
2053
- contents.LdapServerMetadata = deserializeAws_restJson1LdapServerMetadataOutput(data.ldapServerMetadata, context);
2054
- }
2055
- if (data.logs != null) {
2056
- contents.Logs = deserializeAws_restJson1Logs(data.logs, context);
2057
- }
2058
- if (data.maintenanceWindowStartTime != null) {
2059
- contents.MaintenanceWindowStartTime = deserializeAws_restJson1WeeklyStartTime(data.maintenanceWindowStartTime, context);
2060
- }
2061
- if (data.securityGroups != null) {
2062
- contents.SecurityGroups = deserializeAws_restJson1__listOf__string(data.securityGroups, context);
2063
- }
2064
- return [2, contents];
2065
- }
1530
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1531
+ if (data.arn != null) {
1532
+ contents.Arn = __expectString(data.arn);
1533
+ }
1534
+ if (data.created != null) {
1535
+ contents.Created = __expectNonNull(__parseRfc3339DateTime(data.created));
1536
+ }
1537
+ if (data.id != null) {
1538
+ contents.Id = __expectString(data.id);
1539
+ }
1540
+ if (data.latestRevision != null) {
1541
+ contents.LatestRevision = deserializeAws_restJson1ConfigurationRevision(data.latestRevision, context);
1542
+ }
1543
+ if (data.name != null) {
1544
+ contents.Name = __expectString(data.name);
1545
+ }
1546
+ if (data.warnings != null) {
1547
+ contents.Warnings = deserializeAws_restJson1__listOfSanitizationWarning(data.warnings, context);
1548
+ }
1549
+ return contents;
1550
+ };
1551
+ const deserializeAws_restJson1UpdateConfigurationCommandError = async (output, context) => {
1552
+ const parsedOutput = {
1553
+ ...output,
1554
+ body: await parseErrorBody(output.body, context),
1555
+ };
1556
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1557
+ switch (errorCode) {
1558
+ case "BadRequestException":
1559
+ case "com.amazonaws.mq#BadRequestException":
1560
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1561
+ case "ConflictException":
1562
+ case "com.amazonaws.mq#ConflictException":
1563
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1564
+ case "ForbiddenException":
1565
+ case "com.amazonaws.mq#ForbiddenException":
1566
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1567
+ case "InternalServerErrorException":
1568
+ case "com.amazonaws.mq#InternalServerErrorException":
1569
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1570
+ case "NotFoundException":
1571
+ case "com.amazonaws.mq#NotFoundException":
1572
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1573
+ default:
1574
+ const parsedBody = parsedOutput.body;
1575
+ throwDefaultError({
1576
+ output,
1577
+ parsedBody,
1578
+ exceptionCtor: __BaseException,
1579
+ errorCode,
1580
+ });
1581
+ }
1582
+ };
1583
+ export const deserializeAws_restJson1UpdateUserCommand = async (output, context) => {
1584
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1585
+ return deserializeAws_restJson1UpdateUserCommandError(output, context);
1586
+ }
1587
+ const contents = map({
1588
+ $metadata: deserializeMetadata(output),
2066
1589
  });
2067
- }); };
2068
- var deserializeAws_restJson1UpdateBrokerCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2069
- var parsedOutput, _a, errorCode, _b, parsedBody;
2070
- var _c;
2071
- return __generator(this, function (_d) {
2072
- switch (_d.label) {
2073
- case 0:
2074
- _a = [__assign({}, output)];
2075
- _c = {};
2076
- return [4, parseBody(output.body, context)];
2077
- case 1:
2078
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2079
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2080
- _b = errorCode;
2081
- switch (_b) {
2082
- case "BadRequestException": return [3, 2];
2083
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
2084
- case "ConflictException": return [3, 4];
2085
- case "com.amazonaws.mq#ConflictException": return [3, 4];
2086
- case "ForbiddenException": return [3, 6];
2087
- case "com.amazonaws.mq#ForbiddenException": return [3, 6];
2088
- case "InternalServerErrorException": return [3, 8];
2089
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 8];
2090
- case "NotFoundException": return [3, 10];
2091
- case "com.amazonaws.mq#NotFoundException": return [3, 10];
2092
- }
2093
- return [3, 12];
2094
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
2095
- case 3: throw _d.sent();
2096
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2097
- case 5: throw _d.sent();
2098
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
2099
- case 7: throw _d.sent();
2100
- case 8: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
2101
- case 9: throw _d.sent();
2102
- case 10: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
2103
- case 11: throw _d.sent();
2104
- case 12:
2105
- parsedBody = parsedOutput.body;
2106
- throwDefaultError({
2107
- output: output,
2108
- parsedBody: parsedBody,
2109
- exceptionCtor: __BaseException,
2110
- errorCode: errorCode,
2111
- });
2112
- _d.label = 13;
2113
- case 13: return [2];
2114
- }
1590
+ await collectBody(output.body, context);
1591
+ return contents;
1592
+ };
1593
+ const deserializeAws_restJson1UpdateUserCommandError = async (output, context) => {
1594
+ const parsedOutput = {
1595
+ ...output,
1596
+ body: await parseErrorBody(output.body, context),
1597
+ };
1598
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1599
+ switch (errorCode) {
1600
+ case "BadRequestException":
1601
+ case "com.amazonaws.mq#BadRequestException":
1602
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1603
+ case "ConflictException":
1604
+ case "com.amazonaws.mq#ConflictException":
1605
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1606
+ case "ForbiddenException":
1607
+ case "com.amazonaws.mq#ForbiddenException":
1608
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1609
+ case "InternalServerErrorException":
1610
+ case "com.amazonaws.mq#InternalServerErrorException":
1611
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1612
+ case "NotFoundException":
1613
+ case "com.amazonaws.mq#NotFoundException":
1614
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1615
+ default:
1616
+ const parsedBody = parsedOutput.body;
1617
+ throwDefaultError({
1618
+ output,
1619
+ parsedBody,
1620
+ exceptionCtor: __BaseException,
1621
+ errorCode,
1622
+ });
1623
+ }
1624
+ };
1625
+ const map = __map;
1626
+ const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
1627
+ const contents = map({});
1628
+ const data = parsedOutput.body;
1629
+ if (data.errorAttribute != null) {
1630
+ contents.ErrorAttribute = __expectString(data.errorAttribute);
1631
+ }
1632
+ if (data.message != null) {
1633
+ contents.Message = __expectString(data.message);
1634
+ }
1635
+ const exception = new BadRequestException({
1636
+ $metadata: deserializeMetadata(parsedOutput),
1637
+ ...contents,
2115
1638
  });
2116
- }); };
2117
- export var deserializeAws_restJson1UpdateConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2118
- var contents, data, _a, _b;
2119
- return __generator(this, function (_c) {
2120
- switch (_c.label) {
2121
- case 0:
2122
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2123
- return [2, deserializeAws_restJson1UpdateConfigurationCommandError(output, context)];
2124
- }
2125
- contents = map({
2126
- $metadata: deserializeMetadata(output),
2127
- });
2128
- _a = __expectNonNull;
2129
- _b = __expectObject;
2130
- return [4, parseBody(output.body, context)];
2131
- case 1:
2132
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2133
- if (data.arn != null) {
2134
- contents.Arn = __expectString(data.arn);
2135
- }
2136
- if (data.created != null) {
2137
- contents.Created = __expectNonNull(__parseRfc3339DateTime(data.created));
2138
- }
2139
- if (data.id != null) {
2140
- contents.Id = __expectString(data.id);
2141
- }
2142
- if (data.latestRevision != null) {
2143
- contents.LatestRevision = deserializeAws_restJson1ConfigurationRevision(data.latestRevision, context);
2144
- }
2145
- if (data.name != null) {
2146
- contents.Name = __expectString(data.name);
2147
- }
2148
- if (data.warnings != null) {
2149
- contents.Warnings = deserializeAws_restJson1__listOfSanitizationWarning(data.warnings, context);
2150
- }
2151
- return [2, contents];
2152
- }
1639
+ return __decorateServiceException(exception, parsedOutput.body);
1640
+ };
1641
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1642
+ const contents = map({});
1643
+ const data = parsedOutput.body;
1644
+ if (data.errorAttribute != null) {
1645
+ contents.ErrorAttribute = __expectString(data.errorAttribute);
1646
+ }
1647
+ if (data.message != null) {
1648
+ contents.Message = __expectString(data.message);
1649
+ }
1650
+ const exception = new ConflictException({
1651
+ $metadata: deserializeMetadata(parsedOutput),
1652
+ ...contents,
2153
1653
  });
2154
- }); };
2155
- var deserializeAws_restJson1UpdateConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2156
- var parsedOutput, _a, errorCode, _b, parsedBody;
2157
- var _c;
2158
- return __generator(this, function (_d) {
2159
- switch (_d.label) {
2160
- case 0:
2161
- _a = [__assign({}, output)];
2162
- _c = {};
2163
- return [4, parseBody(output.body, context)];
2164
- case 1:
2165
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2166
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2167
- _b = errorCode;
2168
- switch (_b) {
2169
- case "BadRequestException": return [3, 2];
2170
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
2171
- case "ConflictException": return [3, 4];
2172
- case "com.amazonaws.mq#ConflictException": return [3, 4];
2173
- case "ForbiddenException": return [3, 6];
2174
- case "com.amazonaws.mq#ForbiddenException": return [3, 6];
2175
- case "InternalServerErrorException": return [3, 8];
2176
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 8];
2177
- case "NotFoundException": return [3, 10];
2178
- case "com.amazonaws.mq#NotFoundException": return [3, 10];
2179
- }
2180
- return [3, 12];
2181
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
2182
- case 3: throw _d.sent();
2183
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2184
- case 5: throw _d.sent();
2185
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
2186
- case 7: throw _d.sent();
2187
- case 8: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
2188
- case 9: throw _d.sent();
2189
- case 10: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
2190
- case 11: throw _d.sent();
2191
- case 12:
2192
- parsedBody = parsedOutput.body;
2193
- throwDefaultError({
2194
- output: output,
2195
- parsedBody: parsedBody,
2196
- exceptionCtor: __BaseException,
2197
- errorCode: errorCode,
2198
- });
2199
- _d.label = 13;
2200
- case 13: return [2];
2201
- }
1654
+ return __decorateServiceException(exception, parsedOutput.body);
1655
+ };
1656
+ const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput, context) => {
1657
+ const contents = map({});
1658
+ const data = parsedOutput.body;
1659
+ if (data.errorAttribute != null) {
1660
+ contents.ErrorAttribute = __expectString(data.errorAttribute);
1661
+ }
1662
+ if (data.message != null) {
1663
+ contents.Message = __expectString(data.message);
1664
+ }
1665
+ const exception = new ForbiddenException({
1666
+ $metadata: deserializeMetadata(parsedOutput),
1667
+ ...contents,
2202
1668
  });
2203
- }); };
2204
- export var deserializeAws_restJson1UpdateUserCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2205
- var contents;
2206
- return __generator(this, function (_a) {
2207
- switch (_a.label) {
2208
- case 0:
2209
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2210
- return [2, deserializeAws_restJson1UpdateUserCommandError(output, context)];
2211
- }
2212
- contents = map({
2213
- $metadata: deserializeMetadata(output),
2214
- });
2215
- return [4, collectBody(output.body, context)];
2216
- case 1:
2217
- _a.sent();
2218
- return [2, contents];
2219
- }
1669
+ return __decorateServiceException(exception, parsedOutput.body);
1670
+ };
1671
+ const deserializeAws_restJson1InternalServerErrorExceptionResponse = async (parsedOutput, context) => {
1672
+ const contents = map({});
1673
+ const data = parsedOutput.body;
1674
+ if (data.errorAttribute != null) {
1675
+ contents.ErrorAttribute = __expectString(data.errorAttribute);
1676
+ }
1677
+ if (data.message != null) {
1678
+ contents.Message = __expectString(data.message);
1679
+ }
1680
+ const exception = new InternalServerErrorException({
1681
+ $metadata: deserializeMetadata(parsedOutput),
1682
+ ...contents,
2220
1683
  });
2221
- }); };
2222
- var deserializeAws_restJson1UpdateUserCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2223
- var parsedOutput, _a, errorCode, _b, parsedBody;
2224
- var _c;
2225
- return __generator(this, function (_d) {
2226
- switch (_d.label) {
2227
- case 0:
2228
- _a = [__assign({}, output)];
2229
- _c = {};
2230
- return [4, parseBody(output.body, context)];
2231
- case 1:
2232
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2233
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2234
- _b = errorCode;
2235
- switch (_b) {
2236
- case "BadRequestException": return [3, 2];
2237
- case "com.amazonaws.mq#BadRequestException": return [3, 2];
2238
- case "ConflictException": return [3, 4];
2239
- case "com.amazonaws.mq#ConflictException": return [3, 4];
2240
- case "ForbiddenException": return [3, 6];
2241
- case "com.amazonaws.mq#ForbiddenException": return [3, 6];
2242
- case "InternalServerErrorException": return [3, 8];
2243
- case "com.amazonaws.mq#InternalServerErrorException": return [3, 8];
2244
- case "NotFoundException": return [3, 10];
2245
- case "com.amazonaws.mq#NotFoundException": return [3, 10];
2246
- }
2247
- return [3, 12];
2248
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
2249
- case 3: throw _d.sent();
2250
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2251
- case 5: throw _d.sent();
2252
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
2253
- case 7: throw _d.sent();
2254
- case 8: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
2255
- case 9: throw _d.sent();
2256
- case 10: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
2257
- case 11: throw _d.sent();
2258
- case 12:
2259
- parsedBody = parsedOutput.body;
2260
- throwDefaultError({
2261
- output: output,
2262
- parsedBody: parsedBody,
2263
- exceptionCtor: __BaseException,
2264
- errorCode: errorCode,
2265
- });
2266
- _d.label = 13;
2267
- case 13: return [2];
2268
- }
1684
+ return __decorateServiceException(exception, parsedOutput.body);
1685
+ };
1686
+ const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
1687
+ const contents = map({});
1688
+ const data = parsedOutput.body;
1689
+ if (data.errorAttribute != null) {
1690
+ contents.ErrorAttribute = __expectString(data.errorAttribute);
1691
+ }
1692
+ if (data.message != null) {
1693
+ contents.Message = __expectString(data.message);
1694
+ }
1695
+ const exception = new NotFoundException({
1696
+ $metadata: deserializeMetadata(parsedOutput),
1697
+ ...contents,
2269
1698
  });
2270
- }); };
2271
- var map = __map;
2272
- var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2273
- var contents, data, exception;
2274
- return __generator(this, function (_a) {
2275
- contents = map({});
2276
- data = parsedOutput.body;
2277
- if (data.errorAttribute != null) {
2278
- contents.ErrorAttribute = __expectString(data.errorAttribute);
2279
- }
2280
- if (data.message != null) {
2281
- contents.Message = __expectString(data.message);
2282
- }
2283
- exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2284
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2285
- });
2286
- }); };
2287
- var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2288
- var contents, data, exception;
2289
- return __generator(this, function (_a) {
2290
- contents = map({});
2291
- data = parsedOutput.body;
2292
- if (data.errorAttribute != null) {
2293
- contents.ErrorAttribute = __expectString(data.errorAttribute);
2294
- }
2295
- if (data.message != null) {
2296
- contents.Message = __expectString(data.message);
2297
- }
2298
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2299
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2300
- });
2301
- }); };
2302
- var deserializeAws_restJson1ForbiddenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2303
- var contents, data, exception;
2304
- return __generator(this, function (_a) {
2305
- contents = map({});
2306
- data = parsedOutput.body;
2307
- if (data.errorAttribute != null) {
2308
- contents.ErrorAttribute = __expectString(data.errorAttribute);
2309
- }
2310
- if (data.message != null) {
2311
- contents.Message = __expectString(data.message);
2312
- }
2313
- exception = new ForbiddenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2314
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2315
- });
2316
- }); };
2317
- var deserializeAws_restJson1InternalServerErrorExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2318
- var contents, data, exception;
2319
- return __generator(this, function (_a) {
2320
- contents = map({});
2321
- data = parsedOutput.body;
2322
- if (data.errorAttribute != null) {
2323
- contents.ErrorAttribute = __expectString(data.errorAttribute);
2324
- }
2325
- if (data.message != null) {
2326
- contents.Message = __expectString(data.message);
2327
- }
2328
- exception = new InternalServerErrorException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2329
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2330
- });
2331
- }); };
2332
- var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2333
- var contents, data, exception;
2334
- return __generator(this, function (_a) {
2335
- contents = map({});
2336
- data = parsedOutput.body;
2337
- if (data.errorAttribute != null) {
2338
- contents.ErrorAttribute = __expectString(data.errorAttribute);
2339
- }
2340
- if (data.message != null) {
2341
- contents.Message = __expectString(data.message);
2342
- }
2343
- exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2344
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2345
- });
2346
- }); };
2347
- var deserializeAws_restJson1UnauthorizedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2348
- var contents, data, exception;
2349
- return __generator(this, function (_a) {
2350
- contents = map({});
2351
- data = parsedOutput.body;
2352
- if (data.errorAttribute != null) {
2353
- contents.ErrorAttribute = __expectString(data.errorAttribute);
2354
- }
2355
- if (data.message != null) {
2356
- contents.Message = __expectString(data.message);
2357
- }
2358
- exception = new UnauthorizedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2359
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1699
+ return __decorateServiceException(exception, parsedOutput.body);
1700
+ };
1701
+ const deserializeAws_restJson1UnauthorizedExceptionResponse = async (parsedOutput, context) => {
1702
+ const contents = map({});
1703
+ const data = parsedOutput.body;
1704
+ if (data.errorAttribute != null) {
1705
+ contents.ErrorAttribute = __expectString(data.errorAttribute);
1706
+ }
1707
+ if (data.message != null) {
1708
+ contents.Message = __expectString(data.message);
1709
+ }
1710
+ const exception = new UnauthorizedException({
1711
+ $metadata: deserializeMetadata(parsedOutput),
1712
+ ...contents,
2360
1713
  });
2361
- }); };
2362
- var serializeAws_restJson1__listOf__string = function (input, context) {
1714
+ return __decorateServiceException(exception, parsedOutput.body);
1715
+ };
1716
+ const serializeAws_restJson1__listOf__string = (input, context) => {
2363
1717
  return input
2364
- .filter(function (e) { return e != null; })
2365
- .map(function (entry) {
1718
+ .filter((e) => e != null)
1719
+ .map((entry) => {
2366
1720
  return entry;
2367
1721
  });
2368
1722
  };
2369
- var serializeAws_restJson1__listOfUser = function (input, context) {
1723
+ const serializeAws_restJson1__listOfUser = (input, context) => {
2370
1724
  return input
2371
- .filter(function (e) { return e != null; })
2372
- .map(function (entry) {
1725
+ .filter((e) => e != null)
1726
+ .map((entry) => {
2373
1727
  return serializeAws_restJson1User(entry, context);
2374
1728
  });
2375
1729
  };
2376
- var serializeAws_restJson1__mapOf__string = function (input, context) {
2377
- return Object.entries(input).reduce(function (acc, _a) {
2378
- var _b;
2379
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1730
+ const serializeAws_restJson1__mapOf__string = (input, context) => {
1731
+ return Object.entries(input).reduce((acc, [key, value]) => {
2380
1732
  if (value === null) {
2381
1733
  return acc;
2382
1734
  }
2383
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1735
+ return {
1736
+ ...acc,
1737
+ [key]: value,
1738
+ };
2384
1739
  }, {});
2385
1740
  };
2386
- var serializeAws_restJson1ConfigurationId = function (input, context) {
2387
- return __assign(__assign({}, (input.Id != null && { id: input.Id })), (input.Revision != null && { revision: input.Revision }));
1741
+ const serializeAws_restJson1ConfigurationId = (input, context) => {
1742
+ return {
1743
+ ...(input.Id != null && { id: input.Id }),
1744
+ ...(input.Revision != null && { revision: input.Revision }),
1745
+ };
2388
1746
  };
2389
- var serializeAws_restJson1EncryptionOptions = function (input, context) {
2390
- return __assign(__assign({}, (input.KmsKeyId != null && { kmsKeyId: input.KmsKeyId })), (input.UseAwsOwnedKey != null && { useAwsOwnedKey: input.UseAwsOwnedKey }));
1747
+ const serializeAws_restJson1EncryptionOptions = (input, context) => {
1748
+ return {
1749
+ ...(input.KmsKeyId != null && { kmsKeyId: input.KmsKeyId }),
1750
+ ...(input.UseAwsOwnedKey != null && { useAwsOwnedKey: input.UseAwsOwnedKey }),
1751
+ };
2391
1752
  };
2392
- var serializeAws_restJson1LdapServerMetadataInput = function (input, context) {
2393
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.Hosts != null && { hosts: serializeAws_restJson1__listOf__string(input.Hosts, context) })), (input.RoleBase != null && { roleBase: input.RoleBase })), (input.RoleName != null && { roleName: input.RoleName })), (input.RoleSearchMatching != null && { roleSearchMatching: input.RoleSearchMatching })), (input.RoleSearchSubtree != null && { roleSearchSubtree: input.RoleSearchSubtree })), (input.ServiceAccountPassword != null && { serviceAccountPassword: input.ServiceAccountPassword })), (input.ServiceAccountUsername != null && { serviceAccountUsername: input.ServiceAccountUsername })), (input.UserBase != null && { userBase: input.UserBase })), (input.UserRoleName != null && { userRoleName: input.UserRoleName })), (input.UserSearchMatching != null && { userSearchMatching: input.UserSearchMatching })), (input.UserSearchSubtree != null && { userSearchSubtree: input.UserSearchSubtree }));
1753
+ const serializeAws_restJson1LdapServerMetadataInput = (input, context) => {
1754
+ return {
1755
+ ...(input.Hosts != null && { hosts: serializeAws_restJson1__listOf__string(input.Hosts, context) }),
1756
+ ...(input.RoleBase != null && { roleBase: input.RoleBase }),
1757
+ ...(input.RoleName != null && { roleName: input.RoleName }),
1758
+ ...(input.RoleSearchMatching != null && { roleSearchMatching: input.RoleSearchMatching }),
1759
+ ...(input.RoleSearchSubtree != null && { roleSearchSubtree: input.RoleSearchSubtree }),
1760
+ ...(input.ServiceAccountPassword != null && { serviceAccountPassword: input.ServiceAccountPassword }),
1761
+ ...(input.ServiceAccountUsername != null && { serviceAccountUsername: input.ServiceAccountUsername }),
1762
+ ...(input.UserBase != null && { userBase: input.UserBase }),
1763
+ ...(input.UserRoleName != null && { userRoleName: input.UserRoleName }),
1764
+ ...(input.UserSearchMatching != null && { userSearchMatching: input.UserSearchMatching }),
1765
+ ...(input.UserSearchSubtree != null && { userSearchSubtree: input.UserSearchSubtree }),
1766
+ };
2394
1767
  };
2395
- var serializeAws_restJson1Logs = function (input, context) {
2396
- return __assign(__assign({}, (input.Audit != null && { audit: input.Audit })), (input.General != null && { general: input.General }));
1768
+ const serializeAws_restJson1Logs = (input, context) => {
1769
+ return {
1770
+ ...(input.Audit != null && { audit: input.Audit }),
1771
+ ...(input.General != null && { general: input.General }),
1772
+ };
2397
1773
  };
2398
- var serializeAws_restJson1User = function (input, context) {
2399
- return __assign(__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 })), (input.Username != null && { username: input.Username }));
1774
+ const serializeAws_restJson1User = (input, context) => {
1775
+ return {
1776
+ ...(input.ConsoleAccess != null && { consoleAccess: input.ConsoleAccess }),
1777
+ ...(input.Groups != null && { groups: serializeAws_restJson1__listOf__string(input.Groups, context) }),
1778
+ ...(input.Password != null && { password: input.Password }),
1779
+ ...(input.Username != null && { username: input.Username }),
1780
+ };
2400
1781
  };
2401
- var serializeAws_restJson1WeeklyStartTime = function (input, context) {
2402
- return __assign(__assign(__assign({}, (input.DayOfWeek != null && { dayOfWeek: input.DayOfWeek })), (input.TimeOfDay != null && { timeOfDay: input.TimeOfDay })), (input.TimeZone != null && { timeZone: input.TimeZone }));
1782
+ const serializeAws_restJson1WeeklyStartTime = (input, context) => {
1783
+ return {
1784
+ ...(input.DayOfWeek != null && { dayOfWeek: input.DayOfWeek }),
1785
+ ...(input.TimeOfDay != null && { timeOfDay: input.TimeOfDay }),
1786
+ ...(input.TimeZone != null && { timeZone: input.TimeZone }),
1787
+ };
2403
1788
  };
2404
- var deserializeAws_restJson1__listOf__string = function (output, context) {
2405
- var retVal = (output || [])
2406
- .filter(function (e) { return e != null; })
2407
- .map(function (entry) {
1789
+ const deserializeAws_restJson1__listOf__string = (output, context) => {
1790
+ const retVal = (output || [])
1791
+ .filter((e) => e != null)
1792
+ .map((entry) => {
2408
1793
  if (entry === null) {
2409
1794
  return null;
2410
1795
  }
@@ -2412,10 +1797,10 @@ var deserializeAws_restJson1__listOf__string = function (output, context) {
2412
1797
  });
2413
1798
  return retVal;
2414
1799
  };
2415
- var deserializeAws_restJson1__listOfActionRequired = function (output, context) {
2416
- var retVal = (output || [])
2417
- .filter(function (e) { return e != null; })
2418
- .map(function (entry) {
1800
+ const deserializeAws_restJson1__listOfActionRequired = (output, context) => {
1801
+ const retVal = (output || [])
1802
+ .filter((e) => e != null)
1803
+ .map((entry) => {
2419
1804
  if (entry === null) {
2420
1805
  return null;
2421
1806
  }
@@ -2423,10 +1808,10 @@ var deserializeAws_restJson1__listOfActionRequired = function (output, context)
2423
1808
  });
2424
1809
  return retVal;
2425
1810
  };
2426
- var deserializeAws_restJson1__listOfAvailabilityZone = function (output, context) {
2427
- var retVal = (output || [])
2428
- .filter(function (e) { return e != null; })
2429
- .map(function (entry) {
1811
+ const deserializeAws_restJson1__listOfAvailabilityZone = (output, context) => {
1812
+ const retVal = (output || [])
1813
+ .filter((e) => e != null)
1814
+ .map((entry) => {
2430
1815
  if (entry === null) {
2431
1816
  return null;
2432
1817
  }
@@ -2434,10 +1819,10 @@ var deserializeAws_restJson1__listOfAvailabilityZone = function (output, context
2434
1819
  });
2435
1820
  return retVal;
2436
1821
  };
2437
- var deserializeAws_restJson1__listOfBrokerEngineType = function (output, context) {
2438
- var retVal = (output || [])
2439
- .filter(function (e) { return e != null; })
2440
- .map(function (entry) {
1822
+ const deserializeAws_restJson1__listOfBrokerEngineType = (output, context) => {
1823
+ const retVal = (output || [])
1824
+ .filter((e) => e != null)
1825
+ .map((entry) => {
2441
1826
  if (entry === null) {
2442
1827
  return null;
2443
1828
  }
@@ -2445,10 +1830,10 @@ var deserializeAws_restJson1__listOfBrokerEngineType = function (output, context
2445
1830
  });
2446
1831
  return retVal;
2447
1832
  };
2448
- var deserializeAws_restJson1__listOfBrokerInstance = function (output, context) {
2449
- var retVal = (output || [])
2450
- .filter(function (e) { return e != null; })
2451
- .map(function (entry) {
1833
+ const deserializeAws_restJson1__listOfBrokerInstance = (output, context) => {
1834
+ const retVal = (output || [])
1835
+ .filter((e) => e != null)
1836
+ .map((entry) => {
2452
1837
  if (entry === null) {
2453
1838
  return null;
2454
1839
  }
@@ -2456,10 +1841,10 @@ var deserializeAws_restJson1__listOfBrokerInstance = function (output, context)
2456
1841
  });
2457
1842
  return retVal;
2458
1843
  };
2459
- var deserializeAws_restJson1__listOfBrokerInstanceOption = function (output, context) {
2460
- var retVal = (output || [])
2461
- .filter(function (e) { return e != null; })
2462
- .map(function (entry) {
1844
+ const deserializeAws_restJson1__listOfBrokerInstanceOption = (output, context) => {
1845
+ const retVal = (output || [])
1846
+ .filter((e) => e != null)
1847
+ .map((entry) => {
2463
1848
  if (entry === null) {
2464
1849
  return null;
2465
1850
  }
@@ -2467,10 +1852,10 @@ var deserializeAws_restJson1__listOfBrokerInstanceOption = function (output, con
2467
1852
  });
2468
1853
  return retVal;
2469
1854
  };
2470
- var deserializeAws_restJson1__listOfBrokerSummary = function (output, context) {
2471
- var retVal = (output || [])
2472
- .filter(function (e) { return e != null; })
2473
- .map(function (entry) {
1855
+ const deserializeAws_restJson1__listOfBrokerSummary = (output, context) => {
1856
+ const retVal = (output || [])
1857
+ .filter((e) => e != null)
1858
+ .map((entry) => {
2474
1859
  if (entry === null) {
2475
1860
  return null;
2476
1861
  }
@@ -2478,10 +1863,10 @@ var deserializeAws_restJson1__listOfBrokerSummary = function (output, context) {
2478
1863
  });
2479
1864
  return retVal;
2480
1865
  };
2481
- var deserializeAws_restJson1__listOfConfiguration = function (output, context) {
2482
- var retVal = (output || [])
2483
- .filter(function (e) { return e != null; })
2484
- .map(function (entry) {
1866
+ const deserializeAws_restJson1__listOfConfiguration = (output, context) => {
1867
+ const retVal = (output || [])
1868
+ .filter((e) => e != null)
1869
+ .map((entry) => {
2485
1870
  if (entry === null) {
2486
1871
  return null;
2487
1872
  }
@@ -2489,10 +1874,10 @@ var deserializeAws_restJson1__listOfConfiguration = function (output, context) {
2489
1874
  });
2490
1875
  return retVal;
2491
1876
  };
2492
- var deserializeAws_restJson1__listOfConfigurationId = function (output, context) {
2493
- var retVal = (output || [])
2494
- .filter(function (e) { return e != null; })
2495
- .map(function (entry) {
1877
+ const deserializeAws_restJson1__listOfConfigurationId = (output, context) => {
1878
+ const retVal = (output || [])
1879
+ .filter((e) => e != null)
1880
+ .map((entry) => {
2496
1881
  if (entry === null) {
2497
1882
  return null;
2498
1883
  }
@@ -2500,10 +1885,10 @@ var deserializeAws_restJson1__listOfConfigurationId = function (output, context)
2500
1885
  });
2501
1886
  return retVal;
2502
1887
  };
2503
- var deserializeAws_restJson1__listOfConfigurationRevision = function (output, context) {
2504
- var retVal = (output || [])
2505
- .filter(function (e) { return e != null; })
2506
- .map(function (entry) {
1888
+ const deserializeAws_restJson1__listOfConfigurationRevision = (output, context) => {
1889
+ const retVal = (output || [])
1890
+ .filter((e) => e != null)
1891
+ .map((entry) => {
2507
1892
  if (entry === null) {
2508
1893
  return null;
2509
1894
  }
@@ -2511,10 +1896,10 @@ var deserializeAws_restJson1__listOfConfigurationRevision = function (output, co
2511
1896
  });
2512
1897
  return retVal;
2513
1898
  };
2514
- var deserializeAws_restJson1__listOfDeploymentMode = function (output, context) {
2515
- var retVal = (output || [])
2516
- .filter(function (e) { return e != null; })
2517
- .map(function (entry) {
1899
+ const deserializeAws_restJson1__listOfDeploymentMode = (output, context) => {
1900
+ const retVal = (output || [])
1901
+ .filter((e) => e != null)
1902
+ .map((entry) => {
2518
1903
  if (entry === null) {
2519
1904
  return null;
2520
1905
  }
@@ -2522,10 +1907,10 @@ var deserializeAws_restJson1__listOfDeploymentMode = function (output, context)
2522
1907
  });
2523
1908
  return retVal;
2524
1909
  };
2525
- var deserializeAws_restJson1__listOfEngineVersion = function (output, context) {
2526
- var retVal = (output || [])
2527
- .filter(function (e) { return e != null; })
2528
- .map(function (entry) {
1910
+ const deserializeAws_restJson1__listOfEngineVersion = (output, context) => {
1911
+ const retVal = (output || [])
1912
+ .filter((e) => e != null)
1913
+ .map((entry) => {
2529
1914
  if (entry === null) {
2530
1915
  return null;
2531
1916
  }
@@ -2533,10 +1918,10 @@ var deserializeAws_restJson1__listOfEngineVersion = function (output, context) {
2533
1918
  });
2534
1919
  return retVal;
2535
1920
  };
2536
- var deserializeAws_restJson1__listOfSanitizationWarning = function (output, context) {
2537
- var retVal = (output || [])
2538
- .filter(function (e) { return e != null; })
2539
- .map(function (entry) {
1921
+ const deserializeAws_restJson1__listOfSanitizationWarning = (output, context) => {
1922
+ const retVal = (output || [])
1923
+ .filter((e) => e != null)
1924
+ .map((entry) => {
2540
1925
  if (entry === null) {
2541
1926
  return null;
2542
1927
  }
@@ -2544,10 +1929,10 @@ var deserializeAws_restJson1__listOfSanitizationWarning = function (output, cont
2544
1929
  });
2545
1930
  return retVal;
2546
1931
  };
2547
- var deserializeAws_restJson1__listOfUserSummary = function (output, context) {
2548
- var retVal = (output || [])
2549
- .filter(function (e) { return e != null; })
2550
- .map(function (entry) {
1932
+ const deserializeAws_restJson1__listOfUserSummary = (output, context) => {
1933
+ const retVal = (output || [])
1934
+ .filter((e) => e != null)
1935
+ .map((entry) => {
2551
1936
  if (entry === null) {
2552
1937
  return null;
2553
1938
  }
@@ -2555,28 +1940,29 @@ var deserializeAws_restJson1__listOfUserSummary = function (output, context) {
2555
1940
  });
2556
1941
  return retVal;
2557
1942
  };
2558
- var deserializeAws_restJson1__mapOf__string = function (output, context) {
2559
- return Object.entries(output).reduce(function (acc, _a) {
2560
- var _b;
2561
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1943
+ const deserializeAws_restJson1__mapOf__string = (output, context) => {
1944
+ return Object.entries(output).reduce((acc, [key, value]) => {
2562
1945
  if (value === null) {
2563
1946
  return acc;
2564
1947
  }
2565
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1948
+ return {
1949
+ ...acc,
1950
+ [key]: __expectString(value),
1951
+ };
2566
1952
  }, {});
2567
1953
  };
2568
- var deserializeAws_restJson1ActionRequired = function (output, context) {
1954
+ const deserializeAws_restJson1ActionRequired = (output, context) => {
2569
1955
  return {
2570
1956
  ActionRequiredCode: __expectString(output.actionRequiredCode),
2571
1957
  ActionRequiredInfo: __expectString(output.actionRequiredInfo),
2572
1958
  };
2573
1959
  };
2574
- var deserializeAws_restJson1AvailabilityZone = function (output, context) {
1960
+ const deserializeAws_restJson1AvailabilityZone = (output, context) => {
2575
1961
  return {
2576
1962
  Name: __expectString(output.name),
2577
1963
  };
2578
1964
  };
2579
- var deserializeAws_restJson1BrokerEngineType = function (output, context) {
1965
+ const deserializeAws_restJson1BrokerEngineType = (output, context) => {
2580
1966
  return {
2581
1967
  EngineType: __expectString(output.engineType),
2582
1968
  EngineVersions: output.engineVersions != null
@@ -2584,14 +1970,14 @@ var deserializeAws_restJson1BrokerEngineType = function (output, context) {
2584
1970
  : undefined,
2585
1971
  };
2586
1972
  };
2587
- var deserializeAws_restJson1BrokerInstance = function (output, context) {
1973
+ const deserializeAws_restJson1BrokerInstance = (output, context) => {
2588
1974
  return {
2589
1975
  ConsoleURL: __expectString(output.consoleURL),
2590
1976
  Endpoints: output.endpoints != null ? deserializeAws_restJson1__listOf__string(output.endpoints, context) : undefined,
2591
1977
  IpAddress: __expectString(output.ipAddress),
2592
1978
  };
2593
1979
  };
2594
- var deserializeAws_restJson1BrokerInstanceOption = function (output, context) {
1980
+ const deserializeAws_restJson1BrokerInstanceOption = (output, context) => {
2595
1981
  return {
2596
1982
  AvailabilityZones: output.availabilityZones != null
2597
1983
  ? deserializeAws_restJson1__listOfAvailabilityZone(output.availabilityZones, context)
@@ -2607,7 +1993,7 @@ var deserializeAws_restJson1BrokerInstanceOption = function (output, context) {
2607
1993
  : undefined,
2608
1994
  };
2609
1995
  };
2610
- var deserializeAws_restJson1BrokerSummary = function (output, context) {
1996
+ const deserializeAws_restJson1BrokerSummary = (output, context) => {
2611
1997
  return {
2612
1998
  BrokerArn: __expectString(output.brokerArn),
2613
1999
  BrokerId: __expectString(output.brokerId),
@@ -2619,7 +2005,7 @@ var deserializeAws_restJson1BrokerSummary = function (output, context) {
2619
2005
  HostInstanceType: __expectString(output.hostInstanceType),
2620
2006
  };
2621
2007
  };
2622
- var deserializeAws_restJson1Configuration = function (output, context) {
2008
+ const deserializeAws_restJson1Configuration = (output, context) => {
2623
2009
  return {
2624
2010
  Arn: __expectString(output.arn),
2625
2011
  AuthenticationStrategy: __expectString(output.authenticationStrategy),
@@ -2635,38 +2021,38 @@ var deserializeAws_restJson1Configuration = function (output, context) {
2635
2021
  Tags: output.tags != null ? deserializeAws_restJson1__mapOf__string(output.tags, context) : undefined,
2636
2022
  };
2637
2023
  };
2638
- var deserializeAws_restJson1ConfigurationId = function (output, context) {
2024
+ const deserializeAws_restJson1ConfigurationId = (output, context) => {
2639
2025
  return {
2640
2026
  Id: __expectString(output.id),
2641
2027
  Revision: __expectInt32(output.revision),
2642
2028
  };
2643
2029
  };
2644
- var deserializeAws_restJson1ConfigurationRevision = function (output, context) {
2030
+ const deserializeAws_restJson1ConfigurationRevision = (output, context) => {
2645
2031
  return {
2646
2032
  Created: output.created != null ? __expectNonNull(__parseRfc3339DateTime(output.created)) : undefined,
2647
2033
  Description: __expectString(output.description),
2648
2034
  Revision: __expectInt32(output.revision),
2649
2035
  };
2650
2036
  };
2651
- var deserializeAws_restJson1Configurations = function (output, context) {
2037
+ const deserializeAws_restJson1Configurations = (output, context) => {
2652
2038
  return {
2653
2039
  Current: output.current != null ? deserializeAws_restJson1ConfigurationId(output.current, context) : undefined,
2654
2040
  History: output.history != null ? deserializeAws_restJson1__listOfConfigurationId(output.history, context) : undefined,
2655
2041
  Pending: output.pending != null ? deserializeAws_restJson1ConfigurationId(output.pending, context) : undefined,
2656
2042
  };
2657
2043
  };
2658
- var deserializeAws_restJson1EncryptionOptions = function (output, context) {
2044
+ const deserializeAws_restJson1EncryptionOptions = (output, context) => {
2659
2045
  return {
2660
2046
  KmsKeyId: __expectString(output.kmsKeyId),
2661
2047
  UseAwsOwnedKey: __expectBoolean(output.useAwsOwnedKey),
2662
2048
  };
2663
2049
  };
2664
- var deserializeAws_restJson1EngineVersion = function (output, context) {
2050
+ const deserializeAws_restJson1EngineVersion = (output, context) => {
2665
2051
  return {
2666
2052
  Name: __expectString(output.name),
2667
2053
  };
2668
2054
  };
2669
- var deserializeAws_restJson1LdapServerMetadataOutput = function (output, context) {
2055
+ const deserializeAws_restJson1LdapServerMetadataOutput = (output, context) => {
2670
2056
  return {
2671
2057
  Hosts: output.hosts != null ? deserializeAws_restJson1__listOf__string(output.hosts, context) : undefined,
2672
2058
  RoleBase: __expectString(output.roleBase),
@@ -2680,13 +2066,13 @@ var deserializeAws_restJson1LdapServerMetadataOutput = function (output, context
2680
2066
  UserSearchSubtree: __expectBoolean(output.userSearchSubtree),
2681
2067
  };
2682
2068
  };
2683
- var deserializeAws_restJson1Logs = function (output, context) {
2069
+ const deserializeAws_restJson1Logs = (output, context) => {
2684
2070
  return {
2685
2071
  Audit: __expectBoolean(output.audit),
2686
2072
  General: __expectBoolean(output.general),
2687
2073
  };
2688
2074
  };
2689
- var deserializeAws_restJson1LogsSummary = function (output, context) {
2075
+ const deserializeAws_restJson1LogsSummary = (output, context) => {
2690
2076
  return {
2691
2077
  Audit: __expectBoolean(output.audit),
2692
2078
  AuditLogGroup: __expectString(output.auditLogGroup),
@@ -2695,77 +2081,72 @@ var deserializeAws_restJson1LogsSummary = function (output, context) {
2695
2081
  Pending: output.pending != null ? deserializeAws_restJson1PendingLogs(output.pending, context) : undefined,
2696
2082
  };
2697
2083
  };
2698
- var deserializeAws_restJson1PendingLogs = function (output, context) {
2084
+ const deserializeAws_restJson1PendingLogs = (output, context) => {
2699
2085
  return {
2700
2086
  Audit: __expectBoolean(output.audit),
2701
2087
  General: __expectBoolean(output.general),
2702
2088
  };
2703
2089
  };
2704
- var deserializeAws_restJson1SanitizationWarning = function (output, context) {
2090
+ const deserializeAws_restJson1SanitizationWarning = (output, context) => {
2705
2091
  return {
2706
2092
  AttributeName: __expectString(output.attributeName),
2707
2093
  ElementName: __expectString(output.elementName),
2708
2094
  Reason: __expectString(output.reason),
2709
2095
  };
2710
2096
  };
2711
- var deserializeAws_restJson1UserPendingChanges = function (output, context) {
2097
+ const deserializeAws_restJson1UserPendingChanges = (output, context) => {
2712
2098
  return {
2713
2099
  ConsoleAccess: __expectBoolean(output.consoleAccess),
2714
2100
  Groups: output.groups != null ? deserializeAws_restJson1__listOf__string(output.groups, context) : undefined,
2715
2101
  PendingChange: __expectString(output.pendingChange),
2716
2102
  };
2717
2103
  };
2718
- var deserializeAws_restJson1UserSummary = function (output, context) {
2104
+ const deserializeAws_restJson1UserSummary = (output, context) => {
2719
2105
  return {
2720
2106
  PendingChange: __expectString(output.pendingChange),
2721
2107
  Username: __expectString(output.username),
2722
2108
  };
2723
2109
  };
2724
- var deserializeAws_restJson1WeeklyStartTime = function (output, context) {
2110
+ const deserializeAws_restJson1WeeklyStartTime = (output, context) => {
2725
2111
  return {
2726
2112
  DayOfWeek: __expectString(output.dayOfWeek),
2727
2113
  TimeOfDay: __expectString(output.timeOfDay),
2728
2114
  TimeZone: __expectString(output.timeZone),
2729
2115
  };
2730
2116
  };
2731
- var deserializeMetadata = function (output) {
2732
- var _a;
2733
- return ({
2734
- httpStatusCode: output.statusCode,
2735
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
2736
- extendedRequestId: output.headers["x-amz-id-2"],
2737
- cfId: output.headers["x-amz-cf-id"],
2738
- });
2739
- };
2740
- var collectBody = function (streamBody, context) {
2741
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
2117
+ const deserializeMetadata = (output) => ({
2118
+ httpStatusCode: output.statusCode,
2119
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
2120
+ extendedRequestId: output.headers["x-amz-id-2"],
2121
+ cfId: output.headers["x-amz-cf-id"],
2122
+ });
2123
+ const collectBody = (streamBody = new Uint8Array(), context) => {
2742
2124
  if (streamBody instanceof Uint8Array) {
2743
2125
  return Promise.resolve(streamBody);
2744
2126
  }
2745
2127
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2746
2128
  };
2747
- var collectBodyString = function (streamBody, context) {
2748
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
2749
- };
2750
- var isSerializableHeaderValue = function (value) {
2751
- return value !== undefined &&
2752
- value !== null &&
2753
- value !== "" &&
2754
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2755
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2756
- };
2757
- var parseBody = function (streamBody, context) {
2758
- return collectBodyString(streamBody, context).then(function (encoded) {
2759
- if (encoded.length) {
2760
- return JSON.parse(encoded);
2761
- }
2762
- return {};
2763
- });
2129
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
2130
+ const isSerializableHeaderValue = (value) => value !== undefined &&
2131
+ value !== null &&
2132
+ value !== "" &&
2133
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2134
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2135
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
2136
+ if (encoded.length) {
2137
+ return JSON.parse(encoded);
2138
+ }
2139
+ return {};
2140
+ });
2141
+ const parseErrorBody = async (errorBody, context) => {
2142
+ const value = await parseBody(errorBody, context);
2143
+ value.message = value.message ?? value.Message;
2144
+ return value;
2764
2145
  };
2765
- var loadRestJsonErrorCode = function (output, data) {
2766
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
2767
- var sanitizeErrorCode = function (rawValue) {
2768
- var cleanValue = rawValue;
2146
+ const loadRestJsonErrorCode = (output, data) => {
2147
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
2148
+ const sanitizeErrorCode = (rawValue) => {
2149
+ let cleanValue = rawValue;
2769
2150
  if (typeof cleanValue === "number") {
2770
2151
  cleanValue = cleanValue.toString();
2771
2152
  }
@@ -2780,7 +2161,7 @@ var loadRestJsonErrorCode = function (output, data) {
2780
2161
  }
2781
2162
  return cleanValue;
2782
2163
  };
2783
- var headerKey = findKey(output.headers, "x-amzn-errortype");
2164
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
2784
2165
  if (headerKey !== undefined) {
2785
2166
  return sanitizeErrorCode(output.headers[headerKey]);
2786
2167
  }