@aws-sdk/client-codestar-connections 3.186.0 → 3.190.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,895 +1,700 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectString as __expectString, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { CodeStarConnectionsServiceException as __BaseException } from "../models/CodeStarConnectionsServiceException";
5
4
  import { ConflictException, LimitExceededException, ResourceNotFoundException, ResourceUnavailableException, UnsupportedOperationException, } from "../models/models_0";
6
- export var serializeAws_json1_0CreateConnectionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var headers, body;
8
- return __generator(this, function (_a) {
9
- headers = {
10
- "content-type": "application/x-amz-json-1.0",
11
- "x-amz-target": "CodeStar_connections_20191201.CreateConnection",
12
- };
13
- body = JSON.stringify(serializeAws_json1_0CreateConnectionInput(input, context));
14
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
15
- });
16
- }); };
17
- export var serializeAws_json1_0CreateHostCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
18
- var headers, body;
19
- return __generator(this, function (_a) {
20
- headers = {
21
- "content-type": "application/x-amz-json-1.0",
22
- "x-amz-target": "CodeStar_connections_20191201.CreateHost",
23
- };
24
- body = JSON.stringify(serializeAws_json1_0CreateHostInput(input, context));
25
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
26
- });
27
- }); };
28
- export var serializeAws_json1_0DeleteConnectionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
29
- var headers, body;
30
- return __generator(this, function (_a) {
31
- headers = {
32
- "content-type": "application/x-amz-json-1.0",
33
- "x-amz-target": "CodeStar_connections_20191201.DeleteConnection",
34
- };
35
- body = JSON.stringify(serializeAws_json1_0DeleteConnectionInput(input, context));
36
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
37
- });
38
- }); };
39
- export var serializeAws_json1_0DeleteHostCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
40
- var headers, body;
41
- return __generator(this, function (_a) {
42
- headers = {
43
- "content-type": "application/x-amz-json-1.0",
44
- "x-amz-target": "CodeStar_connections_20191201.DeleteHost",
45
- };
46
- body = JSON.stringify(serializeAws_json1_0DeleteHostInput(input, context));
47
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
48
- });
49
- }); };
50
- export var serializeAws_json1_0GetConnectionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
51
- var headers, body;
52
- return __generator(this, function (_a) {
53
- headers = {
54
- "content-type": "application/x-amz-json-1.0",
55
- "x-amz-target": "CodeStar_connections_20191201.GetConnection",
56
- };
57
- body = JSON.stringify(serializeAws_json1_0GetConnectionInput(input, context));
58
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
59
- });
60
- }); };
61
- export var serializeAws_json1_0GetHostCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
62
- var headers, body;
63
- return __generator(this, function (_a) {
64
- headers = {
65
- "content-type": "application/x-amz-json-1.0",
66
- "x-amz-target": "CodeStar_connections_20191201.GetHost",
67
- };
68
- body = JSON.stringify(serializeAws_json1_0GetHostInput(input, context));
69
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
70
- });
71
- }); };
72
- export var serializeAws_json1_0ListConnectionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
73
- var headers, body;
74
- return __generator(this, function (_a) {
75
- headers = {
76
- "content-type": "application/x-amz-json-1.0",
77
- "x-amz-target": "CodeStar_connections_20191201.ListConnections",
78
- };
79
- body = JSON.stringify(serializeAws_json1_0ListConnectionsInput(input, context));
80
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
81
- });
82
- }); };
83
- export var serializeAws_json1_0ListHostsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
84
- var headers, body;
85
- return __generator(this, function (_a) {
86
- headers = {
87
- "content-type": "application/x-amz-json-1.0",
88
- "x-amz-target": "CodeStar_connections_20191201.ListHosts",
89
- };
90
- body = JSON.stringify(serializeAws_json1_0ListHostsInput(input, context));
91
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
92
- });
93
- }); };
94
- export var serializeAws_json1_0ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
95
- var headers, body;
96
- return __generator(this, function (_a) {
97
- headers = {
98
- "content-type": "application/x-amz-json-1.0",
99
- "x-amz-target": "CodeStar_connections_20191201.ListTagsForResource",
100
- };
101
- body = JSON.stringify(serializeAws_json1_0ListTagsForResourceInput(input, context));
102
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
103
- });
104
- }); };
105
- export var serializeAws_json1_0TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
106
- var headers, body;
107
- return __generator(this, function (_a) {
108
- headers = {
109
- "content-type": "application/x-amz-json-1.0",
110
- "x-amz-target": "CodeStar_connections_20191201.TagResource",
111
- };
112
- body = JSON.stringify(serializeAws_json1_0TagResourceInput(input, context));
113
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
114
- });
115
- }); };
116
- export var serializeAws_json1_0UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
117
- var headers, body;
118
- return __generator(this, function (_a) {
119
- headers = {
120
- "content-type": "application/x-amz-json-1.0",
121
- "x-amz-target": "CodeStar_connections_20191201.UntagResource",
122
- };
123
- body = JSON.stringify(serializeAws_json1_0UntagResourceInput(input, context));
124
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
125
- });
126
- }); };
127
- export var serializeAws_json1_0UpdateHostCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
128
- var headers, body;
129
- return __generator(this, function (_a) {
130
- headers = {
131
- "content-type": "application/x-amz-json-1.0",
132
- "x-amz-target": "CodeStar_connections_20191201.UpdateHost",
133
- };
134
- body = JSON.stringify(serializeAws_json1_0UpdateHostInput(input, context));
135
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
136
- });
137
- }); };
138
- export var deserializeAws_json1_0CreateConnectionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
139
- var data, contents, response;
140
- return __generator(this, function (_a) {
141
- switch (_a.label) {
142
- case 0:
143
- if (output.statusCode >= 300) {
144
- return [2, deserializeAws_json1_0CreateConnectionCommandError(output, context)];
145
- }
146
- return [4, parseBody(output.body, context)];
147
- case 1:
148
- data = _a.sent();
149
- contents = {};
150
- contents = deserializeAws_json1_0CreateConnectionOutput(data, context);
151
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
152
- return [2, Promise.resolve(response)];
153
- }
154
- });
155
- }); };
156
- var deserializeAws_json1_0CreateConnectionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
157
- var parsedOutput, _a, errorCode, _b, parsedBody;
158
- var _c;
159
- return __generator(this, function (_d) {
160
- switch (_d.label) {
161
- case 0:
162
- _a = [__assign({}, output)];
163
- _c = {};
164
- return [4, parseErrorBody(output.body, context)];
165
- case 1:
166
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
167
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
168
- _b = errorCode;
169
- switch (_b) {
170
- case "LimitExceededException": return [3, 2];
171
- case "com.amazonaws.codestarconnections#LimitExceededException": return [3, 2];
172
- case "ResourceNotFoundException": return [3, 4];
173
- case "com.amazonaws.codestarconnections#ResourceNotFoundException": return [3, 4];
174
- case "ResourceUnavailableException": return [3, 6];
175
- case "com.amazonaws.codestarconnections#ResourceUnavailableException": return [3, 6];
176
- }
177
- return [3, 8];
178
- case 2: return [4, deserializeAws_json1_0LimitExceededExceptionResponse(parsedOutput, context)];
179
- case 3: throw _d.sent();
180
- case 4: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
181
- case 5: throw _d.sent();
182
- case 6: return [4, deserializeAws_json1_0ResourceUnavailableExceptionResponse(parsedOutput, context)];
183
- case 7: throw _d.sent();
184
- case 8:
185
- parsedBody = parsedOutput.body;
186
- throwDefaultError({
187
- output: output,
188
- parsedBody: parsedBody,
189
- exceptionCtor: __BaseException,
190
- errorCode: errorCode,
191
- });
192
- _d.label = 9;
193
- case 9: return [2];
194
- }
195
- });
196
- }); };
197
- export var deserializeAws_json1_0CreateHostCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
198
- var data, contents, response;
199
- return __generator(this, function (_a) {
200
- switch (_a.label) {
201
- case 0:
202
- if (output.statusCode >= 300) {
203
- return [2, deserializeAws_json1_0CreateHostCommandError(output, context)];
204
- }
205
- return [4, parseBody(output.body, context)];
206
- case 1:
207
- data = _a.sent();
208
- contents = {};
209
- contents = deserializeAws_json1_0CreateHostOutput(data, context);
210
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
211
- return [2, Promise.resolve(response)];
212
- }
213
- });
214
- }); };
215
- var deserializeAws_json1_0CreateHostCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
216
- var parsedOutput, _a, errorCode, _b, parsedBody;
217
- var _c;
218
- return __generator(this, function (_d) {
219
- switch (_d.label) {
220
- case 0:
221
- _a = [__assign({}, output)];
222
- _c = {};
223
- return [4, parseErrorBody(output.body, context)];
224
- case 1:
225
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
226
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
227
- _b = errorCode;
228
- switch (_b) {
229
- case "LimitExceededException": return [3, 2];
230
- case "com.amazonaws.codestarconnections#LimitExceededException": return [3, 2];
231
- }
232
- return [3, 4];
233
- case 2: return [4, deserializeAws_json1_0LimitExceededExceptionResponse(parsedOutput, context)];
234
- case 3: throw _d.sent();
235
- case 4:
236
- parsedBody = parsedOutput.body;
237
- throwDefaultError({
238
- output: output,
239
- parsedBody: parsedBody,
240
- exceptionCtor: __BaseException,
241
- errorCode: errorCode,
242
- });
243
- _d.label = 5;
244
- case 5: return [2];
245
- }
246
- });
247
- }); };
248
- export var deserializeAws_json1_0DeleteConnectionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
249
- var data, contents, response;
250
- return __generator(this, function (_a) {
251
- switch (_a.label) {
252
- case 0:
253
- if (output.statusCode >= 300) {
254
- return [2, deserializeAws_json1_0DeleteConnectionCommandError(output, context)];
255
- }
256
- return [4, parseBody(output.body, context)];
257
- case 1:
258
- data = _a.sent();
259
- contents = {};
260
- contents = deserializeAws_json1_0DeleteConnectionOutput(data, context);
261
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
262
- return [2, Promise.resolve(response)];
263
- }
264
- });
265
- }); };
266
- var deserializeAws_json1_0DeleteConnectionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
267
- var parsedOutput, _a, errorCode, _b, parsedBody;
268
- var _c;
269
- return __generator(this, function (_d) {
270
- switch (_d.label) {
271
- case 0:
272
- _a = [__assign({}, output)];
273
- _c = {};
274
- return [4, parseErrorBody(output.body, context)];
275
- case 1:
276
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
277
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
278
- _b = errorCode;
279
- switch (_b) {
280
- case "ResourceNotFoundException": return [3, 2];
281
- case "com.amazonaws.codestarconnections#ResourceNotFoundException": return [3, 2];
282
- }
283
- return [3, 4];
284
- case 2: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
285
- case 3: throw _d.sent();
286
- case 4:
287
- parsedBody = parsedOutput.body;
288
- throwDefaultError({
289
- output: output,
290
- parsedBody: parsedBody,
291
- exceptionCtor: __BaseException,
292
- errorCode: errorCode,
293
- });
294
- _d.label = 5;
295
- case 5: return [2];
296
- }
297
- });
298
- }); };
299
- export var deserializeAws_json1_0DeleteHostCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
300
- var data, contents, response;
301
- return __generator(this, function (_a) {
302
- switch (_a.label) {
303
- case 0:
304
- if (output.statusCode >= 300) {
305
- return [2, deserializeAws_json1_0DeleteHostCommandError(output, context)];
306
- }
307
- return [4, parseBody(output.body, context)];
308
- case 1:
309
- data = _a.sent();
310
- contents = {};
311
- contents = deserializeAws_json1_0DeleteHostOutput(data, context);
312
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
313
- return [2, Promise.resolve(response)];
314
- }
315
- });
316
- }); };
317
- var deserializeAws_json1_0DeleteHostCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
318
- var parsedOutput, _a, errorCode, _b, parsedBody;
319
- var _c;
320
- return __generator(this, function (_d) {
321
- switch (_d.label) {
322
- case 0:
323
- _a = [__assign({}, output)];
324
- _c = {};
325
- return [4, parseErrorBody(output.body, context)];
326
- case 1:
327
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
328
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
329
- _b = errorCode;
330
- switch (_b) {
331
- case "ResourceNotFoundException": return [3, 2];
332
- case "com.amazonaws.codestarconnections#ResourceNotFoundException": return [3, 2];
333
- case "ResourceUnavailableException": return [3, 4];
334
- case "com.amazonaws.codestarconnections#ResourceUnavailableException": return [3, 4];
335
- }
336
- return [3, 6];
337
- case 2: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
338
- case 3: throw _d.sent();
339
- case 4: return [4, deserializeAws_json1_0ResourceUnavailableExceptionResponse(parsedOutput, context)];
340
- case 5: throw _d.sent();
341
- case 6:
342
- parsedBody = parsedOutput.body;
343
- throwDefaultError({
344
- output: output,
345
- parsedBody: parsedBody,
346
- exceptionCtor: __BaseException,
347
- errorCode: errorCode,
348
- });
349
- _d.label = 7;
350
- case 7: return [2];
351
- }
352
- });
353
- }); };
354
- export var deserializeAws_json1_0GetConnectionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
355
- var data, contents, response;
356
- return __generator(this, function (_a) {
357
- switch (_a.label) {
358
- case 0:
359
- if (output.statusCode >= 300) {
360
- return [2, deserializeAws_json1_0GetConnectionCommandError(output, context)];
361
- }
362
- return [4, parseBody(output.body, context)];
363
- case 1:
364
- data = _a.sent();
365
- contents = {};
366
- contents = deserializeAws_json1_0GetConnectionOutput(data, context);
367
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
368
- return [2, Promise.resolve(response)];
369
- }
370
- });
371
- }); };
372
- var deserializeAws_json1_0GetConnectionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
373
- var parsedOutput, _a, errorCode, _b, parsedBody;
374
- var _c;
375
- return __generator(this, function (_d) {
376
- switch (_d.label) {
377
- case 0:
378
- _a = [__assign({}, output)];
379
- _c = {};
380
- return [4, parseErrorBody(output.body, context)];
381
- case 1:
382
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
383
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
384
- _b = errorCode;
385
- switch (_b) {
386
- case "ResourceNotFoundException": return [3, 2];
387
- case "com.amazonaws.codestarconnections#ResourceNotFoundException": return [3, 2];
388
- case "ResourceUnavailableException": return [3, 4];
389
- case "com.amazonaws.codestarconnections#ResourceUnavailableException": return [3, 4];
390
- }
391
- return [3, 6];
392
- case 2: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
393
- case 3: throw _d.sent();
394
- case 4: return [4, deserializeAws_json1_0ResourceUnavailableExceptionResponse(parsedOutput, context)];
395
- case 5: throw _d.sent();
396
- case 6:
397
- parsedBody = parsedOutput.body;
398
- throwDefaultError({
399
- output: output,
400
- parsedBody: parsedBody,
401
- exceptionCtor: __BaseException,
402
- errorCode: errorCode,
403
- });
404
- _d.label = 7;
405
- case 7: return [2];
406
- }
407
- });
408
- }); };
409
- export var deserializeAws_json1_0GetHostCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
410
- var data, contents, response;
411
- return __generator(this, function (_a) {
412
- switch (_a.label) {
413
- case 0:
414
- if (output.statusCode >= 300) {
415
- return [2, deserializeAws_json1_0GetHostCommandError(output, context)];
416
- }
417
- return [4, parseBody(output.body, context)];
418
- case 1:
419
- data = _a.sent();
420
- contents = {};
421
- contents = deserializeAws_json1_0GetHostOutput(data, context);
422
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
423
- return [2, Promise.resolve(response)];
424
- }
425
- });
426
- }); };
427
- var deserializeAws_json1_0GetHostCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
428
- var parsedOutput, _a, errorCode, _b, parsedBody;
429
- var _c;
430
- return __generator(this, function (_d) {
431
- switch (_d.label) {
432
- case 0:
433
- _a = [__assign({}, output)];
434
- _c = {};
435
- return [4, parseErrorBody(output.body, context)];
436
- case 1:
437
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
438
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
439
- _b = errorCode;
440
- switch (_b) {
441
- case "ResourceNotFoundException": return [3, 2];
442
- case "com.amazonaws.codestarconnections#ResourceNotFoundException": return [3, 2];
443
- case "ResourceUnavailableException": return [3, 4];
444
- case "com.amazonaws.codestarconnections#ResourceUnavailableException": return [3, 4];
445
- }
446
- return [3, 6];
447
- case 2: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
448
- case 3: throw _d.sent();
449
- case 4: return [4, deserializeAws_json1_0ResourceUnavailableExceptionResponse(parsedOutput, context)];
450
- case 5: throw _d.sent();
451
- case 6:
452
- parsedBody = parsedOutput.body;
453
- throwDefaultError({
454
- output: output,
455
- parsedBody: parsedBody,
456
- exceptionCtor: __BaseException,
457
- errorCode: errorCode,
458
- });
459
- _d.label = 7;
460
- case 7: return [2];
461
- }
462
- });
463
- }); };
464
- export var deserializeAws_json1_0ListConnectionsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
465
- var data, contents, response;
466
- return __generator(this, function (_a) {
467
- switch (_a.label) {
468
- case 0:
469
- if (output.statusCode >= 300) {
470
- return [2, deserializeAws_json1_0ListConnectionsCommandError(output, context)];
471
- }
472
- return [4, parseBody(output.body, context)];
473
- case 1:
474
- data = _a.sent();
475
- contents = {};
476
- contents = deserializeAws_json1_0ListConnectionsOutput(data, context);
477
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
478
- return [2, Promise.resolve(response)];
479
- }
480
- });
481
- }); };
482
- var deserializeAws_json1_0ListConnectionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
483
- var parsedOutput, _a, errorCode, parsedBody;
484
- var _b;
485
- return __generator(this, function (_c) {
486
- switch (_c.label) {
487
- case 0:
488
- _a = [__assign({}, output)];
489
- _b = {};
490
- return [4, parseErrorBody(output.body, context)];
491
- case 1:
492
- parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
493
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
494
- parsedBody = parsedOutput.body;
495
- throwDefaultError({
496
- output: output,
497
- parsedBody: parsedBody,
498
- exceptionCtor: __BaseException,
499
- errorCode: errorCode,
500
- });
501
- return [2];
502
- }
503
- });
504
- }); };
505
- export var deserializeAws_json1_0ListHostsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
506
- var data, contents, response;
507
- return __generator(this, function (_a) {
508
- switch (_a.label) {
509
- case 0:
510
- if (output.statusCode >= 300) {
511
- return [2, deserializeAws_json1_0ListHostsCommandError(output, context)];
512
- }
513
- return [4, parseBody(output.body, context)];
514
- case 1:
515
- data = _a.sent();
516
- contents = {};
517
- contents = deserializeAws_json1_0ListHostsOutput(data, context);
518
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
519
- return [2, Promise.resolve(response)];
520
- }
521
- });
522
- }); };
523
- var deserializeAws_json1_0ListHostsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
524
- var parsedOutput, _a, errorCode, parsedBody;
525
- var _b;
526
- return __generator(this, function (_c) {
527
- switch (_c.label) {
528
- case 0:
529
- _a = [__assign({}, output)];
530
- _b = {};
531
- return [4, parseErrorBody(output.body, context)];
532
- case 1:
533
- parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
534
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
535
- parsedBody = parsedOutput.body;
536
- throwDefaultError({
537
- output: output,
538
- parsedBody: parsedBody,
539
- exceptionCtor: __BaseException,
540
- errorCode: errorCode,
541
- });
542
- return [2];
543
- }
544
- });
545
- }); };
546
- export var deserializeAws_json1_0ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
547
- var data, contents, response;
548
- return __generator(this, function (_a) {
549
- switch (_a.label) {
550
- case 0:
551
- if (output.statusCode >= 300) {
552
- return [2, deserializeAws_json1_0ListTagsForResourceCommandError(output, context)];
553
- }
554
- return [4, parseBody(output.body, context)];
555
- case 1:
556
- data = _a.sent();
557
- contents = {};
558
- contents = deserializeAws_json1_0ListTagsForResourceOutput(data, context);
559
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
560
- return [2, Promise.resolve(response)];
561
- }
562
- });
563
- }); };
564
- var deserializeAws_json1_0ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
565
- var parsedOutput, _a, errorCode, _b, parsedBody;
566
- var _c;
567
- return __generator(this, function (_d) {
568
- switch (_d.label) {
569
- case 0:
570
- _a = [__assign({}, output)];
571
- _c = {};
572
- return [4, parseErrorBody(output.body, context)];
573
- case 1:
574
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
575
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
576
- _b = errorCode;
577
- switch (_b) {
578
- case "ResourceNotFoundException": return [3, 2];
579
- case "com.amazonaws.codestarconnections#ResourceNotFoundException": return [3, 2];
580
- }
581
- return [3, 4];
582
- case 2: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
583
- case 3: throw _d.sent();
584
- case 4:
585
- parsedBody = parsedOutput.body;
586
- throwDefaultError({
587
- output: output,
588
- parsedBody: parsedBody,
589
- exceptionCtor: __BaseException,
590
- errorCode: errorCode,
591
- });
592
- _d.label = 5;
593
- case 5: return [2];
594
- }
595
- });
596
- }); };
597
- export var deserializeAws_json1_0TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
598
- var data, contents, response;
599
- return __generator(this, function (_a) {
600
- switch (_a.label) {
601
- case 0:
602
- if (output.statusCode >= 300) {
603
- return [2, deserializeAws_json1_0TagResourceCommandError(output, context)];
604
- }
605
- return [4, parseBody(output.body, context)];
606
- case 1:
607
- data = _a.sent();
608
- contents = {};
609
- contents = deserializeAws_json1_0TagResourceOutput(data, context);
610
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
611
- return [2, Promise.resolve(response)];
612
- }
613
- });
614
- }); };
615
- var deserializeAws_json1_0TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
616
- var parsedOutput, _a, errorCode, _b, parsedBody;
617
- var _c;
618
- return __generator(this, function (_d) {
619
- switch (_d.label) {
620
- case 0:
621
- _a = [__assign({}, output)];
622
- _c = {};
623
- return [4, parseErrorBody(output.body, context)];
624
- case 1:
625
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
626
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
627
- _b = errorCode;
628
- switch (_b) {
629
- case "LimitExceededException": return [3, 2];
630
- case "com.amazonaws.codestarconnections#LimitExceededException": return [3, 2];
631
- case "ResourceNotFoundException": return [3, 4];
632
- case "com.amazonaws.codestarconnections#ResourceNotFoundException": return [3, 4];
633
- }
634
- return [3, 6];
635
- case 2: return [4, deserializeAws_json1_0LimitExceededExceptionResponse(parsedOutput, context)];
636
- case 3: throw _d.sent();
637
- case 4: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
638
- case 5: throw _d.sent();
639
- case 6:
640
- parsedBody = parsedOutput.body;
641
- throwDefaultError({
642
- output: output,
643
- parsedBody: parsedBody,
644
- exceptionCtor: __BaseException,
645
- errorCode: errorCode,
646
- });
647
- _d.label = 7;
648
- case 7: return [2];
649
- }
650
- });
651
- }); };
652
- export var deserializeAws_json1_0UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
653
- var data, contents, response;
654
- return __generator(this, function (_a) {
655
- switch (_a.label) {
656
- case 0:
657
- if (output.statusCode >= 300) {
658
- return [2, deserializeAws_json1_0UntagResourceCommandError(output, context)];
659
- }
660
- return [4, parseBody(output.body, context)];
661
- case 1:
662
- data = _a.sent();
663
- contents = {};
664
- contents = deserializeAws_json1_0UntagResourceOutput(data, context);
665
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
666
- return [2, Promise.resolve(response)];
667
- }
668
- });
669
- }); };
670
- var deserializeAws_json1_0UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
671
- var parsedOutput, _a, errorCode, _b, parsedBody;
672
- var _c;
673
- return __generator(this, function (_d) {
674
- switch (_d.label) {
675
- case 0:
676
- _a = [__assign({}, output)];
677
- _c = {};
678
- return [4, parseErrorBody(output.body, context)];
679
- case 1:
680
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
681
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
682
- _b = errorCode;
683
- switch (_b) {
684
- case "ResourceNotFoundException": return [3, 2];
685
- case "com.amazonaws.codestarconnections#ResourceNotFoundException": return [3, 2];
686
- }
687
- return [3, 4];
688
- case 2: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
689
- case 3: throw _d.sent();
690
- case 4:
691
- parsedBody = parsedOutput.body;
692
- throwDefaultError({
693
- output: output,
694
- parsedBody: parsedBody,
695
- exceptionCtor: __BaseException,
696
- errorCode: errorCode,
697
- });
698
- _d.label = 5;
699
- case 5: return [2];
700
- }
701
- });
702
- }); };
703
- export var deserializeAws_json1_0UpdateHostCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
704
- var data, contents, response;
705
- return __generator(this, function (_a) {
706
- switch (_a.label) {
707
- case 0:
708
- if (output.statusCode >= 300) {
709
- return [2, deserializeAws_json1_0UpdateHostCommandError(output, context)];
710
- }
711
- return [4, parseBody(output.body, context)];
712
- case 1:
713
- data = _a.sent();
714
- contents = {};
715
- contents = deserializeAws_json1_0UpdateHostOutput(data, context);
716
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
717
- return [2, Promise.resolve(response)];
718
- }
719
- });
720
- }); };
721
- var deserializeAws_json1_0UpdateHostCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
722
- var parsedOutput, _a, errorCode, _b, parsedBody;
723
- var _c;
724
- return __generator(this, function (_d) {
725
- switch (_d.label) {
726
- case 0:
727
- _a = [__assign({}, output)];
728
- _c = {};
729
- return [4, parseErrorBody(output.body, context)];
730
- case 1:
731
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
732
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
733
- _b = errorCode;
734
- switch (_b) {
735
- case "ConflictException": return [3, 2];
736
- case "com.amazonaws.codestarconnections#ConflictException": return [3, 2];
737
- case "ResourceNotFoundException": return [3, 4];
738
- case "com.amazonaws.codestarconnections#ResourceNotFoundException": return [3, 4];
739
- case "ResourceUnavailableException": return [3, 6];
740
- case "com.amazonaws.codestarconnections#ResourceUnavailableException": return [3, 6];
741
- case "UnsupportedOperationException": return [3, 8];
742
- case "com.amazonaws.codestarconnections#UnsupportedOperationException": return [3, 8];
743
- }
744
- return [3, 10];
745
- case 2: return [4, deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)];
746
- case 3: throw _d.sent();
747
- case 4: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
748
- case 5: throw _d.sent();
749
- case 6: return [4, deserializeAws_json1_0ResourceUnavailableExceptionResponse(parsedOutput, context)];
750
- case 7: throw _d.sent();
751
- case 8: return [4, deserializeAws_json1_0UnsupportedOperationExceptionResponse(parsedOutput, context)];
752
- case 9: throw _d.sent();
753
- case 10:
754
- parsedBody = parsedOutput.body;
755
- throwDefaultError({
756
- output: output,
757
- parsedBody: parsedBody,
758
- exceptionCtor: __BaseException,
759
- errorCode: errorCode,
760
- });
761
- _d.label = 11;
762
- case 11: return [2];
763
- }
764
- });
765
- }); };
766
- var deserializeAws_json1_0ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
767
- var body, deserialized, exception;
768
- return __generator(this, function (_a) {
769
- body = parsedOutput.body;
770
- deserialized = deserializeAws_json1_0ConflictException(body, context);
771
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
772
- return [2, __decorateServiceException(exception, body)];
5
+ export const serializeAws_json1_0CreateConnectionCommand = async (input, context) => {
6
+ const headers = {
7
+ "content-type": "application/x-amz-json-1.0",
8
+ "x-amz-target": "CodeStar_connections_20191201.CreateConnection",
9
+ };
10
+ let body;
11
+ body = JSON.stringify(serializeAws_json1_0CreateConnectionInput(input, context));
12
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
+ };
14
+ export const serializeAws_json1_0CreateHostCommand = async (input, context) => {
15
+ const headers = {
16
+ "content-type": "application/x-amz-json-1.0",
17
+ "x-amz-target": "CodeStar_connections_20191201.CreateHost",
18
+ };
19
+ let body;
20
+ body = JSON.stringify(serializeAws_json1_0CreateHostInput(input, context));
21
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
+ };
23
+ export const serializeAws_json1_0DeleteConnectionCommand = async (input, context) => {
24
+ const headers = {
25
+ "content-type": "application/x-amz-json-1.0",
26
+ "x-amz-target": "CodeStar_connections_20191201.DeleteConnection",
27
+ };
28
+ let body;
29
+ body = JSON.stringify(serializeAws_json1_0DeleteConnectionInput(input, context));
30
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
+ };
32
+ export const serializeAws_json1_0DeleteHostCommand = async (input, context) => {
33
+ const headers = {
34
+ "content-type": "application/x-amz-json-1.0",
35
+ "x-amz-target": "CodeStar_connections_20191201.DeleteHost",
36
+ };
37
+ let body;
38
+ body = JSON.stringify(serializeAws_json1_0DeleteHostInput(input, context));
39
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
+ };
41
+ export const serializeAws_json1_0GetConnectionCommand = async (input, context) => {
42
+ const headers = {
43
+ "content-type": "application/x-amz-json-1.0",
44
+ "x-amz-target": "CodeStar_connections_20191201.GetConnection",
45
+ };
46
+ let body;
47
+ body = JSON.stringify(serializeAws_json1_0GetConnectionInput(input, context));
48
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
+ };
50
+ export const serializeAws_json1_0GetHostCommand = async (input, context) => {
51
+ const headers = {
52
+ "content-type": "application/x-amz-json-1.0",
53
+ "x-amz-target": "CodeStar_connections_20191201.GetHost",
54
+ };
55
+ let body;
56
+ body = JSON.stringify(serializeAws_json1_0GetHostInput(input, context));
57
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
+ };
59
+ export const serializeAws_json1_0ListConnectionsCommand = async (input, context) => {
60
+ const headers = {
61
+ "content-type": "application/x-amz-json-1.0",
62
+ "x-amz-target": "CodeStar_connections_20191201.ListConnections",
63
+ };
64
+ let body;
65
+ body = JSON.stringify(serializeAws_json1_0ListConnectionsInput(input, context));
66
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
67
+ };
68
+ export const serializeAws_json1_0ListHostsCommand = async (input, context) => {
69
+ const headers = {
70
+ "content-type": "application/x-amz-json-1.0",
71
+ "x-amz-target": "CodeStar_connections_20191201.ListHosts",
72
+ };
73
+ let body;
74
+ body = JSON.stringify(serializeAws_json1_0ListHostsInput(input, context));
75
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
+ };
77
+ export const serializeAws_json1_0ListTagsForResourceCommand = async (input, context) => {
78
+ const headers = {
79
+ "content-type": "application/x-amz-json-1.0",
80
+ "x-amz-target": "CodeStar_connections_20191201.ListTagsForResource",
81
+ };
82
+ let body;
83
+ body = JSON.stringify(serializeAws_json1_0ListTagsForResourceInput(input, context));
84
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
85
+ };
86
+ export const serializeAws_json1_0TagResourceCommand = async (input, context) => {
87
+ const headers = {
88
+ "content-type": "application/x-amz-json-1.0",
89
+ "x-amz-target": "CodeStar_connections_20191201.TagResource",
90
+ };
91
+ let body;
92
+ body = JSON.stringify(serializeAws_json1_0TagResourceInput(input, context));
93
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
94
+ };
95
+ export const serializeAws_json1_0UntagResourceCommand = async (input, context) => {
96
+ const headers = {
97
+ "content-type": "application/x-amz-json-1.0",
98
+ "x-amz-target": "CodeStar_connections_20191201.UntagResource",
99
+ };
100
+ let body;
101
+ body = JSON.stringify(serializeAws_json1_0UntagResourceInput(input, context));
102
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
103
+ };
104
+ export const serializeAws_json1_0UpdateHostCommand = async (input, context) => {
105
+ const headers = {
106
+ "content-type": "application/x-amz-json-1.0",
107
+ "x-amz-target": "CodeStar_connections_20191201.UpdateHost",
108
+ };
109
+ let body;
110
+ body = JSON.stringify(serializeAws_json1_0UpdateHostInput(input, context));
111
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
112
+ };
113
+ export const deserializeAws_json1_0CreateConnectionCommand = async (output, context) => {
114
+ if (output.statusCode >= 300) {
115
+ return deserializeAws_json1_0CreateConnectionCommandError(output, context);
116
+ }
117
+ const data = await parseBody(output.body, context);
118
+ let contents = {};
119
+ contents = deserializeAws_json1_0CreateConnectionOutput(data, context);
120
+ const response = {
121
+ $metadata: deserializeMetadata(output),
122
+ ...contents,
123
+ };
124
+ return Promise.resolve(response);
125
+ };
126
+ const deserializeAws_json1_0CreateConnectionCommandError = async (output, context) => {
127
+ const parsedOutput = {
128
+ ...output,
129
+ body: await parseErrorBody(output.body, context),
130
+ };
131
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
132
+ switch (errorCode) {
133
+ case "LimitExceededException":
134
+ case "com.amazonaws.codestarconnections#LimitExceededException":
135
+ throw await deserializeAws_json1_0LimitExceededExceptionResponse(parsedOutput, context);
136
+ case "ResourceNotFoundException":
137
+ case "com.amazonaws.codestarconnections#ResourceNotFoundException":
138
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
139
+ case "ResourceUnavailableException":
140
+ case "com.amazonaws.codestarconnections#ResourceUnavailableException":
141
+ throw await deserializeAws_json1_0ResourceUnavailableExceptionResponse(parsedOutput, context);
142
+ default:
143
+ const parsedBody = parsedOutput.body;
144
+ throwDefaultError({
145
+ output,
146
+ parsedBody,
147
+ exceptionCtor: __BaseException,
148
+ errorCode,
149
+ });
150
+ }
151
+ };
152
+ export const deserializeAws_json1_0CreateHostCommand = async (output, context) => {
153
+ if (output.statusCode >= 300) {
154
+ return deserializeAws_json1_0CreateHostCommandError(output, context);
155
+ }
156
+ const data = await parseBody(output.body, context);
157
+ let contents = {};
158
+ contents = deserializeAws_json1_0CreateHostOutput(data, context);
159
+ const response = {
160
+ $metadata: deserializeMetadata(output),
161
+ ...contents,
162
+ };
163
+ return Promise.resolve(response);
164
+ };
165
+ const deserializeAws_json1_0CreateHostCommandError = async (output, context) => {
166
+ const parsedOutput = {
167
+ ...output,
168
+ body: await parseErrorBody(output.body, context),
169
+ };
170
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
171
+ switch (errorCode) {
172
+ case "LimitExceededException":
173
+ case "com.amazonaws.codestarconnections#LimitExceededException":
174
+ throw await deserializeAws_json1_0LimitExceededExceptionResponse(parsedOutput, context);
175
+ default:
176
+ const parsedBody = parsedOutput.body;
177
+ throwDefaultError({
178
+ output,
179
+ parsedBody,
180
+ exceptionCtor: __BaseException,
181
+ errorCode,
182
+ });
183
+ }
184
+ };
185
+ export const deserializeAws_json1_0DeleteConnectionCommand = async (output, context) => {
186
+ if (output.statusCode >= 300) {
187
+ return deserializeAws_json1_0DeleteConnectionCommandError(output, context);
188
+ }
189
+ const data = await parseBody(output.body, context);
190
+ let contents = {};
191
+ contents = deserializeAws_json1_0DeleteConnectionOutput(data, context);
192
+ const response = {
193
+ $metadata: deserializeMetadata(output),
194
+ ...contents,
195
+ };
196
+ return Promise.resolve(response);
197
+ };
198
+ const deserializeAws_json1_0DeleteConnectionCommandError = async (output, context) => {
199
+ const parsedOutput = {
200
+ ...output,
201
+ body: await parseErrorBody(output.body, context),
202
+ };
203
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
204
+ switch (errorCode) {
205
+ case "ResourceNotFoundException":
206
+ case "com.amazonaws.codestarconnections#ResourceNotFoundException":
207
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
208
+ default:
209
+ const parsedBody = parsedOutput.body;
210
+ throwDefaultError({
211
+ output,
212
+ parsedBody,
213
+ exceptionCtor: __BaseException,
214
+ errorCode,
215
+ });
216
+ }
217
+ };
218
+ export const deserializeAws_json1_0DeleteHostCommand = async (output, context) => {
219
+ if (output.statusCode >= 300) {
220
+ return deserializeAws_json1_0DeleteHostCommandError(output, context);
221
+ }
222
+ const data = await parseBody(output.body, context);
223
+ let contents = {};
224
+ contents = deserializeAws_json1_0DeleteHostOutput(data, context);
225
+ const response = {
226
+ $metadata: deserializeMetadata(output),
227
+ ...contents,
228
+ };
229
+ return Promise.resolve(response);
230
+ };
231
+ const deserializeAws_json1_0DeleteHostCommandError = async (output, context) => {
232
+ const parsedOutput = {
233
+ ...output,
234
+ body: await parseErrorBody(output.body, context),
235
+ };
236
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
237
+ switch (errorCode) {
238
+ case "ResourceNotFoundException":
239
+ case "com.amazonaws.codestarconnections#ResourceNotFoundException":
240
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
241
+ case "ResourceUnavailableException":
242
+ case "com.amazonaws.codestarconnections#ResourceUnavailableException":
243
+ throw await deserializeAws_json1_0ResourceUnavailableExceptionResponse(parsedOutput, context);
244
+ default:
245
+ const parsedBody = parsedOutput.body;
246
+ throwDefaultError({
247
+ output,
248
+ parsedBody,
249
+ exceptionCtor: __BaseException,
250
+ errorCode,
251
+ });
252
+ }
253
+ };
254
+ export const deserializeAws_json1_0GetConnectionCommand = async (output, context) => {
255
+ if (output.statusCode >= 300) {
256
+ return deserializeAws_json1_0GetConnectionCommandError(output, context);
257
+ }
258
+ const data = await parseBody(output.body, context);
259
+ let contents = {};
260
+ contents = deserializeAws_json1_0GetConnectionOutput(data, context);
261
+ const response = {
262
+ $metadata: deserializeMetadata(output),
263
+ ...contents,
264
+ };
265
+ return Promise.resolve(response);
266
+ };
267
+ const deserializeAws_json1_0GetConnectionCommandError = async (output, context) => {
268
+ const parsedOutput = {
269
+ ...output,
270
+ body: await parseErrorBody(output.body, context),
271
+ };
272
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
273
+ switch (errorCode) {
274
+ case "ResourceNotFoundException":
275
+ case "com.amazonaws.codestarconnections#ResourceNotFoundException":
276
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
277
+ case "ResourceUnavailableException":
278
+ case "com.amazonaws.codestarconnections#ResourceUnavailableException":
279
+ throw await deserializeAws_json1_0ResourceUnavailableExceptionResponse(parsedOutput, context);
280
+ default:
281
+ const parsedBody = parsedOutput.body;
282
+ throwDefaultError({
283
+ output,
284
+ parsedBody,
285
+ exceptionCtor: __BaseException,
286
+ errorCode,
287
+ });
288
+ }
289
+ };
290
+ export const deserializeAws_json1_0GetHostCommand = async (output, context) => {
291
+ if (output.statusCode >= 300) {
292
+ return deserializeAws_json1_0GetHostCommandError(output, context);
293
+ }
294
+ const data = await parseBody(output.body, context);
295
+ let contents = {};
296
+ contents = deserializeAws_json1_0GetHostOutput(data, context);
297
+ const response = {
298
+ $metadata: deserializeMetadata(output),
299
+ ...contents,
300
+ };
301
+ return Promise.resolve(response);
302
+ };
303
+ const deserializeAws_json1_0GetHostCommandError = async (output, context) => {
304
+ const parsedOutput = {
305
+ ...output,
306
+ body: await parseErrorBody(output.body, context),
307
+ };
308
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
309
+ switch (errorCode) {
310
+ case "ResourceNotFoundException":
311
+ case "com.amazonaws.codestarconnections#ResourceNotFoundException":
312
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
313
+ case "ResourceUnavailableException":
314
+ case "com.amazonaws.codestarconnections#ResourceUnavailableException":
315
+ throw await deserializeAws_json1_0ResourceUnavailableExceptionResponse(parsedOutput, context);
316
+ default:
317
+ const parsedBody = parsedOutput.body;
318
+ throwDefaultError({
319
+ output,
320
+ parsedBody,
321
+ exceptionCtor: __BaseException,
322
+ errorCode,
323
+ });
324
+ }
325
+ };
326
+ export const deserializeAws_json1_0ListConnectionsCommand = async (output, context) => {
327
+ if (output.statusCode >= 300) {
328
+ return deserializeAws_json1_0ListConnectionsCommandError(output, context);
329
+ }
330
+ const data = await parseBody(output.body, context);
331
+ let contents = {};
332
+ contents = deserializeAws_json1_0ListConnectionsOutput(data, context);
333
+ const response = {
334
+ $metadata: deserializeMetadata(output),
335
+ ...contents,
336
+ };
337
+ return Promise.resolve(response);
338
+ };
339
+ const deserializeAws_json1_0ListConnectionsCommandError = async (output, context) => {
340
+ const parsedOutput = {
341
+ ...output,
342
+ body: await parseErrorBody(output.body, context),
343
+ };
344
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
345
+ const parsedBody = parsedOutput.body;
346
+ throwDefaultError({
347
+ output,
348
+ parsedBody,
349
+ exceptionCtor: __BaseException,
350
+ errorCode,
351
+ });
352
+ };
353
+ export const deserializeAws_json1_0ListHostsCommand = async (output, context) => {
354
+ if (output.statusCode >= 300) {
355
+ return deserializeAws_json1_0ListHostsCommandError(output, context);
356
+ }
357
+ const data = await parseBody(output.body, context);
358
+ let contents = {};
359
+ contents = deserializeAws_json1_0ListHostsOutput(data, context);
360
+ const response = {
361
+ $metadata: deserializeMetadata(output),
362
+ ...contents,
363
+ };
364
+ return Promise.resolve(response);
365
+ };
366
+ const deserializeAws_json1_0ListHostsCommandError = async (output, context) => {
367
+ const parsedOutput = {
368
+ ...output,
369
+ body: await parseErrorBody(output.body, context),
370
+ };
371
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
372
+ const parsedBody = parsedOutput.body;
373
+ throwDefaultError({
374
+ output,
375
+ parsedBody,
376
+ exceptionCtor: __BaseException,
377
+ errorCode,
378
+ });
379
+ };
380
+ export const deserializeAws_json1_0ListTagsForResourceCommand = async (output, context) => {
381
+ if (output.statusCode >= 300) {
382
+ return deserializeAws_json1_0ListTagsForResourceCommandError(output, context);
383
+ }
384
+ const data = await parseBody(output.body, context);
385
+ let contents = {};
386
+ contents = deserializeAws_json1_0ListTagsForResourceOutput(data, context);
387
+ const response = {
388
+ $metadata: deserializeMetadata(output),
389
+ ...contents,
390
+ };
391
+ return Promise.resolve(response);
392
+ };
393
+ const deserializeAws_json1_0ListTagsForResourceCommandError = async (output, context) => {
394
+ const parsedOutput = {
395
+ ...output,
396
+ body: await parseErrorBody(output.body, context),
397
+ };
398
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
399
+ switch (errorCode) {
400
+ case "ResourceNotFoundException":
401
+ case "com.amazonaws.codestarconnections#ResourceNotFoundException":
402
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
403
+ default:
404
+ const parsedBody = parsedOutput.body;
405
+ throwDefaultError({
406
+ output,
407
+ parsedBody,
408
+ exceptionCtor: __BaseException,
409
+ errorCode,
410
+ });
411
+ }
412
+ };
413
+ export const deserializeAws_json1_0TagResourceCommand = async (output, context) => {
414
+ if (output.statusCode >= 300) {
415
+ return deserializeAws_json1_0TagResourceCommandError(output, context);
416
+ }
417
+ const data = await parseBody(output.body, context);
418
+ let contents = {};
419
+ contents = deserializeAws_json1_0TagResourceOutput(data, context);
420
+ const response = {
421
+ $metadata: deserializeMetadata(output),
422
+ ...contents,
423
+ };
424
+ return Promise.resolve(response);
425
+ };
426
+ const deserializeAws_json1_0TagResourceCommandError = async (output, context) => {
427
+ const parsedOutput = {
428
+ ...output,
429
+ body: await parseErrorBody(output.body, context),
430
+ };
431
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
432
+ switch (errorCode) {
433
+ case "LimitExceededException":
434
+ case "com.amazonaws.codestarconnections#LimitExceededException":
435
+ throw await deserializeAws_json1_0LimitExceededExceptionResponse(parsedOutput, context);
436
+ case "ResourceNotFoundException":
437
+ case "com.amazonaws.codestarconnections#ResourceNotFoundException":
438
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
439
+ default:
440
+ const parsedBody = parsedOutput.body;
441
+ throwDefaultError({
442
+ output,
443
+ parsedBody,
444
+ exceptionCtor: __BaseException,
445
+ errorCode,
446
+ });
447
+ }
448
+ };
449
+ export const deserializeAws_json1_0UntagResourceCommand = async (output, context) => {
450
+ if (output.statusCode >= 300) {
451
+ return deserializeAws_json1_0UntagResourceCommandError(output, context);
452
+ }
453
+ const data = await parseBody(output.body, context);
454
+ let contents = {};
455
+ contents = deserializeAws_json1_0UntagResourceOutput(data, context);
456
+ const response = {
457
+ $metadata: deserializeMetadata(output),
458
+ ...contents,
459
+ };
460
+ return Promise.resolve(response);
461
+ };
462
+ const deserializeAws_json1_0UntagResourceCommandError = async (output, context) => {
463
+ const parsedOutput = {
464
+ ...output,
465
+ body: await parseErrorBody(output.body, context),
466
+ };
467
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
468
+ switch (errorCode) {
469
+ case "ResourceNotFoundException":
470
+ case "com.amazonaws.codestarconnections#ResourceNotFoundException":
471
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
472
+ default:
473
+ const parsedBody = parsedOutput.body;
474
+ throwDefaultError({
475
+ output,
476
+ parsedBody,
477
+ exceptionCtor: __BaseException,
478
+ errorCode,
479
+ });
480
+ }
481
+ };
482
+ export const deserializeAws_json1_0UpdateHostCommand = async (output, context) => {
483
+ if (output.statusCode >= 300) {
484
+ return deserializeAws_json1_0UpdateHostCommandError(output, context);
485
+ }
486
+ const data = await parseBody(output.body, context);
487
+ let contents = {};
488
+ contents = deserializeAws_json1_0UpdateHostOutput(data, context);
489
+ const response = {
490
+ $metadata: deserializeMetadata(output),
491
+ ...contents,
492
+ };
493
+ return Promise.resolve(response);
494
+ };
495
+ const deserializeAws_json1_0UpdateHostCommandError = async (output, context) => {
496
+ const parsedOutput = {
497
+ ...output,
498
+ body: await parseErrorBody(output.body, context),
499
+ };
500
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
501
+ switch (errorCode) {
502
+ case "ConflictException":
503
+ case "com.amazonaws.codestarconnections#ConflictException":
504
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
505
+ case "ResourceNotFoundException":
506
+ case "com.amazonaws.codestarconnections#ResourceNotFoundException":
507
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
508
+ case "ResourceUnavailableException":
509
+ case "com.amazonaws.codestarconnections#ResourceUnavailableException":
510
+ throw await deserializeAws_json1_0ResourceUnavailableExceptionResponse(parsedOutput, context);
511
+ case "UnsupportedOperationException":
512
+ case "com.amazonaws.codestarconnections#UnsupportedOperationException":
513
+ throw await deserializeAws_json1_0UnsupportedOperationExceptionResponse(parsedOutput, context);
514
+ default:
515
+ const parsedBody = parsedOutput.body;
516
+ throwDefaultError({
517
+ output,
518
+ parsedBody,
519
+ exceptionCtor: __BaseException,
520
+ errorCode,
521
+ });
522
+ }
523
+ };
524
+ const deserializeAws_json1_0ConflictExceptionResponse = async (parsedOutput, context) => {
525
+ const body = parsedOutput.body;
526
+ const deserialized = deserializeAws_json1_0ConflictException(body, context);
527
+ const exception = new ConflictException({
528
+ $metadata: deserializeMetadata(parsedOutput),
529
+ ...deserialized,
773
530
  });
774
- }); };
775
- var deserializeAws_json1_0LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
776
- var body, deserialized, exception;
777
- return __generator(this, function (_a) {
778
- body = parsedOutput.body;
779
- deserialized = deserializeAws_json1_0LimitExceededException(body, context);
780
- exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
781
- return [2, __decorateServiceException(exception, body)];
531
+ return __decorateServiceException(exception, body);
532
+ };
533
+ const deserializeAws_json1_0LimitExceededExceptionResponse = async (parsedOutput, context) => {
534
+ const body = parsedOutput.body;
535
+ const deserialized = deserializeAws_json1_0LimitExceededException(body, context);
536
+ const exception = new LimitExceededException({
537
+ $metadata: deserializeMetadata(parsedOutput),
538
+ ...deserialized,
782
539
  });
783
- }); };
784
- var deserializeAws_json1_0ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
785
- var body, deserialized, exception;
786
- return __generator(this, function (_a) {
787
- body = parsedOutput.body;
788
- deserialized = deserializeAws_json1_0ResourceNotFoundException(body, context);
789
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
790
- return [2, __decorateServiceException(exception, body)];
540
+ return __decorateServiceException(exception, body);
541
+ };
542
+ const deserializeAws_json1_0ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
543
+ const body = parsedOutput.body;
544
+ const deserialized = deserializeAws_json1_0ResourceNotFoundException(body, context);
545
+ const exception = new ResourceNotFoundException({
546
+ $metadata: deserializeMetadata(parsedOutput),
547
+ ...deserialized,
791
548
  });
792
- }); };
793
- var deserializeAws_json1_0ResourceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
794
- var body, deserialized, exception;
795
- return __generator(this, function (_a) {
796
- body = parsedOutput.body;
797
- deserialized = deserializeAws_json1_0ResourceUnavailableException(body, context);
798
- exception = new ResourceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
799
- return [2, __decorateServiceException(exception, body)];
549
+ return __decorateServiceException(exception, body);
550
+ };
551
+ const deserializeAws_json1_0ResourceUnavailableExceptionResponse = async (parsedOutput, context) => {
552
+ const body = parsedOutput.body;
553
+ const deserialized = deserializeAws_json1_0ResourceUnavailableException(body, context);
554
+ const exception = new ResourceUnavailableException({
555
+ $metadata: deserializeMetadata(parsedOutput),
556
+ ...deserialized,
800
557
  });
801
- }); };
802
- var deserializeAws_json1_0UnsupportedOperationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
803
- var body, deserialized, exception;
804
- return __generator(this, function (_a) {
805
- body = parsedOutput.body;
806
- deserialized = deserializeAws_json1_0UnsupportedOperationException(body, context);
807
- exception = new UnsupportedOperationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
808
- return [2, __decorateServiceException(exception, body)];
558
+ return __decorateServiceException(exception, body);
559
+ };
560
+ const deserializeAws_json1_0UnsupportedOperationExceptionResponse = async (parsedOutput, context) => {
561
+ const body = parsedOutput.body;
562
+ const deserialized = deserializeAws_json1_0UnsupportedOperationException(body, context);
563
+ const exception = new UnsupportedOperationException({
564
+ $metadata: deserializeMetadata(parsedOutput),
565
+ ...deserialized,
809
566
  });
810
- }); };
811
- var serializeAws_json1_0CreateConnectionInput = function (input, context) {
812
- return __assign(__assign(__assign(__assign({}, (input.ConnectionName != null && { ConnectionName: input.ConnectionName })), (input.HostArn != null && { HostArn: input.HostArn })), (input.ProviderType != null && { ProviderType: input.ProviderType })), (input.Tags != null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }));
567
+ return __decorateServiceException(exception, body);
813
568
  };
