@aws-sdk/client-managedblockchain 3.183.0 → 3.185.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 (42) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist-cjs/protocols/Aws_restJson1.js +2 -2
  3. package/dist-es/ManagedBlockchain.js +101 -94
  4. package/dist-es/ManagedBlockchainClient.js +28 -22
  5. package/dist-es/commands/CreateMemberCommand.js +28 -21
  6. package/dist-es/commands/CreateNetworkCommand.js +28 -21
  7. package/dist-es/commands/CreateNodeCommand.js +28 -21
  8. package/dist-es/commands/CreateProposalCommand.js +28 -21
  9. package/dist-es/commands/DeleteMemberCommand.js +28 -21
  10. package/dist-es/commands/DeleteNodeCommand.js +28 -21
  11. package/dist-es/commands/GetMemberCommand.js +28 -21
  12. package/dist-es/commands/GetNetworkCommand.js +28 -21
  13. package/dist-es/commands/GetNodeCommand.js +28 -21
  14. package/dist-es/commands/GetProposalCommand.js +28 -21
  15. package/dist-es/commands/ListInvitationsCommand.js +28 -21
  16. package/dist-es/commands/ListMembersCommand.js +28 -21
  17. package/dist-es/commands/ListNetworksCommand.js +28 -21
  18. package/dist-es/commands/ListNodesCommand.js +28 -21
  19. package/dist-es/commands/ListProposalVotesCommand.js +28 -21
  20. package/dist-es/commands/ListProposalsCommand.js +28 -21
  21. package/dist-es/commands/ListTagsForResourceCommand.js +28 -21
  22. package/dist-es/commands/RejectInvitationCommand.js +28 -21
  23. package/dist-es/commands/TagResourceCommand.js +28 -21
  24. package/dist-es/commands/UntagResourceCommand.js +28 -21
  25. package/dist-es/commands/UpdateMemberCommand.js +28 -21
  26. package/dist-es/commands/UpdateNodeCommand.js +28 -21
  27. package/dist-es/commands/VoteOnProposalCommand.js +28 -21
  28. package/dist-es/endpoints.js +8 -8
  29. package/dist-es/models/ManagedBlockchainServiceException.js +10 -5
  30. package/dist-es/models/models_0.js +208 -374
  31. package/dist-es/pagination/ListInvitationsPaginator.js +68 -25
  32. package/dist-es/pagination/ListMembersPaginator.js +68 -25
  33. package/dist-es/pagination/ListNetworksPaginator.js +68 -25
  34. package/dist-es/pagination/ListNodesPaginator.js +68 -25
  35. package/dist-es/pagination/ListProposalVotesPaginator.js +68 -25
  36. package/dist-es/pagination/ListProposalsPaginator.js +68 -25
  37. package/dist-es/protocols/Aws_restJson1.js +2555 -1862
  38. package/dist-es/runtimeConfig.browser.js +12 -26
  39. package/dist-es/runtimeConfig.js +12 -30
  40. package/dist-es/runtimeConfig.native.js +5 -8
  41. package/dist-es/runtimeConfig.shared.js +11 -8
  42. package/package.json +5 -5
@@ -1,1841 +1,2517 @@
1
+ import { __assign, __awaiter, __generator, __read } from "tslib";
1
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
3
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, parseRfc3339DateTime as __parseRfc3339DateTime, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
3
4
  import { v4 as generateIdempotencyToken } from "uuid";
4
5
  import { ManagedBlockchainServiceException as __BaseException } from "../models/ManagedBlockchainServiceException";
5
6
  import { AccessDeniedException, IllegalActionException, InternalServiceErrorException, InvalidRequestException, ResourceAlreadyExistsException, ResourceLimitExceededException, ResourceNotFoundException, ResourceNotReadyException, ThrottlingException, TooManyTagsException, } from "../models/models_0";
6
- export const serializeAws_restJson1CreateMemberCommand = async (input, context) => {
7
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
- const headers = {
9
- "content-type": "application/json",
10
- };
11
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/networks/{NetworkId}/members";
12
- resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", () => input.NetworkId, "{NetworkId}", false);
13
- let body;
14
- body = JSON.stringify({
15
- ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
16
- ...(input.InvitationId != null && { InvitationId: input.InvitationId }),
17
- ...(input.MemberConfiguration != null && {
18
- MemberConfiguration: serializeAws_restJson1MemberConfiguration(input.MemberConfiguration, context),
19
- }),
20
- });
21
- return new __HttpRequest({
22
- protocol,
23
- hostname,
24
- port,
25
- method: "POST",
26
- headers,
27
- path: resolvedPath,
28
- body,
29
- });
30
- };
31
- export const serializeAws_restJson1CreateNetworkCommand = async (input, context) => {
32
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
33
- const headers = {
34
- "content-type": "application/json",
35
- };
36
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/networks";
37
- let body;
38
- body = JSON.stringify({
39
- ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
40
- ...(input.Description != null && { Description: input.Description }),
41
- ...(input.Framework != null && { Framework: input.Framework }),
42
- ...(input.FrameworkConfiguration != null && {
43
- FrameworkConfiguration: serializeAws_restJson1NetworkFrameworkConfiguration(input.FrameworkConfiguration, context),
44
- }),
45
- ...(input.FrameworkVersion != null && { FrameworkVersion: input.FrameworkVersion }),
46
- ...(input.MemberConfiguration != null && {
47
- MemberConfiguration: serializeAws_restJson1MemberConfiguration(input.MemberConfiguration, context),
48
- }),
49
- ...(input.Name != null && { Name: input.Name }),
50
- ...(input.Tags != null && { Tags: serializeAws_restJson1InputTagMap(input.Tags, context) }),
51
- ...(input.VotingPolicy != null && {
52
- VotingPolicy: serializeAws_restJson1VotingPolicy(input.VotingPolicy, context),
53
- }),
54
- });
55
- return new __HttpRequest({
56
- protocol,
57
- hostname,
58
- port,
59
- method: "POST",
60
- headers,
61
- path: resolvedPath,
62
- body,
63
- });
64
- };
65
- export const serializeAws_restJson1CreateNodeCommand = async (input, context) => {
66
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
67
- const headers = {
68
- "content-type": "application/json",
69
- };
70
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/networks/{NetworkId}/nodes";
71
- resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", () => input.NetworkId, "{NetworkId}", false);
72
- let body;
73
- body = JSON.stringify({
74
- ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
75
- ...(input.MemberId != null && { MemberId: input.MemberId }),
76
- ...(input.NodeConfiguration != null && {
77
- NodeConfiguration: serializeAws_restJson1NodeConfiguration(input.NodeConfiguration, context),
78
- }),
79
- ...(input.Tags != null && { Tags: serializeAws_restJson1InputTagMap(input.Tags, context) }),
80
- });
81
- return new __HttpRequest({
82
- protocol,
83
- hostname,
84
- port,
85
- method: "POST",
86
- headers,
87
- path: resolvedPath,
88
- body,
89
- });
90
- };
91
- export const serializeAws_restJson1CreateProposalCommand = async (input, context) => {
92
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
93
- const headers = {
94
- "content-type": "application/json",
95
- };
96
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/networks/{NetworkId}/proposals";
97
- resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", () => input.NetworkId, "{NetworkId}", false);
98
- let body;
99
- body = JSON.stringify({
100
- ...(input.Actions != null && { Actions: serializeAws_restJson1ProposalActions(input.Actions, context) }),
101
- ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
102
- ...(input.Description != null && { Description: input.Description }),
103
- ...(input.MemberId != null && { MemberId: input.MemberId }),
104
- ...(input.Tags != null && { Tags: serializeAws_restJson1InputTagMap(input.Tags, context) }),
105
- });
106
- return new __HttpRequest({
107
- protocol,
108
- hostname,
109
- port,
110
- method: "POST",
111
- headers,
112
- path: resolvedPath,
113
- body,
114
- });
115
- };
116
- export const serializeAws_restJson1DeleteMemberCommand = async (input, context) => {
117
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
118
- const headers = {};
119
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/networks/{NetworkId}/members/{MemberId}";
120
- resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", () => input.NetworkId, "{NetworkId}", false);
121
- resolvedPath = __resolvedPath(resolvedPath, input, "MemberId", () => input.MemberId, "{MemberId}", false);
122
- let body;
123
- return new __HttpRequest({
124
- protocol,
125
- hostname,
126
- port,
127
- method: "DELETE",
128
- headers,
129
- path: resolvedPath,
130
- body,
131
- });
132
- };
133
- export const serializeAws_restJson1DeleteNodeCommand = async (input, context) => {
134
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
135
- const headers = {};
136
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/networks/{NetworkId}/nodes/{NodeId}";
137
- resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", () => input.NetworkId, "{NetworkId}", false);
138
- resolvedPath = __resolvedPath(resolvedPath, input, "NodeId", () => input.NodeId, "{NodeId}", false);
139
- const query = map({
140
- memberId: [, input.MemberId],
141
- });
142
- let body;
143
- return new __HttpRequest({
144
- protocol,
145
- hostname,
146
- port,
147
- method: "DELETE",
148
- headers,
149
- path: resolvedPath,
150
- query,
151
- body,
152
- });
153
- };
154
- export const serializeAws_restJson1GetMemberCommand = async (input, context) => {
155
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
156
- const headers = {};
157
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/networks/{NetworkId}/members/{MemberId}";
158
- resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", () => input.NetworkId, "{NetworkId}", false);
159
- resolvedPath = __resolvedPath(resolvedPath, input, "MemberId", () => input.MemberId, "{MemberId}", false);
160
- let body;
161
- return new __HttpRequest({
162
- protocol,
163
- hostname,
164
- port,
165
- method: "GET",
166
- headers,
167
- path: resolvedPath,
168
- body,
169
- });
170
- };
171
- export const serializeAws_restJson1GetNetworkCommand = async (input, context) => {
172
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
173
- const headers = {};
174
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/networks/{NetworkId}";
175
- resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", () => input.NetworkId, "{NetworkId}", false);
176
- let body;
177
- return new __HttpRequest({
178
- protocol,
179
- hostname,
180
- port,
181
- method: "GET",
182
- headers,
183
- path: resolvedPath,
184
- body,
185
- });
186
- };
187
- export const serializeAws_restJson1GetNodeCommand = async (input, context) => {
188
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
189
- const headers = {};
190
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/networks/{NetworkId}/nodes/{NodeId}";
191
- resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", () => input.NetworkId, "{NetworkId}", false);
192
- resolvedPath = __resolvedPath(resolvedPath, input, "NodeId", () => input.NodeId, "{NodeId}", false);
193
- const query = map({
194
- memberId: [, input.MemberId],
195
- });
196
- let body;
197
- return new __HttpRequest({
198
- protocol,
199
- hostname,
200
- port,
201
- method: "GET",
202
- headers,
203
- path: resolvedPath,
204
- query,
205
- body,
206
- });
207
- };
208
- export const serializeAws_restJson1GetProposalCommand = async (input, context) => {
209
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
210
- const headers = {};
211
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
212
- "/networks/{NetworkId}/proposals/{ProposalId}";
213
- resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", () => input.NetworkId, "{NetworkId}", false);
214
- resolvedPath = __resolvedPath(resolvedPath, input, "ProposalId", () => input.ProposalId, "{ProposalId}", false);
215
- let body;
216
- return new __HttpRequest({
217
- protocol,
218
- hostname,
219
- port,
220
- method: "GET",
221
- headers,
222
- path: resolvedPath,
223
- body,
224
- });
225
- };
226
- export const serializeAws_restJson1ListInvitationsCommand = async (input, context) => {
227
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
228
- const headers = {};
229
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/invitations";
230
- const query = map({
231
- maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
232
- nextToken: [, input.NextToken],
233
- });
234
- let body;
235
- return new __HttpRequest({
236
- protocol,
237
- hostname,
238
- port,
239
- method: "GET",
240
- headers,
241
- path: resolvedPath,
242
- query,
243
- body,
244
- });
245
- };
246
- export const serializeAws_restJson1ListMembersCommand = async (input, context) => {
247
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
248
- const headers = {};
249
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/networks/{NetworkId}/members";
250
- resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", () => input.NetworkId, "{NetworkId}", false);
251
- const query = map({
252
- name: [, input.Name],
253
- status: [, input.Status],
254
- isOwned: [() => input.IsOwned !== void 0, () => input.IsOwned.toString()],
255
- maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
256
- nextToken: [, input.NextToken],
257
- });
258
- let body;
259
- return new __HttpRequest({
260
- protocol,
261
- hostname,
262
- port,
263
- method: "GET",
264
- headers,
265
- path: resolvedPath,
266
- query,
267
- body,
268
- });
269
- };
270
- export const serializeAws_restJson1ListNetworksCommand = async (input, context) => {
271
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
272
- const headers = {};
273
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/networks";
274
- const query = map({
275
- name: [, input.Name],
276
- framework: [, input.Framework],
277
- status: [, input.Status],
278
- maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
279
- nextToken: [, input.NextToken],
280
- });
281
- let body;
282
- return new __HttpRequest({
283
- protocol,
284
- hostname,
285
- port,
286
- method: "GET",
287
- headers,
288
- path: resolvedPath,
289
- query,
290
- body,
291
- });
292
- };
293
- export const serializeAws_restJson1ListNodesCommand = async (input, context) => {
294
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
295
- const headers = {};
296
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/networks/{NetworkId}/nodes";
297
- resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", () => input.NetworkId, "{NetworkId}", false);
298
- const query = map({
299
- memberId: [, input.MemberId],
300
- status: [, input.Status],
301
- maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
302
- nextToken: [, input.NextToken],
303
- });
304
- let body;
305
- return new __HttpRequest({
306
- protocol,
307
- hostname,
308
- port,
309
- method: "GET",
310
- headers,
311
- path: resolvedPath,
312
- query,
313
- body,
314
- });
315
- };
316
- export const serializeAws_restJson1ListProposalsCommand = async (input, context) => {
317
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
318
- const headers = {};
319
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/networks/{NetworkId}/proposals";
320
- resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", () => input.NetworkId, "{NetworkId}", false);
321
- const query = map({
322
- maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
323
- nextToken: [, input.NextToken],
324
- });
325
- let body;
326
- return new __HttpRequest({
327
- protocol,
328
- hostname,
329
- port,
330
- method: "GET",
331
- headers,
332
- path: resolvedPath,
333
- query,
334
- body,
335
- });
336
- };
337
- export const serializeAws_restJson1ListProposalVotesCommand = async (input, context) => {
338
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
339
- const headers = {};
340
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
341
- "/networks/{NetworkId}/proposals/{ProposalId}/votes";
342
- resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", () => input.NetworkId, "{NetworkId}", false);
343
- resolvedPath = __resolvedPath(resolvedPath, input, "ProposalId", () => input.ProposalId, "{ProposalId}", false);
344
- const query = map({
345
- maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
346
- nextToken: [, input.NextToken],
347
- });
348
- let body;
349
- return new __HttpRequest({
350
- protocol,
351
- hostname,
352
- port,
353
- method: "GET",
354
- headers,
355
- path: resolvedPath,
356
- query,
357
- body,
358
- });
359
- };
360
- export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
361
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
362
- const headers = {};
363
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
364
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
365
- let body;
366
- return new __HttpRequest({
367
- protocol,
368
- hostname,
369
- port,
370
- method: "GET",
371
- headers,
372
- path: resolvedPath,
373
- body,
374
- });
375
- };
376
- export const serializeAws_restJson1RejectInvitationCommand = async (input, context) => {
377
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
378
- const headers = {};
379
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/invitations/{InvitationId}";
380
- resolvedPath = __resolvedPath(resolvedPath, input, "InvitationId", () => input.InvitationId, "{InvitationId}", false);
381
- let body;
382
- return new __HttpRequest({
383
- protocol,
384
- hostname,
385
- port,
386
- method: "DELETE",
387
- headers,
388
- path: resolvedPath,
389
- body,
390
- });
391
- };
392
- export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
393
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
394
- const headers = {
395
- "content-type": "application/json",
396
- };
397
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
398
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
399
- let body;
400
- body = JSON.stringify({
401
- ...(input.Tags != null && { Tags: serializeAws_restJson1InputTagMap(input.Tags, context) }),
402
- });
403
- return new __HttpRequest({
404
- protocol,
405
- hostname,
406
- port,
407
- method: "POST",
408
- headers,
409
- path: resolvedPath,
410
- body,
411
- });
412
- };
413
- export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
414
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
415
- const headers = {};
416
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
417
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
418
- const query = map({
419
- tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
420
- });
421
- let body;
422
- return new __HttpRequest({
423
- protocol,
424
- hostname,
425
- port,
426
- method: "DELETE",
427
- headers,
428
- path: resolvedPath,
429
- query,
430
- body,
431
- });
432
- };
433
- export const serializeAws_restJson1UpdateMemberCommand = async (input, context) => {
434
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
435
- const headers = {
436
- "content-type": "application/json",
437
- };
438
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/networks/{NetworkId}/members/{MemberId}";
439
- resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", () => input.NetworkId, "{NetworkId}", false);
440
- resolvedPath = __resolvedPath(resolvedPath, input, "MemberId", () => input.MemberId, "{MemberId}", false);
441
- let body;
442
- body = JSON.stringify({
443
- ...(input.LogPublishingConfiguration != null && {
444
- LogPublishingConfiguration: serializeAws_restJson1MemberLogPublishingConfiguration(input.LogPublishingConfiguration, context),
445
- }),
446
- });
447
- return new __HttpRequest({
448
- protocol,
449
- hostname,
450
- port,
451
- method: "PATCH",
452
- headers,
453
- path: resolvedPath,
454
- body,
455
- });
456
- };
457
- export const serializeAws_restJson1UpdateNodeCommand = async (input, context) => {
458
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
459
- const headers = {
460
- "content-type": "application/json",
461
- };
462
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/networks/{NetworkId}/nodes/{NodeId}";
463
- resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", () => input.NetworkId, "{NetworkId}", false);
464
- resolvedPath = __resolvedPath(resolvedPath, input, "NodeId", () => input.NodeId, "{NodeId}", false);
465
- let body;
466
- body = JSON.stringify({
467
- ...(input.LogPublishingConfiguration != null && {
468
- LogPublishingConfiguration: serializeAws_restJson1NodeLogPublishingConfiguration(input.LogPublishingConfiguration, context),
469
- }),
470
- ...(input.MemberId != null && { MemberId: input.MemberId }),
471
- });
472
- return new __HttpRequest({
473
- protocol,
474
- hostname,
475
- port,
476
- method: "PATCH",
477
- headers,
478
- path: resolvedPath,
479
- body,
480
- });
481
- };
482
- export const serializeAws_restJson1VoteOnProposalCommand = async (input, context) => {
483
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
484
- const headers = {
485
- "content-type": "application/json",
486
- };
487
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
488
- "/networks/{NetworkId}/proposals/{ProposalId}/votes";
489
- resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", () => input.NetworkId, "{NetworkId}", false);
490
- resolvedPath = __resolvedPath(resolvedPath, input, "ProposalId", () => input.ProposalId, "{ProposalId}", false);
491
- let body;
492
- body = JSON.stringify({
493
- ...(input.Vote != null && { Vote: input.Vote }),
494
- ...(input.VoterMemberId != null && { VoterMemberId: input.VoterMemberId }),
495
- });
496
- return new __HttpRequest({
497
- protocol,
498
- hostname,
499
- port,
500
- method: "POST",
501
- headers,
502
- path: resolvedPath,
503
- body,
504
- });
505
- };
506
- export const deserializeAws_restJson1CreateMemberCommand = async (output, context) => {
507
- if (output.statusCode !== 200 && output.statusCode >= 300) {
508
- return deserializeAws_restJson1CreateMemberCommandError(output, context);
509
- }
510
- const contents = map({
511
- $metadata: deserializeMetadata(output),
7
+ export var serializeAws_restJson1CreateMemberCommand = 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 || "") + "/networks/{NetworkId}/members";
19
+ resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", function () { return input.NetworkId; }, "{NetworkId}", false);
20
+ body = JSON.stringify(__assign(__assign({ ClientRequestToken: (_c = input.ClientRequestToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.InvitationId != null && { InvitationId: input.InvitationId })), (input.MemberConfiguration != null && {
21
+ MemberConfiguration: serializeAws_restJson1MemberConfiguration(input.MemberConfiguration, context),
22
+ })));
23
+ return [2, new __HttpRequest({
24
+ protocol: protocol,
25
+ hostname: hostname,
26
+ port: port,
27
+ method: "POST",
28
+ headers: headers,
29
+ path: resolvedPath,
30
+ body: body,
31
+ })];
32
+ }
512
33
  });
513
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
514
- if (data.MemberId != null) {
515
- contents.MemberId = __expectString(data.MemberId);
516
- }
517
- return contents;
518
- };
519
- const deserializeAws_restJson1CreateMemberCommandError = async (output, context) => {
520
- const parsedOutput = {
521
- ...output,
522
- body: await parseErrorBody(output.body, context),
523
- };
524
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
525
- switch (errorCode) {
526
- case "AccessDeniedException":
527
- case "com.amazonaws.managedblockchain#AccessDeniedException":
528
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
529
- case "InternalServiceErrorException":
530
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
531
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
532
- case "InvalidRequestException":
533
- case "com.amazonaws.managedblockchain#InvalidRequestException":
534
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
535
- case "ResourceAlreadyExistsException":
536
- case "com.amazonaws.managedblockchain#ResourceAlreadyExistsException":
537
- throw await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
538
- case "ResourceLimitExceededException":
539
- case "com.amazonaws.managedblockchain#ResourceLimitExceededException":
540
- throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
541
- case "ResourceNotFoundException":
542
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
543
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
544
- case "ResourceNotReadyException":
545
- case "com.amazonaws.managedblockchain#ResourceNotReadyException":
546
- throw await deserializeAws_restJson1ResourceNotReadyExceptionResponse(parsedOutput, context);
547
- case "ThrottlingException":
548
- case "com.amazonaws.managedblockchain#ThrottlingException":
549
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
550
- case "TooManyTagsException":
551
- case "com.amazonaws.managedblockchain#TooManyTagsException":
552
- throw await deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context);
553
- default:
554
- const parsedBody = parsedOutput.body;
555
- throwDefaultError({
556
- output,
557
- parsedBody,
558
- exceptionCtor: __BaseException,
559
- errorCode,
560
- });
561
- }
562
- };
563
- export const deserializeAws_restJson1CreateNetworkCommand = async (output, context) => {
564
- if (output.statusCode !== 200 && output.statusCode >= 300) {
565
- return deserializeAws_restJson1CreateNetworkCommandError(output, context);
566
- }
567
- const contents = map({
568
- $metadata: deserializeMetadata(output),
34
+ }); };
35
+ export var serializeAws_restJson1CreateNetworkCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
36
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
37
+ var _c;
38
+ return __generator(this, function (_d) {
39
+ switch (_d.label) {
40
+ case 0: return [4, context.endpoint()];
41
+ case 1:
42
+ _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
43
+ headers = {
44
+ "content-type": "application/json",
45
+ };
46
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/networks";
47
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ ClientRequestToken: (_c = input.ClientRequestToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.Description != null && { Description: input.Description })), (input.Framework != null && { Framework: input.Framework })), (input.FrameworkConfiguration != null && {
48
+ FrameworkConfiguration: serializeAws_restJson1NetworkFrameworkConfiguration(input.FrameworkConfiguration, context),
49
+ })), (input.FrameworkVersion != null && { FrameworkVersion: input.FrameworkVersion })), (input.MemberConfiguration != null && {
50
+ MemberConfiguration: serializeAws_restJson1MemberConfiguration(input.MemberConfiguration, context),
51
+ })), (input.Name != null && { Name: input.Name })), (input.Tags != null && { Tags: serializeAws_restJson1InputTagMap(input.Tags, context) })), (input.VotingPolicy != null && {
52
+ VotingPolicy: serializeAws_restJson1VotingPolicy(input.VotingPolicy, context),
53
+ })));
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
+ }
569
64
  });
570
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
571
- if (data.MemberId != null) {
572
- contents.MemberId = __expectString(data.MemberId);
573
- }
574
- if (data.NetworkId != null) {
575
- contents.NetworkId = __expectString(data.NetworkId);
576
- }
577
- return contents;
578
- };
579
- const deserializeAws_restJson1CreateNetworkCommandError = async (output, context) => {
580
- const parsedOutput = {
581
- ...output,
582
- body: await parseErrorBody(output.body, context),
583
- };
584
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
585
- switch (errorCode) {
586
- case "AccessDeniedException":
587
- case "com.amazonaws.managedblockchain#AccessDeniedException":
588
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
589
- case "InternalServiceErrorException":
590
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
591
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
592
- case "InvalidRequestException":
593
- case "com.amazonaws.managedblockchain#InvalidRequestException":
594
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
595
- case "ResourceAlreadyExistsException":
596
- case "com.amazonaws.managedblockchain#ResourceAlreadyExistsException":
597
- throw await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
598
- case "ResourceLimitExceededException":
599
- case "com.amazonaws.managedblockchain#ResourceLimitExceededException":
600
- throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
601
- case "ThrottlingException":
602
- case "com.amazonaws.managedblockchain#ThrottlingException":
603
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
604
- case "TooManyTagsException":
605
- case "com.amazonaws.managedblockchain#TooManyTagsException":
606
- throw await deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context);
607
- default:
608
- const parsedBody = parsedOutput.body;
609
- throwDefaultError({
610
- output,
611
- parsedBody,
612
- exceptionCtor: __BaseException,
613
- errorCode,
614
- });
615
- }
616
- };
617
- export const deserializeAws_restJson1CreateNodeCommand = async (output, context) => {
618
- if (output.statusCode !== 200 && output.statusCode >= 300) {
619
- return deserializeAws_restJson1CreateNodeCommandError(output, context);
620
- }
621
- const contents = map({
622
- $metadata: deserializeMetadata(output),
65
+ }); };
66
+ export var serializeAws_restJson1CreateNodeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
67
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
68
+ var _c;
69
+ return __generator(this, function (_d) {
70
+ switch (_d.label) {
71
+ case 0: return [4, context.endpoint()];
72
+ case 1:
73
+ _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
74
+ headers = {
75
+ "content-type": "application/json",
76
+ };
77
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/networks/{NetworkId}/nodes";
78
+ resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", function () { return input.NetworkId; }, "{NetworkId}", false);
79
+ body = JSON.stringify(__assign(__assign(__assign({ ClientRequestToken: (_c = input.ClientRequestToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.MemberId != null && { MemberId: input.MemberId })), (input.NodeConfiguration != null && {
80
+ NodeConfiguration: serializeAws_restJson1NodeConfiguration(input.NodeConfiguration, context),
81
+ })), (input.Tags != null && { Tags: serializeAws_restJson1InputTagMap(input.Tags, context) })));
82
+ return [2, new __HttpRequest({
83
+ protocol: protocol,
84
+ hostname: hostname,
85
+ port: port,
86
+ method: "POST",
87
+ headers: headers,
88
+ path: resolvedPath,
89
+ body: body,
90
+ })];
91
+ }
623
92
  });
624
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
625
- if (data.NodeId != null) {
626
- contents.NodeId = __expectString(data.NodeId);
627
- }
628
- return contents;
629
- };
630
- const deserializeAws_restJson1CreateNodeCommandError = async (output, context) => {
631
- const parsedOutput = {
632
- ...output,
633
- body: await parseErrorBody(output.body, context),
634
- };
635
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
636
- switch (errorCode) {
637
- case "AccessDeniedException":
638
- case "com.amazonaws.managedblockchain#AccessDeniedException":
639
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
640
- case "InternalServiceErrorException":
641
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
642
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
643
- case "InvalidRequestException":
644
- case "com.amazonaws.managedblockchain#InvalidRequestException":
645
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
646
- case "ResourceAlreadyExistsException":
647
- case "com.amazonaws.managedblockchain#ResourceAlreadyExistsException":
648
- throw await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
649
- case "ResourceLimitExceededException":
650
- case "com.amazonaws.managedblockchain#ResourceLimitExceededException":
651
- throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
652
- case "ResourceNotFoundException":
653
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
654
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
655
- case "ResourceNotReadyException":
656
- case "com.amazonaws.managedblockchain#ResourceNotReadyException":
657
- throw await deserializeAws_restJson1ResourceNotReadyExceptionResponse(parsedOutput, context);
658
- case "ThrottlingException":
659
- case "com.amazonaws.managedblockchain#ThrottlingException":
660
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
661
- case "TooManyTagsException":
662
- case "com.amazonaws.managedblockchain#TooManyTagsException":
663
- throw await deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context);
664
- default:
665
- const parsedBody = parsedOutput.body;
666
- throwDefaultError({
667
- output,
668
- parsedBody,
669
- exceptionCtor: __BaseException,
670
- errorCode,
671
- });
672
- }
673
- };
674
- export const deserializeAws_restJson1CreateProposalCommand = async (output, context) => {
675
- if (output.statusCode !== 200 && output.statusCode >= 300) {
676
- return deserializeAws_restJson1CreateProposalCommandError(output, context);
677
- }
678
- const contents = map({
679
- $metadata: deserializeMetadata(output),
93
+ }); };
94
+ export var serializeAws_restJson1CreateProposalCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
95
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
96
+ var _c;
97
+ return __generator(this, function (_d) {
98
+ switch (_d.label) {
99
+ case 0: return [4, context.endpoint()];
100
+ case 1:
101
+ _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
102
+ headers = {
103
+ "content-type": "application/json",
104
+ };
105
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/networks/{NetworkId}/proposals";
106
+ resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", function () { return input.NetworkId; }, "{NetworkId}", false);
107
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.Actions != null && { Actions: serializeAws_restJson1ProposalActions(input.Actions, context) })), { ClientRequestToken: (_c = input.ClientRequestToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }), (input.Description != null && { Description: input.Description })), (input.MemberId != null && { MemberId: input.MemberId })), (input.Tags != null && { Tags: serializeAws_restJson1InputTagMap(input.Tags, context) })));
108
+ return [2, new __HttpRequest({
109
+ protocol: protocol,
110
+ hostname: hostname,
111
+ port: port,
112
+ method: "POST",
113
+ headers: headers,
114
+ path: resolvedPath,
115
+ body: body,
116
+ })];
117
+ }
680
118
  });
681
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
682
- if (data.ProposalId != null) {
683
- contents.ProposalId = __expectString(data.ProposalId);
684
- }
685
- return contents;
686
- };
687
- const deserializeAws_restJson1CreateProposalCommandError = async (output, context) => {
688
- const parsedOutput = {
689
- ...output,
690
- body: await parseErrorBody(output.body, context),
691
- };
692
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
693
- switch (errorCode) {
694
- case "AccessDeniedException":
695
- case "com.amazonaws.managedblockchain#AccessDeniedException":
696
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
697
- case "InternalServiceErrorException":
698
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
699
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
700
- case "InvalidRequestException":
701
- case "com.amazonaws.managedblockchain#InvalidRequestException":
702
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
703
- case "ResourceNotFoundException":
704
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
705
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
706
- case "ResourceNotReadyException":
707
- case "com.amazonaws.managedblockchain#ResourceNotReadyException":
708
- throw await deserializeAws_restJson1ResourceNotReadyExceptionResponse(parsedOutput, context);
709
- case "ThrottlingException":
710
- case "com.amazonaws.managedblockchain#ThrottlingException":
711
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
712
- case "TooManyTagsException":
713
- case "com.amazonaws.managedblockchain#TooManyTagsException":
714
- throw await deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context);
715
- default:
716
- const parsedBody = parsedOutput.body;
717
- throwDefaultError({
718
- output,
719
- parsedBody,
720
- exceptionCtor: __BaseException,
721
- errorCode,
722
- });
723
- }
724
- };
725
- export const deserializeAws_restJson1DeleteMemberCommand = async (output, context) => {
726
- if (output.statusCode !== 200 && output.statusCode >= 300) {
727
- return deserializeAws_restJson1DeleteMemberCommandError(output, context);
728
- }
729
- const contents = map({
730
- $metadata: deserializeMetadata(output),
119
+ }); };
120
+ export var serializeAws_restJson1DeleteMemberCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
121
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
122
+ return __generator(this, function (_c) {
123
+ switch (_c.label) {
124
+ case 0: return [4, context.endpoint()];
125
+ case 1:
126
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
127
+ headers = {};
128
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/networks/{NetworkId}/members/{MemberId}";
129
+ resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", function () { return input.NetworkId; }, "{NetworkId}", false);
130
+ resolvedPath = __resolvedPath(resolvedPath, input, "MemberId", function () { return input.MemberId; }, "{MemberId}", false);
131
+ return [2, new __HttpRequest({
132
+ protocol: protocol,
133
+ hostname: hostname,
134
+ port: port,
135
+ method: "DELETE",
136
+ headers: headers,
137
+ path: resolvedPath,
138
+ body: body,
139
+ })];
140
+ }
731
141
  });
732
- await collectBody(output.body, context);
733
- return contents;
734
- };
735
- const deserializeAws_restJson1DeleteMemberCommandError = async (output, context) => {
736
- const parsedOutput = {
737
- ...output,
738
- body: await parseErrorBody(output.body, context),
739
- };
740
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
741
- switch (errorCode) {
742
- case "AccessDeniedException":
743
- case "com.amazonaws.managedblockchain#AccessDeniedException":
744
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
745
- case "InternalServiceErrorException":
746
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
747
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
748
- case "InvalidRequestException":
749
- case "com.amazonaws.managedblockchain#InvalidRequestException":
750
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
751
- case "ResourceNotFoundException":
752
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
753
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
754
- case "ResourceNotReadyException":
755
- case "com.amazonaws.managedblockchain#ResourceNotReadyException":
756
- throw await deserializeAws_restJson1ResourceNotReadyExceptionResponse(parsedOutput, context);
757
- case "ThrottlingException":
758
- case "com.amazonaws.managedblockchain#ThrottlingException":
759
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
760
- default:
761
- const parsedBody = parsedOutput.body;
762
- throwDefaultError({
763
- output,
764
- parsedBody,
765
- exceptionCtor: __BaseException,
766
- errorCode,
767
- });
768
- }
769
- };
770
- export const deserializeAws_restJson1DeleteNodeCommand = async (output, context) => {
771
- if (output.statusCode !== 200 && output.statusCode >= 300) {
772
- return deserializeAws_restJson1DeleteNodeCommandError(output, context);
773
- }
774
- const contents = map({
775
- $metadata: deserializeMetadata(output),
142
+ }); };
143
+ export var serializeAws_restJson1DeleteNodeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
144
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
145
+ return __generator(this, function (_c) {
146
+ switch (_c.label) {
147
+ case 0: return [4, context.endpoint()];
148
+ case 1:
149
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
150
+ headers = {};
151
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/networks/{NetworkId}/nodes/{NodeId}";
152
+ resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", function () { return input.NetworkId; }, "{NetworkId}", false);
153
+ resolvedPath = __resolvedPath(resolvedPath, input, "NodeId", function () { return input.NodeId; }, "{NodeId}", false);
154
+ query = map({
155
+ memberId: [, input.MemberId],
156
+ });
157
+ return [2, new __HttpRequest({
158
+ protocol: protocol,
159
+ hostname: hostname,
160
+ port: port,
161
+ method: "DELETE",
162
+ headers: headers,
163
+ path: resolvedPath,
164
+ query: query,
165
+ body: body,
166
+ })];
167
+ }
776
168
  });
777
- await collectBody(output.body, context);
778
- return contents;
779
- };
780
- const deserializeAws_restJson1DeleteNodeCommandError = async (output, context) => {
781
- const parsedOutput = {
782
- ...output,
783
- body: await parseErrorBody(output.body, context),
784
- };
785
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
786
- switch (errorCode) {
787
- case "AccessDeniedException":
788
- case "com.amazonaws.managedblockchain#AccessDeniedException":
789
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
790
- case "InternalServiceErrorException":
791
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
792
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
793
- case "InvalidRequestException":
794
- case "com.amazonaws.managedblockchain#InvalidRequestException":
795
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
796
- case "ResourceNotFoundException":
797
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
798
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
799
- case "ResourceNotReadyException":
800
- case "com.amazonaws.managedblockchain#ResourceNotReadyException":
801
- throw await deserializeAws_restJson1ResourceNotReadyExceptionResponse(parsedOutput, context);
802
- case "ThrottlingException":
803
- case "com.amazonaws.managedblockchain#ThrottlingException":
804
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
805
- default:
806
- const parsedBody = parsedOutput.body;
807
- throwDefaultError({
808
- output,
809
- parsedBody,
810
- exceptionCtor: __BaseException,
811
- errorCode,
812
- });
813
- }
814
- };
815
- export const deserializeAws_restJson1GetMemberCommand = async (output, context) => {
816
- if (output.statusCode !== 200 && output.statusCode >= 300) {
817
- return deserializeAws_restJson1GetMemberCommandError(output, context);
818
- }
819
- const contents = map({
820
- $metadata: deserializeMetadata(output),
169
+ }); };
170
+ export var serializeAws_restJson1GetMemberCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
171
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
172
+ return __generator(this, function (_c) {
173
+ switch (_c.label) {
174
+ case 0: return [4, context.endpoint()];
175
+ case 1:
176
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
177
+ headers = {};
178
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/networks/{NetworkId}/members/{MemberId}";
179
+ resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", function () { return input.NetworkId; }, "{NetworkId}", false);
180
+ resolvedPath = __resolvedPath(resolvedPath, input, "MemberId", function () { return input.MemberId; }, "{MemberId}", false);
181
+ return [2, new __HttpRequest({
182
+ protocol: protocol,
183
+ hostname: hostname,
184
+ port: port,
185
+ method: "GET",
186
+ headers: headers,
187
+ path: resolvedPath,
188
+ body: body,
189
+ })];
190
+ }
821
191
  });
822
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
823
- if (data.Member != null) {
824
- contents.Member = deserializeAws_restJson1Member(data.Member, context);
825
- }
826
- return contents;
827
- };
828
- const deserializeAws_restJson1GetMemberCommandError = async (output, context) => {
829
- const parsedOutput = {
830
- ...output,
831
- body: await parseErrorBody(output.body, context),
832
- };
833
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
834
- switch (errorCode) {
835
- case "AccessDeniedException":
836
- case "com.amazonaws.managedblockchain#AccessDeniedException":
837
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
838
- case "InternalServiceErrorException":
839
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
840
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
841
- case "InvalidRequestException":
842
- case "com.amazonaws.managedblockchain#InvalidRequestException":
843
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
844
- case "ResourceNotFoundException":
845
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
846
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
847
- case "ThrottlingException":
848
- case "com.amazonaws.managedblockchain#ThrottlingException":
849
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
850
- default:
851
- const parsedBody = parsedOutput.body;
852
- throwDefaultError({
853
- output,
854
- parsedBody,
855
- exceptionCtor: __BaseException,
856
- errorCode,
857
- });
858
- }
859
- };
860
- export const deserializeAws_restJson1GetNetworkCommand = async (output, context) => {
861
- if (output.statusCode !== 200 && output.statusCode >= 300) {
862
- return deserializeAws_restJson1GetNetworkCommandError(output, context);
863
- }
864
- const contents = map({
865
- $metadata: deserializeMetadata(output),
192
+ }); };
193
+ export var serializeAws_restJson1GetNetworkCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
194
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
195
+ return __generator(this, function (_c) {
196
+ switch (_c.label) {
197
+ case 0: return [4, context.endpoint()];
198
+ case 1:
199
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
200
+ headers = {};
201
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/networks/{NetworkId}";
202
+ resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", function () { return input.NetworkId; }, "{NetworkId}", false);
203
+ return [2, new __HttpRequest({
204
+ protocol: protocol,
205
+ hostname: hostname,
206
+ port: port,
207
+ method: "GET",
208
+ headers: headers,
209
+ path: resolvedPath,
210
+ body: body,
211
+ })];
212
+ }
866
213
  });
867
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
868
- if (data.Network != null) {
869
- contents.Network = deserializeAws_restJson1Network(data.Network, context);
870
- }
871
- return contents;
872
- };
873
- const deserializeAws_restJson1GetNetworkCommandError = async (output, context) => {
874
- const parsedOutput = {
875
- ...output,
876
- body: await parseErrorBody(output.body, context),
877
- };
878
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
879
- switch (errorCode) {
880
- case "AccessDeniedException":
881
- case "com.amazonaws.managedblockchain#AccessDeniedException":
882
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
883
- case "InternalServiceErrorException":
884
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
885
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
886
- case "InvalidRequestException":
887
- case "com.amazonaws.managedblockchain#InvalidRequestException":
888
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
889
- case "ResourceNotFoundException":
890
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
891
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
892
- case "ThrottlingException":
893
- case "com.amazonaws.managedblockchain#ThrottlingException":
894
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
895
- default:
896
- const parsedBody = parsedOutput.body;
897
- throwDefaultError({
898
- output,
899
- parsedBody,
900
- exceptionCtor: __BaseException,
901
- errorCode,
902
- });
903
- }
904
- };
905
- export const deserializeAws_restJson1GetNodeCommand = async (output, context) => {
906
- if (output.statusCode !== 200 && output.statusCode >= 300) {
907
- return deserializeAws_restJson1GetNodeCommandError(output, context);
908
- }
909
- const contents = map({
910
- $metadata: deserializeMetadata(output),
214
+ }); };
215
+ export var serializeAws_restJson1GetNodeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
216
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
217
+ return __generator(this, function (_c) {
218
+ switch (_c.label) {
219
+ case 0: return [4, context.endpoint()];
220
+ case 1:
221
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
222
+ headers = {};
223
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/networks/{NetworkId}/nodes/{NodeId}";
224
+ resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", function () { return input.NetworkId; }, "{NetworkId}", false);
225
+ resolvedPath = __resolvedPath(resolvedPath, input, "NodeId", function () { return input.NodeId; }, "{NodeId}", false);
226
+ query = map({
227
+ memberId: [, input.MemberId],
228
+ });
229
+ return [2, new __HttpRequest({
230
+ protocol: protocol,
231
+ hostname: hostname,
232
+ port: port,
233
+ method: "GET",
234
+ headers: headers,
235
+ path: resolvedPath,
236
+ query: query,
237
+ body: body,
238
+ })];
239
+ }
911
240
  });
912
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
913
- if (data.Node != null) {
914
- contents.Node = deserializeAws_restJson1Node(data.Node, context);
915
- }
916
- return contents;
917
- };
918
- const deserializeAws_restJson1GetNodeCommandError = async (output, context) => {
919
- const parsedOutput = {
920
- ...output,
921
- body: await parseErrorBody(output.body, context),
922
- };
923
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
924
- switch (errorCode) {
925
- case "AccessDeniedException":
926
- case "com.amazonaws.managedblockchain#AccessDeniedException":
927
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
928
- case "InternalServiceErrorException":
929
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
930
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
931
- case "InvalidRequestException":
932
- case "com.amazonaws.managedblockchain#InvalidRequestException":
933
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
934
- case "ResourceNotFoundException":
935
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
936
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
937
- case "ThrottlingException":
938
- case "com.amazonaws.managedblockchain#ThrottlingException":
939
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
940
- default:
941
- const parsedBody = parsedOutput.body;
942
- throwDefaultError({
943
- output,
944
- parsedBody,
945
- exceptionCtor: __BaseException,
946
- errorCode,
947
- });
948
- }
949
- };
950
- export const deserializeAws_restJson1GetProposalCommand = async (output, context) => {
951
- if (output.statusCode !== 200 && output.statusCode >= 300) {
952
- return deserializeAws_restJson1GetProposalCommandError(output, context);
953
- }
954
- const contents = map({
955
- $metadata: deserializeMetadata(output),
241
+ }); };
242
+ export var serializeAws_restJson1GetProposalCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
243
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
244
+ return __generator(this, function (_c) {
245
+ switch (_c.label) {
246
+ case 0: return [4, context.endpoint()];
247
+ case 1:
248
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
249
+ headers = {};
250
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
251
+ "/networks/{NetworkId}/proposals/{ProposalId}";
252
+ resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", function () { return input.NetworkId; }, "{NetworkId}", false);
253
+ resolvedPath = __resolvedPath(resolvedPath, input, "ProposalId", function () { return input.ProposalId; }, "{ProposalId}", false);
254
+ return [2, new __HttpRequest({
255
+ protocol: protocol,
256
+ hostname: hostname,
257
+ port: port,
258
+ method: "GET",
259
+ headers: headers,
260
+ path: resolvedPath,
261
+ body: body,
262
+ })];
263
+ }
956
264
  });