814
- var serializeAws_json1_0CreateHostInput = function (input, context) {
815
- return __assign(__assign(__assign(__assign(__assign({}, (input.Name != null && { Name: input.Name })), (input.ProviderEndpoint != null && { ProviderEndpoint: input.ProviderEndpoint })), (input.ProviderType != null && { ProviderType: input.ProviderType })), (input.Tags != null && { Tags: serializeAws_json1_0TagList(input.Tags, context) })), (input.VpcConfiguration != null && {
816
- VpcConfiguration: serializeAws_json1_0VpcConfiguration(input.VpcConfiguration, context),
817
- }));
569
+ const serializeAws_json1_0CreateConnectionInput = (input, context) => {
570
+ return {
571
+ ...(input.ConnectionName != null && { ConnectionName: input.ConnectionName }),
572
+ ...(input.HostArn != null && { HostArn: input.HostArn }),
573
+ ...(input.ProviderType != null && { ProviderType: input.ProviderType }),
574
+ ...(input.Tags != null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }),
575
+ };
818
576
  };
819
- var serializeAws_json1_0DeleteConnectionInput = function (input, context) {
820
- return __assign({}, (input.ConnectionArn != null && { ConnectionArn: input.ConnectionArn }));
577
+ const serializeAws_json1_0CreateHostInput = (input, context) => {
578
+ return {
579
+ ...(input.Name != null && { Name: input.Name }),
580
+ ...(input.ProviderEndpoint != null && { ProviderEndpoint: input.ProviderEndpoint }),
581
+ ...(input.ProviderType != null && { ProviderType: input.ProviderType }),
582
+ ...(input.Tags != null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }),
583
+ ...(input.VpcConfiguration != null && {
584
+ VpcConfiguration: serializeAws_json1_0VpcConfiguration(input.VpcConfiguration, context),
585
+ }),
586
+ };
821
587
  };