957
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
958
- if (data.Proposal != null) {
959
- contents.Proposal = deserializeAws_restJson1Proposal(data.Proposal, context);
960
- }
961
- return contents;
962
- };
963
- const deserializeAws_restJson1GetProposalCommandError = async (output, context) => {
964
- const parsedOutput = {
965
- ...output,
966
- body: await parseErrorBody(output.body, context),
967
- };
968
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
969
- switch (errorCode) {
970
- case "AccessDeniedException":
971
- case "com.amazonaws.managedblockchain#AccessDeniedException":
972
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
973
- case "InternalServiceErrorException":
974
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
975
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
976
- case "InvalidRequestException":
977
- case "com.amazonaws.managedblockchain#InvalidRequestException":
978
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
979
- case "ResourceNotFoundException":
980
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
981
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
982
- case "ThrottlingException":
983
- case "com.amazonaws.managedblockchain#ThrottlingException":
984
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
985
- default:
986
- const parsedBody = parsedOutput.body;
987
- throwDefaultError({
988
- output,
989
- parsedBody,
990
- exceptionCtor: __BaseException,
991
- errorCode,
992
- });
993
- }
994
- };
995
- export const deserializeAws_restJson1ListInvitationsCommand = async (output, context) => {
996
- if (output.statusCode !== 200 && output.statusCode >= 300) {
997
- return deserializeAws_restJson1ListInvitationsCommandError(output, context);
998
- }
999
- const contents = map({
1000
- $metadata: deserializeMetadata(output),
265
+ }); };
266
+ export var serializeAws_restJson1ListInvitationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
267
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, 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 || "") + "/invitations";
275
+ query = map({
276
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
277
+ nextToken: [, input.NextToken],
278
+ });
279
+ return [2, new __HttpRequest({
280
+ protocol: protocol,
281
+ hostname: hostname,
282
+ port: port,
283
+ method: "GET",
284
+ headers: headers,
285
+ path: resolvedPath,
286
+ query: query,
287
+ body: body,
288
+ })];
289
+ }
1001
290
  });
1002
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1003
- if (data.Invitations != null) {
1004
- contents.Invitations = deserializeAws_restJson1InvitationList(data.Invitations, context);
1005
- }
1006
- if (data.NextToken != null) {
1007
- contents.NextToken = __expectString(data.NextToken);
1008
- }
1009
- return contents;
1010
- };
1011
- const deserializeAws_restJson1ListInvitationsCommandError = async (output, context) => {
1012
- const parsedOutput = {
1013
- ...output,
1014
- body: await parseErrorBody(output.body, context),
1015
- };
1016
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1017
- switch (errorCode) {
1018
- case "AccessDeniedException":
1019
- case "com.amazonaws.managedblockchain#AccessDeniedException":
1020
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1021
- case "InternalServiceErrorException":
1022
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
1023
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1024
- case "InvalidRequestException":
1025
- case "com.amazonaws.managedblockchain#InvalidRequestException":
1026
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1027
- case "ResourceLimitExceededException":
1028
- case "com.amazonaws.managedblockchain#ResourceLimitExceededException":
1029
- throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
1030
- case "ResourceNotFoundException":
1031
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
1032
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1033
- case "ThrottlingException":
1034
- case "com.amazonaws.managedblockchain#ThrottlingException":
1035
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1036
- default:
1037
- const parsedBody = parsedOutput.body;
1038
- throwDefaultError({
1039
- output,
1040
- parsedBody,
1041
- exceptionCtor: __BaseException,
1042
- errorCode,
1043
- });
1044
- }
1045
- };
1046
- export const deserializeAws_restJson1ListMembersCommand = async (output, context) => {
1047
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1048
- return deserializeAws_restJson1ListMembersCommandError(output, context);
1049
- }
1050
- const contents = map({
1051
- $metadata: deserializeMetadata(output),
291
+ }); };
292
+ export var serializeAws_restJson1ListMembersCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
293
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
294
+ return __generator(this, function (_c) {
295
+ switch (_c.label) {
296
+ case 0: return [4, context.endpoint()];
297
+ case 1:
298
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
299
+ headers = {};
300
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/networks/{NetworkId}/members";
301
+ resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", function () { return input.NetworkId; }, "{NetworkId}", false);
302
+ query = map({
303
+ name: [, input.Name],
304
+ status: [, input.Status],
305
+ isOwned: [function () { return input.IsOwned !== void 0; }, function () { return input.IsOwned.toString(); }],
306
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
307
+ nextToken: [, input.NextToken],
308
+ });
309
+ return [2, new __HttpRequest({
310
+ protocol: protocol,
311
+ hostname: hostname,
312
+ port: port,
313
+ method: "GET",
314
+ headers: headers,
315
+ path: resolvedPath,
316
+ query: query,
317
+ body: body,
318
+ })];
319
+ }
1052
320
  });
1053
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1054
- if (data.Members != null) {
1055
- contents.Members = deserializeAws_restJson1MemberSummaryList(data.Members, context);
1056
- }
1057
- if (data.NextToken != null) {
1058
- contents.NextToken = __expectString(data.NextToken);
1059
- }
1060
- return contents;
1061
- };
1062
- const deserializeAws_restJson1ListMembersCommandError = async (output, context) => {
1063
- const parsedOutput = {
1064
- ...output,
1065
- body: await parseErrorBody(output.body, context),
1066
- };
1067
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1068
- switch (errorCode) {
1069
- case "AccessDeniedException":
1070
- case "com.amazonaws.managedblockchain#AccessDeniedException":
1071
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1072
- case "InternalServiceErrorException":
1073
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
1074
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1075
- case "InvalidRequestException":
1076
- case "com.amazonaws.managedblockchain#InvalidRequestException":
1077
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1078
- case "ThrottlingException":
1079
- case "com.amazonaws.managedblockchain#ThrottlingException":
1080
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1081
- default:
1082
- const parsedBody = parsedOutput.body;
1083
- throwDefaultError({
1084
- output,
1085
- parsedBody,
1086
- exceptionCtor: __BaseException,
1087
- errorCode,
1088
- });
1089
- }
1090
- };
1091
- export const deserializeAws_restJson1ListNetworksCommand = async (output, context) => {
1092
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1093
- return deserializeAws_restJson1ListNetworksCommandError(output, context);
1094
- }
1095
- const contents = map({
1096
- $metadata: deserializeMetadata(output),
321
+ }); };
322
+ export var serializeAws_restJson1ListNetworksCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
323
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
324
+ return __generator(this, function (_c) {
325
+ switch (_c.label) {
326
+ case 0: return [4, context.endpoint()];
327
+ case 1:
328
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
329
+ headers = {};
330
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/networks";
331
+ query = map({
332
+ name: [, input.Name],
333
+ framework: [, input.Framework],
334
+ status: [, input.Status],
335
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
336
+ nextToken: [, input.NextToken],
337
+ });
338
+ return [2, new __HttpRequest({
339
+ protocol: protocol,
340
+ hostname: hostname,
341
+ port: port,
342
+ method: "GET",
343
+ headers: headers,
344
+ path: resolvedPath,
345
+ query: query,
346
+ body: body,
347
+ })];
348
+ }
1097
349
  });
1098
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1099
- if (data.Networks != null) {
1100
- contents.Networks = deserializeAws_restJson1NetworkSummaryList(data.Networks, context);
1101
- }
1102
- if (data.NextToken != null) {
1103
- contents.NextToken = __expectString(data.NextToken);
1104
- }
1105
- return contents;
1106
- };
1107
- const deserializeAws_restJson1ListNetworksCommandError = async (output, context) => {
1108
- const parsedOutput = {
1109
- ...output,
1110
- body: await parseErrorBody(output.body, context),
1111
- };
1112
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1113
- switch (errorCode) {
1114
- case "AccessDeniedException":
1115
- case "com.amazonaws.managedblockchain#AccessDeniedException":
1116
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1117
- case "InternalServiceErrorException":
1118
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
1119
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1120
- case "InvalidRequestException":
1121
- case "com.amazonaws.managedblockchain#InvalidRequestException":
1122
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1123
- case "ThrottlingException":
1124
- case "com.amazonaws.managedblockchain#ThrottlingException":
1125
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1126
- default:
1127
- const parsedBody = parsedOutput.body;
1128
- throwDefaultError({
1129
- output,
1130
- parsedBody,
1131
- exceptionCtor: __BaseException,
1132
- errorCode,
1133
- });
1134
- }
1135
- };
1136
- export const deserializeAws_restJson1ListNodesCommand = async (output, context) => {
1137
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1138
- return deserializeAws_restJson1ListNodesCommandError(output, context);
1139
- }
1140
- const contents = map({
1141
- $metadata: deserializeMetadata(output),
350
+ }); };
351
+ export var serializeAws_restJson1ListNodesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
352
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
353
+ return __generator(this, function (_c) {
354
+ switch (_c.label) {
355
+ case 0: return [4, context.endpoint()];
356
+ case 1:
357
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
358
+ headers = {};
359
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/networks/{NetworkId}/nodes";
360
+ resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", function () { return input.NetworkId; }, "{NetworkId}", false);
361
+ query = map({
362
+ memberId: [, input.MemberId],
363
+ status: [, input.Status],
364
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
365
+ nextToken: [, input.NextToken],
366
+ });
367
+ return [2, new __HttpRequest({
368
+ protocol: protocol,
369
+ hostname: hostname,
370
+ port: port,
371
+ method: "GET",
372
+ headers: headers,
373
+ path: resolvedPath,
374
+ query: query,
375
+ body: body,
376
+ })];
377
+ }
1142
378
  });
1143
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1144
- if (data.NextToken != null) {
1145
- contents.NextToken = __expectString(data.NextToken);
1146
- }
1147
- if (data.Nodes != null) {
1148
- contents.Nodes = deserializeAws_restJson1NodeSummaryList(data.Nodes, context);
1149
- }
1150
- return contents;
1151
- };
1152
- const deserializeAws_restJson1ListNodesCommandError = 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 "AccessDeniedException":
1160
- case "com.amazonaws.managedblockchain#AccessDeniedException":
1161
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1162
- case "InternalServiceErrorException":
1163
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
1164
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1165
- case "InvalidRequestException":
1166
- case "com.amazonaws.managedblockchain#InvalidRequestException":
1167
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1168
- case "ThrottlingException":
1169
- case "com.amazonaws.managedblockchain#ThrottlingException":
1170
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(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_restJson1ListProposalsCommand = async (output, context) => {
1182
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1183
- return deserializeAws_restJson1ListProposalsCommandError(output, context);
1184
- }
1185
- const contents = map({
1186
- $metadata: deserializeMetadata(output),
379
+ }); };
380
+ export var serializeAws_restJson1ListProposalsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
381
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
382
+ return __generator(this, function (_c) {
383
+ switch (_c.label) {
384
+ case 0: return [4, context.endpoint()];
385
+ case 1:
386
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
387
+ headers = {};
388
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/networks/{NetworkId}/proposals";
389
+ resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", function () { return input.NetworkId; }, "{NetworkId}", false);
390
+ query = map({
391
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
392
+ nextToken: [, input.NextToken],
393
+ });
394
+ return [2, new __HttpRequest({
395
+ protocol: protocol,
396
+ hostname: hostname,
397
+ port: port,
398
+ method: "GET",
399
+ headers: headers,
400
+ path: resolvedPath,
401
+ query: query,
402
+ body: body,
403
+ })];
404
+ }
1187
405
  });
1188
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1189
- if (data.NextToken != null) {
1190
- contents.NextToken = __expectString(data.NextToken);
1191
- }
1192
- if (data.Proposals != null) {
1193
- contents.Proposals = deserializeAws_restJson1ProposalSummaryList(data.Proposals, context);
1194
- }
1195
- return contents;
1196
- };
1197
- const deserializeAws_restJson1ListProposalsCommandError = 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 "AccessDeniedException":
1205
- case "com.amazonaws.managedblockchain#AccessDeniedException":
1206
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1207
- case "InternalServiceErrorException":
1208
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
1209
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1210
- case "InvalidRequestException":
1211
- case "com.amazonaws.managedblockchain#InvalidRequestException":
1212
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1213
- case "ResourceNotFoundException":
1214
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
1215
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1216
- case "ThrottlingException":
1217
- case "com.amazonaws.managedblockchain#ThrottlingException":
1218
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1219
- default:
1220
- const parsedBody = parsedOutput.body;
1221
- throwDefaultError({
1222
- output,
1223
- parsedBody,
1224
- exceptionCtor: __BaseException,
1225
- errorCode,
1226
- });
1227
- }
1228
- };
1229
- export const deserializeAws_restJson1ListProposalVotesCommand = async (output, context) => {
1230
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1231
- return deserializeAws_restJson1ListProposalVotesCommandError(output, context);
1232
- }
1233
- const contents = map({
1234
- $metadata: deserializeMetadata(output),
406
+ }); };
407
+ export var serializeAws_restJson1ListProposalVotesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
408
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
409
+ return __generator(this, function (_c) {
410
+ switch (_c.label) {
411
+ case 0: return [4, context.endpoint()];
412
+ case 1:
413
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
414
+ headers = {};
415
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
416
+ "/networks/{NetworkId}/proposals/{ProposalId}/votes";
417
+ resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", function () { return input.NetworkId; }, "{NetworkId}", false);
418
+ resolvedPath = __resolvedPath(resolvedPath, input, "ProposalId", function () { return input.ProposalId; }, "{ProposalId}", false);
419
+ query = map({
420
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
421
+ nextToken: [, input.NextToken],
422
+ });
423
+ return [2, new __HttpRequest({
424
+ protocol: protocol,
425
+ hostname: hostname,
426
+ port: port,
427
+ method: "GET",
428
+ headers: headers,
429
+ path: resolvedPath,
430
+ query: query,
431
+ body: body,
432
+ })];
433
+ }
1235
434
  });
1236
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1237
- if (data.NextToken != null) {
1238
- contents.NextToken = __expectString(data.NextToken);
1239
- }
1240
- if (data.ProposalVotes != null) {
1241
- contents.ProposalVotes = deserializeAws_restJson1ProposalVoteList(data.ProposalVotes, context);
1242
- }
1243
- return contents;
1244
- };
1245
- const deserializeAws_restJson1ListProposalVotesCommandError = 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 "AccessDeniedException":
1253
- case "com.amazonaws.managedblockchain#AccessDeniedException":
1254
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1255
- case "InternalServiceErrorException":
1256
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
1257
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1258
- case "InvalidRequestException":
1259
- case "com.amazonaws.managedblockchain#InvalidRequestException":
1260
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1261
- case "ThrottlingException":
1262
- case "com.amazonaws.managedblockchain#ThrottlingException":
1263
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(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_restJson1ListTagsForResourceCommand = async (output, context) => {
1275
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1276
- return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1277
- }
1278
- const contents = map({
1279
- $metadata: deserializeMetadata(output),
435
+ }); };
436
+ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
437
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
438
+ return __generator(this, function (_c) {
439
+ switch (_c.label) {
440
+ case 0: return [4, context.endpoint()];
441
+ case 1:
442
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
443
+ headers = {};
444
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
445
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
446
+ return [2, new __HttpRequest({
447
+ protocol: protocol,
448
+ hostname: hostname,
449
+ port: port,
450
+ method: "GET",
451
+ headers: headers,
452
+ path: resolvedPath,
453
+ body: body,
454
+ })];
455
+ }
1280
456
  });
1281
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1282
- if (data.Tags != null) {
1283
- contents.Tags = deserializeAws_restJson1OutputTagMap(data.Tags, context);
1284
- }
1285
- return contents;
1286
- };
1287
- const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
1288
- const parsedOutput = {
1289
- ...output,
1290
- body: await parseErrorBody(output.body, context),
1291
- };
1292
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1293
- switch (errorCode) {
1294
- case "InternalServiceErrorException":
1295
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
1296
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1297
- case "InvalidRequestException":
1298
- case "com.amazonaws.managedblockchain#InvalidRequestException":
1299
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1300
- case "ResourceNotFoundException":
1301
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
1302
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1303
- case "ResourceNotReadyException":
1304
- case "com.amazonaws.managedblockchain#ResourceNotReadyException":
1305
- throw await deserializeAws_restJson1ResourceNotReadyExceptionResponse(parsedOutput, context);
1306
- default:
1307
- const parsedBody = parsedOutput.body;
1308
- throwDefaultError({
1309
- output,
1310
- parsedBody,
1311
- exceptionCtor: __BaseException,
1312
- errorCode,
1313
- });
1314
- }
1315
- };
1316
- export const deserializeAws_restJson1RejectInvitationCommand = async (output, context) => {
1317
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1318
- return deserializeAws_restJson1RejectInvitationCommandError(output, context);
1319
- }
1320
- const contents = map({
1321
- $metadata: deserializeMetadata(output),
457
+ }); };
458
+ export var serializeAws_restJson1RejectInvitationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
459
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
460
+ return __generator(this, function (_c) {
461
+ switch (_c.label) {
462
+ case 0: return [4, context.endpoint()];
463
+ case 1:
464
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
465
+ headers = {};
466
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/invitations/{InvitationId}";
467
+ resolvedPath = __resolvedPath(resolvedPath, input, "InvitationId", function () { return input.InvitationId; }, "{InvitationId}", false);
468
+ return [2, new __HttpRequest({
469
+ protocol: protocol,
470
+ hostname: hostname,
471
+ port: port,
472
+ method: "DELETE",
473
+ headers: headers,
474
+ path: resolvedPath,
475
+ body: body,
476
+ })];
477
+ }
1322
478
  });
1323
- await collectBody(output.body, context);
1324
- return contents;
1325
- };
1326
- const deserializeAws_restJson1RejectInvitationCommandError = async (output, context) => {
1327
- const parsedOutput = {
1328
- ...output,
1329
- body: await parseErrorBody(output.body, context),
1330
- };
1331
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1332
- switch (errorCode) {
1333
- case "AccessDeniedException":
1334
- case "com.amazonaws.managedblockchain#AccessDeniedException":
1335
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1336
- case "IllegalActionException":
1337
- case "com.amazonaws.managedblockchain#IllegalActionException":
1338
- throw await deserializeAws_restJson1IllegalActionExceptionResponse(parsedOutput, context);
1339
- case "InternalServiceErrorException":
1340
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
1341
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1342
- case "InvalidRequestException":
1343
- case "com.amazonaws.managedblockchain#InvalidRequestException":
1344
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1345
- case "ResourceNotFoundException":
1346
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
1347
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1348
- case "ThrottlingException":
1349
- case "com.amazonaws.managedblockchain#ThrottlingException":
1350
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(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_restJson1TagResourceCommand = async (output, context) => {
1362
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1363
- return deserializeAws_restJson1TagResourceCommandError(output, context);
1364
- }
1365
- const contents = map({
1366
- $metadata: deserializeMetadata(output),
479
+ }); };
480
+ export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
481
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
482
+ return __generator(this, function (_c) {
483
+ switch (_c.label) {
484
+ case 0: return [4, context.endpoint()];
485
+ case 1:
486
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
487
+ headers = {
488
+ "content-type": "application/json",
489
+ };
490
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
491
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
492
+ body = JSON.stringify(__assign({}, (input.Tags != null && { Tags: serializeAws_restJson1InputTagMap(input.Tags, context) })));
493
+ return [2, new __HttpRequest({
494
+ protocol: protocol,
495
+ hostname: hostname,
496
+ port: port,
497
+ method: "POST",
498
+ headers: headers,
499
+ path: resolvedPath,
500
+ body: body,
501
+ })];
502
+ }
1367
503
  });
1368
- await collectBody(output.body, context);
1369
- return contents;
1370
- };
1371
- const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
1372
- const parsedOutput = {
1373
- ...output,
1374
- body: await parseErrorBody(output.body, context),
1375
- };
1376
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1377
- switch (errorCode) {
1378
- case "InternalServiceErrorException":
1379
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
1380
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1381
- case "InvalidRequestException":
1382
- case "com.amazonaws.managedblockchain#InvalidRequestException":
1383
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1384
- case "ResourceNotFoundException":
1385
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
1386
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1387
- case "ResourceNotReadyException":
1388
- case "com.amazonaws.managedblockchain#ResourceNotReadyException":
1389
- throw await deserializeAws_restJson1ResourceNotReadyExceptionResponse(parsedOutput, context);
1390
- case "TooManyTagsException":
1391
- case "com.amazonaws.managedblockchain#TooManyTagsException":
1392
- throw await deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context);
1393
- default:
1394
- const parsedBody = parsedOutput.body;
1395
- throwDefaultError({
1396
- output,
1397
- parsedBody,
1398
- exceptionCtor: __BaseException,
1399
- errorCode,
1400
- });
1401
- }
1402
- };
1403
- export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1404
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1405
- return deserializeAws_restJson1UntagResourceCommandError(output, context);
1406
- }
1407
- const contents = map({
1408
- $metadata: deserializeMetadata(output),
504
+ }); };
505
+ export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
506
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
507
+ return __generator(this, function (_c) {
508
+ switch (_c.label) {
509
+ case 0: return [4, context.endpoint()];
510
+ case 1:
511
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
512
+ headers = {};
513
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
514
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
515
+ query = map({
516
+ tagKeys: [function () { return input.TagKeys !== void 0; }, function () { return (input.TagKeys || []).map(function (_entry) { return _entry; }); }],
517
+ });
518
+ return [2, new __HttpRequest({
519
+ protocol: protocol,
520
+ hostname: hostname,
521
+ port: port,
522
+ method: "DELETE",
523
+ headers: headers,
524
+ path: resolvedPath,
525
+ query: query,
526
+ body: body,
527
+ })];
528
+ }
1409
529
  });
1410
- await collectBody(output.body, context);
1411
- return contents;
1412
- };
1413
- const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
1414
- const parsedOutput = {
1415
- ...output,
1416
- body: await parseErrorBody(output.body, context),
1417
- };
1418
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1419
- switch (errorCode) {
1420
- case "InternalServiceErrorException":
1421
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
1422
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1423
- case "InvalidRequestException":
1424
- case "com.amazonaws.managedblockchain#InvalidRequestException":
1425
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1426
- case "ResourceNotFoundException":
1427
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
1428
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1429
- case "ResourceNotReadyException":
1430
- case "com.amazonaws.managedblockchain#ResourceNotReadyException":
1431
- throw await deserializeAws_restJson1ResourceNotReadyExceptionResponse(parsedOutput, context);
1432
- default:
1433
- const parsedBody = parsedOutput.body;
1434
- throwDefaultError({
1435
- output,
1436
- parsedBody,
1437
- exceptionCtor: __BaseException,
1438
- errorCode,
1439
- });
1440
- }
1441
- };
1442
- export const deserializeAws_restJson1UpdateMemberCommand = async (output, context) => {
1443
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1444
- return deserializeAws_restJson1UpdateMemberCommandError(output, context);
1445
- }
1446
- const contents = map({
1447
- $metadata: deserializeMetadata(output),
530
+ }); };
531
+ export var serializeAws_restJson1UpdateMemberCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
532
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
533
+ return __generator(this, function (_c) {
534
+ switch (_c.label) {
535
+ case 0: return [4, context.endpoint()];
536
+ case 1:
537
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
538
+ headers = {
539
+ "content-type": "application/json",
540
+ };
541
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/networks/{NetworkId}/members/{MemberId}";
542
+ resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", function () { return input.NetworkId; }, "{NetworkId}", false);
543
+ resolvedPath = __resolvedPath(resolvedPath, input, "MemberId", function () { return input.MemberId; }, "{MemberId}", false);
544
+ body = JSON.stringify(__assign({}, (input.LogPublishingConfiguration != null && {
545
+ LogPublishingConfiguration: serializeAws_restJson1MemberLogPublishingConfiguration(input.LogPublishingConfiguration, context),
546
+ })));
547
+ return [2, new __HttpRequest({
548
+ protocol: protocol,
549
+ hostname: hostname,
550
+ port: port,
551
+ method: "PATCH",
552
+ headers: headers,
553
+ path: resolvedPath,
554
+ body: body,
555
+ })];
556
+ }
1448
557
  });
1449
- await collectBody(output.body, context);
1450
- return contents;
1451
- };
1452
- const deserializeAws_restJson1UpdateMemberCommandError = async (output, context) => {
1453
- const parsedOutput = {
1454
- ...output,
1455
- body: await parseErrorBody(output.body, context),
1456
- };
1457
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1458
- switch (errorCode) {
1459
- case "AccessDeniedException":
1460
- case "com.amazonaws.managedblockchain#AccessDeniedException":
1461
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1462
- case "InternalServiceErrorException":
1463
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
1464
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1465
- case "InvalidRequestException":
1466
- case "com.amazonaws.managedblockchain#InvalidRequestException":
1467
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1468
- case "ResourceNotFoundException":
1469
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
1470
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1471
- case "ThrottlingException":
1472
- case "com.amazonaws.managedblockchain#ThrottlingException":
1473
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1474
- default:
1475
- const parsedBody = parsedOutput.body;
1476
- throwDefaultError({
1477
- output,
1478
- parsedBody,
1479
- exceptionCtor: __BaseException,
1480
- errorCode,
1481
- });
1482
- }
1483
- };
1484
- export const deserializeAws_restJson1UpdateNodeCommand = async (output, context) => {
1485
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1486
- return deserializeAws_restJson1UpdateNodeCommandError(output, context);
1487
- }
1488
- const contents = map({
1489
- $metadata: deserializeMetadata(output),
558
+ }); };
559
+ export var serializeAws_restJson1UpdateNodeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
560
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
561
+ return __generator(this, function (_c) {
562
+ switch (_c.label) {
563
+ case 0: return [4, context.endpoint()];
564
+ case 1:
565
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
566
+ headers = {
567
+ "content-type": "application/json",
568
+ };
569
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/networks/{NetworkId}/nodes/{NodeId}";
570
+ resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", function () { return input.NetworkId; }, "{NetworkId}", false);
571
+ resolvedPath = __resolvedPath(resolvedPath, input, "NodeId", function () { return input.NodeId; }, "{NodeId}", false);
572
+ body = JSON.stringify(__assign(__assign({}, (input.LogPublishingConfiguration != null && {
573
+ LogPublishingConfiguration: serializeAws_restJson1NodeLogPublishingConfiguration(input.LogPublishingConfiguration, context),
574
+ })), (input.MemberId != null && { MemberId: input.MemberId })));
575
+ return [2, new __HttpRequest({
576
+ protocol: protocol,
577
+ hostname: hostname,
578
+ port: port,
579
+ method: "PATCH",
580
+ headers: headers,
581
+ path: resolvedPath,
582
+ body: body,
583
+ })];
584
+ }
1490
585
  });
1491
- await collectBody(output.body, context);
1492
- return contents;
1493
- };
1494
- const deserializeAws_restJson1UpdateNodeCommandError = async (output, context) => {
1495
- const parsedOutput = {
1496
- ...output,
1497
- body: await parseErrorBody(output.body, context),
1498
- };
1499
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1500
- switch (errorCode) {
1501
- case "AccessDeniedException":
1502
- case "com.amazonaws.managedblockchain#AccessDeniedException":
1503
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1504
- case "InternalServiceErrorException":
1505
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
1506
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1507
- case "InvalidRequestException":
1508
- case "com.amazonaws.managedblockchain#InvalidRequestException":
1509
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1510
- case "ResourceNotFoundException":
1511
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
1512
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1513
- case "ThrottlingException":
1514
- case "com.amazonaws.managedblockchain#ThrottlingException":
1515
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1516
- default:
1517
- const parsedBody = parsedOutput.body;
1518
- throwDefaultError({
1519
- output,
1520
- parsedBody,
1521
- exceptionCtor: __BaseException,
1522
- errorCode,
1523
- });
1524
- }
1525
- };
1526
- export const deserializeAws_restJson1VoteOnProposalCommand = async (output, context) => {
1527
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1528
- return deserializeAws_restJson1VoteOnProposalCommandError(output, context);
1529
- }
1530
- const contents = map({
1531
- $metadata: deserializeMetadata(output),
586
+ }); };
587
+ export var serializeAws_restJson1VoteOnProposalCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
588
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
589
+ return __generator(this, function (_c) {
590
+ switch (_c.label) {
591
+ case 0: return [4, context.endpoint()];
592
+ case 1:
593
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
594
+ headers = {
595
+ "content-type": "application/json",
596
+ };
597
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
598
+ "/networks/{NetworkId}/proposals/{ProposalId}/votes";
599
+ resolvedPath = __resolvedPath(resolvedPath, input, "NetworkId", function () { return input.NetworkId; }, "{NetworkId}", false);
600
+ resolvedPath = __resolvedPath(resolvedPath, input, "ProposalId", function () { return input.ProposalId; }, "{ProposalId}", false);
601
+ body = JSON.stringify(__assign(__assign({}, (input.Vote != null && { Vote: input.Vote })), (input.VoterMemberId != null && { VoterMemberId: input.VoterMemberId })));
602
+ return [2, new __HttpRequest({
603
+ protocol: protocol,
604
+ hostname: hostname,
605
+ port: port,
606
+ method: "POST",
607
+ headers: headers,
608
+ path: resolvedPath,
609
+ body: body,
610
+ })];
611
+ }
1532
612
  });
1533
- await collectBody(output.body, context);
1534
- return contents;
1535
- };
1536
- const deserializeAws_restJson1VoteOnProposalCommandError = async (output, context) => {
1537
- const parsedOutput = {
1538
- ...output,
1539
- body: await parseErrorBody(output.body, context),
1540
- };
1541
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1542
- switch (errorCode) {
1543
- case "AccessDeniedException":
1544
- case "com.amazonaws.managedblockchain#AccessDeniedException":
1545
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1546
- case "IllegalActionException":
1547
- case "com.amazonaws.managedblockchain#IllegalActionException":
1548
- throw await deserializeAws_restJson1IllegalActionExceptionResponse(parsedOutput, context);
1549
- case "InternalServiceErrorException":
1550
- case "com.amazonaws.managedblockchain#InternalServiceErrorException":
1551
- throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1552
- case "InvalidRequestException":
1553
- case "com.amazonaws.managedblockchain#InvalidRequestException":
1554
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1555
- case "ResourceNotFoundException":
1556
- case "com.amazonaws.managedblockchain#ResourceNotFoundException":
1557
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1558
- case "ThrottlingException":
1559
- case "com.amazonaws.managedblockchain#ThrottlingException":
1560
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1561
- default:
1562
- const parsedBody = parsedOutput.body;
1563
- throwDefaultError({
1564
- output,
1565
- parsedBody,
1566
- exceptionCtor: __BaseException,
1567
- errorCode,
1568
- });
1569
- }
1570
- };
1571
- const map = __map;
1572
- const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1573
- const contents = map({});
1574
- const data = parsedOutput.body;
1575
- if (data.Message != null) {
1576
- contents.Message = __expectString(data.Message);
1577
- }
1578
- const exception = new AccessDeniedException({
1579
- $metadata: deserializeMetadata(parsedOutput),
1580
- ...contents,
613
+ }); };
614
+ export var deserializeAws_restJson1CreateMemberCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
615
+ var contents, data, _a, _b;
616
+ return __generator(this, function (_c) {
617
+ switch (_c.label) {
618
+ case 0:
619
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
620
+ return [2, deserializeAws_restJson1CreateMemberCommandError(output, context)];
621
+ }
622
+ contents = map({
623
+ $metadata: deserializeMetadata(output),
624
+ });
625
+ _a = __expectNonNull;
626
+ _b = __expectObject;
627
+ return [4, parseBody(output.body, context)];
628
+ case 1:
629
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
630
+ if (data.MemberId != null) {
631
+ contents.MemberId = __expectString(data.MemberId);
632
+ }
633
+ return [2, contents];
634
+ }
1581
635
  });
1582
- return __decorateServiceException(exception, parsedOutput.body);
1583
- };
1584
- const deserializeAws_restJson1IllegalActionExceptionResponse = async (parsedOutput, context) => {
1585
- const contents = map({});
1586
- const data = parsedOutput.body;
1587
- if (data.Message != null) {
1588
- contents.Message = __expectString(data.Message);
1589
- }
1590
- const exception = new IllegalActionException({
1591
- $metadata: deserializeMetadata(parsedOutput),
1592
- ...contents,
1593
- });
1594
- return __decorateServiceException(exception, parsedOutput.body);
1595
- };
1596
- const deserializeAws_restJson1InternalServiceErrorExceptionResponse = async (parsedOutput, context) => {
1597
- const contents = map({});
1598
- const data = parsedOutput.body;
1599
- const exception = new InternalServiceErrorException({
1600
- $metadata: deserializeMetadata(parsedOutput),
1601
- ...contents,
1602
- });
1603
- return __decorateServiceException(exception, parsedOutput.body);
1604
- };
1605
- const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
1606
- const contents = map({});
1607
- const data = parsedOutput.body;
1608
- if (data.Message != null) {
1609
- contents.Message = __expectString(data.Message);
1610
- }
1611
- const exception = new InvalidRequestException({
1612
- $metadata: deserializeMetadata(parsedOutput),
1613
- ...contents,
636
+ }); };
637
+ var deserializeAws_restJson1CreateMemberCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
638
+ var parsedOutput, _a, errorCode, _b, parsedBody;
639
+ var _c;
640
+ return __generator(this, function (_d) {
641
+ switch (_d.label) {
642
+ case 0:
643
+ _a = [__assign({}, output)];
644
+ _c = {};
645
+ return [4, parseErrorBody(output.body, context)];
646
+ case 1:
647
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
648
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
649
+ _b = errorCode;
650
+ switch (_b) {
651
+ case "AccessDeniedException": return [3, 2];
652
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
653
+ case "InternalServiceErrorException": return [3, 4];
654
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
655
+ case "InvalidRequestException": return [3, 6];
656
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
657
+ case "ResourceAlreadyExistsException": return [3, 8];
658
+ case "com.amazonaws.managedblockchain#ResourceAlreadyExistsException": return [3, 8];
659
+ case "ResourceLimitExceededException": return [3, 10];
660
+ case "com.amazonaws.managedblockchain#ResourceLimitExceededException": return [3, 10];
661
+ case "ResourceNotFoundException": return [3, 12];
662
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 12];
663
+ case "ResourceNotReadyException": return [3, 14];
664
+ case "com.amazonaws.managedblockchain#ResourceNotReadyException": return [3, 14];
665
+ case "ThrottlingException": return [3, 16];
666
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 16];
667
+ case "TooManyTagsException": return [3, 18];
668
+ case "com.amazonaws.managedblockchain#TooManyTagsException": return [3, 18];
669
+ }
670
+ return [3, 20];
671
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
672
+ case 3: throw _d.sent();
673
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
674
+ case 5: throw _d.sent();
675
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
676
+ case 7: throw _d.sent();
677
+ case 8: return [4, deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)];
678
+ case 9: throw _d.sent();
679
+ case 10: return [4, deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context)];
680
+ case 11: throw _d.sent();
681
+ case 12: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
682
+ case 13: throw _d.sent();
683
+ case 14: return [4, deserializeAws_restJson1ResourceNotReadyExceptionResponse(parsedOutput, context)];
684
+ case 15: throw _d.sent();
685
+ case 16: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
686
+ case 17: throw _d.sent();
687
+ case 18: return [4, deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context)];
688
+ case 19: throw _d.sent();
689
+ case 20:
690
+ parsedBody = parsedOutput.body;
691
+ throwDefaultError({
692
+ output: output,
693
+ parsedBody: parsedBody,
694
+ exceptionCtor: __BaseException,
695
+ errorCode: errorCode,
696
+ });
697
+ _d.label = 21;
698
+ case 21: return [2];
699
+ }
1614
700
  });
1615
- return __decorateServiceException(exception, parsedOutput.body);
1616
- };
1617
- const deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse = async (parsedOutput, context) => {
1618
- const contents = map({});
1619
- const data = parsedOutput.body;
1620
- if (data.Message != null) {
1621
- contents.Message = __expectString(data.Message);
1622
- }
1623
- const exception = new ResourceAlreadyExistsException({
1624
- $metadata: deserializeMetadata(parsedOutput),
1625
- ...contents,
701
+ }); };
702
+ export var deserializeAws_restJson1CreateNetworkCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
703
+ var contents, data, _a, _b;
704
+ return __generator(this, function (_c) {
705
+ switch (_c.label) {
706
+ case 0:
707
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
708
+ return [2, deserializeAws_restJson1CreateNetworkCommandError(output, context)];
709
+ }
710
+ contents = map({
711
+ $metadata: deserializeMetadata(output),
712
+ });
713
+ _a = __expectNonNull;
714
+ _b = __expectObject;
715
+ return [4, parseBody(output.body, context)];
716
+ case 1:
717
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
718
+ if (data.MemberId != null) {
719
+ contents.MemberId = __expectString(data.MemberId);
720
+ }
721
+ if (data.NetworkId != null) {
722
+ contents.NetworkId = __expectString(data.NetworkId);
723
+ }
724
+ return [2, contents];
725
+ }
1626
726
  });
1627
- return __decorateServiceException(exception, parsedOutput.body);
1628
- };
1629
- const deserializeAws_restJson1ResourceLimitExceededExceptionResponse = async (parsedOutput, context) => {
1630
- const contents = map({});
1631
- const data = parsedOutput.body;
1632
- if (data.Message != null) {
1633
- contents.Message = __expectString(data.Message);
1634
- }
1635
- const exception = new ResourceLimitExceededException({
1636
- $metadata: deserializeMetadata(parsedOutput),
1637
- ...contents,
727
+ }); };
728
+ var deserializeAws_restJson1CreateNetworkCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
729
+ var parsedOutput, _a, errorCode, _b, parsedBody;
730
+ var _c;
731
+ return __generator(this, function (_d) {
732
+ switch (_d.label) {
733
+ case 0:
734
+ _a = [__assign({}, output)];
735
+ _c = {};
736
+ return [4, parseErrorBody(output.body, context)];
737
+ case 1:
738
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
739
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
740
+ _b = errorCode;
741
+ switch (_b) {
742
+ case "AccessDeniedException": return [3, 2];
743
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
744
+ case "InternalServiceErrorException": return [3, 4];
745
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
746
+ case "InvalidRequestException": return [3, 6];
747
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
748
+ case "ResourceAlreadyExistsException": return [3, 8];
749
+ case "com.amazonaws.managedblockchain#ResourceAlreadyExistsException": return [3, 8];
750
+ case "ResourceLimitExceededException": return [3, 10];
751
+ case "com.amazonaws.managedblockchain#ResourceLimitExceededException": return [3, 10];
752
+ case "ThrottlingException": return [3, 12];
753
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 12];
754
+ case "TooManyTagsException": return [3, 14];
755
+ case "com.amazonaws.managedblockchain#TooManyTagsException": return [3, 14];
756
+ }
757
+ return [3, 16];
758
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
759
+ case 3: throw _d.sent();
760
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
761
+ case 5: throw _d.sent();
762
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
763
+ case 7: throw _d.sent();
764
+ case 8: return [4, deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)];
765
+ case 9: throw _d.sent();
766
+ case 10: return [4, deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context)];
767
+ case 11: throw _d.sent();
768
+ case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
769
+ case 13: throw _d.sent();
770
+ case 14: return [4, deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context)];
771
+ case 15: throw _d.sent();
772
+ case 16:
773
+ parsedBody = parsedOutput.body;
774
+ throwDefaultError({
775
+ output: output,
776
+ parsedBody: parsedBody,
777
+ exceptionCtor: __BaseException,
778
+ errorCode: errorCode,
779
+ });
780
+ _d.label = 17;
781
+ case 17: return [2];
782
+ }
1638
783
  });
1639
- return __decorateServiceException(exception, parsedOutput.body);
1640
- };
1641
- const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1642
- const contents = map({});
1643
- const data = parsedOutput.body;
1644
- if (data.Message != null) {
1645
- contents.Message = __expectString(data.Message);
1646
- }
1647
- if (data.ResourceName != null) {
1648
- contents.ResourceName = __expectString(data.ResourceName);
1649
- }
1650
- const exception = new ResourceNotFoundException({
1651
- $metadata: deserializeMetadata(parsedOutput),
1652
- ...contents,
784
+ }); };
785
+ export var deserializeAws_restJson1CreateNodeCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
786
+ var contents, data, _a, _b;
787
+ return __generator(this, function (_c) {
788
+ switch (_c.label) {
789
+ case 0:
790
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
791
+ return [2, deserializeAws_restJson1CreateNodeCommandError(output, context)];
792
+ }
793
+ contents = map({
794
+ $metadata: deserializeMetadata(output),
795
+ });
796
+ _a = __expectNonNull;
797
+ _b = __expectObject;
798
+ return [4, parseBody(output.body, context)];
799
+ case 1:
800
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
801
+ if (data.NodeId != null) {
802
+ contents.NodeId = __expectString(data.NodeId);
803
+ }
804
+ return [2, contents];
805
+ }
1653
806
  });
1654
- return __decorateServiceException(exception, parsedOutput.body);
1655
- };
1656
- const deserializeAws_restJson1ResourceNotReadyExceptionResponse = async (parsedOutput, context) => {
1657
- const contents = map({});
1658
- const data = parsedOutput.body;
1659
- if (data.Message != null) {
1660
- contents.Message = __expectString(data.Message);
1661
- }
1662
- const exception = new ResourceNotReadyException({
1663
- $metadata: deserializeMetadata(parsedOutput),
1664
- ...contents,
1665
- });
1666
- return __decorateServiceException(exception, parsedOutput.body);
1667
- };
1668
- const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
1669
- const contents = map({});
1670
- const data = parsedOutput.body;
1671
- const exception = new ThrottlingException({
1672
- $metadata: deserializeMetadata(parsedOutput),
1673
- ...contents,
1674
- });
1675
- return __decorateServiceException(exception, parsedOutput.body);
1676
- };
1677
- const deserializeAws_restJson1TooManyTagsExceptionResponse = async (parsedOutput, context) => {
1678
- const contents = map({});
1679
- const data = parsedOutput.body;
1680
- if (data.Message != null) {
1681
- contents.Message = __expectString(data.Message);
1682
- }
1683
- if (data.ResourceName != null) {
1684
- contents.ResourceName = __expectString(data.ResourceName);
1685
- }
1686
- const exception = new TooManyTagsException({
1687
- $metadata: deserializeMetadata(parsedOutput),
1688
- ...contents,
807
+ }); };
808
+ var deserializeAws_restJson1CreateNodeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
809
+ var parsedOutput, _a, errorCode, _b, parsedBody;
810
+ var _c;
811
+ return __generator(this, function (_d) {
812
+ switch (_d.label) {
813
+ case 0:
814
+ _a = [__assign({}, output)];
815
+ _c = {};
816
+ return [4, parseErrorBody(output.body, context)];
817
+ case 1:
818
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
819
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
820
+ _b = errorCode;
821
+ switch (_b) {
822
+ case "AccessDeniedException": return [3, 2];
823
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
824
+ case "InternalServiceErrorException": return [3, 4];
825
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
826
+ case "InvalidRequestException": return [3, 6];
827
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
828
+ case "ResourceAlreadyExistsException": return [3, 8];
829
+ case "com.amazonaws.managedblockchain#ResourceAlreadyExistsException": return [3, 8];
830
+ case "ResourceLimitExceededException": return [3, 10];
831
+ case "com.amazonaws.managedblockchain#ResourceLimitExceededException": return [3, 10];
832
+ case "ResourceNotFoundException": return [3, 12];
833
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 12];
834
+ case "ResourceNotReadyException": return [3, 14];
835
+ case "com.amazonaws.managedblockchain#ResourceNotReadyException": return [3, 14];
836
+ case "ThrottlingException": return [3, 16];
837
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 16];
838
+ case "TooManyTagsException": return [3, 18];
839
+ case "com.amazonaws.managedblockchain#TooManyTagsException": return [3, 18];
840
+ }
841
+ return [3, 20];
842
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
843
+ case 3: throw _d.sent();
844
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
845
+ case 5: throw _d.sent();
846
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
847
+ case 7: throw _d.sent();
848
+ case 8: return [4, deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)];
849
+ case 9: throw _d.sent();
850
+ case 10: return [4, deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context)];
851
+ case 11: throw _d.sent();
852
+ case 12: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
853
+ case 13: throw _d.sent();
854
+ case 14: return [4, deserializeAws_restJson1ResourceNotReadyExceptionResponse(parsedOutput, context)];
855
+ case 15: throw _d.sent();
856
+ case 16: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
857
+ case 17: throw _d.sent();
858
+ case 18: return [4, deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context)];
859
+ case 19: throw _d.sent();
860
+ case 20:
861
+ parsedBody = parsedOutput.body;
862
+ throwDefaultError({
863
+ output: output,
864
+ parsedBody: parsedBody,
865
+ exceptionCtor: __BaseException,
866
+ errorCode: errorCode,
867
+ });
868
+ _d.label = 21;
869
+ case 21: return [2];
870
+ }
1689
871
  });