822
- var serializeAws_json1_0DeleteHostInput = function (input, context) {
823
- return __assign({}, (input.HostArn != null && { HostArn: input.HostArn }));
588
+ const serializeAws_json1_0DeleteConnectionInput = (input, context) => {
589
+ return {
590
+ ...(input.ConnectionArn != null && { ConnectionArn: input.ConnectionArn }),
591
+ };
824
592
  };
825
- var serializeAws_json1_0GetConnectionInput = function (input, context) {
826
- return __assign({}, (input.ConnectionArn != null && { ConnectionArn: input.ConnectionArn }));
593
+ const serializeAws_json1_0DeleteHostInput = (input, context) => {
594
+ return {
595
+ ...(input.HostArn != null && { HostArn: input.HostArn }),
596
+ };
827
597
  };
828
- var serializeAws_json1_0GetHostInput = function (input, context) {
829
- return __assign({}, (input.HostArn != null && { HostArn: input.HostArn }));
598
+ const serializeAws_json1_0GetConnectionInput = (input, context) => {
599
+ return {
600
+ ...(input.ConnectionArn != null && { ConnectionArn: input.ConnectionArn }),
601
+ };
830
602
  };
831
- var serializeAws_json1_0ListConnectionsInput = function (input, context) {
832
- return __assign(__assign(__assign(__assign({}, (input.HostArnFilter != null && { HostArnFilter: input.HostArnFilter })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.ProviderTypeFilter != null && { ProviderTypeFilter: input.ProviderTypeFilter }));
603
+ const serializeAws_json1_0GetHostInput = (input, context) => {
604
+ return {
605
+ ...(input.HostArn != null && { HostArn: input.HostArn }),
606
+ };
833
607
  };
834
- var serializeAws_json1_0ListHostsInput = function (input, context) {
835
- return __assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken }));
608
+ const serializeAws_json1_0ListConnectionsInput = (input, context) => {
609
+ return {
610
+ ...(input.HostArnFilter != null && { HostArnFilter: input.HostArnFilter }),
611
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
612
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
613
+ ...(input.ProviderTypeFilter != null && { ProviderTypeFilter: input.ProviderTypeFilter }),
614
+ };
836
615
  };
837
- var serializeAws_json1_0ListTagsForResourceInput = function (input, context) {
838
- return __assign({}, (input.ResourceArn != null && { ResourceArn: input.ResourceArn }));
616
+ const serializeAws_json1_0ListHostsInput = (input, context) => {
617
+ return {
618
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
619
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
620
+ };
621
+ };
622
+ const serializeAws_json1_0ListTagsForResourceInput = (input, context) => {
623
+ return {
624
+ ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
625
+ };
839
626
  };
840
- var serializeAws_json1_0SecurityGroupIds = function (input, context) {
627
+ const serializeAws_json1_0SecurityGroupIds = (input, context) => {
841
628
  return input
842
- .filter(function (e) { return e != null; })
843
- .map(function (entry) {
629
+ .filter((e) => e != null)
630
+ .map((entry) => {
844
631
  return entry;
845
632
  });
846
633
  };
847
- var serializeAws_json1_0SubnetIds = function (input, context) {
634
+ const serializeAws_json1_0SubnetIds = (input, context) => {
848
635
  return input
849
- .filter(function (e) { return e != null; })
850
- .map(function (entry) {
636
+ .filter((e) => e != null)
637
+ .map((entry) => {
851
638
  return entry;
852
639
  });
853
640
  };
854
- var serializeAws_json1_0Tag = function (input, context) {
855
- return __assign(__assign({}, (input.Key != null && { Key: input.Key })), (input.Value != null && { Value: input.Value }));
641
+ const serializeAws_json1_0Tag = (input, context) => {
642
+ return {
643
+ ...(input.Key != null && { Key: input.Key }),
644
+ ...(input.Value != null && { Value: input.Value }),
645
+ };
856
646
  };
857
- var serializeAws_json1_0TagKeyList = function (input, context) {
647
+ const serializeAws_json1_0TagKeyList = (input, context) => {
858
648
  return input
859
- .filter(function (e) { return e != null; })
860
- .map(function (entry) {
649
+ .filter((e) => e != null)
650
+ .map((entry) => {
861
651
  return entry;
862
652
  });
863
653
  };
864
- var serializeAws_json1_0TagList = function (input, context) {
654
+ const serializeAws_json1_0TagList = (input, context) => {
865
655
  return input
866
- .filter(function (e) { return e != null; })
867
- .map(function (entry) {
656
+ .filter((e) => e != null)
657
+ .map((entry) => {
868
658
  return serializeAws_json1_0Tag(entry, context);
869
659
  });
870
660
  };
871
- var serializeAws_json1_0TagResourceInput = function (input, context) {
872
- return __assign(__assign({}, (input.ResourceArn != null && { ResourceArn: input.ResourceArn })), (input.Tags != null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }));
661
+ const serializeAws_json1_0TagResourceInput = (input, context) => {
662
+ return {
663
+ ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
664
+ ...(input.Tags != null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }),
665
+ };
873
666
  };
874
- var serializeAws_json1_0UntagResourceInput = function (input, context) {
875
- return __assign(__assign({}, (input.ResourceArn != null && { ResourceArn: input.ResourceArn })), (input.TagKeys != null && { TagKeys: serializeAws_json1_0TagKeyList(input.TagKeys, context) }));
667
+ const serializeAws_json1_0UntagResourceInput = (input, context) => {
668
+ return {
669
+ ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
670
+ ...(input.TagKeys != null && { TagKeys: serializeAws_json1_0TagKeyList(input.TagKeys, context) }),
671
+ };
876
672
  };
877
- var serializeAws_json1_0UpdateHostInput = function (input, context) {
878
- return __assign(__assign(__assign({}, (input.HostArn != null && { HostArn: input.HostArn })), (input.ProviderEndpoint != null && { ProviderEndpoint: input.ProviderEndpoint })), (input.VpcConfiguration != null && {
879
- VpcConfiguration: serializeAws_json1_0VpcConfiguration(input.VpcConfiguration, context),
880
- }));
673
+ const serializeAws_json1_0UpdateHostInput = (input, context) => {
674
+ return {
675
+ ...(input.HostArn != null && { HostArn: input.HostArn }),
676
+ ...(input.ProviderEndpoint != null && { ProviderEndpoint: input.ProviderEndpoint }),
677
+ ...(input.VpcConfiguration != null && {
678
+ VpcConfiguration: serializeAws_json1_0VpcConfiguration(input.VpcConfiguration, context),
679
+ }),
680
+ };
881
681
  };
882
- var serializeAws_json1_0VpcConfiguration = function (input, context) {
883
- return __assign(__assign(__assign(__assign({}, (input.SecurityGroupIds != null && {
884
- SecurityGroupIds: serializeAws_json1_0SecurityGroupIds(input.SecurityGroupIds, context),
885
- })), (input.SubnetIds != null && { SubnetIds: serializeAws_json1_0SubnetIds(input.SubnetIds, context) })), (input.TlsCertificate != null && { TlsCertificate: input.TlsCertificate })), (input.VpcId != null && { VpcId: input.VpcId }));
682
+ const serializeAws_json1_0VpcConfiguration = (input, context) => {
683
+ return {
684
+ ...(input.SecurityGroupIds != null && {
685
+ SecurityGroupIds: serializeAws_json1_0SecurityGroupIds(input.SecurityGroupIds, context),
686
+ }),
687
+ ...(input.SubnetIds != null && { SubnetIds: serializeAws_json1_0SubnetIds(input.SubnetIds, context) }),
688
+ ...(input.TlsCertificate != null && { TlsCertificate: input.TlsCertificate }),
689
+ ...(input.VpcId != null && { VpcId: input.VpcId }),
690
+ };
886
691
  };
887
- var deserializeAws_json1_0ConflictException = function (output, context) {
692
+ const deserializeAws_json1_0ConflictException = (output, context) => {
888
693
  return {
889
694
  Message: __expectString(output.Message),
890
695
  };
891
696
  };
892
- var deserializeAws_json1_0Connection = function (output, context) {
697
+ const deserializeAws_json1_0Connection = (output, context) => {
893
698
  return {
894
699
  ConnectionArn: __expectString(output.ConnectionArn),
895
700
  ConnectionName: __expectString(output.ConnectionName),
@@ -899,10 +704,10 @@ var deserializeAws_json1_0Connection = function (output, context) {
899
704
  ProviderType: __expectString(output.ProviderType),
900
705
  };
901
706
  };
902
- var deserializeAws_json1_0ConnectionList = function (output, context) {
903
- var retVal = (output || [])
904
- .filter(function (e) { return e != null; })
905
- .map(function (entry) {
707
+ const deserializeAws_json1_0ConnectionList = (output, context) => {
708
+ const retVal = (output || [])
709
+ .filter((e) => e != null)
710
+ .map((entry) => {
906
711
  if (entry === null) {
907
712
  return null;
908
713
  }
@@ -910,30 +715,30 @@ var deserializeAws_json1_0ConnectionList = function (output, context) {
910
715
  });
911
716
  return retVal;
912
717
  };
913
- var deserializeAws_json1_0CreateConnectionOutput = function (output, context) {
718
+ const deserializeAws_json1_0CreateConnectionOutput = (output, context) => {
914
719
  return {
915
720
  ConnectionArn: __expectString(output.ConnectionArn),
916
721
  Tags: output.Tags != null ? deserializeAws_json1_0TagList(output.Tags, context) : undefined,
917
722
  };
918
723
  };
919
- var deserializeAws_json1_0CreateHostOutput = function (output, context) {
724
+ const deserializeAws_json1_0CreateHostOutput = (output, context) => {
920
725
  return {
921
726
  HostArn: __expectString(output.HostArn),
922
727
  Tags: output.Tags != null ? deserializeAws_json1_0TagList(output.Tags, context) : undefined,
923
728
  };
924
729
  };
925
- var deserializeAws_json1_0DeleteConnectionOutput = function (output, context) {
730
+ const deserializeAws_json1_0DeleteConnectionOutput = (output, context) => {
926
731
  return {};
927
732
  };
928
- var deserializeAws_json1_0DeleteHostOutput = function (output, context) {
733
+ const deserializeAws_json1_0DeleteHostOutput = (output, context) => {
929
734
  return {};
930
735
  };
931
- var deserializeAws_json1_0GetConnectionOutput = function (output, context) {
736
+ const deserializeAws_json1_0GetConnectionOutput = (output, context) => {
932
737
  return {
933
738
  Connection: output.Connection != null ? deserializeAws_json1_0Connection(output.Connection, context) : undefined,
934
739
  };
935
740
  };
936
- var deserializeAws_json1_0GetHostOutput = function (output, context) {
741
+ const deserializeAws_json1_0GetHostOutput = (output, context) => {
937
742
  return {
938
743
  Name: __expectString(output.Name),
939
744
  ProviderEndpoint: __expectString(output.ProviderEndpoint),
@@ -944,7 +749,7 @@ var deserializeAws_json1_0GetHostOutput = function (output, context) {
944
749
  : undefined,
945
750
  };
946
751
  };
947
- var deserializeAws_json1_0Host = function (output, context) {
752
+ const deserializeAws_json1_0Host = (output, context) => {
948
753
  return {
949
754
  HostArn: __expectString(output.HostArn),
950
755
  Name: __expectString(output.Name),
@@ -957,10 +762,10 @@ var deserializeAws_json1_0Host = function (output, context) {
957
762
  : undefined,
958
763
  };
959
764
  };
960
- var deserializeAws_json1_0HostList = function (output, context) {
961
- var retVal = (output || [])
962
- .filter(function (e) { return e != null; })
963
- .map(function (entry) {
765
+ const deserializeAws_json1_0HostList = (output, context) => {
766
+ const retVal = (output || [])
767
+ .filter((e) => e != null)
768
+ .map((entry) => {
964
769
  if (entry === null) {
965
770
  return null;
966
771
  }
@@ -968,42 +773,42 @@ var deserializeAws_json1_0HostList = function (output, context) {
968
773
  });
969
774
  return retVal;
970
775
  };
971
- var deserializeAws_json1_0LimitExceededException = function (output, context) {
776
+ const deserializeAws_json1_0LimitExceededException = (output, context) => {
972
777
  return {
973
778
  Message: __expectString(output.Message),
974
779
  };
975
780
  };
976
- var deserializeAws_json1_0ListConnectionsOutput = function (output, context) {
781
+ const deserializeAws_json1_0ListConnectionsOutput = (output, context) => {
977
782
  return {
978
783
  Connections: output.Connections != null ? deserializeAws_json1_0ConnectionList(output.Connections, context) : undefined,
979
784
  NextToken: __expectString(output.NextToken),
980
785
  };
981
786
  };
982
- var deserializeAws_json1_0ListHostsOutput = function (output, context) {
787
+ const deserializeAws_json1_0ListHostsOutput = (output, context) => {
983
788
  return {
984
789
  Hosts: output.Hosts != null ? deserializeAws_json1_0HostList(output.Hosts, context) : undefined,
985
790
  NextToken: __expectString(output.NextToken),
986
791
  };
987
792
  };
988
- var deserializeAws_json1_0ListTagsForResourceOutput = function (output, context) {
793
+ const deserializeAws_json1_0ListTagsForResourceOutput = (output, context) => {
989
794
  return {
990
795
  Tags: output.Tags != null ? deserializeAws_json1_0TagList(output.Tags, context) : undefined,
991
796
  };
992
797
  };
993
- var deserializeAws_json1_0ResourceNotFoundException = function (output, context) {
798
+ const deserializeAws_json1_0ResourceNotFoundException = (output, context) => {
994
799
  return {
995
800
  Message: __expectString(output.Message),
996
801
  };
997
802
  };
998
- var deserializeAws_json1_0ResourceUnavailableException = function (output, context) {
803
+ const deserializeAws_json1_0ResourceUnavailableException = (output, context) => {
999
804
  return {
1000
805
  Message: __expectString(output.Message),
1001
806
  };
1002
807
  };
1003
- var deserializeAws_json1_0SecurityGroupIds = function (output, context) {
1004
- var retVal = (output || [])
1005
- .filter(function (e) { return e != null; })
1006
- .map(function (entry) {
808
+ const deserializeAws_json1_0SecurityGroupIds = (output, context) => {
809
+ const retVal = (output || [])
810
+ .filter((e) => e != null)
811
+ .map((entry) => {
1007
812
  if (entry === null) {
1008
813
  return null;
1009
814
  }
@@ -1011,10 +816,10 @@ var deserializeAws_json1_0SecurityGroupIds = function (output, context) {
1011
816
  });
1012
817
  return retVal;
1013
818
  };
1014
- var deserializeAws_json1_0SubnetIds = function (output, context) {
1015
- var retVal = (output || [])
1016
- .filter(function (e) { return e != null; })
1017
- .map(function (entry) {
819
+ const deserializeAws_json1_0SubnetIds = (output, context) => {
820
+ const retVal = (output || [])
821
+ .filter((e) => e != null)
822
+ .map((entry) => {
1018
823
  if (entry === null) {
1019
824
  return null;
1020
825
  }
@@ -1022,16 +827,16 @@ var deserializeAws_json1_0SubnetIds = function (output, context) {
1022
827
  });
1023
828
  return retVal;
1024
829
  };
1025
- var deserializeAws_json1_0Tag = function (output, context) {
830
+ const deserializeAws_json1_0Tag = (output, context) => {
1026
831
  return {
1027
832
  Key: __expectString(output.Key),
1028
833
  Value: __expectString(output.Value),
1029
834
  };
1030
835
  };
1031
- var deserializeAws_json1_0TagList = function (output, context) {
1032
- var retVal = (output || [])
1033
- .filter(function (e) { return e != null; })
1034
- .map(function (entry) {
836
+ const deserializeAws_json1_0TagList = (output, context) => {
837
+ const retVal = (output || [])
838
+ .filter((e) => e != null)
839
+ .map((entry) => {
1035
840
  if (entry === null) {
1036
841
  return null;
1037
842
  }
@@ -1039,21 +844,21 @@ var deserializeAws_json1_0TagList = function (output, context) {
1039
844
  });
1040
845
  return retVal;
1041
846
  };
1042
- var deserializeAws_json1_0TagResourceOutput = function (output, context) {
847
+ const deserializeAws_json1_0TagResourceOutput = (output, context) => {
1043
848
  return {};
1044
849
  };
1045
- var deserializeAws_json1_0UnsupportedOperationException = function (output, context) {
850
+ const deserializeAws_json1_0UnsupportedOperationException = (output, context) => {
1046
851
  return {
1047
852
  Message: __expectString(output.Message),
1048
853
  };
1049
854
  };
1050
- var deserializeAws_json1_0UntagResourceOutput = function (output, context) {
855
+ const deserializeAws_json1_0UntagResourceOutput = (output, context) => {
1051
856
  return {};
1052
857
  };
1053
- var deserializeAws_json1_0UpdateHostOutput = function (output, context) {
858
+ const deserializeAws_json1_0UpdateHostOutput = (output, context) => {
1054
859
  return {};
1055
860
  };
1056
- var deserializeAws_json1_0VpcConfiguration = function (output, context) {
861
+ const deserializeAws_json1_0VpcConfiguration = (output, context) => {
1057
862
  return {
1058
863
  SecurityGroupIds: output.SecurityGroupIds != null
1059
864
  ? deserializeAws_json1_0SecurityGroupIds(output.SecurityGroupIds, context)
@@ -1063,75 +868,52 @@ var deserializeAws_json1_0VpcConfiguration = function (output, context) {
1063
868
  VpcId: __expectString(output.VpcId),
1064
869
  };
1065
870
  };
1066
- var deserializeMetadata = function (output) {
1067
- var _a, _b;
1068
- return ({
1069
- httpStatusCode: output.statusCode,
1070
- 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"],
1071
- extendedRequestId: output.headers["x-amz-id-2"],
1072
- cfId: output.headers["x-amz-cf-id"],
1073
- });
1074
- };
1075
- var collectBody = function (streamBody, context) {
1076
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
871
+ const deserializeMetadata = (output) => ({
872
+ httpStatusCode: output.statusCode,
873
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
874
+ extendedRequestId: output.headers["x-amz-id-2"],
875
+ cfId: output.headers["x-amz-cf-id"],
876
+ });
877
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1077
878
  if (streamBody instanceof Uint8Array) {
1078
879
  return Promise.resolve(streamBody);
1079
880
  }
1080
881
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1081
882
  };
1082
- var collectBodyString = function (streamBody, context) {
1083
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1084
- };
1085
- var buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {
1086
- var _a, hostname, _b, protocol, port, basePath, contents;
1087
- return __generator(this, function (_c) {
1088
- switch (_c.label) {
1089
- case 0: return [4, context.endpoint()];
1090
- case 1:
1091
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1092
- contents = {
1093
- protocol: protocol,
1094
- hostname: hostname,
1095
- port: port,
1096
- method: "POST",
1097
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1098
- headers: headers,
1099
- };
1100
- if (resolvedHostname !== undefined) {
1101
- contents.hostname = resolvedHostname;
1102
- }
1103
- if (body !== undefined) {
1104
- contents.body = body;
1105
- }
1106
- return [2, new __HttpRequest(contents)];
1107
- }
1108
- });
1109
- }); };
1110
- var parseBody = function (streamBody, context) {
1111
- return collectBodyString(streamBody, context).then(function (encoded) {
1112
- if (encoded.length) {
1113
- return JSON.parse(encoded);
1114
- }
1115
- return {};
1116
- });
883
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
884
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
885
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
886
+ const contents = {
887
+ protocol,
888
+ hostname,
889
+ port,
890
+ method: "POST",
891
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
892
+ headers,
893
+ };
894
+ if (resolvedHostname !== undefined) {
895
+ contents.hostname = resolvedHostname;
896
+ }
897
+ if (body !== undefined) {
898
+ contents.body = body;
899
+ }
900
+ return new __HttpRequest(contents);
1117
901
  };
1118
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1119
- var value;
1120
- var _a;
1121
- return __generator(this, function (_b) {
1122
- switch (_b.label) {
1123
- case 0: return [4, parseBody(errorBody, context)];
1124
- case 1:
1125
- value = _b.sent();
1126
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1127
- return [2, value];
1128
- }
1129
- });
1130
- }); };
1131
- var loadRestJsonErrorCode = function (output, data) {
1132
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1133
- var sanitizeErrorCode = function (rawValue) {
1134
- var cleanValue = rawValue;
902
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
903
+ if (encoded.length) {
904
+ return JSON.parse(encoded);
905
+ }
906
+ return {};
907
+ });
908
+ const parseErrorBody = async (errorBody, context) => {
909
+ const value = await parseBody(errorBody, context);
910
+ value.message = value.message ?? value.Message;
911
+ return value;
912
+ };
913
+ const loadRestJsonErrorCode = (output, data) => {
914
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
915
+ const sanitizeErrorCode = (rawValue) => {
916
+ let cleanValue = rawValue;
1135
917
  if (typeof cleanValue === "number") {
1136
918
  cleanValue = cleanValue.toString();
1137
919
  }
@@ -1146,7 +928,7 @@ var loadRestJsonErrorCode = function (output, data) {
1146
928
  }
1147
929
  return cleanValue;
1148
930
  };
1149
- var headerKey = findKey(output.headers, "x-amzn-errortype");
931
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1150
932
  if (headerKey !== undefined) {
1151
933
  return sanitizeErrorCode(output.headers[headerKey]);
1152
934
  }