1690
- return __decorateServiceException(exception, parsedOutput.body);
1691
- };
1692
- const serializeAws_restJson1ApprovalThresholdPolicy = (input, context) => {
1693
- return {
1694
- ...(input.ProposalDurationInHours != null && { ProposalDurationInHours: input.ProposalDurationInHours }),
1695
- ...(input.ThresholdComparator != null && { ThresholdComparator: input.ThresholdComparator }),
1696
- ...(input.ThresholdPercentage != null && { ThresholdPercentage: input.ThresholdPercentage }),
1697
- };
872
+ }); };
873
+ export var deserializeAws_restJson1CreateProposalCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
874
+ var contents, data, _a, _b;
875
+ return __generator(this, function (_c) {
876
+ switch (_c.label) {
877
+ case 0:
878
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
879
+ return [2, deserializeAws_restJson1CreateProposalCommandError(output, context)];
880
+ }
881
+ contents = map({
882
+ $metadata: deserializeMetadata(output),
883
+ });
884
+ _a = __expectNonNull;
885
+ _b = __expectObject;
886
+ return [4, parseBody(output.body, context)];
887
+ case 1:
888
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
889
+ if (data.ProposalId != null) {
890
+ contents.ProposalId = __expectString(data.ProposalId);
891
+ }
892
+ return [2, contents];
893
+ }
894
+ });
895
+ }); };
896
+ var deserializeAws_restJson1CreateProposalCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
897
+ var parsedOutput, _a, errorCode, _b, parsedBody;
898
+ var _c;
899
+ return __generator(this, function (_d) {
900
+ switch (_d.label) {
901
+ case 0:
902
+ _a = [__assign({}, output)];
903
+ _c = {};
904
+ return [4, parseErrorBody(output.body, context)];
905
+ case 1:
906
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
907
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
908
+ _b = errorCode;
909
+ switch (_b) {
910
+ case "AccessDeniedException": return [3, 2];
911
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
912
+ case "InternalServiceErrorException": return [3, 4];
913
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
914
+ case "InvalidRequestException": return [3, 6];
915
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
916
+ case "ResourceNotFoundException": return [3, 8];
917
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 8];
918
+ case "ResourceNotReadyException": return [3, 10];
919
+ case "com.amazonaws.managedblockchain#ResourceNotReadyException": return [3, 10];
920
+ case "ThrottlingException": return [3, 12];
921
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 12];
922
+ case "TooManyTagsException": return [3, 14];
923
+ case "com.amazonaws.managedblockchain#TooManyTagsException": return [3, 14];
924
+ }
925
+ return [3, 16];
926
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
927
+ case 3: throw _d.sent();
928
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
929
+ case 5: throw _d.sent();
930
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
931
+ case 7: throw _d.sent();
932
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
933
+ case 9: throw _d.sent();
934
+ case 10: return [4, deserializeAws_restJson1ResourceNotReadyExceptionResponse(parsedOutput, context)];
935
+ case 11: throw _d.sent();
936
+ case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
937
+ case 13: throw _d.sent();
938
+ case 14: return [4, deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context)];
939
+ case 15: throw _d.sent();
940
+ case 16:
941
+ parsedBody = parsedOutput.body;
942
+ throwDefaultError({
943
+ output: output,
944
+ parsedBody: parsedBody,
945
+ exceptionCtor: __BaseException,
946
+ errorCode: errorCode,
947
+ });
948
+ _d.label = 17;
949
+ case 17: return [2];
950
+ }
951
+ });
952
+ }); };
953
+ export var deserializeAws_restJson1DeleteMemberCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
954
+ var contents;
955
+ return __generator(this, function (_a) {
956
+ switch (_a.label) {
957
+ case 0:
958
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
959
+ return [2, deserializeAws_restJson1DeleteMemberCommandError(output, context)];
960
+ }
961
+ contents = map({
962
+ $metadata: deserializeMetadata(output),
963
+ });
964
+ return [4, collectBody(output.body, context)];
965
+ case 1:
966
+ _a.sent();
967
+ return [2, contents];
968
+ }
969
+ });
970
+ }); };
971
+ var deserializeAws_restJson1DeleteMemberCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
972
+ var parsedOutput, _a, errorCode, _b, parsedBody;
973
+ var _c;
974
+ return __generator(this, function (_d) {
975
+ switch (_d.label) {
976
+ case 0:
977
+ _a = [__assign({}, output)];
978
+ _c = {};
979
+ return [4, parseErrorBody(output.body, context)];
980
+ case 1:
981
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
982
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
983
+ _b = errorCode;
984
+ switch (_b) {
985
+ case "AccessDeniedException": return [3, 2];
986
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
987
+ case "InternalServiceErrorException": return [3, 4];
988
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
989
+ case "InvalidRequestException": return [3, 6];
990
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
991
+ case "ResourceNotFoundException": return [3, 8];
992
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 8];
993
+ case "ResourceNotReadyException": return [3, 10];
994
+ case "com.amazonaws.managedblockchain#ResourceNotReadyException": return [3, 10];
995
+ case "ThrottlingException": return [3, 12];
996
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 12];
997
+ }
998
+ return [3, 14];
999
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1000
+ case 3: throw _d.sent();
1001
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1002
+ case 5: throw _d.sent();
1003
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
1004
+ case 7: throw _d.sent();
1005
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1006
+ case 9: throw _d.sent();
1007
+ case 10: return [4, deserializeAws_restJson1ResourceNotReadyExceptionResponse(parsedOutput, context)];
1008
+ case 11: throw _d.sent();
1009
+ case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1010
+ case 13: throw _d.sent();
1011
+ case 14:
1012
+ parsedBody = parsedOutput.body;
1013
+ throwDefaultError({
1014
+ output: output,
1015
+ parsedBody: parsedBody,
1016
+ exceptionCtor: __BaseException,
1017
+ errorCode: errorCode,
1018
+ });
1019
+ _d.label = 15;
1020
+ case 15: return [2];
1021
+ }
1022
+ });
1023
+ }); };
1024
+ export var deserializeAws_restJson1DeleteNodeCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1025
+ var contents;
1026
+ return __generator(this, function (_a) {
1027
+ switch (_a.label) {
1028
+ case 0:
1029
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1030
+ return [2, deserializeAws_restJson1DeleteNodeCommandError(output, context)];
1031
+ }
1032
+ contents = map({
1033
+ $metadata: deserializeMetadata(output),
1034
+ });
1035
+ return [4, collectBody(output.body, context)];
1036
+ case 1:
1037
+ _a.sent();
1038
+ return [2, contents];
1039
+ }
1040
+ });
1041
+ }); };
1042
+ var deserializeAws_restJson1DeleteNodeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1043
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1044
+ var _c;
1045
+ return __generator(this, function (_d) {
1046
+ switch (_d.label) {
1047
+ case 0:
1048
+ _a = [__assign({}, output)];
1049
+ _c = {};
1050
+ return [4, parseErrorBody(output.body, context)];
1051
+ case 1:
1052
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1053
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1054
+ _b = errorCode;
1055
+ switch (_b) {
1056
+ case "AccessDeniedException": return [3, 2];
1057
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
1058
+ case "InternalServiceErrorException": return [3, 4];
1059
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
1060
+ case "InvalidRequestException": return [3, 6];
1061
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
1062
+ case "ResourceNotFoundException": return [3, 8];
1063
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 8];
1064
+ case "ResourceNotReadyException": return [3, 10];
1065
+ case "com.amazonaws.managedblockchain#ResourceNotReadyException": return [3, 10];
1066
+ case "ThrottlingException": return [3, 12];
1067
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 12];
1068
+ }
1069
+ return [3, 14];
1070
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1071
+ case 3: throw _d.sent();
1072
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1073
+ case 5: throw _d.sent();
1074
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
1075
+ case 7: throw _d.sent();
1076
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1077
+ case 9: throw _d.sent();
1078
+ case 10: return [4, deserializeAws_restJson1ResourceNotReadyExceptionResponse(parsedOutput, context)];
1079
+ case 11: throw _d.sent();
1080
+ case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1081
+ case 13: throw _d.sent();
1082
+ case 14:
1083
+ parsedBody = parsedOutput.body;
1084
+ throwDefaultError({
1085
+ output: output,
1086
+ parsedBody: parsedBody,
1087
+ exceptionCtor: __BaseException,
1088
+ errorCode: errorCode,
1089
+ });
1090
+ _d.label = 15;
1091
+ case 15: return [2];
1092
+ }
1093
+ });
1094
+ }); };
1095
+ export var deserializeAws_restJson1GetMemberCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1096
+ var contents, data, _a, _b;
1097
+ return __generator(this, function (_c) {
1098
+ switch (_c.label) {
1099
+ case 0:
1100
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1101
+ return [2, deserializeAws_restJson1GetMemberCommandError(output, context)];
1102
+ }
1103
+ contents = map({
1104
+ $metadata: deserializeMetadata(output),
1105
+ });
1106
+ _a = __expectNonNull;
1107
+ _b = __expectObject;
1108
+ return [4, parseBody(output.body, context)];
1109
+ case 1:
1110
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1111
+ if (data.Member != null) {
1112
+ contents.Member = deserializeAws_restJson1Member(data.Member, context);
1113
+ }
1114
+ return [2, contents];
1115
+ }
1116
+ });
1117
+ }); };
1118
+ var deserializeAws_restJson1GetMemberCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1119
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1120
+ var _c;
1121
+ return __generator(this, function (_d) {
1122
+ switch (_d.label) {
1123
+ case 0:
1124
+ _a = [__assign({}, output)];
1125
+ _c = {};
1126
+ return [4, parseErrorBody(output.body, context)];
1127
+ case 1:
1128
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1129
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1130
+ _b = errorCode;
1131
+ switch (_b) {
1132
+ case "AccessDeniedException": return [3, 2];
1133
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
1134
+ case "InternalServiceErrorException": return [3, 4];
1135
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
1136
+ case "InvalidRequestException": return [3, 6];
1137
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
1138
+ case "ResourceNotFoundException": return [3, 8];
1139
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 8];
1140
+ case "ThrottlingException": return [3, 10];
1141
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 10];
1142
+ }
1143
+ return [3, 12];
1144
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1145
+ case 3: throw _d.sent();
1146
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1147
+ case 5: throw _d.sent();
1148
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
1149
+ case 7: throw _d.sent();
1150
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1151
+ case 9: throw _d.sent();
1152
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1153
+ case 11: throw _d.sent();
1154
+ case 12:
1155
+ parsedBody = parsedOutput.body;
1156
+ throwDefaultError({
1157
+ output: output,
1158
+ parsedBody: parsedBody,
1159
+ exceptionCtor: __BaseException,
1160
+ errorCode: errorCode,
1161
+ });
1162
+ _d.label = 13;
1163
+ case 13: return [2];
1164
+ }
1165
+ });
1166
+ }); };
1167
+ export var deserializeAws_restJson1GetNetworkCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1168
+ var contents, data, _a, _b;
1169
+ return __generator(this, function (_c) {
1170
+ switch (_c.label) {
1171
+ case 0:
1172
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1173
+ return [2, deserializeAws_restJson1GetNetworkCommandError(output, context)];
1174
+ }
1175
+ contents = map({
1176
+ $metadata: deserializeMetadata(output),
1177
+ });
1178
+ _a = __expectNonNull;
1179
+ _b = __expectObject;
1180
+ return [4, parseBody(output.body, context)];
1181
+ case 1:
1182
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1183
+ if (data.Network != null) {
1184
+ contents.Network = deserializeAws_restJson1Network(data.Network, context);
1185
+ }
1186
+ return [2, contents];
1187
+ }
1188
+ });
1189
+ }); };
1190
+ var deserializeAws_restJson1GetNetworkCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1191
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1192
+ var _c;
1193
+ return __generator(this, function (_d) {
1194
+ switch (_d.label) {
1195
+ case 0:
1196
+ _a = [__assign({}, output)];
1197
+ _c = {};
1198
+ return [4, parseErrorBody(output.body, context)];
1199
+ case 1:
1200
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1201
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1202
+ _b = errorCode;
1203
+ switch (_b) {
1204
+ case "AccessDeniedException": return [3, 2];
1205
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
1206
+ case "InternalServiceErrorException": return [3, 4];
1207
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
1208
+ case "InvalidRequestException": return [3, 6];
1209
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
1210
+ case "ResourceNotFoundException": return [3, 8];
1211
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 8];
1212
+ case "ThrottlingException": return [3, 10];
1213
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 10];
1214
+ }
1215
+ return [3, 12];
1216
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1217
+ case 3: throw _d.sent();
1218
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1219
+ case 5: throw _d.sent();
1220
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
1221
+ case 7: throw _d.sent();
1222
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1223
+ case 9: throw _d.sent();
1224
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1225
+ case 11: throw _d.sent();
1226
+ case 12:
1227
+ parsedBody = parsedOutput.body;
1228
+ throwDefaultError({
1229
+ output: output,
1230
+ parsedBody: parsedBody,
1231
+ exceptionCtor: __BaseException,
1232
+ errorCode: errorCode,
1233
+ });
1234
+ _d.label = 13;
1235
+ case 13: return [2];
1236
+ }
1237
+ });
1238
+ }); };
1239
+ export var deserializeAws_restJson1GetNodeCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1240
+ var contents, data, _a, _b;
1241
+ return __generator(this, function (_c) {
1242
+ switch (_c.label) {
1243
+ case 0:
1244
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1245
+ return [2, deserializeAws_restJson1GetNodeCommandError(output, context)];
1246
+ }
1247
+ contents = map({
1248
+ $metadata: deserializeMetadata(output),
1249
+ });
1250
+ _a = __expectNonNull;
1251
+ _b = __expectObject;
1252
+ return [4, parseBody(output.body, context)];
1253
+ case 1:
1254
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1255
+ if (data.Node != null) {
1256
+ contents.Node = deserializeAws_restJson1Node(data.Node, context);
1257
+ }
1258
+ return [2, contents];
1259
+ }
1260
+ });
1261
+ }); };
1262
+ var deserializeAws_restJson1GetNodeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1263
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1264
+ var _c;
1265
+ return __generator(this, function (_d) {
1266
+ switch (_d.label) {
1267
+ case 0:
1268
+ _a = [__assign({}, output)];
1269
+ _c = {};
1270
+ return [4, parseErrorBody(output.body, context)];
1271
+ case 1:
1272
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1273
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1274
+ _b = errorCode;
1275
+ switch (_b) {
1276
+ case "AccessDeniedException": return [3, 2];
1277
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
1278
+ case "InternalServiceErrorException": return [3, 4];
1279
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
1280
+ case "InvalidRequestException": return [3, 6];
1281
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
1282
+ case "ResourceNotFoundException": return [3, 8];
1283
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 8];
1284
+ case "ThrottlingException": return [3, 10];
1285
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 10];
1286
+ }
1287
+ return [3, 12];
1288
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1289
+ case 3: throw _d.sent();
1290
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1291
+ case 5: throw _d.sent();
1292
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
1293
+ case 7: throw _d.sent();
1294
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1295
+ case 9: throw _d.sent();
1296
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1297
+ case 11: throw _d.sent();
1298
+ case 12:
1299
+ parsedBody = parsedOutput.body;
1300
+ throwDefaultError({
1301
+ output: output,
1302
+ parsedBody: parsedBody,
1303
+ exceptionCtor: __BaseException,
1304
+ errorCode: errorCode,
1305
+ });
1306
+ _d.label = 13;
1307
+ case 13: return [2];
1308
+ }
1309
+ });
1310
+ }); };
1311
+ export var deserializeAws_restJson1GetProposalCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1312
+ var contents, data, _a, _b;
1313
+ return __generator(this, function (_c) {
1314
+ switch (_c.label) {
1315
+ case 0:
1316
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1317
+ return [2, deserializeAws_restJson1GetProposalCommandError(output, context)];
1318
+ }
1319
+ contents = map({
1320
+ $metadata: deserializeMetadata(output),
1321
+ });
1322
+ _a = __expectNonNull;
1323
+ _b = __expectObject;
1324
+ return [4, parseBody(output.body, context)];
1325
+ case 1:
1326
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1327
+ if (data.Proposal != null) {
1328
+ contents.Proposal = deserializeAws_restJson1Proposal(data.Proposal, context);
1329
+ }
1330
+ return [2, contents];
1331
+ }
1332
+ });
1333
+ }); };
1334
+ var deserializeAws_restJson1GetProposalCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1335
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1336
+ var _c;
1337
+ return __generator(this, function (_d) {
1338
+ switch (_d.label) {
1339
+ case 0:
1340
+ _a = [__assign({}, output)];
1341
+ _c = {};
1342
+ return [4, parseErrorBody(output.body, context)];
1343
+ case 1:
1344
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1345
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1346
+ _b = errorCode;
1347
+ switch (_b) {
1348
+ case "AccessDeniedException": return [3, 2];
1349
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
1350
+ case "InternalServiceErrorException": return [3, 4];
1351
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
1352
+ case "InvalidRequestException": return [3, 6];
1353
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
1354
+ case "ResourceNotFoundException": return [3, 8];
1355
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 8];
1356
+ case "ThrottlingException": return [3, 10];
1357
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 10];
1358
+ }
1359
+ return [3, 12];
1360
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1361
+ case 3: throw _d.sent();
1362
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1363
+ case 5: throw _d.sent();
1364
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
1365
+ case 7: throw _d.sent();
1366
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1367
+ case 9: throw _d.sent();
1368
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1369
+ case 11: throw _d.sent();
1370
+ case 12:
1371
+ parsedBody = parsedOutput.body;
1372
+ throwDefaultError({
1373
+ output: output,
1374
+ parsedBody: parsedBody,
1375
+ exceptionCtor: __BaseException,
1376
+ errorCode: errorCode,
1377
+ });
1378
+ _d.label = 13;
1379
+ case 13: return [2];
1380
+ }
1381
+ });
1382
+ }); };
1383
+ export var deserializeAws_restJson1ListInvitationsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1384
+ var contents, data, _a, _b;
1385
+ return __generator(this, function (_c) {
1386
+ switch (_c.label) {
1387
+ case 0:
1388
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1389
+ return [2, deserializeAws_restJson1ListInvitationsCommandError(output, context)];
1390
+ }
1391
+ contents = map({
1392
+ $metadata: deserializeMetadata(output),
1393
+ });
1394
+ _a = __expectNonNull;
1395
+ _b = __expectObject;
1396
+ return [4, parseBody(output.body, context)];
1397
+ case 1:
1398
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1399
+ if (data.Invitations != null) {
1400
+ contents.Invitations = deserializeAws_restJson1InvitationList(data.Invitations, context);
1401
+ }
1402
+ if (data.NextToken != null) {
1403
+ contents.NextToken = __expectString(data.NextToken);
1404
+ }
1405
+ return [2, contents];
1406
+ }
1407
+ });
1408
+ }); };
1409
+ var deserializeAws_restJson1ListInvitationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1410
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1411
+ var _c;
1412
+ return __generator(this, function (_d) {
1413
+ switch (_d.label) {
1414
+ case 0:
1415
+ _a = [__assign({}, output)];
1416
+ _c = {};
1417
+ return [4, parseErrorBody(output.body, context)];
1418
+ case 1:
1419
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1420
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1421
+ _b = errorCode;
1422
+ switch (_b) {
1423
+ case "AccessDeniedException": return [3, 2];
1424
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
1425
+ case "InternalServiceErrorException": return [3, 4];
1426
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
1427
+ case "InvalidRequestException": return [3, 6];
1428
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
1429
+ case "ResourceLimitExceededException": return [3, 8];
1430
+ case "com.amazonaws.managedblockchain#ResourceLimitExceededException": return [3, 8];
1431
+ case "ResourceNotFoundException": return [3, 10];
1432
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 10];
1433
+ case "ThrottlingException": return [3, 12];
1434
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 12];
1435
+ }
1436
+ return [3, 14];
1437
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1438
+ case 3: throw _d.sent();
1439
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1440
+ case 5: throw _d.sent();
1441
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
1442
+ case 7: throw _d.sent();
1443
+ case 8: return [4, deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context)];
1444
+ case 9: throw _d.sent();
1445
+ case 10: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1446
+ case 11: throw _d.sent();
1447
+ case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1448
+ case 13: throw _d.sent();
1449
+ case 14:
1450
+ parsedBody = parsedOutput.body;
1451
+ throwDefaultError({
1452
+ output: output,
1453
+ parsedBody: parsedBody,
1454
+ exceptionCtor: __BaseException,
1455
+ errorCode: errorCode,
1456
+ });
1457
+ _d.label = 15;
1458
+ case 15: return [2];
1459
+ }
1460
+ });
1461
+ }); };
1462
+ export var deserializeAws_restJson1ListMembersCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1463
+ var contents, data, _a, _b;
1464
+ return __generator(this, function (_c) {
1465
+ switch (_c.label) {
1466
+ case 0:
1467
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1468
+ return [2, deserializeAws_restJson1ListMembersCommandError(output, context)];
1469
+ }
1470
+ contents = map({
1471
+ $metadata: deserializeMetadata(output),
1472
+ });
1473
+ _a = __expectNonNull;
1474
+ _b = __expectObject;
1475
+ return [4, parseBody(output.body, context)];
1476
+ case 1:
1477
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1478
+ if (data.Members != null) {
1479
+ contents.Members = deserializeAws_restJson1MemberSummaryList(data.Members, context);
1480
+ }
1481
+ if (data.NextToken != null) {
1482
+ contents.NextToken = __expectString(data.NextToken);
1483
+ }
1484
+ return [2, contents];
1485
+ }
1486
+ });
1487
+ }); };
1488
+ var deserializeAws_restJson1ListMembersCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1489
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1490
+ var _c;
1491
+ return __generator(this, function (_d) {
1492
+ switch (_d.label) {
1493
+ case 0:
1494
+ _a = [__assign({}, output)];
1495
+ _c = {};
1496
+ return [4, parseErrorBody(output.body, context)];
1497
+ case 1:
1498
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1499
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1500
+ _b = errorCode;
1501
+ switch (_b) {
1502
+ case "AccessDeniedException": return [3, 2];
1503
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
1504
+ case "InternalServiceErrorException": return [3, 4];
1505
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
1506
+ case "InvalidRequestException": return [3, 6];
1507
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
1508
+ case "ThrottlingException": return [3, 8];
1509
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 8];
1510
+ }
1511
+ return [3, 10];
1512
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1513
+ case 3: throw _d.sent();
1514
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1515
+ case 5: throw _d.sent();
1516
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
1517
+ case 7: throw _d.sent();
1518
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1519
+ case 9: throw _d.sent();
1520
+ case 10:
1521
+ parsedBody = parsedOutput.body;
1522
+ throwDefaultError({
1523
+ output: output,
1524
+ parsedBody: parsedBody,
1525
+ exceptionCtor: __BaseException,
1526
+ errorCode: errorCode,
1527
+ });
1528
+ _d.label = 11;
1529
+ case 11: return [2];
1530
+ }
1531
+ });
1532
+ }); };
1533
+ export var deserializeAws_restJson1ListNetworksCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1534
+ var contents, data, _a, _b;
1535
+ return __generator(this, function (_c) {
1536
+ switch (_c.label) {
1537
+ case 0:
1538
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1539
+ return [2, deserializeAws_restJson1ListNetworksCommandError(output, context)];
1540
+ }
1541
+ contents = map({
1542
+ $metadata: deserializeMetadata(output),
1543
+ });
1544
+ _a = __expectNonNull;
1545
+ _b = __expectObject;
1546
+ return [4, parseBody(output.body, context)];
1547
+ case 1:
1548
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1549
+ if (data.Networks != null) {
1550
+ contents.Networks = deserializeAws_restJson1NetworkSummaryList(data.Networks, context);
1551
+ }
1552
+ if (data.NextToken != null) {
1553
+ contents.NextToken = __expectString(data.NextToken);
1554
+ }
1555
+ return [2, contents];
1556
+ }
1557
+ });
1558
+ }); };
1559
+ var deserializeAws_restJson1ListNetworksCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1560
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1561
+ var _c;
1562
+ return __generator(this, function (_d) {
1563
+ switch (_d.label) {
1564
+ case 0:
1565
+ _a = [__assign({}, output)];
1566
+ _c = {};
1567
+ return [4, parseErrorBody(output.body, context)];
1568
+ case 1:
1569
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1570
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1571
+ _b = errorCode;
1572
+ switch (_b) {
1573
+ case "AccessDeniedException": return [3, 2];
1574
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
1575
+ case "InternalServiceErrorException": return [3, 4];
1576
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
1577
+ case "InvalidRequestException": return [3, 6];
1578
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
1579
+ case "ThrottlingException": return [3, 8];
1580
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 8];
1581
+ }
1582
+ return [3, 10];
1583
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1584
+ case 3: throw _d.sent();
1585
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1586
+ case 5: throw _d.sent();
1587
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
1588
+ case 7: throw _d.sent();
1589
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1590
+ case 9: throw _d.sent();
1591
+ case 10:
1592
+ parsedBody = parsedOutput.body;
1593
+ throwDefaultError({
1594
+ output: output,
1595
+ parsedBody: parsedBody,
1596
+ exceptionCtor: __BaseException,
1597
+ errorCode: errorCode,
1598
+ });
1599
+ _d.label = 11;
1600
+ case 11: return [2];
1601
+ }
1602
+ });
1603
+ }); };
1604
+ export var deserializeAws_restJson1ListNodesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1605
+ var contents, data, _a, _b;
1606
+ return __generator(this, function (_c) {
1607
+ switch (_c.label) {
1608
+ case 0:
1609
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1610
+ return [2, deserializeAws_restJson1ListNodesCommandError(output, context)];
1611
+ }
1612
+ contents = map({
1613
+ $metadata: deserializeMetadata(output),
1614
+ });
1615
+ _a = __expectNonNull;
1616
+ _b = __expectObject;
1617
+ return [4, parseBody(output.body, context)];
1618
+ case 1:
1619
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1620
+ if (data.NextToken != null) {
1621
+ contents.NextToken = __expectString(data.NextToken);
1622
+ }
1623
+ if (data.Nodes != null) {
1624
+ contents.Nodes = deserializeAws_restJson1NodeSummaryList(data.Nodes, context);
1625
+ }
1626
+ return [2, contents];
1627
+ }
1628
+ });
1629
+ }); };
1630
+ var deserializeAws_restJson1ListNodesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1631
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1632
+ var _c;
1633
+ return __generator(this, function (_d) {
1634
+ switch (_d.label) {
1635
+ case 0:
1636
+ _a = [__assign({}, output)];
1637
+ _c = {};
1638
+ return [4, parseErrorBody(output.body, context)];
1639
+ case 1:
1640
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1641
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1642
+ _b = errorCode;
1643
+ switch (_b) {
1644
+ case "AccessDeniedException": return [3, 2];
1645
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
1646
+ case "InternalServiceErrorException": return [3, 4];
1647
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
1648
+ case "InvalidRequestException": return [3, 6];
1649
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
1650
+ case "ThrottlingException": return [3, 8];
1651
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 8];
1652
+ }
1653
+ return [3, 10];
1654
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1655
+ case 3: throw _d.sent();
1656
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1657
+ case 5: throw _d.sent();
1658
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
1659
+ case 7: throw _d.sent();
1660
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1661
+ case 9: throw _d.sent();
1662
+ case 10:
1663
+ parsedBody = parsedOutput.body;
1664
+ throwDefaultError({
1665
+ output: output,
1666
+ parsedBody: parsedBody,
1667
+ exceptionCtor: __BaseException,
1668
+ errorCode: errorCode,
1669
+ });
1670
+ _d.label = 11;
1671
+ case 11: return [2];
1672
+ }
1673
+ });
1674
+ }); };
1675
+ export var deserializeAws_restJson1ListProposalsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1676
+ var contents, data, _a, _b;
1677
+ return __generator(this, function (_c) {
1678
+ switch (_c.label) {
1679
+ case 0:
1680
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1681
+ return [2, deserializeAws_restJson1ListProposalsCommandError(output, context)];
1682
+ }
1683
+ contents = map({
1684
+ $metadata: deserializeMetadata(output),
1685
+ });
1686
+ _a = __expectNonNull;
1687
+ _b = __expectObject;
1688
+ return [4, parseBody(output.body, context)];
1689
+ case 1:
1690
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1691
+ if (data.NextToken != null) {
1692
+ contents.NextToken = __expectString(data.NextToken);
1693
+ }
1694
+ if (data.Proposals != null) {
1695
+ contents.Proposals = deserializeAws_restJson1ProposalSummaryList(data.Proposals, context);
1696
+ }
1697
+ return [2, contents];
1698
+ }
1699
+ });
1700
+ }); };
1701
+ var deserializeAws_restJson1ListProposalsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1702
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1703
+ var _c;
1704
+ return __generator(this, function (_d) {
1705
+ switch (_d.label) {
1706
+ case 0:
1707
+ _a = [__assign({}, output)];
1708
+ _c = {};
1709
+ return [4, parseErrorBody(output.body, context)];
1710
+ case 1:
1711
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1712
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1713
+ _b = errorCode;
1714
+ switch (_b) {
1715
+ case "AccessDeniedException": return [3, 2];
1716
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
1717
+ case "InternalServiceErrorException": return [3, 4];
1718
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
1719
+ case "InvalidRequestException": return [3, 6];
1720
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
1721
+ case "ResourceNotFoundException": return [3, 8];
1722
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 8];
1723
+ case "ThrottlingException": return [3, 10];
1724
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 10];
1725
+ }
1726
+ return [3, 12];
1727
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1728
+ case 3: throw _d.sent();
1729
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1730
+ case 5: throw _d.sent();
1731
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
1732
+ case 7: throw _d.sent();
1733
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1734
+ case 9: throw _d.sent();
1735
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1736
+ case 11: throw _d.sent();
1737
+ case 12:
1738
+ parsedBody = parsedOutput.body;
1739
+ throwDefaultError({
1740
+ output: output,
1741
+ parsedBody: parsedBody,
1742
+ exceptionCtor: __BaseException,
1743
+ errorCode: errorCode,
1744
+ });
1745
+ _d.label = 13;
1746
+ case 13: return [2];
1747
+ }
1748
+ });
1749
+ }); };
1750
+ export var deserializeAws_restJson1ListProposalVotesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1751
+ var contents, data, _a, _b;
1752
+ return __generator(this, function (_c) {
1753
+ switch (_c.label) {
1754
+ case 0:
1755
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1756
+ return [2, deserializeAws_restJson1ListProposalVotesCommandError(output, context)];
1757
+ }
1758
+ contents = map({
1759
+ $metadata: deserializeMetadata(output),
1760
+ });
1761
+ _a = __expectNonNull;
1762
+ _b = __expectObject;
1763
+ return [4, parseBody(output.body, context)];
1764
+ case 1:
1765
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1766
+ if (data.NextToken != null) {
1767
+ contents.NextToken = __expectString(data.NextToken);
1768
+ }
1769
+ if (data.ProposalVotes != null) {
1770
+ contents.ProposalVotes = deserializeAws_restJson1ProposalVoteList(data.ProposalVotes, context);
1771
+ }
1772
+ return [2, contents];
1773
+ }
1774
+ });
1775
+ }); };
1776
+ var deserializeAws_restJson1ListProposalVotesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1777
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1778
+ var _c;
1779
+ return __generator(this, function (_d) {
1780
+ switch (_d.label) {
1781
+ case 0:
1782
+ _a = [__assign({}, output)];
1783
+ _c = {};
1784
+ return [4, parseErrorBody(output.body, context)];
1785
+ case 1:
1786
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1787
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1788
+ _b = errorCode;
1789
+ switch (_b) {
1790
+ case "AccessDeniedException": return [3, 2];
1791
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
1792
+ case "InternalServiceErrorException": return [3, 4];
1793
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
1794
+ case "InvalidRequestException": return [3, 6];
1795
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
1796
+ case "ThrottlingException": return [3, 8];
1797
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 8];
1798
+ }
1799
+ return [3, 10];
1800
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1801
+ case 3: throw _d.sent();
1802
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1803
+ case 5: throw _d.sent();
1804
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
1805
+ case 7: throw _d.sent();
1806
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1807
+ case 9: throw _d.sent();
1808
+ case 10:
1809
+ parsedBody = parsedOutput.body;
1810
+ throwDefaultError({
1811
+ output: output,
1812
+ parsedBody: parsedBody,
1813
+ exceptionCtor: __BaseException,
1814
+ errorCode: errorCode,
1815
+ });
1816
+ _d.label = 11;
1817
+ case 11: return [2];
1818
+ }
1819
+ });
1820
+ }); };
1821
+ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1822
+ var contents, data, _a, _b;
1823
+ return __generator(this, function (_c) {
1824
+ switch (_c.label) {
1825
+ case 0:
1826
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1827
+ return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1828
+ }
1829
+ contents = map({
1830
+ $metadata: deserializeMetadata(output),
1831
+ });
1832
+ _a = __expectNonNull;
1833
+ _b = __expectObject;
1834
+ return [4, parseBody(output.body, context)];
1835
+ case 1:
1836
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1837
+ if (data.Tags != null) {
1838
+ contents.Tags = deserializeAws_restJson1OutputTagMap(data.Tags, context);
1839
+ }
1840
+ return [2, contents];
1841
+ }
1842
+ });
1843
+ }); };
1844
+ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1845
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1846
+ var _c;
1847
+ return __generator(this, function (_d) {
1848
+ switch (_d.label) {
1849
+ case 0:
1850
+ _a = [__assign({}, output)];
1851
+ _c = {};
1852
+ return [4, parseErrorBody(output.body, context)];
1853
+ case 1:
1854
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1855
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1856
+ _b = errorCode;
1857
+ switch (_b) {
1858
+ case "InternalServiceErrorException": return [3, 2];
1859
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 2];
1860
+ case "InvalidRequestException": return [3, 4];
1861
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 4];
1862
+ case "ResourceNotFoundException": return [3, 6];
1863
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 6];
1864
+ case "ResourceNotReadyException": return [3, 8];
1865
+ case "com.amazonaws.managedblockchain#ResourceNotReadyException": return [3, 8];
1866
+ }
1867
+ return [3, 10];
1868
+ case 2: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1869
+ case 3: throw _d.sent();
1870
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
1871
+ case 5: throw _d.sent();
1872
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1873
+ case 7: throw _d.sent();
1874
+ case 8: return [4, deserializeAws_restJson1ResourceNotReadyExceptionResponse(parsedOutput, context)];
1875
+ case 9: throw _d.sent();
1876
+ case 10:
1877
+ parsedBody = parsedOutput.body;
1878
+ throwDefaultError({
1879
+ output: output,
1880
+ parsedBody: parsedBody,
1881
+ exceptionCtor: __BaseException,
1882
+ errorCode: errorCode,
1883
+ });
1884
+ _d.label = 11;
1885
+ case 11: return [2];
1886
+ }
1887
+ });
1888
+ }); };
1889
+ export var deserializeAws_restJson1RejectInvitationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1890
+ var contents;
1891
+ return __generator(this, function (_a) {
1892
+ switch (_a.label) {
1893
+ case 0:
1894
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1895
+ return [2, deserializeAws_restJson1RejectInvitationCommandError(output, context)];
1896
+ }
1897
+ contents = map({
1898
+ $metadata: deserializeMetadata(output),
1899
+ });
1900
+ return [4, collectBody(output.body, context)];
1901
+ case 1:
1902
+ _a.sent();
1903
+ return [2, contents];
1904
+ }
1905
+ });
1906
+ }); };
1907
+ var deserializeAws_restJson1RejectInvitationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1908
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1909
+ var _c;
1910
+ return __generator(this, function (_d) {
1911
+ switch (_d.label) {
1912
+ case 0:
1913
+ _a = [__assign({}, output)];
1914
+ _c = {};
1915
+ return [4, parseErrorBody(output.body, context)];
1916
+ case 1:
1917
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1918
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1919
+ _b = errorCode;
1920
+ switch (_b) {
1921
+ case "AccessDeniedException": return [3, 2];
1922
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
1923
+ case "IllegalActionException": return [3, 4];
1924
+ case "com.amazonaws.managedblockchain#IllegalActionException": return [3, 4];
1925
+ case "InternalServiceErrorException": return [3, 6];
1926
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 6];
1927
+ case "InvalidRequestException": return [3, 8];
1928
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 8];
1929
+ case "ResourceNotFoundException": return [3, 10];
1930
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 10];
1931
+ case "ThrottlingException": return [3, 12];
1932
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 12];
1933
+ }
1934
+ return [3, 14];
1935
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1936
+ case 3: throw _d.sent();
1937
+ case 4: return [4, deserializeAws_restJson1IllegalActionExceptionResponse(parsedOutput, context)];
1938
+ case 5: throw _d.sent();
1939
+ case 6: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1940
+ case 7: throw _d.sent();
1941
+ case 8: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
1942
+ case 9: throw _d.sent();
1943
+ case 10: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1944
+ case 11: throw _d.sent();
1945
+ case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1946
+ case 13: throw _d.sent();
1947
+ case 14:
1948
+ parsedBody = parsedOutput.body;
1949
+ throwDefaultError({
1950
+ output: output,
1951
+ parsedBody: parsedBody,
1952
+ exceptionCtor: __BaseException,
1953
+ errorCode: errorCode,
1954
+ });
1955
+ _d.label = 15;
1956
+ case 15: return [2];
1957
+ }
1958
+ });
1959
+ }); };
1960
+ export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1961
+ var contents;
1962
+ return __generator(this, function (_a) {
1963
+ switch (_a.label) {
1964
+ case 0:
1965
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1966
+ return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
1967
+ }
1968
+ contents = map({
1969
+ $metadata: deserializeMetadata(output),
1970
+ });
1971
+ return [4, collectBody(output.body, context)];
1972
+ case 1:
1973
+ _a.sent();
1974
+ return [2, contents];
1975
+ }
1976
+ });
1977
+ }); };
1978
+ var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1979
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1980
+ var _c;
1981
+ return __generator(this, function (_d) {
1982
+ switch (_d.label) {
1983
+ case 0:
1984
+ _a = [__assign({}, output)];
1985
+ _c = {};
1986
+ return [4, parseErrorBody(output.body, context)];
1987
+ case 1:
1988
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1989
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1990
+ _b = errorCode;
1991
+ switch (_b) {
1992
+ case "InternalServiceErrorException": return [3, 2];
1993
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 2];
1994
+ case "InvalidRequestException": return [3, 4];
1995
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 4];
1996
+ case "ResourceNotFoundException": return [3, 6];
1997
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 6];
1998
+ case "ResourceNotReadyException": return [3, 8];
1999
+ case "com.amazonaws.managedblockchain#ResourceNotReadyException": return [3, 8];
2000
+ case "TooManyTagsException": return [3, 10];
2001
+ case "com.amazonaws.managedblockchain#TooManyTagsException": return [3, 10];
2002
+ }
2003
+ return [3, 12];
2004
+ case 2: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
2005
+ case 3: throw _d.sent();
2006
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
2007
+ case 5: throw _d.sent();
2008
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2009
+ case 7: throw _d.sent();
2010
+ case 8: return [4, deserializeAws_restJson1ResourceNotReadyExceptionResponse(parsedOutput, context)];
2011
+ case 9: throw _d.sent();
2012
+ case 10: return [4, deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context)];
2013
+ case 11: throw _d.sent();
2014
+ case 12:
2015
+ parsedBody = parsedOutput.body;
2016
+ throwDefaultError({
2017
+ output: output,
2018
+ parsedBody: parsedBody,
2019
+ exceptionCtor: __BaseException,
2020
+ errorCode: errorCode,
2021
+ });
2022
+ _d.label = 13;
2023
+ case 13: return [2];
2024
+ }
2025
+ });
2026
+ }); };
2027
+ export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2028
+ var contents;
2029
+ return __generator(this, function (_a) {
2030
+ switch (_a.label) {
2031
+ case 0:
2032
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2033
+ return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
2034
+ }
2035
+ contents = map({
2036
+ $metadata: deserializeMetadata(output),
2037
+ });
2038
+ return [4, collectBody(output.body, context)];
2039
+ case 1:
2040
+ _a.sent();
2041
+ return [2, contents];
2042
+ }
2043
+ });
2044
+ }); };
2045
+ var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2046
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2047
+ var _c;
2048
+ return __generator(this, function (_d) {
2049
+ switch (_d.label) {
2050
+ case 0:
2051
+ _a = [__assign({}, output)];
2052
+ _c = {};
2053
+ return [4, parseErrorBody(output.body, context)];
2054
+ case 1:
2055
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2056
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2057
+ _b = errorCode;
2058
+ switch (_b) {
2059
+ case "InternalServiceErrorException": return [3, 2];
2060
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 2];
2061
+ case "InvalidRequestException": return [3, 4];
2062
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 4];
2063
+ case "ResourceNotFoundException": return [3, 6];
2064
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 6];
2065
+ case "ResourceNotReadyException": return [3, 8];
2066
+ case "com.amazonaws.managedblockchain#ResourceNotReadyException": return [3, 8];
2067
+ }
2068
+ return [3, 10];
2069
+ case 2: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
2070
+ case 3: throw _d.sent();
2071
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
2072
+ case 5: throw _d.sent();
2073
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2074
+ case 7: throw _d.sent();
2075
+ case 8: return [4, deserializeAws_restJson1ResourceNotReadyExceptionResponse(parsedOutput, context)];
2076
+ case 9: throw _d.sent();
2077
+ case 10:
2078
+ parsedBody = parsedOutput.body;
2079
+ throwDefaultError({
2080
+ output: output,
2081
+ parsedBody: parsedBody,
2082
+ exceptionCtor: __BaseException,
2083
+ errorCode: errorCode,
2084
+ });
2085
+ _d.label = 11;
2086
+ case 11: return [2];
2087
+ }
2088
+ });
2089
+ }); };
2090
+ export var deserializeAws_restJson1UpdateMemberCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2091
+ var contents;
2092
+ return __generator(this, function (_a) {
2093
+ switch (_a.label) {
2094
+ case 0:
2095
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2096
+ return [2, deserializeAws_restJson1UpdateMemberCommandError(output, context)];
2097
+ }
2098
+ contents = map({
2099
+ $metadata: deserializeMetadata(output),
2100
+ });
2101
+ return [4, collectBody(output.body, context)];
2102
+ case 1:
2103
+ _a.sent();
2104
+ return [2, contents];
2105
+ }
2106
+ });
2107
+ }); };
2108
+ var deserializeAws_restJson1UpdateMemberCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2109
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2110
+ var _c;
2111
+ return __generator(this, function (_d) {
2112
+ switch (_d.label) {
2113
+ case 0:
2114
+ _a = [__assign({}, output)];
2115
+ _c = {};
2116
+ return [4, parseErrorBody(output.body, context)];
2117
+ case 1:
2118
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2119
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2120
+ _b = errorCode;
2121
+ switch (_b) {
2122
+ case "AccessDeniedException": return [3, 2];
2123
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
2124
+ case "InternalServiceErrorException": return [3, 4];
2125
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
2126
+ case "InvalidRequestException": return [3, 6];
2127
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
2128
+ case "ResourceNotFoundException": return [3, 8];
2129
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 8];
2130
+ case "ThrottlingException": return [3, 10];
2131
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 10];
2132
+ }
2133
+ return [3, 12];
2134
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2135
+ case 3: throw _d.sent();
2136
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
2137
+ case 5: throw _d.sent();
2138
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
2139
+ case 7: throw _d.sent();
2140
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2141
+ case 9: throw _d.sent();
2142
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2143
+ case 11: throw _d.sent();
2144
+ case 12:
2145
+ parsedBody = parsedOutput.body;
2146
+ throwDefaultError({
2147
+ output: output,
2148
+ parsedBody: parsedBody,
2149
+ exceptionCtor: __BaseException,
2150
+ errorCode: errorCode,
2151
+ });
2152
+ _d.label = 13;
2153
+ case 13: return [2];
2154
+ }
2155
+ });
2156
+ }); };
2157
+ export var deserializeAws_restJson1UpdateNodeCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2158
+ var contents;
2159
+ return __generator(this, function (_a) {
2160
+ switch (_a.label) {
2161
+ case 0:
2162
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2163
+ return [2, deserializeAws_restJson1UpdateNodeCommandError(output, context)];
2164
+ }
2165
+ contents = map({
2166
+ $metadata: deserializeMetadata(output),
2167
+ });
2168
+ return [4, collectBody(output.body, context)];
2169
+ case 1:
2170
+ _a.sent();
2171
+ return [2, contents];
2172
+ }
2173
+ });
2174
+ }); };
2175
+ var deserializeAws_restJson1UpdateNodeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2176
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2177
+ var _c;
2178
+ return __generator(this, function (_d) {
2179
+ switch (_d.label) {
2180
+ case 0:
2181
+ _a = [__assign({}, output)];
2182
+ _c = {};
2183
+ return [4, parseErrorBody(output.body, context)];
2184
+ case 1:
2185
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2186
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2187
+ _b = errorCode;
2188
+ switch (_b) {
2189
+ case "AccessDeniedException": return [3, 2];
2190
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
2191
+ case "InternalServiceErrorException": return [3, 4];
2192
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 4];
2193
+ case "InvalidRequestException": return [3, 6];
2194
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 6];
2195
+ case "ResourceNotFoundException": return [3, 8];
2196
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 8];
2197
+ case "ThrottlingException": return [3, 10];
2198
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 10];
2199
+ }
2200
+ return [3, 12];
2201
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2202
+ case 3: throw _d.sent();
2203
+ case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
2204
+ case 5: throw _d.sent();
2205
+ case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
2206
+ case 7: throw _d.sent();
2207
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2208
+ case 9: throw _d.sent();
2209
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2210
+ case 11: throw _d.sent();
2211
+ case 12:
2212
+ parsedBody = parsedOutput.body;
2213
+ throwDefaultError({
2214
+ output: output,
2215
+ parsedBody: parsedBody,
2216
+ exceptionCtor: __BaseException,
2217
+ errorCode: errorCode,
2218
+ });
2219
+ _d.label = 13;
2220
+ case 13: return [2];
2221
+ }
2222
+ });
2223
+ }); };
2224
+ export var deserializeAws_restJson1VoteOnProposalCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2225
+ var contents;
2226
+ return __generator(this, function (_a) {
2227
+ switch (_a.label) {
2228
+ case 0:
2229
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2230
+ return [2, deserializeAws_restJson1VoteOnProposalCommandError(output, context)];
2231
+ }
2232
+ contents = map({
2233
+ $metadata: deserializeMetadata(output),
2234
+ });
2235
+ return [4, collectBody(output.body, context)];
2236
+ case 1:
2237
+ _a.sent();
2238
+ return [2, contents];
2239
+ }
2240
+ });
2241
+ }); };
2242
+ var deserializeAws_restJson1VoteOnProposalCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2243
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2244
+ var _c;
2245
+ return __generator(this, function (_d) {
2246
+ switch (_d.label) {
2247
+ case 0:
2248
+ _a = [__assign({}, output)];
2249
+ _c = {};
2250
+ return [4, parseErrorBody(output.body, context)];
2251
+ case 1:
2252
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2253
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2254
+ _b = errorCode;
2255
+ switch (_b) {
2256
+ case "AccessDeniedException": return [3, 2];
2257
+ case "com.amazonaws.managedblockchain#AccessDeniedException": return [3, 2];
2258
+ case "IllegalActionException": return [3, 4];
2259
+ case "com.amazonaws.managedblockchain#IllegalActionException": return [3, 4];
2260
+ case "InternalServiceErrorException": return [3, 6];
2261
+ case "com.amazonaws.managedblockchain#InternalServiceErrorException": return [3, 6];
2262
+ case "InvalidRequestException": return [3, 8];
2263
+ case "com.amazonaws.managedblockchain#InvalidRequestException": return [3, 8];
2264
+ case "ResourceNotFoundException": return [3, 10];
2265
+ case "com.amazonaws.managedblockchain#ResourceNotFoundException": return [3, 10];
2266
+ case "ThrottlingException": return [3, 12];
2267
+ case "com.amazonaws.managedblockchain#ThrottlingException": return [3, 12];
2268
+ }
2269
+ return [3, 14];
2270
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2271
+ case 3: throw _d.sent();
2272
+ case 4: return [4, deserializeAws_restJson1IllegalActionExceptionResponse(parsedOutput, context)];
2273
+ case 5: throw _d.sent();
2274
+ case 6: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
2275
+ case 7: throw _d.sent();
2276
+ case 8: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
2277
+ case 9: throw _d.sent();
2278
+ case 10: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2279
+ case 11: throw _d.sent();
2280
+ case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2281
+ case 13: throw _d.sent();
2282
+ case 14:
2283
+ parsedBody = parsedOutput.body;
2284
+ throwDefaultError({
2285
+ output: output,
2286
+ parsedBody: parsedBody,
2287
+ exceptionCtor: __BaseException,
2288
+ errorCode: errorCode,
2289
+ });
2290
+ _d.label = 15;
2291
+ case 15: return [2];
2292
+ }
2293
+ });
2294
+ }); };
2295
+ var map = __map;
2296
+ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2297
+ var contents, data, exception;
2298
+ return __generator(this, function (_a) {
2299
+ contents = map({});
2300
+ data = parsedOutput.body;
2301
+ if (data.Message != null) {
2302
+ contents.Message = __expectString(data.Message);
2303
+ }
2304
+ exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2305
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
2306
+ });
2307
+ }); };
2308
+ var deserializeAws_restJson1IllegalActionExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2309
+ var contents, data, exception;
2310
+ return __generator(this, function (_a) {
2311
+ contents = map({});
2312
+ data = parsedOutput.body;
2313
+ if (data.Message != null) {
2314
+ contents.Message = __expectString(data.Message);
2315
+ }
2316
+ exception = new IllegalActionException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2317
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
2318
+ });
2319
+ }); };
2320
+ var deserializeAws_restJson1InternalServiceErrorExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2321
+ var contents, data, exception;
2322
+ return __generator(this, function (_a) {
2323
+ contents = map({});
2324
+ data = parsedOutput.body;
2325
+ exception = new InternalServiceErrorException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2326
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
2327
+ });
2328
+ }); };
2329
+ var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2330
+ var contents, data, exception;
2331
+ return __generator(this, function (_a) {
2332
+ contents = map({});
2333
+ data = parsedOutput.body;
2334
+ if (data.Message != null) {
2335
+ contents.Message = __expectString(data.Message);
2336
+ }
2337
+ exception = new InvalidRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2338
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
2339
+ });
2340
+ }); };
2341
+ var deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2342
+ var contents, data, exception;
2343
+ return __generator(this, function (_a) {
2344
+ contents = map({});
2345
+ data = parsedOutput.body;
2346
+ if (data.Message != null) {
2347
+ contents.Message = __expectString(data.Message);
2348
+ }
2349
+ exception = new ResourceAlreadyExistsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2350
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
2351
+ });
2352
+ }); };
2353
+ var deserializeAws_restJson1ResourceLimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2354
+ var contents, data, exception;
2355
+ return __generator(this, function (_a) {
2356
+ contents = map({});
2357
+ data = parsedOutput.body;
2358
+ if (data.Message != null) {
2359
+ contents.Message = __expectString(data.Message);
2360
+ }
2361
+ exception = new ResourceLimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2362
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
2363
+ });
2364
+ }); };
2365
+ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2366
+ var contents, data, exception;
2367
+ return __generator(this, function (_a) {
2368
+ contents = map({});
2369
+ data = parsedOutput.body;
2370
+ if (data.Message != null) {
2371
+ contents.Message = __expectString(data.Message);
2372
+ }
2373
+ if (data.ResourceName != null) {
2374
+ contents.ResourceName = __expectString(data.ResourceName);
2375
+ }
2376
+ exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2377
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
2378
+ });
2379
+ }); };
2380
+ var deserializeAws_restJson1ResourceNotReadyExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2381
+ var contents, data, exception;
2382
+ return __generator(this, function (_a) {
2383
+ contents = map({});
2384
+ data = parsedOutput.body;
2385
+ if (data.Message != null) {
2386
+ contents.Message = __expectString(data.Message);
2387
+ }
2388
+ exception = new ResourceNotReadyException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2389
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
2390
+ });
2391
+ }); };
2392
+ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2393
+ var contents, data, exception;
2394
+ return __generator(this, function (_a) {
2395
+ contents = map({});
2396
+ data = parsedOutput.body;
2397
+ exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2398
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
2399
+ });
2400
+ }); };
2401
+ var deserializeAws_restJson1TooManyTagsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2402
+ var contents, data, exception;
2403
+ return __generator(this, function (_a) {
2404
+ contents = map({});
2405
+ data = parsedOutput.body;
2406
+ if (data.Message != null) {
2407
+ contents.Message = __expectString(data.Message);
2408
+ }
2409
+ if (data.ResourceName != null) {
2410
+ contents.ResourceName = __expectString(data.ResourceName);
2411
+ }
2412
+ exception = new TooManyTagsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2413
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
2414
+ });
2415
+ }); };
2416
+ var serializeAws_restJson1ApprovalThresholdPolicy = function (input, context) {
2417
+ return __assign(__assign(__assign({}, (input.ProposalDurationInHours != null && { ProposalDurationInHours: input.ProposalDurationInHours })), (input.ThresholdComparator != null && { ThresholdComparator: input.ThresholdComparator })), (input.ThresholdPercentage != null && { ThresholdPercentage: input.ThresholdPercentage }));
1698
2418
  };
1699
- const serializeAws_restJson1InputTagMap = (input, context) => {
1700
- return Object.entries(input).reduce((acc, [key, value]) => {
2419
+ var serializeAws_restJson1InputTagMap = function (input, context) {
2420
+ return Object.entries(input).reduce(function (acc, _a) {
2421
+ var _b;
2422
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1701
2423
  if (value === null) {
1702
2424
  return acc;
1703
2425
  }
1704
- return {
1705
- ...acc,
1706
- [key]: value,
1707
- };
2426
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1708
2427
  }, {});
1709
2428
  };
1710
- const serializeAws_restJson1InviteAction = (input, context) => {
1711
- return {
1712
- ...(input.Principal != null && { Principal: input.Principal }),
1713
- };
2429
+ var serializeAws_restJson1InviteAction = function (input, context) {
2430
+ return __assign({}, (input.Principal != null && { Principal: input.Principal }));
1714
2431
  };
1715
- const serializeAws_restJson1InviteActionList = (input, context) => {
2432
+ var serializeAws_restJson1InviteActionList = function (input, context) {
1716
2433
  return input
1717
- .filter((e) => e != null)
1718
- .map((entry) => {
2434
+ .filter(function (e) { return e != null; })
2435
+ .map(function (entry) {
1719
2436
  return serializeAws_restJson1InviteAction(entry, context);
1720
2437
  });
1721
2438
  };
1722
- const serializeAws_restJson1LogConfiguration = (input, context) => {
1723
- return {
1724
- ...(input.Enabled != null && { Enabled: input.Enabled }),
1725
- };
2439
+ var serializeAws_restJson1LogConfiguration = function (input, context) {
2440
+ return __assign({}, (input.Enabled != null && { Enabled: input.Enabled }));
1726
2441
  };
1727
- const serializeAws_restJson1LogConfigurations = (input, context) => {
1728
- return {
1729
- ...(input.Cloudwatch != null && { Cloudwatch: serializeAws_restJson1LogConfiguration(input.Cloudwatch, context) }),
1730
- };
2442
+ var serializeAws_restJson1LogConfigurations = function (input, context) {
2443
+ return __assign({}, (input.Cloudwatch != null && { Cloudwatch: serializeAws_restJson1LogConfiguration(input.Cloudwatch, context) }));
1731
2444
  };
1732
- const serializeAws_restJson1MemberConfiguration = (input, context) => {
1733
- return {
1734
- ...(input.Description != null && { Description: input.Description }),
1735
- ...(input.FrameworkConfiguration != null && {
1736
- FrameworkConfiguration: serializeAws_restJson1MemberFrameworkConfiguration(input.FrameworkConfiguration, context),
1737
- }),
1738
- ...(input.KmsKeyArn != null && { KmsKeyArn: input.KmsKeyArn }),
1739
- ...(input.LogPublishingConfiguration != null && {
1740
- LogPublishingConfiguration: serializeAws_restJson1MemberLogPublishingConfiguration(input.LogPublishingConfiguration, context),
1741
- }),
1742
- ...(input.Name != null && { Name: input.Name }),
1743
- ...(input.Tags != null && { Tags: serializeAws_restJson1InputTagMap(input.Tags, context) }),
1744
- };
2445
+ var serializeAws_restJson1MemberConfiguration = function (input, context) {
2446
+ return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.Description != null && { Description: input.Description })), (input.FrameworkConfiguration != null && {
2447
+ FrameworkConfiguration: serializeAws_restJson1MemberFrameworkConfiguration(input.FrameworkConfiguration, context),
2448
+ })), (input.KmsKeyArn != null && { KmsKeyArn: input.KmsKeyArn })), (input.LogPublishingConfiguration != null && {
2449
+ LogPublishingConfiguration: serializeAws_restJson1MemberLogPublishingConfiguration(input.LogPublishingConfiguration, context),
2450
+ })), (input.Name != null && { Name: input.Name })), (input.Tags != null && { Tags: serializeAws_restJson1InputTagMap(input.Tags, context) }));
1745
2451
  };
1746
- const serializeAws_restJson1MemberFabricConfiguration = (input, context) => {
1747
- return {
1748
- ...(input.AdminPassword != null && { AdminPassword: input.AdminPassword }),
1749
- ...(input.AdminUsername != null && { AdminUsername: input.AdminUsername }),
1750
- };
2452
+ var serializeAws_restJson1MemberFabricConfiguration = function (input, context) {
2453
+ return __assign(__assign({}, (input.AdminPassword != null && { AdminPassword: input.AdminPassword })), (input.AdminUsername != null && { AdminUsername: input.AdminUsername }));
1751
2454
  };
1752
- const serializeAws_restJson1MemberFabricLogPublishingConfiguration = (input, context) => {
1753
- return {
1754
- ...(input.CaLogs != null && { CaLogs: serializeAws_restJson1LogConfigurations(input.CaLogs, context) }),
1755
- };
2455
+ var serializeAws_restJson1MemberFabricLogPublishingConfiguration = function (input, context) {
2456
+ return __assign({}, (input.CaLogs != null && { CaLogs: serializeAws_restJson1LogConfigurations(input.CaLogs, context) }));
1756
2457
  };
1757
- const serializeAws_restJson1MemberFrameworkConfiguration = (input, context) => {
1758
- return {
1759
- ...(input.Fabric != null && { Fabric: serializeAws_restJson1MemberFabricConfiguration(input.Fabric, context) }),
1760
- };
2458
+ var serializeAws_restJson1MemberFrameworkConfiguration = function (input, context) {
2459
+ return __assign({}, (input.Fabric != null && { Fabric: serializeAws_restJson1MemberFabricConfiguration(input.Fabric, context) }));
1761
2460
  };
1762
- const serializeAws_restJson1MemberLogPublishingConfiguration = (input, context) => {
1763
- return {
1764
- ...(input.Fabric != null && {
1765
- Fabric: serializeAws_restJson1MemberFabricLogPublishingConfiguration(input.Fabric, context),
1766
- }),
1767
- };
2461
+ var serializeAws_restJson1MemberLogPublishingConfiguration = function (input, context) {
2462
+ return __assign({}, (input.Fabric != null && {
2463
+ Fabric: serializeAws_restJson1MemberFabricLogPublishingConfiguration(input.Fabric, context),
2464
+ }));
1768
2465
  };
1769
- const serializeAws_restJson1NetworkFabricConfiguration = (input, context) => {
1770
- return {
1771
- ...(input.Edition != null && { Edition: input.Edition }),
1772
- };
2466
+ var serializeAws_restJson1NetworkFabricConfiguration = function (input, context) {
2467
+ return __assign({}, (input.Edition != null && { Edition: input.Edition }));
1773
2468
  };
1774
- const serializeAws_restJson1NetworkFrameworkConfiguration = (input, context) => {
1775
- return {
1776
- ...(input.Fabric != null && { Fabric: serializeAws_restJson1NetworkFabricConfiguration(input.Fabric, context) }),
1777
- };
2469
+ var serializeAws_restJson1NetworkFrameworkConfiguration = function (input, context) {
2470
+ return __assign({}, (input.Fabric != null && { Fabric: serializeAws_restJson1NetworkFabricConfiguration(input.Fabric, context) }));
1778
2471
  };
1779
- const serializeAws_restJson1NodeConfiguration = (input, context) => {
1780
- return {
1781
- ...(input.AvailabilityZone != null && { AvailabilityZone: input.AvailabilityZone }),
1782
- ...(input.InstanceType != null && { InstanceType: input.InstanceType }),
1783
- ...(input.LogPublishingConfiguration != null && {
1784
- LogPublishingConfiguration: serializeAws_restJson1NodeLogPublishingConfiguration(input.LogPublishingConfiguration, context),
1785
- }),
1786
- ...(input.StateDB != null && { StateDB: input.StateDB }),
1787
- };
2472
+ var serializeAws_restJson1NodeConfiguration = function (input, context) {
2473
+ return __assign(__assign(__assign(__assign({}, (input.AvailabilityZone != null && { AvailabilityZone: input.AvailabilityZone })), (input.InstanceType != null && { InstanceType: input.InstanceType })), (input.LogPublishingConfiguration != null && {
2474
+ LogPublishingConfiguration: serializeAws_restJson1NodeLogPublishingConfiguration(input.LogPublishingConfiguration, context),
2475
+ })), (input.StateDB != null && { StateDB: input.StateDB }));
1788
2476
  };
1789
- const serializeAws_restJson1NodeFabricLogPublishingConfiguration = (input, context) => {
1790
- return {
1791
- ...(input.ChaincodeLogs != null && {
1792
- ChaincodeLogs: serializeAws_restJson1LogConfigurations(input.ChaincodeLogs, context),
1793
- }),
1794
- ...(input.PeerLogs != null && { PeerLogs: serializeAws_restJson1LogConfigurations(input.PeerLogs, context) }),
1795
- };
2477
+ var serializeAws_restJson1NodeFabricLogPublishingConfiguration = function (input, context) {
2478
+ return __assign(__assign({}, (input.ChaincodeLogs != null && {
2479
+ ChaincodeLogs: serializeAws_restJson1LogConfigurations(input.ChaincodeLogs, context),
2480
+ })), (input.PeerLogs != null && { PeerLogs: serializeAws_restJson1LogConfigurations(input.PeerLogs, context) }));
1796
2481
  };
1797
- const serializeAws_restJson1NodeLogPublishingConfiguration = (input, context) => {
1798
- return {
1799
- ...(input.Fabric != null && {
1800
- Fabric: serializeAws_restJson1NodeFabricLogPublishingConfiguration(input.Fabric, context),
1801
- }),
1802
- };
2482
+ var serializeAws_restJson1NodeLogPublishingConfiguration = function (input, context) {
2483
+ return __assign({}, (input.Fabric != null && {
2484
+ Fabric: serializeAws_restJson1NodeFabricLogPublishingConfiguration(input.Fabric, context),
2485
+ }));
1803
2486
  };
1804
- const serializeAws_restJson1ProposalActions = (input, context) => {
1805
- return {
1806
- ...(input.Invitations != null && {
1807
- Invitations: serializeAws_restJson1InviteActionList(input.Invitations, context),
1808
- }),
1809
- ...(input.Removals != null && { Removals: serializeAws_restJson1RemoveActionList(input.Removals, context) }),
1810
- };
2487
+ var serializeAws_restJson1ProposalActions = function (input, context) {
2488
+ return __assign(__assign({}, (input.Invitations != null && {
2489
+ Invitations: serializeAws_restJson1InviteActionList(input.Invitations, context),
2490
+ })), (input.Removals != null && { Removals: serializeAws_restJson1RemoveActionList(input.Removals, context) }));
1811
2491
  };
1812
- const serializeAws_restJson1RemoveAction = (input, context) => {
1813
- return {
1814
- ...(input.MemberId != null && { MemberId: input.MemberId }),
1815
- };
2492
+ var serializeAws_restJson1RemoveAction = function (input, context) {
2493
+ return __assign({}, (input.MemberId != null && { MemberId: input.MemberId }));
1816
2494
  };
1817
- const serializeAws_restJson1RemoveActionList = (input, context) => {
2495
+ var serializeAws_restJson1RemoveActionList = function (input, context) {
1818
2496
  return input
1819
- .filter((e) => e != null)
1820
- .map((entry) => {
2497
+ .filter(function (e) { return e != null; })
2498
+ .map(function (entry) {
1821
2499
  return serializeAws_restJson1RemoveAction(entry, context);
1822
2500
  });
1823
2501
  };
1824
- const serializeAws_restJson1VotingPolicy = (input, context) => {
1825
- return {
1826
- ...(input.ApprovalThresholdPolicy != null && {
1827
- ApprovalThresholdPolicy: serializeAws_restJson1ApprovalThresholdPolicy(input.ApprovalThresholdPolicy, context),
1828
- }),
1829
- };
2502
+ var serializeAws_restJson1VotingPolicy = function (input, context) {
2503
+ return __assign({}, (input.ApprovalThresholdPolicy != null && {
2504
+ ApprovalThresholdPolicy: serializeAws_restJson1ApprovalThresholdPolicy(input.ApprovalThresholdPolicy, context),
2505
+ }));
1830
2506
  };
1831
- const deserializeAws_restJson1ApprovalThresholdPolicy = (output, context) => {
2507
+ var deserializeAws_restJson1ApprovalThresholdPolicy = function (output, context) {
1832
2508
  return {
1833
2509
  ProposalDurationInHours: __expectInt32(output.ProposalDurationInHours),
1834
2510
  ThresholdComparator: __expectString(output.ThresholdComparator),
1835
2511
  ThresholdPercentage: __expectInt32(output.ThresholdPercentage),
1836
2512
  };
1837
2513
  };
1838
- const deserializeAws_restJson1Invitation = (output, context) => {
2514
+ var deserializeAws_restJson1Invitation = function (output, context) {
1839
2515
  return {
1840
2516
  Arn: __expectString(output.Arn),
1841
2517
  CreationDate: output.CreationDate != null ? __expectNonNull(__parseRfc3339DateTime(output.CreationDate)) : undefined,
@@ -1847,10 +2523,10 @@ const deserializeAws_restJson1Invitation = (output, context) => {
1847
2523
  Status: __expectString(output.Status),
1848
2524
  };
1849
2525
  };
1850
- const deserializeAws_restJson1InvitationList = (output, context) => {
1851
- const retVal = (output || [])
1852
- .filter((e) => e != null)
1853
- .map((entry) => {
2526
+ var deserializeAws_restJson1InvitationList = function (output, context) {
2527
+ var retVal = (output || [])
2528
+ .filter(function (e) { return e != null; })
2529
+ .map(function (entry) {
1854
2530
  if (entry === null) {
1855
2531
  return null;
1856
2532
  }
@@ -1858,15 +2534,15 @@ const deserializeAws_restJson1InvitationList = (output, context) => {
1858
2534
  });
1859
2535
  return retVal;
1860
2536
  };
1861
- const deserializeAws_restJson1InviteAction = (output, context) => {
2537
+ var deserializeAws_restJson1InviteAction = function (output, context) {
1862
2538
  return {
1863
2539
  Principal: __expectString(output.Principal),
1864
2540
  };
1865
2541
  };
1866
- const deserializeAws_restJson1InviteActionList = (output, context) => {
1867
- const retVal = (output || [])
1868
- .filter((e) => e != null)
1869
- .map((entry) => {
2542
+ var deserializeAws_restJson1InviteActionList = function (output, context) {
2543
+ var retVal = (output || [])
2544
+ .filter(function (e) { return e != null; })
2545
+ .map(function (entry) {
1870
2546
  if (entry === null) {
1871
2547
  return null;
1872
2548
  }
@@ -1874,17 +2550,17 @@ const deserializeAws_restJson1InviteActionList = (output, context) => {
1874
2550
  });
1875
2551
  return retVal;
1876
2552
  };
1877
- const deserializeAws_restJson1LogConfiguration = (output, context) => {
2553
+ var deserializeAws_restJson1LogConfiguration = function (output, context) {
1878
2554
  return {
1879
2555
  Enabled: __expectBoolean(output.Enabled),
1880
2556
  };
1881
2557
  };
1882
- const deserializeAws_restJson1LogConfigurations = (output, context) => {
2558
+ var deserializeAws_restJson1LogConfigurations = function (output, context) {
1883
2559
  return {
1884
2560
  Cloudwatch: output.Cloudwatch != null ? deserializeAws_restJson1LogConfiguration(output.Cloudwatch, context) : undefined,
1885
2561
  };
1886
2562
  };
1887
- const deserializeAws_restJson1Member = (output, context) => {
2563
+ var deserializeAws_restJson1Member = function (output, context) {
1888
2564
  return {
1889
2565
  Arn: __expectString(output.Arn),
1890
2566
  CreationDate: output.CreationDate != null ? __expectNonNull(__parseRfc3339DateTime(output.CreationDate)) : undefined,
@@ -1903,30 +2579,30 @@ const deserializeAws_restJson1Member = (output, context) => {
1903
2579
  Tags: output.Tags != null ? deserializeAws_restJson1OutputTagMap(output.Tags, context) : undefined,
1904
2580
  };
1905
2581
  };
1906
- const deserializeAws_restJson1MemberFabricAttributes = (output, context) => {
2582
+ var deserializeAws_restJson1MemberFabricAttributes = function (output, context) {
1907
2583
  return {
1908
2584
  AdminUsername: __expectString(output.AdminUsername),
1909
2585
  CaEndpoint: __expectString(output.CaEndpoint),
1910
2586
  };
1911
2587
  };
1912
- const deserializeAws_restJson1MemberFabricLogPublishingConfiguration = (output, context) => {
2588
+ var deserializeAws_restJson1MemberFabricLogPublishingConfiguration = function (output, context) {
1913
2589
  return {
1914
2590
  CaLogs: output.CaLogs != null ? deserializeAws_restJson1LogConfigurations(output.CaLogs, context) : undefined,
1915
2591
  };
1916
2592
  };
1917
- const deserializeAws_restJson1MemberFrameworkAttributes = (output, context) => {
2593
+ var deserializeAws_restJson1MemberFrameworkAttributes = function (output, context) {
1918
2594
  return {
1919
2595
  Fabric: output.Fabric != null ? deserializeAws_restJson1MemberFabricAttributes(output.Fabric, context) : undefined,
1920
2596
  };
1921
2597
  };
1922
- const deserializeAws_restJson1MemberLogPublishingConfiguration = (output, context) => {
2598
+ var deserializeAws_restJson1MemberLogPublishingConfiguration = function (output, context) {
1923
2599
  return {
1924
2600
  Fabric: output.Fabric != null
1925
2601
  ? deserializeAws_restJson1MemberFabricLogPublishingConfiguration(output.Fabric, context)
1926
2602
  : undefined,
1927
2603
  };
1928
2604
  };
1929
- const deserializeAws_restJson1MemberSummary = (output, context) => {
2605
+ var deserializeAws_restJson1MemberSummary = function (output, context) {
1930
2606
  return {
1931
2607
  Arn: __expectString(output.Arn),
1932
2608
  CreationDate: output.CreationDate != null ? __expectNonNull(__parseRfc3339DateTime(output.CreationDate)) : undefined,
@@ -1937,10 +2613,10 @@ const deserializeAws_restJson1MemberSummary = (output, context) => {
1937
2613
  Status: __expectString(output.Status),
1938
2614
  };
1939
2615
  };
1940
- const deserializeAws_restJson1MemberSummaryList = (output, context) => {
1941
- const retVal = (output || [])
1942
- .filter((e) => e != null)
1943
- .map((entry) => {
2616
+ var deserializeAws_restJson1MemberSummaryList = function (output, context) {
2617
+ var retVal = (output || [])
2618
+ .filter(function (e) { return e != null; })
2619
+ .map(function (entry) {
1944
2620
  if (entry === null) {
1945
2621
  return null;
1946
2622
  }
@@ -1948,7 +2624,7 @@ const deserializeAws_restJson1MemberSummaryList = (output, context) => {
1948
2624
  });
1949
2625
  return retVal;
1950
2626
  };
1951
- const deserializeAws_restJson1Network = (output, context) => {
2627
+ var deserializeAws_restJson1Network = function (output, context) {
1952
2628
  return {
1953
2629
  Arn: __expectString(output.Arn),
1954
2630
  CreationDate: output.CreationDate != null ? __expectNonNull(__parseRfc3339DateTime(output.CreationDate)) : undefined,
@@ -1966,24 +2642,24 @@ const deserializeAws_restJson1Network = (output, context) => {
1966
2642
  VpcEndpointServiceName: __expectString(output.VpcEndpointServiceName),
1967
2643
  };
1968
2644
  };
1969
- const deserializeAws_restJson1NetworkEthereumAttributes = (output, context) => {
2645
+ var deserializeAws_restJson1NetworkEthereumAttributes = function (output, context) {
1970
2646
  return {
1971
2647
  ChainId: __expectString(output.ChainId),
1972
2648
  };
1973
2649
  };
1974
- const deserializeAws_restJson1NetworkFabricAttributes = (output, context) => {
2650
+ var deserializeAws_restJson1NetworkFabricAttributes = function (output, context) {
1975
2651
  return {
1976
2652
  Edition: __expectString(output.Edition),
1977
2653
  OrderingServiceEndpoint: __expectString(output.OrderingServiceEndpoint),
1978
2654
  };
1979
2655
  };
1980
- const deserializeAws_restJson1NetworkFrameworkAttributes = (output, context) => {
2656
+ var deserializeAws_restJson1NetworkFrameworkAttributes = function (output, context) {
1981
2657
  return {
1982
2658
  Ethereum: output.Ethereum != null ? deserializeAws_restJson1NetworkEthereumAttributes(output.Ethereum, context) : undefined,
1983
2659
  Fabric: output.Fabric != null ? deserializeAws_restJson1NetworkFabricAttributes(output.Fabric, context) : undefined,
1984
2660
  };
1985
2661
  };
1986
- const deserializeAws_restJson1NetworkSummary = (output, context) => {
2662
+ var deserializeAws_restJson1NetworkSummary = function (output, context) {
1987
2663
  return {
1988
2664
  Arn: __expectString(output.Arn),
1989
2665
  CreationDate: output.CreationDate != null ? __expectNonNull(__parseRfc3339DateTime(output.CreationDate)) : undefined,
@@ -1995,10 +2671,10 @@ const deserializeAws_restJson1NetworkSummary = (output, context) => {
1995
2671
  Status: __expectString(output.Status),
1996
2672
  };
1997
2673
  };
1998
- const deserializeAws_restJson1NetworkSummaryList = (output, context) => {
1999
- const retVal = (output || [])
2000
- .filter((e) => e != null)
2001
- .map((entry) => {
2674
+ var deserializeAws_restJson1NetworkSummaryList = function (output, context) {
2675
+ var retVal = (output || [])
2676
+ .filter(function (e) { return e != null; })
2677
+ .map(function (entry) {
2002
2678
  if (entry === null) {
2003
2679
  return null;
2004
2680
  }
@@ -2006,7 +2682,7 @@ const deserializeAws_restJson1NetworkSummaryList = (output, context) => {
2006
2682
  });
2007
2683
  return retVal;
2008
2684
  };
2009
- const deserializeAws_restJson1Node = (output, context) => {
2685
+ var deserializeAws_restJson1Node = function (output, context) {
2010
2686
  return {
2011
2687
  Arn: __expectString(output.Arn),
2012
2688
  AvailabilityZone: __expectString(output.AvailabilityZone),
@@ -2027,19 +2703,19 @@ const deserializeAws_restJson1Node = (output, context) => {
2027
2703
  Tags: output.Tags != null ? deserializeAws_restJson1OutputTagMap(output.Tags, context) : undefined,
2028
2704
  };
2029
2705
  };
2030
- const deserializeAws_restJson1NodeEthereumAttributes = (output, context) => {
2706
+ var deserializeAws_restJson1NodeEthereumAttributes = function (output, context) {
2031
2707
  return {
2032
2708
  HttpEndpoint: __expectString(output.HttpEndpoint),
2033
2709
  WebSocketEndpoint: __expectString(output.WebSocketEndpoint),
2034
2710
  };
2035
2711
  };
2036
- const deserializeAws_restJson1NodeFabricAttributes = (output, context) => {
2712
+ var deserializeAws_restJson1NodeFabricAttributes = function (output, context) {
2037
2713
  return {
2038
2714
  PeerEndpoint: __expectString(output.PeerEndpoint),
2039
2715
  PeerEventEndpoint: __expectString(output.PeerEventEndpoint),
2040
2716
  };
2041
2717
  };
2042
- const deserializeAws_restJson1NodeFabricLogPublishingConfiguration = (output, context) => {
2718
+ var deserializeAws_restJson1NodeFabricLogPublishingConfiguration = function (output, context) {
2043
2719
  return {
2044
2720
  ChaincodeLogs: output.ChaincodeLogs != null
2045
2721
  ? deserializeAws_restJson1LogConfigurations(output.ChaincodeLogs, context)
@@ -2047,20 +2723,20 @@ const deserializeAws_restJson1NodeFabricLogPublishingConfiguration = (output, co
2047
2723
  PeerLogs: output.PeerLogs != null ? deserializeAws_restJson1LogConfigurations(output.PeerLogs, context) : undefined,
2048
2724
  };
2049
2725
  };
2050
- const deserializeAws_restJson1NodeFrameworkAttributes = (output, context) => {
2726
+ var deserializeAws_restJson1NodeFrameworkAttributes = function (output, context) {
2051
2727
  return {
2052
2728
  Ethereum: output.Ethereum != null ? deserializeAws_restJson1NodeEthereumAttributes(output.Ethereum, context) : undefined,
2053
2729
  Fabric: output.Fabric != null ? deserializeAws_restJson1NodeFabricAttributes(output.Fabric, context) : undefined,
2054
2730
  };
2055
2731
  };
2056
- const deserializeAws_restJson1NodeLogPublishingConfiguration = (output, context) => {
2732
+ var deserializeAws_restJson1NodeLogPublishingConfiguration = function (output, context) {
2057
2733
  return {
2058
2734
  Fabric: output.Fabric != null
2059
2735
  ? deserializeAws_restJson1NodeFabricLogPublishingConfiguration(output.Fabric, context)
2060
2736
  : undefined,
2061
2737
  };
2062
2738
  };
2063
- const deserializeAws_restJson1NodeSummary = (output, context) => {
2739
+ var deserializeAws_restJson1NodeSummary = function (output, context) {
2064
2740
  return {
2065
2741
  Arn: __expectString(output.Arn),
2066
2742
  AvailabilityZone: __expectString(output.AvailabilityZone),
@@ -2070,10 +2746,10 @@ const deserializeAws_restJson1NodeSummary = (output, context) => {
2070
2746
  Status: __expectString(output.Status),
2071
2747
  };
2072
2748
  };
2073
- const deserializeAws_restJson1NodeSummaryList = (output, context) => {
2074
- const retVal = (output || [])
2075
- .filter((e) => e != null)
2076
- .map((entry) => {
2749
+ var deserializeAws_restJson1NodeSummaryList = function (output, context) {
2750
+ var retVal = (output || [])
2751
+ .filter(function (e) { return e != null; })
2752
+ .map(function (entry) {
2077
2753
  if (entry === null) {
2078
2754
  return null;
2079
2755
  }
@@ -2081,18 +2757,17 @@ const deserializeAws_restJson1NodeSummaryList = (output, context) => {
2081
2757
  });
2082
2758
  return retVal;
2083
2759
  };
2084
- const deserializeAws_restJson1OutputTagMap = (output, context) => {
2085
- return Object.entries(output).reduce((acc, [key, value]) => {
2760
+ var deserializeAws_restJson1OutputTagMap = function (output, context) {
2761
+ return Object.entries(output).reduce(function (acc, _a) {
2762
+ var _b;
2763
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
2086
2764
  if (value === null) {
2087
2765
  return acc;
2088
2766
  }
2089
- return {
2090
- ...acc,
2091
- [key]: __expectString(value),
2092
- };
2767
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
2093
2768
  }, {});
2094
2769
  };
2095
- const deserializeAws_restJson1Proposal = (output, context) => {
2770
+ var deserializeAws_restJson1Proposal = function (output, context) {
2096
2771
  return {
2097
2772
  Actions: output.Actions != null ? deserializeAws_restJson1ProposalActions(output.Actions, context) : undefined,
2098
2773
  Arn: __expectString(output.Arn),
@@ -2110,13 +2785,13 @@ const deserializeAws_restJson1Proposal = (output, context) => {
2110
2785
  YesVoteCount: __expectInt32(output.YesVoteCount),
2111
2786
  };
2112
2787
  };
2113
- const deserializeAws_restJson1ProposalActions = (output, context) => {
2788
+ var deserializeAws_restJson1ProposalActions = function (output, context) {
2114
2789
  return {
2115
2790
  Invitations: output.Invitations != null ? deserializeAws_restJson1InviteActionList(output.Invitations, context) : undefined,
2116
2791
  Removals: output.Removals != null ? deserializeAws_restJson1RemoveActionList(output.Removals, context) : undefined,
2117
2792
  };
2118
2793
  };
2119
- const deserializeAws_restJson1ProposalSummary = (output, context) => {
2794
+ var deserializeAws_restJson1ProposalSummary = function (output, context) {
2120
2795
  return {
2121
2796
  Arn: __expectString(output.Arn),
2122
2797
  CreationDate: output.CreationDate != null ? __expectNonNull(__parseRfc3339DateTime(output.CreationDate)) : undefined,
@@ -2128,10 +2803,10 @@ const deserializeAws_restJson1ProposalSummary = (output, context) => {
2128
2803
  Status: __expectString(output.Status),
2129
2804
  };
2130
2805
  };
2131
- const deserializeAws_restJson1ProposalSummaryList = (output, context) => {
2132
- const retVal = (output || [])
2133
- .filter((e) => e != null)
2134
- .map((entry) => {
2806
+ var deserializeAws_restJson1ProposalSummaryList = function (output, context) {
2807
+ var retVal = (output || [])
2808
+ .filter(function (e) { return e != null; })
2809
+ .map(function (entry) {
2135
2810
  if (entry === null) {
2136
2811
  return null;
2137
2812
  }
@@ -2139,10 +2814,10 @@ const deserializeAws_restJson1ProposalSummaryList = (output, context) => {
2139
2814
  });
2140
2815
  return retVal;
2141
2816
  };
2142
- const deserializeAws_restJson1ProposalVoteList = (output, context) => {
2143
- const retVal = (output || [])
2144
- .filter((e) => e != null)
2145
- .map((entry) => {
2817
+ var deserializeAws_restJson1ProposalVoteList = function (output, context) {
2818
+ var retVal = (output || [])
2819
+ .filter(function (e) { return e != null; })
2820
+ .map(function (entry) {
2146
2821
  if (entry === null) {
2147
2822
  return null;
2148
2823
  }
@@ -2150,15 +2825,15 @@ const deserializeAws_restJson1ProposalVoteList = (output, context) => {
2150
2825
  });
2151
2826
  return retVal;
2152
2827
  };
2153
- const deserializeAws_restJson1RemoveAction = (output, context) => {
2828
+ var deserializeAws_restJson1RemoveAction = function (output, context) {
2154
2829
  return {
2155
2830
  MemberId: __expectString(output.MemberId),
2156
2831
  };
2157
2832
  };
2158
- const deserializeAws_restJson1RemoveActionList = (output, context) => {
2159
- const retVal = (output || [])
2160
- .filter((e) => e != null)
2161
- .map((entry) => {
2833
+ var deserializeAws_restJson1RemoveActionList = function (output, context) {
2834
+ var retVal = (output || [])
2835
+ .filter(function (e) { return e != null; })
2836
+ .map(function (entry) {
2162
2837
  if (entry === null) {
2163
2838
  return null;
2164
2839
  }
@@ -2166,53 +2841,71 @@ const deserializeAws_restJson1RemoveActionList = (output, context) => {
2166
2841
  });
2167
2842
  return retVal;
2168
2843
  };
2169
- const deserializeAws_restJson1VoteSummary = (output, context) => {
2844
+ var deserializeAws_restJson1VoteSummary = function (output, context) {
2170
2845
  return {
2171
2846
  MemberId: __expectString(output.MemberId),
2172
2847
  MemberName: __expectString(output.MemberName),
2173
2848
  Vote: __expectString(output.Vote),
2174
2849
  };
2175
2850
  };
2176
- const deserializeAws_restJson1VotingPolicy = (output, context) => {
2851
+ var deserializeAws_restJson1VotingPolicy = function (output, context) {
2177
2852
  return {
2178
2853
  ApprovalThresholdPolicy: output.ApprovalThresholdPolicy != null
2179
2854
  ? deserializeAws_restJson1ApprovalThresholdPolicy(output.ApprovalThresholdPolicy, context)
2180
2855
  : undefined,
2181
2856
  };
2182
2857
  };
2183
- const deserializeMetadata = (output) => ({
2184
- httpStatusCode: output.statusCode,
2185
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
2186
- extendedRequestId: output.headers["x-amz-id-2"],
2187
- cfId: output.headers["x-amz-cf-id"],
2188
- });
2189
- const collectBody = (streamBody = new Uint8Array(), context) => {
2858
+ var deserializeMetadata = function (output) {
2859
+ var _a, _b;
2860
+ return ({
2861
+ httpStatusCode: output.statusCode,
2862
+ requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
2863
+ extendedRequestId: output.headers["x-amz-id-2"],
2864
+ cfId: output.headers["x-amz-cf-id"],
2865
+ });
2866
+ };
2867
+ var collectBody = function (streamBody, context) {
2868
+ if (streamBody === void 0) { streamBody = new Uint8Array(); }
2190
2869
  if (streamBody instanceof Uint8Array) {
2191
2870
  return Promise.resolve(streamBody);
2192
2871
  }
2193
2872
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2194
2873
  };
2195
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
2196
- const isSerializableHeaderValue = (value) => value !== undefined &&
2197
- value !== null &&
2198
- value !== "" &&
2199
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2200
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2201
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
2202
- if (encoded.length) {
2203
- return JSON.parse(encoded);
2204
- }
2205
- return {};
2206
- });
2207
- const parseErrorBody = async (errorBody, context) => {
2208
- const value = await parseBody(errorBody, context);
2209
- value.message = value.message ?? value.Message;
2210
- return value;
2211
- };
2212
- const loadRestJsonErrorCode = (output, data) => {
2213
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
2214
- const sanitizeErrorCode = (rawValue) => {
2215
- let cleanValue = rawValue;
2874
+ var collectBodyString = function (streamBody, context) {
2875
+ return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
2876
+ };
2877
+ var isSerializableHeaderValue = function (value) {
2878
+ return value !== undefined &&
2879
+ value !== null &&
2880
+ value !== "" &&
2881
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2882
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2883
+ };
2884
+ var parseBody = function (streamBody, context) {
2885
+ return collectBodyString(streamBody, context).then(function (encoded) {
2886
+ if (encoded.length) {
2887
+ return JSON.parse(encoded);
2888
+ }
2889
+ return {};
2890
+ });
2891
+ };
2892
+ var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
2893
+ var value;
2894
+ var _a;
2895
+ return __generator(this, function (_b) {
2896
+ switch (_b.label) {
2897
+ case 0: return [4, parseBody(errorBody, context)];
2898
+ case 1:
2899
+ value = _b.sent();
2900
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
2901
+ return [2, value];
2902
+ }
2903
+ });
2904
+ }); };
2905
+ var loadRestJsonErrorCode = function (output, data) {
2906
+ var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
2907
+ var sanitizeErrorCode = function (rawValue) {
2908
+ var cleanValue = rawValue;
2216
2909
  if (typeof cleanValue === "number") {
2217
2910
  cleanValue = cleanValue.toString();
2218
2911
  }
@@ -2227,7 +2920,7 @@ const loadRestJsonErrorCode = (output, data) => {
2227
2920
  }
2228
2921
  return cleanValue;
2229
2922
  };
2230
- const headerKey = findKey(output.headers, "x-amzn-errortype");
2923
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
2231
2924
  if (headerKey !== undefined) {
2232
2925
  return sanitizeErrorCode(output.headers[headerKey]);
2233
2926
  }