@aws-sdk/client-outposts 3.181.0 → 3.183.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist-es/Outposts.js +106 -113
  3. package/dist-es/OutpostsClient.js +22 -28
  4. package/dist-es/commands/CancelOrderCommand.js +21 -28
  5. package/dist-es/commands/CreateOrderCommand.js +21 -28
  6. package/dist-es/commands/CreateOutpostCommand.js +21 -28
  7. package/dist-es/commands/CreateSiteCommand.js +21 -28
  8. package/dist-es/commands/DeleteOutpostCommand.js +21 -28
  9. package/dist-es/commands/DeleteSiteCommand.js +21 -28
  10. package/dist-es/commands/GetCatalogItemCommand.js +21 -28
  11. package/dist-es/commands/GetConnectionCommand.js +21 -28
  12. package/dist-es/commands/GetOrderCommand.js +21 -28
  13. package/dist-es/commands/GetOutpostCommand.js +21 -28
  14. package/dist-es/commands/GetOutpostInstanceTypesCommand.js +21 -28
  15. package/dist-es/commands/GetSiteAddressCommand.js +21 -28
  16. package/dist-es/commands/GetSiteCommand.js +21 -28
  17. package/dist-es/commands/ListAssetsCommand.js +21 -28
  18. package/dist-es/commands/ListCatalogItemsCommand.js +21 -28
  19. package/dist-es/commands/ListOrdersCommand.js +21 -28
  20. package/dist-es/commands/ListOutpostsCommand.js +21 -28
  21. package/dist-es/commands/ListSitesCommand.js +21 -28
  22. package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
  23. package/dist-es/commands/StartConnectionCommand.js +21 -28
  24. package/dist-es/commands/TagResourceCommand.js +21 -28
  25. package/dist-es/commands/UntagResourceCommand.js +21 -28
  26. package/dist-es/commands/UpdateOutpostCommand.js +21 -28
  27. package/dist-es/commands/UpdateSiteAddressCommand.js +21 -28
  28. package/dist-es/commands/UpdateSiteCommand.js +21 -28
  29. package/dist-es/commands/UpdateSiteRackPhysicalPropertiesCommand.js +21 -28
  30. package/dist-es/endpoints.js +8 -8
  31. package/dist-es/models/OutpostsServiceException.js +5 -10
  32. package/dist-es/models/models_0.js +281 -144
  33. package/dist-es/pagination/GetOutpostInstanceTypesPaginator.js +25 -68
  34. package/dist-es/pagination/ListAssetsPaginator.js +25 -68
  35. package/dist-es/pagination/ListCatalogItemsPaginator.js +25 -68
  36. package/dist-es/pagination/ListOrdersPaginator.js +25 -68
  37. package/dist-es/pagination/ListOutpostsPaginator.js +25 -68
  38. package/dist-es/pagination/ListSitesPaginator.js +25 -68
  39. package/dist-es/protocols/Aws_restJson1.js +1870 -2638
  40. package/dist-es/runtimeConfig.browser.js +26 -12
  41. package/dist-es/runtimeConfig.js +30 -12
  42. package/dist-es/runtimeConfig.native.js +8 -5
  43. package/dist-es/runtimeConfig.shared.js +8 -11
  44. package/package.json +33 -33
@@ -1,2592 +1,1840 @@
1
- import { __assign, __awaiter, __generator, __read } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, limitedParseFloat32 as __limitedParseFloat32, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { AccessDeniedException, ConflictException, InternalServerException, NotFoundException, ServiceQuotaExceededException, ValidationException, } from "../models/models_0";
5
4
  import { OutpostsServiceException as __BaseException } from "../models/OutpostsServiceException";
6
- export var serializeAws_restJson1CancelOrderCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
- return __generator(this, function (_c) {
9
- switch (_c.label) {
10
- case 0: return [4, context.endpoint()];
11
- case 1:
12
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
- headers = {};
14
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/orders/{OrderId}/cancel";
15
- resolvedPath = __resolvedPath(resolvedPath, input, "OrderId", function () { return input.OrderId; }, "{OrderId}", false);
16
- return [2, new __HttpRequest({
17
- protocol: protocol,
18
- hostname: hostname,
19
- port: port,
20
- method: "POST",
21
- headers: headers,
22
- path: resolvedPath,
23
- body: body,
24
- })];
25
- }
26
- });
27
- }); };
28
- export var serializeAws_restJson1CreateOrderCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
29
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
30
- return __generator(this, function (_c) {
31
- switch (_c.label) {
32
- case 0: return [4, context.endpoint()];
33
- case 1:
34
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
35
- headers = {
36
- "content-type": "application/json",
37
- };
38
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/orders";
39
- body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.LineItems != null && {
40
- LineItems: serializeAws_restJson1LineItemRequestListDefinition(input.LineItems, context),
41
- })), (input.OutpostIdentifier != null && { OutpostIdentifier: input.OutpostIdentifier })), (input.PaymentOption != null && { PaymentOption: input.PaymentOption })), (input.PaymentTerm != null && { PaymentTerm: input.PaymentTerm })));
42
- return [2, new __HttpRequest({
43
- protocol: protocol,
44
- hostname: hostname,
45
- port: port,
46
- method: "POST",
47
- headers: headers,
48
- path: resolvedPath,
49
- body: body,
50
- })];
51
- }
52
- });
53
- }); };
54
- export var serializeAws_restJson1CreateOutpostCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
55
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
56
- return __generator(this, function (_c) {
57
- switch (_c.label) {
58
- case 0: return [4, context.endpoint()];
59
- case 1:
60
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
61
- headers = {
62
- "content-type": "application/json",
63
- };
64
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/outposts";
65
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AvailabilityZone != null && { AvailabilityZone: input.AvailabilityZone })), (input.AvailabilityZoneId != null && { AvailabilityZoneId: input.AvailabilityZoneId })), (input.Description != null && { Description: input.Description })), (input.Name != null && { Name: input.Name })), (input.SiteId != null && { SiteId: input.SiteId })), (input.SupportedHardwareType != null && { SupportedHardwareType: input.SupportedHardwareType })), (input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
66
- return [2, new __HttpRequest({
67
- protocol: protocol,
68
- hostname: hostname,
69
- port: port,
70
- method: "POST",
71
- headers: headers,
72
- path: resolvedPath,
73
- body: body,
74
- })];
75
- }
76
- });
77
- }); };
78
- export var serializeAws_restJson1CreateSiteCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
79
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
80
- return __generator(this, function (_c) {
81
- switch (_c.label) {
82
- case 0: return [4, context.endpoint()];
83
- case 1:
84
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
85
- headers = {
86
- "content-type": "application/json",
87
- };
88
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/sites";
89
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.Description != null && { Description: input.Description })), (input.Name != null && { Name: input.Name })), (input.Notes != null && { Notes: input.Notes })), (input.OperatingAddress != null && {
90
- OperatingAddress: serializeAws_restJson1Address(input.OperatingAddress, context),
91
- })), (input.RackPhysicalProperties != null && {
92
- RackPhysicalProperties: serializeAws_restJson1RackPhysicalProperties(input.RackPhysicalProperties, context),
93
- })), (input.ShippingAddress != null && {
94
- ShippingAddress: serializeAws_restJson1Address(input.ShippingAddress, context),
95
- })), (input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
96
- return [2, new __HttpRequest({
97
- protocol: protocol,
98
- hostname: hostname,
99
- port: port,
100
- method: "POST",
101
- headers: headers,
102
- path: resolvedPath,
103
- body: body,
104
- })];
105
- }
106
- });
107
- }); };
108
- export var serializeAws_restJson1DeleteOutpostCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
109
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
110
- return __generator(this, function (_c) {
111
- switch (_c.label) {
112
- case 0: return [4, context.endpoint()];
113
- case 1:
114
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
115
- headers = {};
116
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/outposts/{OutpostId}";
117
- resolvedPath = __resolvedPath(resolvedPath, input, "OutpostId", function () { return input.OutpostId; }, "{OutpostId}", false);
118
- return [2, new __HttpRequest({
119
- protocol: protocol,
120
- hostname: hostname,
121
- port: port,
122
- method: "DELETE",
123
- headers: headers,
124
- path: resolvedPath,
125
- body: body,
126
- })];
127
- }
128
- });
129
- }); };
130
- export var serializeAws_restJson1DeleteSiteCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
131
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
132
- return __generator(this, function (_c) {
133
- switch (_c.label) {
134
- case 0: return [4, context.endpoint()];
135
- case 1:
136
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
137
- headers = {};
138
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/sites/{SiteId}";
139
- resolvedPath = __resolvedPath(resolvedPath, input, "SiteId", function () { return input.SiteId; }, "{SiteId}", false);
140
- return [2, new __HttpRequest({
141
- protocol: protocol,
142
- hostname: hostname,
143
- port: port,
144
- method: "DELETE",
145
- headers: headers,
146
- path: resolvedPath,
147
- body: body,
148
- })];
149
- }
150
- });
151
- }); };
152
- export var serializeAws_restJson1GetCatalogItemCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
153
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
154
- return __generator(this, function (_c) {
155
- switch (_c.label) {
156
- case 0: return [4, context.endpoint()];
157
- case 1:
158
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
159
- headers = {};
160
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/catalog/item/{CatalogItemId}";
161
- resolvedPath = __resolvedPath(resolvedPath, input, "CatalogItemId", function () { return input.CatalogItemId; }, "{CatalogItemId}", false);
162
- return [2, new __HttpRequest({
163
- protocol: protocol,
164
- hostname: hostname,
165
- port: port,
166
- method: "GET",
167
- headers: headers,
168
- path: resolvedPath,
169
- body: body,
170
- })];
171
- }
172
- });
173
- }); };
174
- export var serializeAws_restJson1GetConnectionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
175
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
176
- return __generator(this, function (_c) {
177
- switch (_c.label) {
178
- case 0: return [4, context.endpoint()];
179
- case 1:
180
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
181
- headers = {};
182
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/connections/{ConnectionId}";
183
- resolvedPath = __resolvedPath(resolvedPath, input, "ConnectionId", function () { return input.ConnectionId; }, "{ConnectionId}", false);
184
- return [2, new __HttpRequest({
185
- protocol: protocol,
186
- hostname: hostname,
187
- port: port,
188
- method: "GET",
189
- headers: headers,
190
- path: resolvedPath,
191
- body: body,
192
- })];
193
- }
194
- });
195
- }); };
196
- export var serializeAws_restJson1GetOrderCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
197
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
198
- return __generator(this, function (_c) {
199
- switch (_c.label) {
200
- case 0: return [4, context.endpoint()];
201
- case 1:
202
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
203
- headers = {};
204
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/orders/{OrderId}";
205
- resolvedPath = __resolvedPath(resolvedPath, input, "OrderId", function () { return input.OrderId; }, "{OrderId}", false);
206
- return [2, new __HttpRequest({
207
- protocol: protocol,
208
- hostname: hostname,
209
- port: port,
210
- method: "GET",
211
- headers: headers,
212
- path: resolvedPath,
213
- body: body,
214
- })];
215
- }
216
- });
217
- }); };
218
- export var serializeAws_restJson1GetOutpostCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
219
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
220
- return __generator(this, function (_c) {
221
- switch (_c.label) {
222
- case 0: return [4, context.endpoint()];
223
- case 1:
224
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
225
- headers = {};
226
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/outposts/{OutpostId}";
227
- resolvedPath = __resolvedPath(resolvedPath, input, "OutpostId", function () { return input.OutpostId; }, "{OutpostId}", false);
228
- return [2, new __HttpRequest({
229
- protocol: protocol,
230
- hostname: hostname,
231
- port: port,
232
- method: "GET",
233
- headers: headers,
234
- path: resolvedPath,
235
- body: body,
236
- })];
237
- }
238
- });
239
- }); };
240
- export var serializeAws_restJson1GetOutpostInstanceTypesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
241
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
242
- return __generator(this, function (_c) {
243
- switch (_c.label) {
244
- case 0: return [4, context.endpoint()];
245
- case 1:
246
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
247
- headers = {};
248
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/outposts/{OutpostId}/instanceTypes";
249
- resolvedPath = __resolvedPath(resolvedPath, input, "OutpostId", function () { return input.OutpostId; }, "{OutpostId}", false);
250
- query = map({
251
- NextToken: [, input.NextToken],
252
- MaxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
253
- });
254
- return [2, new __HttpRequest({
255
- protocol: protocol,
256
- hostname: hostname,
257
- port: port,
258
- method: "GET",
259
- headers: headers,
260
- path: resolvedPath,
261
- query: query,
262
- body: body,
263
- })];
264
- }
265
- });
266
- }); };
267
- export var serializeAws_restJson1GetSiteCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
268
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
269
- return __generator(this, function (_c) {
270
- switch (_c.label) {
271
- case 0: return [4, context.endpoint()];
272
- case 1:
273
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
274
- headers = {};
275
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/sites/{SiteId}";
276
- resolvedPath = __resolvedPath(resolvedPath, input, "SiteId", function () { return input.SiteId; }, "{SiteId}", false);
277
- return [2, new __HttpRequest({
278
- protocol: protocol,
279
- hostname: hostname,
280
- port: port,
281
- method: "GET",
282
- headers: headers,
283
- path: resolvedPath,
284
- body: body,
285
- })];
286
- }
287
- });
288
- }); };
289
- export var serializeAws_restJson1GetSiteAddressCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
290
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
291
- return __generator(this, function (_c) {
292
- switch (_c.label) {
293
- case 0: return [4, context.endpoint()];
294
- case 1:
295
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
296
- headers = {};
297
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/sites/{SiteId}/address";
298
- resolvedPath = __resolvedPath(resolvedPath, input, "SiteId", function () { return input.SiteId; }, "{SiteId}", false);
299
- query = map({
300
- AddressType: [, input.AddressType],
301
- });
302
- return [2, new __HttpRequest({
303
- protocol: protocol,
304
- hostname: hostname,
305
- port: port,
306
- method: "GET",
307
- headers: headers,
308
- path: resolvedPath,
309
- query: query,
310
- body: body,
311
- })];
312
- }
313
- });
314
- }); };
315
- export var serializeAws_restJson1ListAssetsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
316
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
317
- return __generator(this, function (_c) {
318
- switch (_c.label) {
319
- case 0: return [4, context.endpoint()];
320
- case 1:
321
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
322
- headers = {};
323
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/outposts/{OutpostIdentifier}/assets";
324
- resolvedPath = __resolvedPath(resolvedPath, input, "OutpostIdentifier", function () { return input.OutpostIdentifier; }, "{OutpostIdentifier}", false);
325
- query = map({
326
- HostIdFilter: [
327
- function () { return input.HostIdFilter !== void 0; },
328
- function () { return (input.HostIdFilter || []).map(function (_entry) { return _entry; }); },
329
- ],
330
- MaxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
331
- NextToken: [, input.NextToken],
332
- });
333
- return [2, new __HttpRequest({
334
- protocol: protocol,
335
- hostname: hostname,
336
- port: port,
337
- method: "GET",
338
- headers: headers,
339
- path: resolvedPath,
340
- query: query,
341
- body: body,
342
- })];
343
- }
344
- });
345
- }); };
346
- export var serializeAws_restJson1ListCatalogItemsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
347
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
348
- return __generator(this, function (_c) {
349
- switch (_c.label) {
350
- case 0: return [4, context.endpoint()];
351
- case 1:
352
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
353
- headers = {};
354
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/catalog/items";
355
- query = map({
356
- NextToken: [, input.NextToken],
357
- MaxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
358
- ItemClassFilter: [
359
- function () { return input.ItemClassFilter !== void 0; },
360
- function () { return (input.ItemClassFilter || []).map(function (_entry) { return _entry; }); },
361
- ],
362
- SupportedStorageFilter: [
363
- function () { return input.SupportedStorageFilter !== void 0; },
364
- function () { return (input.SupportedStorageFilter || []).map(function (_entry) { return _entry; }); },
365
- ],
366
- EC2FamilyFilter: [
367
- function () { return input.EC2FamilyFilter !== void 0; },
368
- function () { return (input.EC2FamilyFilter || []).map(function (_entry) { return _entry; }); },
369
- ],
370
- });
371
- return [2, new __HttpRequest({
372
- protocol: protocol,
373
- hostname: hostname,
374
- port: port,
375
- method: "GET",
376
- headers: headers,
377
- path: resolvedPath,
378
- query: query,
379
- body: body,
380
- })];
381
- }
382
- });
383
- }); };
384
- export var serializeAws_restJson1ListOrdersCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
385
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
386
- return __generator(this, function (_c) {
387
- switch (_c.label) {
388
- case 0: return [4, context.endpoint()];
389
- case 1:
390
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
391
- headers = {};
392
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/list-orders";
393
- query = map({
394
- OutpostIdentifierFilter: [, input.OutpostIdentifierFilter],
395
- NextToken: [, input.NextToken],
396
- MaxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
397
- });
398
- return [2, new __HttpRequest({
399
- protocol: protocol,
400
- hostname: hostname,
401
- port: port,
402
- method: "GET",
403
- headers: headers,
404
- path: resolvedPath,
405
- query: query,
406
- body: body,
407
- })];
408
- }
409
- });
410
- }); };
411
- export var serializeAws_restJson1ListOutpostsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
412
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
413
- return __generator(this, function (_c) {
414
- switch (_c.label) {
415
- case 0: return [4, context.endpoint()];
416
- case 1:
417
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
418
- headers = {};
419
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/outposts";
420
- query = map({
421
- NextToken: [, input.NextToken],
422
- MaxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
423
- LifeCycleStatusFilter: [
424
- function () { return input.LifeCycleStatusFilter !== void 0; },
425
- function () { return (input.LifeCycleStatusFilter || []).map(function (_entry) { return _entry; }); },
426
- ],
427
- AvailabilityZoneFilter: [
428
- function () { return input.AvailabilityZoneFilter !== void 0; },
429
- function () { return (input.AvailabilityZoneFilter || []).map(function (_entry) { return _entry; }); },
430
- ],
431
- AvailabilityZoneIdFilter: [
432
- function () { return input.AvailabilityZoneIdFilter !== void 0; },
433
- function () { return (input.AvailabilityZoneIdFilter || []).map(function (_entry) { return _entry; }); },
434
- ],
435
- });
436
- return [2, new __HttpRequest({
437
- protocol: protocol,
438
- hostname: hostname,
439
- port: port,
440
- method: "GET",
441
- headers: headers,
442
- path: resolvedPath,
443
- query: query,
444
- body: body,
445
- })];
446
- }
447
- });
448
- }); };
449
- export var serializeAws_restJson1ListSitesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
450
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
451
- return __generator(this, function (_c) {
452
- switch (_c.label) {
453
- case 0: return [4, context.endpoint()];
454
- case 1:
455
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
456
- headers = {};
457
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/sites";
458
- query = map({
459
- NextToken: [, input.NextToken],
460
- MaxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
461
- OperatingAddressCountryCodeFilter: [
462
- function () { return input.OperatingAddressCountryCodeFilter !== void 0; },
463
- function () { return (input.OperatingAddressCountryCodeFilter || []).map(function (_entry) { return _entry; }); },
464
- ],
465
- OperatingAddressStateOrRegionFilter: [
466
- function () { return input.OperatingAddressStateOrRegionFilter !== void 0; },
467
- function () { return (input.OperatingAddressStateOrRegionFilter || []).map(function (_entry) { return _entry; }); },
468
- ],
469
- OperatingAddressCityFilter: [
470
- function () { return input.OperatingAddressCityFilter !== void 0; },
471
- function () { return (input.OperatingAddressCityFilter || []).map(function (_entry) { return _entry; }); },
472
- ],
473
- });
474
- return [2, new __HttpRequest({
475
- protocol: protocol,
476
- hostname: hostname,
477
- port: port,
478
- method: "GET",
479
- headers: headers,
480
- path: resolvedPath,
481
- query: query,
482
- body: body,
483
- })];
484
- }
485
- });
486
- }); };
487
- export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
488
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
489
- return __generator(this, function (_c) {
490
- switch (_c.label) {
491
- case 0: return [4, context.endpoint()];
492
- case 1:
493
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
494
- headers = {};
495
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
496
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
497
- return [2, new __HttpRequest({
498
- protocol: protocol,
499
- hostname: hostname,
500
- port: port,
501
- method: "GET",
502
- headers: headers,
503
- path: resolvedPath,
504
- body: body,
505
- })];
506
- }
507
- });
508
- }); };
509
- export var serializeAws_restJson1StartConnectionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
510
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
511
- return __generator(this, function (_c) {
512
- switch (_c.label) {
513
- case 0: return [4, context.endpoint()];
514
- case 1:
515
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
516
- headers = {
517
- "content-type": "application/json",
518
- };
519
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/connections";
520
- body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.AssetId != null && { AssetId: input.AssetId })), (input.ClientPublicKey != null && { ClientPublicKey: input.ClientPublicKey })), (input.DeviceSerialNumber != null && { DeviceSerialNumber: input.DeviceSerialNumber })), (input.NetworkInterfaceDeviceIndex != null && {
521
- NetworkInterfaceDeviceIndex: input.NetworkInterfaceDeviceIndex,
522
- })));
523
- return [2, new __HttpRequest({
524
- protocol: protocol,
525
- hostname: hostname,
526
- port: port,
527
- method: "POST",
528
- headers: headers,
529
- path: resolvedPath,
530
- body: body,
531
- })];
532
- }
533
- });
534
- }); };
535
- export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
536
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
537
- return __generator(this, function (_c) {
538
- switch (_c.label) {
539
- case 0: return [4, context.endpoint()];
540
- case 1:
541
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
542
- headers = {
543
- "content-type": "application/json",
544
- };
545
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
546
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
547
- body = JSON.stringify(__assign({}, (input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
548
- return [2, new __HttpRequest({
549
- protocol: protocol,
550
- hostname: hostname,
551
- port: port,
552
- method: "POST",
553
- headers: headers,
554
- path: resolvedPath,
555
- body: body,
556
- })];
557
- }
558
- });
559
- }); };
560
- export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
561
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
562
- return __generator(this, function (_c) {
563
- switch (_c.label) {
564
- case 0: return [4, context.endpoint()];
565
- case 1:
566
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
567
- headers = {};
568
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
569
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
570
- query = map({
571
- tagKeys: [function () { return input.TagKeys !== void 0; }, function () { return (input.TagKeys || []).map(function (_entry) { return _entry; }); }],
572
- });
573
- return [2, new __HttpRequest({
574
- protocol: protocol,
575
- hostname: hostname,
576
- port: port,
577
- method: "DELETE",
578
- headers: headers,
579
- path: resolvedPath,
580
- query: query,
581
- body: body,
582
- })];
583
- }
5
+ export const serializeAws_restJson1CancelOrderCommand = async (input, context) => {
6
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const headers = {};
8
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/orders/{OrderId}/cancel";
9
+ resolvedPath = __resolvedPath(resolvedPath, input, "OrderId", () => input.OrderId, "{OrderId}", false);
10
+ let body;
11
+ return new __HttpRequest({
12
+ protocol,
13
+ hostname,
14
+ port,
15
+ method: "POST",
16
+ headers,
17
+ path: resolvedPath,
18
+ body,
584
19
  });
585
- }); };
586
- export var serializeAws_restJson1UpdateOutpostCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
587
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
588
- return __generator(this, function (_c) {
589
- switch (_c.label) {
590
- case 0: return [4, context.endpoint()];
591
- case 1:
592
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
593
- headers = {
594
- "content-type": "application/json",
595
- };
596
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/outposts/{OutpostId}";
597
- resolvedPath = __resolvedPath(resolvedPath, input, "OutpostId", function () { return input.OutpostId; }, "{OutpostId}", false);
598
- body = JSON.stringify(__assign(__assign(__assign({}, (input.Description != null && { Description: input.Description })), (input.Name != null && { Name: input.Name })), (input.SupportedHardwareType != null && { SupportedHardwareType: input.SupportedHardwareType })));
599
- return [2, new __HttpRequest({
600
- protocol: protocol,
601
- hostname: hostname,
602
- port: port,
603
- method: "PATCH",
604
- headers: headers,
605
- path: resolvedPath,
606
- body: body,
607
- })];
608
- }
20
+ };
21
+ export const serializeAws_restJson1CreateOrderCommand = async (input, context) => {
22
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
23
+ const headers = {
24
+ "content-type": "application/json",
25
+ };
26
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/orders";
27
+ let body;
28
+ body = JSON.stringify({
29
+ ...(input.LineItems != null && {
30
+ LineItems: serializeAws_restJson1LineItemRequestListDefinition(input.LineItems, context),
31
+ }),
32
+ ...(input.OutpostIdentifier != null && { OutpostIdentifier: input.OutpostIdentifier }),
33
+ ...(input.PaymentOption != null && { PaymentOption: input.PaymentOption }),
34
+ ...(input.PaymentTerm != null && { PaymentTerm: input.PaymentTerm }),
35
+ });
36
+ return new __HttpRequest({
37
+ protocol,
38
+ hostname,
39
+ port,
40
+ method: "POST",
41
+ headers,
42
+ path: resolvedPath,
43
+ body,
609
44
  });
610
- }); };
611
- export var serializeAws_restJson1UpdateSiteCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
612
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
613
- return __generator(this, function (_c) {
614
- switch (_c.label) {
615
- case 0: return [4, context.endpoint()];
616
- case 1:
617
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
618
- headers = {
619
- "content-type": "application/json",
620
- };
621
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/sites/{SiteId}";
622
- resolvedPath = __resolvedPath(resolvedPath, input, "SiteId", function () { return input.SiteId; }, "{SiteId}", false);
623
- body = JSON.stringify(__assign(__assign(__assign({}, (input.Description != null && { Description: input.Description })), (input.Name != null && { Name: input.Name })), (input.Notes != null && { Notes: input.Notes })));
624
- return [2, new __HttpRequest({
625
- protocol: protocol,
626
- hostname: hostname,
627
- port: port,
628
- method: "PATCH",
629
- headers: headers,
630
- path: resolvedPath,
631
- body: body,
632
- })];
633
- }
45
+ };
46
+ export const serializeAws_restJson1CreateOutpostCommand = async (input, context) => {
47
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
48
+ const headers = {
49
+ "content-type": "application/json",
50
+ };
51
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/outposts";
52
+ let body;
53
+ body = JSON.stringify({
54
+ ...(input.AvailabilityZone != null && { AvailabilityZone: input.AvailabilityZone }),
55
+ ...(input.AvailabilityZoneId != null && { AvailabilityZoneId: input.AvailabilityZoneId }),
56
+ ...(input.Description != null && { Description: input.Description }),
57
+ ...(input.Name != null && { Name: input.Name }),
58
+ ...(input.SiteId != null && { SiteId: input.SiteId }),
59
+ ...(input.SupportedHardwareType != null && { SupportedHardwareType: input.SupportedHardwareType }),
60
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
61
+ });
62
+ return new __HttpRequest({
63
+ protocol,
64
+ hostname,
65
+ port,
66
+ method: "POST",
67
+ headers,
68
+ path: resolvedPath,
69
+ body,
634
70
  });
635
- }); };
636
- export var serializeAws_restJson1UpdateSiteAddressCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
637
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
638
- return __generator(this, function (_c) {
639
- switch (_c.label) {
640
- case 0: return [4, context.endpoint()];
641
- case 1:
642
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
643
- headers = {
644
- "content-type": "application/json",
645
- };
646
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/sites/{SiteId}/address";
647
- resolvedPath = __resolvedPath(resolvedPath, input, "SiteId", function () { return input.SiteId; }, "{SiteId}", false);
648
- body = JSON.stringify(__assign(__assign({}, (input.Address != null && { Address: serializeAws_restJson1Address(input.Address, context) })), (input.AddressType != null && { AddressType: input.AddressType })));
649
- return [2, new __HttpRequest({
650
- protocol: protocol,
651
- hostname: hostname,
652
- port: port,
653
- method: "PUT",
654
- headers: headers,
655
- path: resolvedPath,
656
- body: body,
657
- })];
658
- }
71
+ };
72
+ export const serializeAws_restJson1CreateSiteCommand = async (input, context) => {
73
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
74
+ const headers = {
75
+ "content-type": "application/json",
76
+ };
77
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/sites";
78
+ let body;
79
+ body = JSON.stringify({
80
+ ...(input.Description != null && { Description: input.Description }),
81
+ ...(input.Name != null && { Name: input.Name }),
82
+ ...(input.Notes != null && { Notes: input.Notes }),
83
+ ...(input.OperatingAddress != null && {
84
+ OperatingAddress: serializeAws_restJson1Address(input.OperatingAddress, context),
85
+ }),
86
+ ...(input.RackPhysicalProperties != null && {
87
+ RackPhysicalProperties: serializeAws_restJson1RackPhysicalProperties(input.RackPhysicalProperties, context),
88
+ }),
89
+ ...(input.ShippingAddress != null && {
90
+ ShippingAddress: serializeAws_restJson1Address(input.ShippingAddress, context),
91
+ }),
92
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
93
+ });
94
+ return new __HttpRequest({
95
+ protocol,
96
+ hostname,
97
+ port,
98
+ method: "POST",
99
+ headers,
100
+ path: resolvedPath,
101
+ body,
659
102
  });
660
- }); };
661
- export var serializeAws_restJson1UpdateSiteRackPhysicalPropertiesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
662
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
663
- return __generator(this, function (_c) {
664
- switch (_c.label) {
665
- case 0: return [4, context.endpoint()];
666
- case 1:
667
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
668
- headers = {
669
- "content-type": "application/json",
670
- };
671
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/sites/{SiteId}/rackPhysicalProperties";
672
- resolvedPath = __resolvedPath(resolvedPath, input, "SiteId", function () { return input.SiteId; }, "{SiteId}", false);
673
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.FiberOpticCableType != null && { FiberOpticCableType: input.FiberOpticCableType })), (input.MaximumSupportedWeightLbs != null && { MaximumSupportedWeightLbs: input.MaximumSupportedWeightLbs })), (input.OpticalStandard != null && { OpticalStandard: input.OpticalStandard })), (input.PowerConnector != null && { PowerConnector: input.PowerConnector })), (input.PowerDrawKva != null && { PowerDrawKva: input.PowerDrawKva })), (input.PowerFeedDrop != null && { PowerFeedDrop: input.PowerFeedDrop })), (input.PowerPhase != null && { PowerPhase: input.PowerPhase })), (input.UplinkCount != null && { UplinkCount: input.UplinkCount })), (input.UplinkGbps != null && { UplinkGbps: input.UplinkGbps })));
674
- return [2, new __HttpRequest({
675
- protocol: protocol,
676
- hostname: hostname,
677
- port: port,
678
- method: "PATCH",
679
- headers: headers,
680
- path: resolvedPath,
681
- body: body,
682
- })];
683
- }
103
+ };
104
+ export const serializeAws_restJson1DeleteOutpostCommand = async (input, context) => {
105
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
106
+ const headers = {};
107
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/outposts/{OutpostId}";
108
+ resolvedPath = __resolvedPath(resolvedPath, input, "OutpostId", () => input.OutpostId, "{OutpostId}", false);
109
+ let body;
110
+ return new __HttpRequest({
111
+ protocol,
112
+ hostname,
113
+ port,
114
+ method: "DELETE",
115
+ headers,
116
+ path: resolvedPath,
117
+ body,
684
118
  });
685
- }); };
686
- export var deserializeAws_restJson1CancelOrderCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
687
- var contents;
688
- return __generator(this, function (_a) {
689
- switch (_a.label) {
690
- case 0:
691
- if (output.statusCode !== 200 && output.statusCode >= 300) {
692
- return [2, deserializeAws_restJson1CancelOrderCommandError(output, context)];
693
- }
694
- contents = map({
695
- $metadata: deserializeMetadata(output),
696
- });
697
- return [4, collectBody(output.body, context)];
698
- case 1:
699
- _a.sent();
700
- return [2, contents];
701
- }
119
+ };
120
+ export const serializeAws_restJson1DeleteSiteCommand = async (input, context) => {
121
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
122
+ const headers = {};
123
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/sites/{SiteId}";
124
+ resolvedPath = __resolvedPath(resolvedPath, input, "SiteId", () => input.SiteId, "{SiteId}", false);
125
+ let body;
126
+ return new __HttpRequest({
127
+ protocol,
128
+ hostname,
129
+ port,
130
+ method: "DELETE",
131
+ headers,
132
+ path: resolvedPath,
133
+ body,
702
134
  });
703
- }); };
704
- var deserializeAws_restJson1CancelOrderCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
705
- var parsedOutput, _a, errorCode, _b, parsedBody;
706
- var _c;
707
- return __generator(this, function (_d) {
708
- switch (_d.label) {
709
- case 0:
710
- _a = [__assign({}, output)];
711
- _c = {};
712
- return [4, parseErrorBody(output.body, context)];
713
- case 1:
714
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
715
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
716
- _b = errorCode;
717
- switch (_b) {
718
- case "AccessDeniedException": return [3, 2];
719
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
720
- case "ConflictException": return [3, 4];
721
- case "com.amazonaws.outposts#ConflictException": return [3, 4];
722
- case "InternalServerException": return [3, 6];
723
- case "com.amazonaws.outposts#InternalServerException": return [3, 6];
724
- case "NotFoundException": return [3, 8];
725
- case "com.amazonaws.outposts#NotFoundException": return [3, 8];
726
- case "ValidationException": return [3, 10];
727
- case "com.amazonaws.outposts#ValidationException": return [3, 10];
728
- }
729
- return [3, 12];
730
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
731
- case 3: throw _d.sent();
732
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
733
- case 5: throw _d.sent();
734
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
735
- case 7: throw _d.sent();
736
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
737
- case 9: throw _d.sent();
738
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
739
- case 11: throw _d.sent();
740
- case 12:
741
- parsedBody = parsedOutput.body;
742
- throwDefaultError({
743
- output: output,
744
- parsedBody: parsedBody,
745
- exceptionCtor: __BaseException,
746
- errorCode: errorCode,
747
- });
748
- _d.label = 13;
749
- case 13: return [2];
750
- }
135
+ };
136
+ export const serializeAws_restJson1GetCatalogItemCommand = async (input, context) => {
137
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
138
+ const headers = {};
139
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/catalog/item/{CatalogItemId}";
140
+ resolvedPath = __resolvedPath(resolvedPath, input, "CatalogItemId", () => input.CatalogItemId, "{CatalogItemId}", false);
141
+ let body;
142
+ return new __HttpRequest({
143
+ protocol,
144
+ hostname,
145
+ port,
146
+ method: "GET",
147
+ headers,
148
+ path: resolvedPath,
149
+ body,
751
150
  });
752
- }); };
753
- export var deserializeAws_restJson1CreateOrderCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
754
- var contents, data, _a, _b;
755
- return __generator(this, function (_c) {
756
- switch (_c.label) {
757
- case 0:
758
- if (output.statusCode !== 200 && output.statusCode >= 300) {
759
- return [2, deserializeAws_restJson1CreateOrderCommandError(output, context)];
760
- }
761
- contents = map({
762
- $metadata: deserializeMetadata(output),
763
- });
764
- _a = __expectNonNull;
765
- _b = __expectObject;
766
- return [4, parseBody(output.body, context)];
767
- case 1:
768
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
769
- if (data.Order != null) {
770
- contents.Order = deserializeAws_restJson1Order(data.Order, context);
771
- }
772
- return [2, contents];
773
- }
151
+ };
152
+ export const serializeAws_restJson1GetConnectionCommand = async (input, context) => {
153
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
154
+ const headers = {};
155
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/connections/{ConnectionId}";
156
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConnectionId", () => input.ConnectionId, "{ConnectionId}", false);
157
+ let body;
158
+ return new __HttpRequest({
159
+ protocol,
160
+ hostname,
161
+ port,
162
+ method: "GET",
163
+ headers,
164
+ path: resolvedPath,
165
+ body,
774
166
  });
775
- }); };
776
- var deserializeAws_restJson1CreateOrderCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
777
- var parsedOutput, _a, errorCode, _b, parsedBody;
778
- var _c;
779
- return __generator(this, function (_d) {
780
- switch (_d.label) {
781
- case 0:
782
- _a = [__assign({}, output)];
783
- _c = {};
784
- return [4, parseErrorBody(output.body, context)];
785
- case 1:
786
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
787
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
788
- _b = errorCode;
789
- switch (_b) {
790
- case "AccessDeniedException": return [3, 2];
791
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
792
- case "ConflictException": return [3, 4];
793
- case "com.amazonaws.outposts#ConflictException": return [3, 4];
794
- case "InternalServerException": return [3, 6];
795
- case "com.amazonaws.outposts#InternalServerException": return [3, 6];
796
- case "NotFoundException": return [3, 8];
797
- case "com.amazonaws.outposts#NotFoundException": return [3, 8];
798
- case "ServiceQuotaExceededException": return [3, 10];
799
- case "com.amazonaws.outposts#ServiceQuotaExceededException": return [3, 10];
800
- case "ValidationException": return [3, 12];
801
- case "com.amazonaws.outposts#ValidationException": return [3, 12];
802
- }
803
- return [3, 14];
804
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
805
- case 3: throw _d.sent();
806
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
807
- case 5: throw _d.sent();
808
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
809
- case 7: throw _d.sent();
810
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
811
- case 9: throw _d.sent();
812
- case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
813
- case 11: throw _d.sent();
814
- case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
815
- case 13: throw _d.sent();
816
- case 14:
817
- parsedBody = parsedOutput.body;
818
- throwDefaultError({
819
- output: output,
820
- parsedBody: parsedBody,
821
- exceptionCtor: __BaseException,
822
- errorCode: errorCode,
823
- });
824
- _d.label = 15;
825
- case 15: return [2];
826
- }
167
+ };
168
+ export const serializeAws_restJson1GetOrderCommand = async (input, context) => {
169
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
170
+ const headers = {};
171
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/orders/{OrderId}";
172
+ resolvedPath = __resolvedPath(resolvedPath, input, "OrderId", () => input.OrderId, "{OrderId}", false);
173
+ let body;
174
+ return new __HttpRequest({
175
+ protocol,
176
+ hostname,
177
+ port,
178
+ method: "GET",
179
+ headers,
180
+ path: resolvedPath,
181
+ body,
827
182
  });
828
- }); };
829
- export var deserializeAws_restJson1CreateOutpostCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
830
- var contents, data, _a, _b;
831
- return __generator(this, function (_c) {
832
- switch (_c.label) {
833
- case 0:
834
- if (output.statusCode !== 200 && output.statusCode >= 300) {
835
- return [2, deserializeAws_restJson1CreateOutpostCommandError(output, context)];
836
- }
837
- contents = map({
838
- $metadata: deserializeMetadata(output),
839
- });
840
- _a = __expectNonNull;
841
- _b = __expectObject;
842
- return [4, parseBody(output.body, context)];
843
- case 1:
844
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
845
- if (data.Outpost != null) {
846
- contents.Outpost = deserializeAws_restJson1Outpost(data.Outpost, context);
847
- }
848
- return [2, contents];
849
- }
183
+ };
184
+ export const serializeAws_restJson1GetOutpostCommand = async (input, context) => {
185
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
186
+ const headers = {};
187
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/outposts/{OutpostId}";
188
+ resolvedPath = __resolvedPath(resolvedPath, input, "OutpostId", () => input.OutpostId, "{OutpostId}", false);
189
+ let body;
190
+ return new __HttpRequest({
191
+ protocol,
192
+ hostname,
193
+ port,
194
+ method: "GET",
195
+ headers,
196
+ path: resolvedPath,
197
+ body,
850
198
  });
851
- }); };
852
- var deserializeAws_restJson1CreateOutpostCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
853
- var parsedOutput, _a, errorCode, _b, parsedBody;
854
- var _c;
855
- return __generator(this, function (_d) {
856
- switch (_d.label) {
857
- case 0:
858
- _a = [__assign({}, output)];
859
- _c = {};
860
- return [4, parseErrorBody(output.body, context)];
861
- case 1:
862
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
863
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
864
- _b = errorCode;
865
- switch (_b) {
866
- case "AccessDeniedException": return [3, 2];
867
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
868
- case "ConflictException": return [3, 4];
869
- case "com.amazonaws.outposts#ConflictException": return [3, 4];
870
- case "InternalServerException": return [3, 6];
871
- case "com.amazonaws.outposts#InternalServerException": return [3, 6];
872
- case "NotFoundException": return [3, 8];
873
- case "com.amazonaws.outposts#NotFoundException": return [3, 8];
874
- case "ServiceQuotaExceededException": return [3, 10];
875
- case "com.amazonaws.outposts#ServiceQuotaExceededException": return [3, 10];
876
- case "ValidationException": return [3, 12];
877
- case "com.amazonaws.outposts#ValidationException": return [3, 12];
878
- }
879
- return [3, 14];
880
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
881
- case 3: throw _d.sent();
882
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
883
- case 5: throw _d.sent();
884
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
885
- case 7: throw _d.sent();
886
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
887
- case 9: throw _d.sent();
888
- case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
889
- case 11: throw _d.sent();
890
- case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
891
- case 13: throw _d.sent();
892
- case 14:
893
- parsedBody = parsedOutput.body;
894
- throwDefaultError({
895
- output: output,
896
- parsedBody: parsedBody,
897
- exceptionCtor: __BaseException,
898
- errorCode: errorCode,
899
- });
900
- _d.label = 15;
901
- case 15: return [2];
902
- }
199
+ };
200
+ export const serializeAws_restJson1GetOutpostInstanceTypesCommand = async (input, context) => {
201
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
202
+ const headers = {};
203
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/outposts/{OutpostId}/instanceTypes";
204
+ resolvedPath = __resolvedPath(resolvedPath, input, "OutpostId", () => input.OutpostId, "{OutpostId}", false);
205
+ const query = map({
206
+ NextToken: [, input.NextToken],
207
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
208
+ });
209
+ let body;
210
+ return new __HttpRequest({
211
+ protocol,
212
+ hostname,
213
+ port,
214
+ method: "GET",
215
+ headers,
216
+ path: resolvedPath,
217
+ query,
218
+ body,
903
219
  });
904
- }); };
905
- export var deserializeAws_restJson1CreateSiteCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
906
- var contents, data, _a, _b;
907
- return __generator(this, function (_c) {
908
- switch (_c.label) {
909
- case 0:
910
- if (output.statusCode !== 200 && output.statusCode >= 300) {
911
- return [2, deserializeAws_restJson1CreateSiteCommandError(output, context)];
912
- }
913
- contents = map({
914
- $metadata: deserializeMetadata(output),
915
- });
916
- _a = __expectNonNull;
917
- _b = __expectObject;
918
- return [4, parseBody(output.body, context)];
919
- case 1:
920
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
921
- if (data.Site != null) {
922
- contents.Site = deserializeAws_restJson1Site(data.Site, context);
923
- }
924
- return [2, contents];
925
- }
220
+ };
221
+ export const serializeAws_restJson1GetSiteCommand = async (input, context) => {
222
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
223
+ const headers = {};
224
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/sites/{SiteId}";
225
+ resolvedPath = __resolvedPath(resolvedPath, input, "SiteId", () => input.SiteId, "{SiteId}", false);
226
+ let body;
227
+ return new __HttpRequest({
228
+ protocol,
229
+ hostname,
230
+ port,
231
+ method: "GET",
232
+ headers,
233
+ path: resolvedPath,
234
+ body,
926
235
  });
927
- }); };
928
- var deserializeAws_restJson1CreateSiteCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
929
- var parsedOutput, _a, errorCode, _b, parsedBody;
930
- var _c;
931
- return __generator(this, function (_d) {
932
- switch (_d.label) {
933
- case 0:
934
- _a = [__assign({}, output)];
935
- _c = {};
936
- return [4, parseErrorBody(output.body, context)];
937
- case 1:
938
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
939
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
940
- _b = errorCode;
941
- switch (_b) {
942
- case "AccessDeniedException": return [3, 2];
943
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
944
- case "ConflictException": return [3, 4];
945
- case "com.amazonaws.outposts#ConflictException": return [3, 4];
946
- case "InternalServerException": return [3, 6];
947
- case "com.amazonaws.outposts#InternalServerException": return [3, 6];
948
- case "ServiceQuotaExceededException": return [3, 8];
949
- case "com.amazonaws.outposts#ServiceQuotaExceededException": return [3, 8];
950
- case "ValidationException": return [3, 10];
951
- case "com.amazonaws.outposts#ValidationException": return [3, 10];
952
- }
953
- return [3, 12];
954
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
955
- case 3: throw _d.sent();
956
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
957
- case 5: throw _d.sent();
958
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
959
- case 7: throw _d.sent();
960
- case 8: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
961
- case 9: throw _d.sent();
962
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
963
- case 11: throw _d.sent();
964
- case 12:
965
- parsedBody = parsedOutput.body;
966
- throwDefaultError({
967
- output: output,
968
- parsedBody: parsedBody,
969
- exceptionCtor: __BaseException,
970
- errorCode: errorCode,
971
- });
972
- _d.label = 13;
973
- case 13: return [2];
974
- }
236
+ };
237
+ export const serializeAws_restJson1GetSiteAddressCommand = async (input, context) => {
238
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
239
+ const headers = {};
240
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/sites/{SiteId}/address";
241
+ resolvedPath = __resolvedPath(resolvedPath, input, "SiteId", () => input.SiteId, "{SiteId}", false);
242
+ const query = map({
243
+ AddressType: [, input.AddressType],
244
+ });
245
+ let body;
246
+ return new __HttpRequest({
247
+ protocol,
248
+ hostname,
249
+ port,
250
+ method: "GET",
251
+ headers,
252
+ path: resolvedPath,
253
+ query,
254
+ body,
975
255
  });
976
- }); };
977
- export var deserializeAws_restJson1DeleteOutpostCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
978
- var contents;
979
- return __generator(this, function (_a) {
980
- switch (_a.label) {
981
- case 0:
982
- if (output.statusCode !== 200 && output.statusCode >= 300) {
983
- return [2, deserializeAws_restJson1DeleteOutpostCommandError(output, context)];
984
- }
985
- contents = map({
986
- $metadata: deserializeMetadata(output),
987
- });
988
- return [4, collectBody(output.body, context)];
989
- case 1:
990
- _a.sent();
991
- return [2, contents];
992
- }
256
+ };
257
+ export const serializeAws_restJson1ListAssetsCommand = async (input, context) => {
258
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
259
+ const headers = {};
260
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/outposts/{OutpostIdentifier}/assets";
261
+ resolvedPath = __resolvedPath(resolvedPath, input, "OutpostIdentifier", () => input.OutpostIdentifier, "{OutpostIdentifier}", false);
262
+ const query = map({
263
+ HostIdFilter: [
264
+ () => input.HostIdFilter !== void 0,
265
+ () => (input.HostIdFilter || []).map((_entry) => _entry),
266
+ ],
267
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
268
+ NextToken: [, input.NextToken],
269
+ });
270
+ let body;
271
+ return new __HttpRequest({
272
+ protocol,
273
+ hostname,
274
+ port,
275
+ method: "GET",
276
+ headers,
277
+ path: resolvedPath,
278
+ query,
279
+ body,
993
280
  });
994
- }); };
995
- var deserializeAws_restJson1DeleteOutpostCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
996
- var parsedOutput, _a, errorCode, _b, parsedBody;
997
- var _c;
998
- return __generator(this, function (_d) {
999
- switch (_d.label) {
1000
- case 0:
1001
- _a = [__assign({}, output)];
1002
- _c = {};
1003
- return [4, parseErrorBody(output.body, context)];
1004
- case 1:
1005
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1006
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1007
- _b = errorCode;
1008
- switch (_b) {
1009
- case "AccessDeniedException": return [3, 2];
1010
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
1011
- case "ConflictException": return [3, 4];
1012
- case "com.amazonaws.outposts#ConflictException": return [3, 4];
1013
- case "InternalServerException": return [3, 6];
1014
- case "com.amazonaws.outposts#InternalServerException": return [3, 6];
1015
- case "NotFoundException": return [3, 8];
1016
- case "com.amazonaws.outposts#NotFoundException": return [3, 8];
1017
- case "ValidationException": return [3, 10];
1018
- case "com.amazonaws.outposts#ValidationException": return [3, 10];
1019
- }
1020
- return [3, 12];
1021
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1022
- case 3: throw _d.sent();
1023
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1024
- case 5: throw _d.sent();
1025
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1026
- case 7: throw _d.sent();
1027
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1028
- case 9: throw _d.sent();
1029
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1030
- case 11: throw _d.sent();
1031
- case 12:
1032
- parsedBody = parsedOutput.body;
1033
- throwDefaultError({
1034
- output: output,
1035
- parsedBody: parsedBody,
1036
- exceptionCtor: __BaseException,
1037
- errorCode: errorCode,
1038
- });
1039
- _d.label = 13;
1040
- case 13: return [2];
1041
- }
281
+ };
282
+ export const serializeAws_restJson1ListCatalogItemsCommand = async (input, context) => {
283
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
284
+ const headers = {};
285
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/catalog/items";
286
+ const query = map({
287
+ NextToken: [, input.NextToken],
288
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
289
+ ItemClassFilter: [
290
+ () => input.ItemClassFilter !== void 0,
291
+ () => (input.ItemClassFilter || []).map((_entry) => _entry),
292
+ ],
293
+ SupportedStorageFilter: [
294
+ () => input.SupportedStorageFilter !== void 0,
295
+ () => (input.SupportedStorageFilter || []).map((_entry) => _entry),
296
+ ],
297
+ EC2FamilyFilter: [
298
+ () => input.EC2FamilyFilter !== void 0,
299
+ () => (input.EC2FamilyFilter || []).map((_entry) => _entry),
300
+ ],
301
+ });
302
+ let body;
303
+ return new __HttpRequest({
304
+ protocol,
305
+ hostname,
306
+ port,
307
+ method: "GET",
308
+ headers,
309
+ path: resolvedPath,
310
+ query,
311
+ body,
1042
312
  });
1043
- }); };
1044
- export var deserializeAws_restJson1DeleteSiteCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1045
- var contents;
1046
- return __generator(this, function (_a) {
1047
- switch (_a.label) {
1048
- case 0:
1049
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1050
- return [2, deserializeAws_restJson1DeleteSiteCommandError(output, context)];
1051
- }
1052
- contents = map({
1053
- $metadata: deserializeMetadata(output),
1054
- });
1055
- return [4, collectBody(output.body, context)];
1056
- case 1:
1057
- _a.sent();
1058
- return [2, contents];
1059
- }
313
+ };
314
+ export const serializeAws_restJson1ListOrdersCommand = async (input, context) => {
315
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
316
+ const headers = {};
317
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/list-orders";
318
+ const query = map({
319
+ OutpostIdentifierFilter: [, input.OutpostIdentifierFilter],
320
+ NextToken: [, input.NextToken],
321
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
322
+ });
323
+ let body;
324
+ return new __HttpRequest({
325
+ protocol,
326
+ hostname,
327
+ port,
328
+ method: "GET",
329
+ headers,
330
+ path: resolvedPath,
331
+ query,
332
+ body,
1060
333
  });
1061
- }); };
1062
- var deserializeAws_restJson1DeleteSiteCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1063
- var parsedOutput, _a, errorCode, _b, parsedBody;
1064
- var _c;
1065
- return __generator(this, function (_d) {
1066
- switch (_d.label) {
1067
- case 0:
1068
- _a = [__assign({}, output)];
1069
- _c = {};
1070
- return [4, parseErrorBody(output.body, context)];
1071
- case 1:
1072
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1073
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1074
- _b = errorCode;
1075
- switch (_b) {
1076
- case "AccessDeniedException": return [3, 2];
1077
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
1078
- case "ConflictException": return [3, 4];
1079
- case "com.amazonaws.outposts#ConflictException": return [3, 4];
1080
- case "InternalServerException": return [3, 6];
1081
- case "com.amazonaws.outposts#InternalServerException": return [3, 6];
1082
- case "NotFoundException": return [3, 8];
1083
- case "com.amazonaws.outposts#NotFoundException": return [3, 8];
1084
- case "ValidationException": return [3, 10];
1085
- case "com.amazonaws.outposts#ValidationException": return [3, 10];
1086
- }
1087
- return [3, 12];
1088
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1089
- case 3: throw _d.sent();
1090
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1091
- case 5: throw _d.sent();
1092
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1093
- case 7: throw _d.sent();
1094
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1095
- case 9: throw _d.sent();
1096
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1097
- case 11: throw _d.sent();
1098
- case 12:
1099
- parsedBody = parsedOutput.body;
1100
- throwDefaultError({
1101
- output: output,
1102
- parsedBody: parsedBody,
1103
- exceptionCtor: __BaseException,
1104
- errorCode: errorCode,
1105
- });
1106
- _d.label = 13;
1107
- case 13: return [2];
1108
- }
334
+ };
335
+ export const serializeAws_restJson1ListOutpostsCommand = async (input, context) => {
336
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
337
+ const headers = {};
338
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/outposts";
339
+ const query = map({
340
+ NextToken: [, input.NextToken],
341
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
342
+ LifeCycleStatusFilter: [
343
+ () => input.LifeCycleStatusFilter !== void 0,
344
+ () => (input.LifeCycleStatusFilter || []).map((_entry) => _entry),
345
+ ],
346
+ AvailabilityZoneFilter: [
347
+ () => input.AvailabilityZoneFilter !== void 0,
348
+ () => (input.AvailabilityZoneFilter || []).map((_entry) => _entry),
349
+ ],
350
+ AvailabilityZoneIdFilter: [
351
+ () => input.AvailabilityZoneIdFilter !== void 0,
352
+ () => (input.AvailabilityZoneIdFilter || []).map((_entry) => _entry),
353
+ ],
354
+ });
355
+ let body;
356
+ return new __HttpRequest({
357
+ protocol,
358
+ hostname,
359
+ port,
360
+ method: "GET",
361
+ headers,
362
+ path: resolvedPath,
363
+ query,
364
+ body,
1109
365
  });
1110
- }); };
1111
- export var deserializeAws_restJson1GetCatalogItemCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1112
- var contents, data, _a, _b;
1113
- return __generator(this, function (_c) {
1114
- switch (_c.label) {
1115
- case 0:
1116
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1117
- return [2, deserializeAws_restJson1GetCatalogItemCommandError(output, context)];
1118
- }
1119
- contents = map({
1120
- $metadata: deserializeMetadata(output),
1121
- });
1122
- _a = __expectNonNull;
1123
- _b = __expectObject;
1124
- return [4, parseBody(output.body, context)];
1125
- case 1:
1126
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1127
- if (data.CatalogItem != null) {
1128
- contents.CatalogItem = deserializeAws_restJson1CatalogItem(data.CatalogItem, context);
1129
- }
1130
- return [2, contents];
1131
- }
366
+ };
367
+ export const serializeAws_restJson1ListSitesCommand = async (input, context) => {
368
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
369
+ const headers = {};
370
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/sites";
371
+ const query = map({
372
+ NextToken: [, input.NextToken],
373
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
374
+ OperatingAddressCountryCodeFilter: [
375
+ () => input.OperatingAddressCountryCodeFilter !== void 0,
376
+ () => (input.OperatingAddressCountryCodeFilter || []).map((_entry) => _entry),
377
+ ],
378
+ OperatingAddressStateOrRegionFilter: [
379
+ () => input.OperatingAddressStateOrRegionFilter !== void 0,
380
+ () => (input.OperatingAddressStateOrRegionFilter || []).map((_entry) => _entry),
381
+ ],
382
+ OperatingAddressCityFilter: [
383
+ () => input.OperatingAddressCityFilter !== void 0,
384
+ () => (input.OperatingAddressCityFilter || []).map((_entry) => _entry),
385
+ ],
386
+ });
387
+ let body;
388
+ return new __HttpRequest({
389
+ protocol,
390
+ hostname,
391
+ port,
392
+ method: "GET",
393
+ headers,
394
+ path: resolvedPath,
395
+ query,
396
+ body,
1132
397
  });
1133
- }); };
1134
- var deserializeAws_restJson1GetCatalogItemCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1135
- var parsedOutput, _a, errorCode, _b, parsedBody;
1136
- var _c;
1137
- return __generator(this, function (_d) {
1138
- switch (_d.label) {
1139
- case 0:
1140
- _a = [__assign({}, output)];
1141
- _c = {};
1142
- return [4, parseErrorBody(output.body, context)];
1143
- case 1:
1144
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1145
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1146
- _b = errorCode;
1147
- switch (_b) {
1148
- case "InternalServerException": return [3, 2];
1149
- case "com.amazonaws.outposts#InternalServerException": return [3, 2];
1150
- case "NotFoundException": return [3, 4];
1151
- case "com.amazonaws.outposts#NotFoundException": return [3, 4];
1152
- case "ValidationException": return [3, 6];
1153
- case "com.amazonaws.outposts#ValidationException": return [3, 6];
1154
- }
1155
- return [3, 8];
1156
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1157
- case 3: throw _d.sent();
1158
- case 4: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1159
- case 5: throw _d.sent();
1160
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1161
- case 7: throw _d.sent();
1162
- case 8:
1163
- parsedBody = parsedOutput.body;
1164
- throwDefaultError({
1165
- output: output,
1166
- parsedBody: parsedBody,
1167
- exceptionCtor: __BaseException,
1168
- errorCode: errorCode,
1169
- });
1170
- _d.label = 9;
1171
- case 9: return [2];
1172
- }
398
+ };
399
+ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
400
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
401
+ const headers = {};
402
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
403
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
404
+ let body;
405
+ return new __HttpRequest({
406
+ protocol,
407
+ hostname,
408
+ port,
409
+ method: "GET",
410
+ headers,
411
+ path: resolvedPath,
412
+ body,
1173
413
  });
1174
- }); };
1175
- export var deserializeAws_restJson1GetConnectionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1176
- var contents, data, _a, _b;
1177
- return __generator(this, function (_c) {
1178
- switch (_c.label) {
1179
- case 0:
1180
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1181
- return [2, deserializeAws_restJson1GetConnectionCommandError(output, context)];
1182
- }
1183
- contents = map({
1184
- $metadata: deserializeMetadata(output),
1185
- });
1186
- _a = __expectNonNull;
1187
- _b = __expectObject;
1188
- return [4, parseBody(output.body, context)];
1189
- case 1:
1190
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1191
- if (data.ConnectionDetails != null) {
1192
- contents.ConnectionDetails = deserializeAws_restJson1ConnectionDetails(data.ConnectionDetails, context);
1193
- }
1194
- if (data.ConnectionId != null) {
1195
- contents.ConnectionId = __expectString(data.ConnectionId);
1196
- }
1197
- return [2, contents];
1198
- }
414
+ };
415
+ export const serializeAws_restJson1StartConnectionCommand = async (input, context) => {
416
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
417
+ const headers = {
418
+ "content-type": "application/json",
419
+ };
420
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/connections";
421
+ let body;
422
+ body = JSON.stringify({
423
+ ...(input.AssetId != null && { AssetId: input.AssetId }),
424
+ ...(input.ClientPublicKey != null && { ClientPublicKey: input.ClientPublicKey }),
425
+ ...(input.DeviceSerialNumber != null && { DeviceSerialNumber: input.DeviceSerialNumber }),
426
+ ...(input.NetworkInterfaceDeviceIndex != null && {
427
+ NetworkInterfaceDeviceIndex: input.NetworkInterfaceDeviceIndex,
428
+ }),
429
+ });
430
+ return new __HttpRequest({
431
+ protocol,
432
+ hostname,
433
+ port,
434
+ method: "POST",
435
+ headers,
436
+ path: resolvedPath,
437
+ body,
1199
438
  });
1200
- }); };
1201
- var deserializeAws_restJson1GetConnectionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1202
- var parsedOutput, _a, errorCode, _b, parsedBody;
1203
- var _c;
1204
- return __generator(this, function (_d) {
1205
- switch (_d.label) {
1206
- case 0:
1207
- _a = [__assign({}, output)];
1208
- _c = {};
1209
- return [4, parseErrorBody(output.body, context)];
1210
- case 1:
1211
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1212
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1213
- _b = errorCode;
1214
- switch (_b) {
1215
- case "AccessDeniedException": return [3, 2];
1216
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
1217
- case "InternalServerException": return [3, 4];
1218
- case "com.amazonaws.outposts#InternalServerException": return [3, 4];
1219
- case "NotFoundException": return [3, 6];
1220
- case "com.amazonaws.outposts#NotFoundException": return [3, 6];
1221
- case "ValidationException": return [3, 8];
1222
- case "com.amazonaws.outposts#ValidationException": return [3, 8];
1223
- }
1224
- return [3, 10];
1225
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1226
- case 3: throw _d.sent();
1227
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1228
- case 5: throw _d.sent();
1229
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1230
- case 7: throw _d.sent();
1231
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1232
- case 9: throw _d.sent();
1233
- case 10:
1234
- parsedBody = parsedOutput.body;
1235
- throwDefaultError({
1236
- output: output,
1237
- parsedBody: parsedBody,
1238
- exceptionCtor: __BaseException,
1239
- errorCode: errorCode,
1240
- });
1241
- _d.label = 11;
1242
- case 11: return [2];
1243
- }
439
+ };
440
+ export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
441
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
442
+ const headers = {
443
+ "content-type": "application/json",
444
+ };
445
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
446
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
447
+ let body;
448
+ body = JSON.stringify({
449
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
450
+ });
451
+ return new __HttpRequest({
452
+ protocol,
453
+ hostname,
454
+ port,
455
+ method: "POST",
456
+ headers,
457
+ path: resolvedPath,
458
+ body,
1244
459
  });
1245
- }); };
1246
- export var deserializeAws_restJson1GetOrderCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1247
- var contents, data, _a, _b;
1248
- return __generator(this, function (_c) {
1249
- switch (_c.label) {
1250
- case 0:
1251
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1252
- return [2, deserializeAws_restJson1GetOrderCommandError(output, context)];
1253
- }
1254
- contents = map({
1255
- $metadata: deserializeMetadata(output),
1256
- });
1257
- _a = __expectNonNull;
1258
- _b = __expectObject;
1259
- return [4, parseBody(output.body, context)];
1260
- case 1:
1261
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1262
- if (data.Order != null) {
1263
- contents.Order = deserializeAws_restJson1Order(data.Order, context);
1264
- }
1265
- return [2, contents];
1266
- }
460
+ };
461
+ export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
462
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
463
+ const headers = {};
464
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
465
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
466
+ const query = map({
467
+ tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
468
+ });
469
+ let body;
470
+ return new __HttpRequest({
471
+ protocol,
472
+ hostname,
473
+ port,
474
+ method: "DELETE",
475
+ headers,
476
+ path: resolvedPath,
477
+ query,
478
+ body,
1267
479
  });
1268
- }); };
1269
- var deserializeAws_restJson1GetOrderCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1270
- var parsedOutput, _a, errorCode, _b, parsedBody;
1271
- var _c;
1272
- return __generator(this, function (_d) {
1273
- switch (_d.label) {
1274
- case 0:
1275
- _a = [__assign({}, output)];
1276
- _c = {};
1277
- return [4, parseErrorBody(output.body, context)];
1278
- case 1:
1279
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1280
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1281
- _b = errorCode;
1282
- switch (_b) {
1283
- case "InternalServerException": return [3, 2];
1284
- case "com.amazonaws.outposts#InternalServerException": return [3, 2];
1285
- case "NotFoundException": return [3, 4];
1286
- case "com.amazonaws.outposts#NotFoundException": return [3, 4];
1287
- case "ValidationException": return [3, 6];
1288
- case "com.amazonaws.outposts#ValidationException": return [3, 6];
1289
- }
1290
- return [3, 8];
1291
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1292
- case 3: throw _d.sent();
1293
- case 4: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1294
- case 5: throw _d.sent();
1295
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1296
- case 7: throw _d.sent();
1297
- case 8:
1298
- parsedBody = parsedOutput.body;
1299
- throwDefaultError({
1300
- output: output,
1301
- parsedBody: parsedBody,
1302
- exceptionCtor: __BaseException,
1303
- errorCode: errorCode,
1304
- });
1305
- _d.label = 9;
1306
- case 9: return [2];
1307
- }
480
+ };
481
+ export const serializeAws_restJson1UpdateOutpostCommand = async (input, context) => {
482
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
483
+ const headers = {
484
+ "content-type": "application/json",
485
+ };
486
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/outposts/{OutpostId}";
487
+ resolvedPath = __resolvedPath(resolvedPath, input, "OutpostId", () => input.OutpostId, "{OutpostId}", false);
488
+ let body;
489
+ body = JSON.stringify({
490
+ ...(input.Description != null && { Description: input.Description }),
491
+ ...(input.Name != null && { Name: input.Name }),
492
+ ...(input.SupportedHardwareType != null && { SupportedHardwareType: input.SupportedHardwareType }),
493
+ });
494
+ return new __HttpRequest({
495
+ protocol,
496
+ hostname,
497
+ port,
498
+ method: "PATCH",
499
+ headers,
500
+ path: resolvedPath,
501
+ body,
1308
502
  });
1309
- }); };
1310
- export var deserializeAws_restJson1GetOutpostCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1311
- var contents, data, _a, _b;
1312
- return __generator(this, function (_c) {
1313
- switch (_c.label) {
1314
- case 0:
1315
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1316
- return [2, deserializeAws_restJson1GetOutpostCommandError(output, context)];
1317
- }
1318
- contents = map({
1319
- $metadata: deserializeMetadata(output),
1320
- });
1321
- _a = __expectNonNull;
1322
- _b = __expectObject;
1323
- return [4, parseBody(output.body, context)];
1324
- case 1:
1325
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1326
- if (data.Outpost != null) {
1327
- contents.Outpost = deserializeAws_restJson1Outpost(data.Outpost, context);
1328
- }
1329
- return [2, contents];
1330
- }
503
+ };
504
+ export const serializeAws_restJson1UpdateSiteCommand = async (input, context) => {
505
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
506
+ const headers = {
507
+ "content-type": "application/json",
508
+ };
509
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/sites/{SiteId}";
510
+ resolvedPath = __resolvedPath(resolvedPath, input, "SiteId", () => input.SiteId, "{SiteId}", false);
511
+ let body;
512
+ body = JSON.stringify({
513
+ ...(input.Description != null && { Description: input.Description }),
514
+ ...(input.Name != null && { Name: input.Name }),
515
+ ...(input.Notes != null && { Notes: input.Notes }),
516
+ });
517
+ return new __HttpRequest({
518
+ protocol,
519
+ hostname,
520
+ port,
521
+ method: "PATCH",
522
+ headers,
523
+ path: resolvedPath,
524
+ body,
1331
525
  });
1332
- }); };
1333
- var deserializeAws_restJson1GetOutpostCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1334
- var parsedOutput, _a, errorCode, _b, parsedBody;
1335
- var _c;
1336
- return __generator(this, function (_d) {
1337
- switch (_d.label) {
1338
- case 0:
1339
- _a = [__assign({}, output)];
1340
- _c = {};
1341
- return [4, parseErrorBody(output.body, context)];
1342
- case 1:
1343
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1344
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1345
- _b = errorCode;
1346
- switch (_b) {
1347
- case "AccessDeniedException": return [3, 2];
1348
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
1349
- case "InternalServerException": return [3, 4];
1350
- case "com.amazonaws.outposts#InternalServerException": return [3, 4];
1351
- case "NotFoundException": return [3, 6];
1352
- case "com.amazonaws.outposts#NotFoundException": return [3, 6];
1353
- case "ValidationException": return [3, 8];
1354
- case "com.amazonaws.outposts#ValidationException": return [3, 8];
1355
- }
1356
- return [3, 10];
1357
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1358
- case 3: throw _d.sent();
1359
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1360
- case 5: throw _d.sent();
1361
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1362
- case 7: throw _d.sent();
1363
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1364
- case 9: throw _d.sent();
1365
- case 10:
1366
- parsedBody = parsedOutput.body;
1367
- throwDefaultError({
1368
- output: output,
1369
- parsedBody: parsedBody,
1370
- exceptionCtor: __BaseException,
1371
- errorCode: errorCode,
1372
- });
1373
- _d.label = 11;
1374
- case 11: return [2];
1375
- }
526
+ };
527
+ export const serializeAws_restJson1UpdateSiteAddressCommand = async (input, context) => {
528
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
529
+ const headers = {
530
+ "content-type": "application/json",
531
+ };
532
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/sites/{SiteId}/address";
533
+ resolvedPath = __resolvedPath(resolvedPath, input, "SiteId", () => input.SiteId, "{SiteId}", false);
534
+ let body;
535
+ body = JSON.stringify({
536
+ ...(input.Address != null && { Address: serializeAws_restJson1Address(input.Address, context) }),
537
+ ...(input.AddressType != null && { AddressType: input.AddressType }),
538
+ });
539
+ return new __HttpRequest({
540
+ protocol,
541
+ hostname,
542
+ port,
543
+ method: "PUT",
544
+ headers,
545
+ path: resolvedPath,
546
+ body,
1376
547
  });
1377
- }); };
1378
- export var deserializeAws_restJson1GetOutpostInstanceTypesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1379
- var contents, data, _a, _b;
1380
- return __generator(this, function (_c) {
1381
- switch (_c.label) {
1382
- case 0:
1383
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1384
- return [2, deserializeAws_restJson1GetOutpostInstanceTypesCommandError(output, context)];
1385
- }
1386
- contents = map({
1387
- $metadata: deserializeMetadata(output),
1388
- });
1389
- _a = __expectNonNull;
1390
- _b = __expectObject;
1391
- return [4, parseBody(output.body, context)];
1392
- case 1:
1393
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1394
- if (data.InstanceTypes != null) {
1395
- contents.InstanceTypes = deserializeAws_restJson1InstanceTypeListDefinition(data.InstanceTypes, context);
1396
- }
1397
- if (data.NextToken != null) {
1398
- contents.NextToken = __expectString(data.NextToken);
1399
- }
1400
- if (data.OutpostArn != null) {
1401
- contents.OutpostArn = __expectString(data.OutpostArn);
1402
- }
1403
- if (data.OutpostId != null) {
1404
- contents.OutpostId = __expectString(data.OutpostId);
1405
- }
1406
- return [2, contents];
1407
- }
548
+ };
549
+ export const serializeAws_restJson1UpdateSiteRackPhysicalPropertiesCommand = async (input, context) => {
550
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
551
+ const headers = {
552
+ "content-type": "application/json",
553
+ };
554
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/sites/{SiteId}/rackPhysicalProperties";
555
+ resolvedPath = __resolvedPath(resolvedPath, input, "SiteId", () => input.SiteId, "{SiteId}", false);
556
+ let body;
557
+ body = JSON.stringify({
558
+ ...(input.FiberOpticCableType != null && { FiberOpticCableType: input.FiberOpticCableType }),
559
+ ...(input.MaximumSupportedWeightLbs != null && { MaximumSupportedWeightLbs: input.MaximumSupportedWeightLbs }),
560
+ ...(input.OpticalStandard != null && { OpticalStandard: input.OpticalStandard }),
561
+ ...(input.PowerConnector != null && { PowerConnector: input.PowerConnector }),
562
+ ...(input.PowerDrawKva != null && { PowerDrawKva: input.PowerDrawKva }),
563
+ ...(input.PowerFeedDrop != null && { PowerFeedDrop: input.PowerFeedDrop }),
564
+ ...(input.PowerPhase != null && { PowerPhase: input.PowerPhase }),
565
+ ...(input.UplinkCount != null && { UplinkCount: input.UplinkCount }),
566
+ ...(input.UplinkGbps != null && { UplinkGbps: input.UplinkGbps }),
567
+ });
568
+ return new __HttpRequest({
569
+ protocol,
570
+ hostname,
571
+ port,
572
+ method: "PATCH",
573
+ headers,
574
+ path: resolvedPath,
575
+ body,
1408
576
  });
1409
- }); };
1410
- var deserializeAws_restJson1GetOutpostInstanceTypesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1411
- var parsedOutput, _a, errorCode, _b, parsedBody;
1412
- var _c;
1413
- return __generator(this, function (_d) {
1414
- switch (_d.label) {
1415
- case 0:
1416
- _a = [__assign({}, output)];
1417
- _c = {};
1418
- return [4, parseErrorBody(output.body, context)];
1419
- case 1:
1420
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1421
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1422
- _b = errorCode;
1423
- switch (_b) {
1424
- case "AccessDeniedException": return [3, 2];
1425
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
1426
- case "InternalServerException": return [3, 4];
1427
- case "com.amazonaws.outposts#InternalServerException": return [3, 4];
1428
- case "NotFoundException": return [3, 6];
1429
- case "com.amazonaws.outposts#NotFoundException": return [3, 6];
1430
- case "ValidationException": return [3, 8];
1431
- case "com.amazonaws.outposts#ValidationException": return [3, 8];
1432
- }
1433
- return [3, 10];
1434
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1435
- case 3: throw _d.sent();
1436
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1437
- case 5: throw _d.sent();
1438
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1439
- case 7: throw _d.sent();
1440
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1441
- case 9: throw _d.sent();
1442
- case 10:
1443
- parsedBody = parsedOutput.body;
1444
- throwDefaultError({
1445
- output: output,
1446
- parsedBody: parsedBody,
1447
- exceptionCtor: __BaseException,
1448
- errorCode: errorCode,
1449
- });
1450
- _d.label = 11;
1451
- case 11: return [2];
1452
- }
577
+ };
578
+ export const deserializeAws_restJson1CancelOrderCommand = async (output, context) => {
579
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
580
+ return deserializeAws_restJson1CancelOrderCommandError(output, context);
581
+ }
582
+ const contents = map({
583
+ $metadata: deserializeMetadata(output),
1453
584
  });
1454
- }); };
1455
- export var deserializeAws_restJson1GetSiteCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1456
- var contents, data, _a, _b;
1457
- return __generator(this, function (_c) {
1458
- switch (_c.label) {
1459
- case 0:
1460
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1461
- return [2, deserializeAws_restJson1GetSiteCommandError(output, context)];
1462
- }
1463
- contents = map({
1464
- $metadata: deserializeMetadata(output),
1465
- });
1466
- _a = __expectNonNull;
1467
- _b = __expectObject;
1468
- return [4, parseBody(output.body, context)];
1469
- case 1:
1470
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1471
- if (data.Site != null) {
1472
- contents.Site = deserializeAws_restJson1Site(data.Site, context);
1473
- }
1474
- return [2, contents];
1475
- }
585
+ await collectBody(output.body, context);
586
+ return contents;
587
+ };
588
+ const deserializeAws_restJson1CancelOrderCommandError = async (output, context) => {
589
+ const parsedOutput = {
590
+ ...output,
591
+ body: await parseErrorBody(output.body, context),
592
+ };
593
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
594
+ switch (errorCode) {
595
+ case "AccessDeniedException":
596
+ case "com.amazonaws.outposts#AccessDeniedException":
597
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
598
+ case "ConflictException":
599
+ case "com.amazonaws.outposts#ConflictException":
600
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
601
+ case "InternalServerException":
602
+ case "com.amazonaws.outposts#InternalServerException":
603
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
604
+ case "NotFoundException":
605
+ case "com.amazonaws.outposts#NotFoundException":
606
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
607
+ case "ValidationException":
608
+ case "com.amazonaws.outposts#ValidationException":
609
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
610
+ default:
611
+ const parsedBody = parsedOutput.body;
612
+ throwDefaultError({
613
+ output,
614
+ parsedBody,
615
+ exceptionCtor: __BaseException,
616
+ errorCode,
617
+ });
618
+ }
619
+ };
620
+ export const deserializeAws_restJson1CreateOrderCommand = async (output, context) => {
621
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
622
+ return deserializeAws_restJson1CreateOrderCommandError(output, context);
623
+ }
624
+ const contents = map({
625
+ $metadata: deserializeMetadata(output),
1476
626
  });
1477
- }); };
1478
- var deserializeAws_restJson1GetSiteCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1479
- var parsedOutput, _a, errorCode, _b, parsedBody;
1480
- var _c;
1481
- return __generator(this, function (_d) {
1482
- switch (_d.label) {
1483
- case 0:
1484
- _a = [__assign({}, output)];
1485
- _c = {};
1486
- return [4, parseErrorBody(output.body, context)];
1487
- case 1:
1488
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1489
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1490
- _b = errorCode;
1491
- switch (_b) {
1492
- case "AccessDeniedException": return [3, 2];
1493
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
1494
- case "InternalServerException": return [3, 4];
1495
- case "com.amazonaws.outposts#InternalServerException": return [3, 4];
1496
- case "NotFoundException": return [3, 6];
1497
- case "com.amazonaws.outposts#NotFoundException": return [3, 6];
1498
- case "ValidationException": return [3, 8];
1499
- case "com.amazonaws.outposts#ValidationException": return [3, 8];
1500
- }
1501
- return [3, 10];
1502
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1503
- case 3: throw _d.sent();
1504
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1505
- case 5: throw _d.sent();
1506
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1507
- case 7: throw _d.sent();
1508
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1509
- case 9: throw _d.sent();
1510
- case 10:
1511
- parsedBody = parsedOutput.body;
1512
- throwDefaultError({
1513
- output: output,
1514
- parsedBody: parsedBody,
1515
- exceptionCtor: __BaseException,
1516
- errorCode: errorCode,
1517
- });
1518
- _d.label = 11;
1519
- case 11: return [2];
1520
- }
627
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
628
+ if (data.Order != null) {
629
+ contents.Order = deserializeAws_restJson1Order(data.Order, context);
630
+ }
631
+ return contents;
632
+ };
633
+ const deserializeAws_restJson1CreateOrderCommandError = async (output, context) => {
634
+ const parsedOutput = {
635
+ ...output,
636
+ body: await parseErrorBody(output.body, context),
637
+ };
638
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
639
+ switch (errorCode) {
640
+ case "AccessDeniedException":
641
+ case "com.amazonaws.outposts#AccessDeniedException":
642
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
643
+ case "ConflictException":
644
+ case "com.amazonaws.outposts#ConflictException":
645
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
646
+ case "InternalServerException":
647
+ case "com.amazonaws.outposts#InternalServerException":
648
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
649
+ case "NotFoundException":
650
+ case "com.amazonaws.outposts#NotFoundException":
651
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
652
+ case "ServiceQuotaExceededException":
653
+ case "com.amazonaws.outposts#ServiceQuotaExceededException":
654
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
655
+ case "ValidationException":
656
+ case "com.amazonaws.outposts#ValidationException":
657
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
658
+ default:
659
+ const parsedBody = parsedOutput.body;
660
+ throwDefaultError({
661
+ output,
662
+ parsedBody,
663
+ exceptionCtor: __BaseException,
664
+ errorCode,
665
+ });
666
+ }
667
+ };
668
+ export const deserializeAws_restJson1CreateOutpostCommand = async (output, context) => {
669
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
670
+ return deserializeAws_restJson1CreateOutpostCommandError(output, context);
671
+ }
672
+ const contents = map({
673
+ $metadata: deserializeMetadata(output),
1521
674
  });
1522
- }); };
1523
- export var deserializeAws_restJson1GetSiteAddressCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1524
- var contents, data, _a, _b;
1525
- return __generator(this, function (_c) {
1526
- switch (_c.label) {
1527
- case 0:
1528
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1529
- return [2, deserializeAws_restJson1GetSiteAddressCommandError(output, context)];
1530
- }
1531
- contents = map({
1532
- $metadata: deserializeMetadata(output),
1533
- });
1534
- _a = __expectNonNull;
1535
- _b = __expectObject;
1536
- return [4, parseBody(output.body, context)];
1537
- case 1:
1538
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1539
- if (data.Address != null) {
1540
- contents.Address = deserializeAws_restJson1Address(data.Address, context);
1541
- }
1542
- if (data.AddressType != null) {
1543
- contents.AddressType = __expectString(data.AddressType);
1544
- }
1545
- if (data.SiteId != null) {
1546
- contents.SiteId = __expectString(data.SiteId);
1547
- }
1548
- return [2, contents];
1549
- }
675
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
676
+ if (data.Outpost != null) {
677
+ contents.Outpost = deserializeAws_restJson1Outpost(data.Outpost, context);
678
+ }
679
+ return contents;
680
+ };
681
+ const deserializeAws_restJson1CreateOutpostCommandError = async (output, context) => {
682
+ const parsedOutput = {
683
+ ...output,
684
+ body: await parseErrorBody(output.body, context),
685
+ };
686
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
687
+ switch (errorCode) {
688
+ case "AccessDeniedException":
689
+ case "com.amazonaws.outposts#AccessDeniedException":
690
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
691
+ case "ConflictException":
692
+ case "com.amazonaws.outposts#ConflictException":
693
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
694
+ case "InternalServerException":
695
+ case "com.amazonaws.outposts#InternalServerException":
696
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
697
+ case "NotFoundException":
698
+ case "com.amazonaws.outposts#NotFoundException":
699
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
700
+ case "ServiceQuotaExceededException":
701
+ case "com.amazonaws.outposts#ServiceQuotaExceededException":
702
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
703
+ case "ValidationException":
704
+ case "com.amazonaws.outposts#ValidationException":
705
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
706
+ default:
707
+ const parsedBody = parsedOutput.body;
708
+ throwDefaultError({
709
+ output,
710
+ parsedBody,
711
+ exceptionCtor: __BaseException,
712
+ errorCode,
713
+ });
714
+ }
715
+ };
716
+ export const deserializeAws_restJson1CreateSiteCommand = async (output, context) => {
717
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
718
+ return deserializeAws_restJson1CreateSiteCommandError(output, context);
719
+ }
720
+ const contents = map({
721
+ $metadata: deserializeMetadata(output),
1550
722
  });
1551
- }); };
1552
- var deserializeAws_restJson1GetSiteAddressCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1553
- var parsedOutput, _a, errorCode, _b, parsedBody;
1554
- var _c;
1555
- return __generator(this, function (_d) {
1556
- switch (_d.label) {
1557
- case 0:
1558
- _a = [__assign({}, output)];
1559
- _c = {};
1560
- return [4, parseErrorBody(output.body, context)];
1561
- case 1:
1562
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1563
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1564
- _b = errorCode;
1565
- switch (_b) {
1566
- case "AccessDeniedException": return [3, 2];
1567
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
1568
- case "InternalServerException": return [3, 4];
1569
- case "com.amazonaws.outposts#InternalServerException": return [3, 4];
1570
- case "NotFoundException": return [3, 6];
1571
- case "com.amazonaws.outposts#NotFoundException": return [3, 6];
1572
- case "ValidationException": return [3, 8];
1573
- case "com.amazonaws.outposts#ValidationException": return [3, 8];
1574
- }
1575
- return [3, 10];
1576
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1577
- case 3: throw _d.sent();
1578
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1579
- case 5: throw _d.sent();
1580
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1581
- case 7: throw _d.sent();
1582
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1583
- case 9: throw _d.sent();
1584
- case 10:
1585
- parsedBody = parsedOutput.body;
1586
- throwDefaultError({
1587
- output: output,
1588
- parsedBody: parsedBody,
1589
- exceptionCtor: __BaseException,
1590
- errorCode: errorCode,
1591
- });
1592
- _d.label = 11;
1593
- case 11: return [2];
1594
- }
723
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
724
+ if (data.Site != null) {
725
+ contents.Site = deserializeAws_restJson1Site(data.Site, context);
726
+ }
727
+ return contents;
728
+ };
729
+ const deserializeAws_restJson1CreateSiteCommandError = async (output, context) => {
730
+ const parsedOutput = {
731
+ ...output,
732
+ body: await parseErrorBody(output.body, context),
733
+ };
734
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
735
+ switch (errorCode) {
736
+ case "AccessDeniedException":
737
+ case "com.amazonaws.outposts#AccessDeniedException":
738
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
739
+ case "ConflictException":
740
+ case "com.amazonaws.outposts#ConflictException":
741
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
742
+ case "InternalServerException":
743
+ case "com.amazonaws.outposts#InternalServerException":
744
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
745
+ case "ServiceQuotaExceededException":
746
+ case "com.amazonaws.outposts#ServiceQuotaExceededException":
747
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
748
+ case "ValidationException":
749
+ case "com.amazonaws.outposts#ValidationException":
750
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
751
+ default:
752
+ const parsedBody = parsedOutput.body;
753
+ throwDefaultError({
754
+ output,
755
+ parsedBody,
756
+ exceptionCtor: __BaseException,
757
+ errorCode,
758
+ });
759
+ }
760
+ };
761
+ export const deserializeAws_restJson1DeleteOutpostCommand = async (output, context) => {
762
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
763
+ return deserializeAws_restJson1DeleteOutpostCommandError(output, context);
764
+ }
765
+ const contents = map({
766
+ $metadata: deserializeMetadata(output),
1595
767
  });
1596
- }); };
1597
- export var deserializeAws_restJson1ListAssetsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1598
- var contents, data, _a, _b;
1599
- return __generator(this, function (_c) {
1600
- switch (_c.label) {
1601
- case 0:
1602
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1603
- return [2, deserializeAws_restJson1ListAssetsCommandError(output, context)];
1604
- }
1605
- contents = map({
1606
- $metadata: deserializeMetadata(output),
1607
- });
1608
- _a = __expectNonNull;
1609
- _b = __expectObject;
1610
- return [4, parseBody(output.body, context)];
1611
- case 1:
1612
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1613
- if (data.Assets != null) {
1614
- contents.Assets = deserializeAws_restJson1AssetListDefinition(data.Assets, context);
1615
- }
1616
- if (data.NextToken != null) {
1617
- contents.NextToken = __expectString(data.NextToken);
1618
- }
1619
- return [2, contents];
1620
- }
768
+ await collectBody(output.body, context);
769
+ return contents;
770
+ };
771
+ const deserializeAws_restJson1DeleteOutpostCommandError = async (output, context) => {
772
+ const parsedOutput = {
773
+ ...output,
774
+ body: await parseErrorBody(output.body, context),
775
+ };
776
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
777
+ switch (errorCode) {
778
+ case "AccessDeniedException":
779
+ case "com.amazonaws.outposts#AccessDeniedException":
780
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
781
+ case "ConflictException":
782
+ case "com.amazonaws.outposts#ConflictException":
783
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
784
+ case "InternalServerException":
785
+ case "com.amazonaws.outposts#InternalServerException":
786
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
787
+ case "NotFoundException":
788
+ case "com.amazonaws.outposts#NotFoundException":
789
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
790
+ case "ValidationException":
791
+ case "com.amazonaws.outposts#ValidationException":
792
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
793
+ default:
794
+ const parsedBody = parsedOutput.body;
795
+ throwDefaultError({
796
+ output,
797
+ parsedBody,
798
+ exceptionCtor: __BaseException,
799
+ errorCode,
800
+ });
801
+ }
802
+ };
803
+ export const deserializeAws_restJson1DeleteSiteCommand = async (output, context) => {
804
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
805
+ return deserializeAws_restJson1DeleteSiteCommandError(output, context);
806
+ }
807
+ const contents = map({
808
+ $metadata: deserializeMetadata(output),
1621
809
  });
1622
- }); };
1623
- var deserializeAws_restJson1ListAssetsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1624
- var parsedOutput, _a, errorCode, _b, parsedBody;
1625
- var _c;
1626
- return __generator(this, function (_d) {
1627
- switch (_d.label) {
1628
- case 0:
1629
- _a = [__assign({}, output)];
1630
- _c = {};
1631
- return [4, parseErrorBody(output.body, context)];
1632
- case 1:
1633
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1634
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1635
- _b = errorCode;
1636
- switch (_b) {
1637
- case "AccessDeniedException": return [3, 2];
1638
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
1639
- case "InternalServerException": return [3, 4];
1640
- case "com.amazonaws.outposts#InternalServerException": return [3, 4];
1641
- case "NotFoundException": return [3, 6];
1642
- case "com.amazonaws.outposts#NotFoundException": return [3, 6];
1643
- case "ValidationException": return [3, 8];
1644
- case "com.amazonaws.outposts#ValidationException": return [3, 8];
1645
- }
1646
- return [3, 10];
1647
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1648
- case 3: throw _d.sent();
1649
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1650
- case 5: throw _d.sent();
1651
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1652
- case 7: throw _d.sent();
1653
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1654
- case 9: throw _d.sent();
1655
- case 10:
1656
- parsedBody = parsedOutput.body;
1657
- throwDefaultError({
1658
- output: output,
1659
- parsedBody: parsedBody,
1660
- exceptionCtor: __BaseException,
1661
- errorCode: errorCode,
1662
- });
1663
- _d.label = 11;
1664
- case 11: return [2];
1665
- }
810
+ await collectBody(output.body, context);
811
+ return contents;
812
+ };
813
+ const deserializeAws_restJson1DeleteSiteCommandError = async (output, context) => {
814
+ const parsedOutput = {
815
+ ...output,
816
+ body: await parseErrorBody(output.body, context),
817
+ };
818
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
819
+ switch (errorCode) {
820
+ case "AccessDeniedException":
821
+ case "com.amazonaws.outposts#AccessDeniedException":
822
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
823
+ case "ConflictException":
824
+ case "com.amazonaws.outposts#ConflictException":
825
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
826
+ case "InternalServerException":
827
+ case "com.amazonaws.outposts#InternalServerException":
828
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
829
+ case "NotFoundException":
830
+ case "com.amazonaws.outposts#NotFoundException":
831
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
832
+ case "ValidationException":
833
+ case "com.amazonaws.outposts#ValidationException":
834
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
835
+ default:
836
+ const parsedBody = parsedOutput.body;
837
+ throwDefaultError({
838
+ output,
839
+ parsedBody,
840
+ exceptionCtor: __BaseException,
841
+ errorCode,
842
+ });
843
+ }
844
+ };
845
+ export const deserializeAws_restJson1GetCatalogItemCommand = async (output, context) => {
846
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
847
+ return deserializeAws_restJson1GetCatalogItemCommandError(output, context);
848
+ }
849
+ const contents = map({
850
+ $metadata: deserializeMetadata(output),
1666
851
  });
1667
- }); };
1668
- export var deserializeAws_restJson1ListCatalogItemsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1669
- var contents, data, _a, _b;
1670
- return __generator(this, function (_c) {
1671
- switch (_c.label) {
1672
- case 0:
1673
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1674
- return [2, deserializeAws_restJson1ListCatalogItemsCommandError(output, context)];
1675
- }
1676
- contents = map({
1677
- $metadata: deserializeMetadata(output),
1678
- });
1679
- _a = __expectNonNull;
1680
- _b = __expectObject;
1681
- return [4, parseBody(output.body, context)];
1682
- case 1:
1683
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1684
- if (data.CatalogItems != null) {
1685
- contents.CatalogItems = deserializeAws_restJson1CatalogItemListDefinition(data.CatalogItems, context);
1686
- }
1687
- if (data.NextToken != null) {
1688
- contents.NextToken = __expectString(data.NextToken);
1689
- }
1690
- return [2, contents];
1691
- }
852
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
853
+ if (data.CatalogItem != null) {
854
+ contents.CatalogItem = deserializeAws_restJson1CatalogItem(data.CatalogItem, context);
855
+ }
856
+ return contents;
857
+ };
858
+ const deserializeAws_restJson1GetCatalogItemCommandError = async (output, context) => {
859
+ const parsedOutput = {
860
+ ...output,
861
+ body: await parseErrorBody(output.body, context),
862
+ };
863
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
864
+ switch (errorCode) {
865
+ case "InternalServerException":
866
+ case "com.amazonaws.outposts#InternalServerException":
867
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
868
+ case "NotFoundException":
869
+ case "com.amazonaws.outposts#NotFoundException":
870
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
871
+ case "ValidationException":
872
+ case "com.amazonaws.outposts#ValidationException":
873
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
874
+ default:
875
+ const parsedBody = parsedOutput.body;
876
+ throwDefaultError({
877
+ output,
878
+ parsedBody,
879
+ exceptionCtor: __BaseException,
880
+ errorCode,
881
+ });
882
+ }
883
+ };
884
+ export const deserializeAws_restJson1GetConnectionCommand = async (output, context) => {
885
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
886
+ return deserializeAws_restJson1GetConnectionCommandError(output, context);
887
+ }
888
+ const contents = map({
889
+ $metadata: deserializeMetadata(output),
1692
890
  });
1693
- }); };
1694
- var deserializeAws_restJson1ListCatalogItemsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1695
- var parsedOutput, _a, errorCode, _b, parsedBody;
1696
- var _c;
1697
- return __generator(this, function (_d) {
1698
- switch (_d.label) {
1699
- case 0:
1700
- _a = [__assign({}, output)];
1701
- _c = {};
1702
- return [4, parseErrorBody(output.body, context)];
1703
- case 1:
1704
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1705
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1706
- _b = errorCode;
1707
- switch (_b) {
1708
- case "InternalServerException": return [3, 2];
1709
- case "com.amazonaws.outposts#InternalServerException": return [3, 2];
1710
- case "NotFoundException": return [3, 4];
1711
- case "com.amazonaws.outposts#NotFoundException": return [3, 4];
1712
- case "ValidationException": return [3, 6];
1713
- case "com.amazonaws.outposts#ValidationException": return [3, 6];
1714
- }
1715
- return [3, 8];
1716
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1717
- case 3: throw _d.sent();
1718
- case 4: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1719
- case 5: throw _d.sent();
1720
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1721
- case 7: throw _d.sent();
1722
- case 8:
1723
- parsedBody = parsedOutput.body;
1724
- throwDefaultError({
1725
- output: output,
1726
- parsedBody: parsedBody,
1727
- exceptionCtor: __BaseException,
1728
- errorCode: errorCode,
1729
- });
1730
- _d.label = 9;
1731
- case 9: return [2];
1732
- }
891
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
892
+ if (data.ConnectionDetails != null) {
893
+ contents.ConnectionDetails = deserializeAws_restJson1ConnectionDetails(data.ConnectionDetails, context);
894
+ }
895
+ if (data.ConnectionId != null) {
896
+ contents.ConnectionId = __expectString(data.ConnectionId);
897
+ }
898
+ return contents;
899
+ };
900
+ const deserializeAws_restJson1GetConnectionCommandError = async (output, context) => {
901
+ const parsedOutput = {
902
+ ...output,
903
+ body: await parseErrorBody(output.body, context),
904
+ };
905
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
906
+ switch (errorCode) {
907
+ case "AccessDeniedException":
908
+ case "com.amazonaws.outposts#AccessDeniedException":
909
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
910
+ case "InternalServerException":
911
+ case "com.amazonaws.outposts#InternalServerException":
912
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
913
+ case "NotFoundException":
914
+ case "com.amazonaws.outposts#NotFoundException":
915
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
916
+ case "ValidationException":
917
+ case "com.amazonaws.outposts#ValidationException":
918
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
919
+ default:
920
+ const parsedBody = parsedOutput.body;
921
+ throwDefaultError({
922
+ output,
923
+ parsedBody,
924
+ exceptionCtor: __BaseException,
925
+ errorCode,
926
+ });
927
+ }
928
+ };
929
+ export const deserializeAws_restJson1GetOrderCommand = async (output, context) => {
930
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
931
+ return deserializeAws_restJson1GetOrderCommandError(output, context);
932
+ }
933
+ const contents = map({
934
+ $metadata: deserializeMetadata(output),
1733
935
  });
1734
- }); };
1735
- export var deserializeAws_restJson1ListOrdersCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1736
- var contents, data, _a, _b;
1737
- return __generator(this, function (_c) {
1738
- switch (_c.label) {
1739
- case 0:
1740
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1741
- return [2, deserializeAws_restJson1ListOrdersCommandError(output, context)];
1742
- }
1743
- contents = map({
1744
- $metadata: deserializeMetadata(output),
1745
- });
1746
- _a = __expectNonNull;
1747
- _b = __expectObject;
1748
- return [4, parseBody(output.body, context)];
1749
- case 1:
1750
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1751
- if (data.NextToken != null) {
1752
- contents.NextToken = __expectString(data.NextToken);
1753
- }
1754
- if (data.Orders != null) {
1755
- contents.Orders = deserializeAws_restJson1OrderSummaryListDefinition(data.Orders, context);
1756
- }
1757
- return [2, contents];
1758
- }
936
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
937
+ if (data.Order != null) {
938
+ contents.Order = deserializeAws_restJson1Order(data.Order, context);
939
+ }
940
+ return contents;
941
+ };
942
+ const deserializeAws_restJson1GetOrderCommandError = async (output, context) => {
943
+ const parsedOutput = {
944
+ ...output,
945
+ body: await parseErrorBody(output.body, context),
946
+ };
947
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
948
+ switch (errorCode) {
949
+ case "InternalServerException":
950
+ case "com.amazonaws.outposts#InternalServerException":
951
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
952
+ case "NotFoundException":
953
+ case "com.amazonaws.outposts#NotFoundException":
954
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
955
+ case "ValidationException":
956
+ case "com.amazonaws.outposts#ValidationException":
957
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
958
+ default:
959
+ const parsedBody = parsedOutput.body;
960
+ throwDefaultError({
961
+ output,
962
+ parsedBody,
963
+ exceptionCtor: __BaseException,
964
+ errorCode,
965
+ });
966
+ }
967
+ };
968
+ export const deserializeAws_restJson1GetOutpostCommand = async (output, context) => {
969
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
970
+ return deserializeAws_restJson1GetOutpostCommandError(output, context);
971
+ }
972
+ const contents = map({
973
+ $metadata: deserializeMetadata(output),
1759
974
  });
1760
- }); };
1761
- var deserializeAws_restJson1ListOrdersCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1762
- var parsedOutput, _a, errorCode, _b, parsedBody;
1763
- var _c;
1764
- return __generator(this, function (_d) {
1765
- switch (_d.label) {
1766
- case 0:
1767
- _a = [__assign({}, output)];
1768
- _c = {};
1769
- return [4, parseErrorBody(output.body, context)];
1770
- case 1:
1771
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1772
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1773
- _b = errorCode;
1774
- switch (_b) {
1775
- case "AccessDeniedException": return [3, 2];
1776
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
1777
- case "InternalServerException": return [3, 4];
1778
- case "com.amazonaws.outposts#InternalServerException": return [3, 4];
1779
- case "NotFoundException": return [3, 6];
1780
- case "com.amazonaws.outposts#NotFoundException": return [3, 6];
1781
- case "ValidationException": return [3, 8];
1782
- case "com.amazonaws.outposts#ValidationException": return [3, 8];
1783
- }
1784
- return [3, 10];
1785
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1786
- case 3: throw _d.sent();
1787
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1788
- case 5: throw _d.sent();
1789
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1790
- case 7: throw _d.sent();
1791
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1792
- case 9: throw _d.sent();
1793
- case 10:
1794
- parsedBody = parsedOutput.body;
1795
- throwDefaultError({
1796
- output: output,
1797
- parsedBody: parsedBody,
1798
- exceptionCtor: __BaseException,
1799
- errorCode: errorCode,
1800
- });
1801
- _d.label = 11;
1802
- case 11: return [2];
1803
- }
975
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
976
+ if (data.Outpost != null) {
977
+ contents.Outpost = deserializeAws_restJson1Outpost(data.Outpost, context);
978
+ }
979
+ return contents;
980
+ };
981
+ const deserializeAws_restJson1GetOutpostCommandError = async (output, context) => {
982
+ const parsedOutput = {
983
+ ...output,
984
+ body: await parseErrorBody(output.body, context),
985
+ };
986
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
987
+ switch (errorCode) {
988
+ case "AccessDeniedException":
989
+ case "com.amazonaws.outposts#AccessDeniedException":
990
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
991
+ case "InternalServerException":
992
+ case "com.amazonaws.outposts#InternalServerException":
993
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
994
+ case "NotFoundException":
995
+ case "com.amazonaws.outposts#NotFoundException":
996
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
997
+ case "ValidationException":
998
+ case "com.amazonaws.outposts#ValidationException":
999
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1000
+ default:
1001
+ const parsedBody = parsedOutput.body;
1002
+ throwDefaultError({
1003
+ output,
1004
+ parsedBody,
1005
+ exceptionCtor: __BaseException,
1006
+ errorCode,
1007
+ });
1008
+ }
1009
+ };
1010
+ export const deserializeAws_restJson1GetOutpostInstanceTypesCommand = async (output, context) => {
1011
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1012
+ return deserializeAws_restJson1GetOutpostInstanceTypesCommandError(output, context);
1013
+ }
1014
+ const contents = map({
1015
+ $metadata: deserializeMetadata(output),
1804
1016
  });
1805
- }); };
1806
- export var deserializeAws_restJson1ListOutpostsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1807
- var contents, data, _a, _b;
1808
- return __generator(this, function (_c) {
1809
- switch (_c.label) {
1810
- case 0:
1811
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1812
- return [2, deserializeAws_restJson1ListOutpostsCommandError(output, context)];
1813
- }
1814
- contents = map({
1815
- $metadata: deserializeMetadata(output),
1816
- });
1817
- _a = __expectNonNull;
1818
- _b = __expectObject;
1819
- return [4, parseBody(output.body, context)];
1820
- case 1:
1821
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1822
- if (data.NextToken != null) {
1823
- contents.NextToken = __expectString(data.NextToken);
1824
- }
1825
- if (data.Outposts != null) {
1826
- contents.Outposts = deserializeAws_restJson1outpostListDefinition(data.Outposts, context);
1827
- }
1828
- return [2, contents];
1829
- }
1017
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1018
+ if (data.InstanceTypes != null) {
1019
+ contents.InstanceTypes = deserializeAws_restJson1InstanceTypeListDefinition(data.InstanceTypes, context);
1020
+ }
1021
+ if (data.NextToken != null) {
1022
+ contents.NextToken = __expectString(data.NextToken);
1023
+ }
1024
+ if (data.OutpostArn != null) {
1025
+ contents.OutpostArn = __expectString(data.OutpostArn);
1026
+ }
1027
+ if (data.OutpostId != null) {
1028
+ contents.OutpostId = __expectString(data.OutpostId);
1029
+ }
1030
+ return contents;
1031
+ };
1032
+ const deserializeAws_restJson1GetOutpostInstanceTypesCommandError = async (output, context) => {
1033
+ const parsedOutput = {
1034
+ ...output,
1035
+ body: await parseErrorBody(output.body, context),
1036
+ };
1037
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1038
+ switch (errorCode) {
1039
+ case "AccessDeniedException":
1040
+ case "com.amazonaws.outposts#AccessDeniedException":
1041
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1042
+ case "InternalServerException":
1043
+ case "com.amazonaws.outposts#InternalServerException":
1044
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1045
+ case "NotFoundException":
1046
+ case "com.amazonaws.outposts#NotFoundException":
1047
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1048
+ case "ValidationException":
1049
+ case "com.amazonaws.outposts#ValidationException":
1050
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1051
+ default:
1052
+ const parsedBody = parsedOutput.body;
1053
+ throwDefaultError({
1054
+ output,
1055
+ parsedBody,
1056
+ exceptionCtor: __BaseException,
1057
+ errorCode,
1058
+ });
1059
+ }
1060
+ };
1061
+ export const deserializeAws_restJson1GetSiteCommand = async (output, context) => {
1062
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1063
+ return deserializeAws_restJson1GetSiteCommandError(output, context);
1064
+ }
1065
+ const contents = map({
1066
+ $metadata: deserializeMetadata(output),
1830
1067
  });
1831
- }); };
1832
- var deserializeAws_restJson1ListOutpostsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1833
- var parsedOutput, _a, errorCode, _b, parsedBody;
1834
- var _c;
1835
- return __generator(this, function (_d) {
1836
- switch (_d.label) {
1837
- case 0:
1838
- _a = [__assign({}, output)];
1839
- _c = {};
1840
- return [4, parseErrorBody(output.body, context)];
1841
- case 1:
1842
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1843
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1844
- _b = errorCode;
1845
- switch (_b) {
1846
- case "AccessDeniedException": return [3, 2];
1847
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
1848
- case "InternalServerException": return [3, 4];
1849
- case "com.amazonaws.outposts#InternalServerException": return [3, 4];
1850
- case "ValidationException": return [3, 6];
1851
- case "com.amazonaws.outposts#ValidationException": return [3, 6];
1852
- }
1853
- return [3, 8];
1854
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1855
- case 3: throw _d.sent();
1856
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1857
- case 5: throw _d.sent();
1858
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1859
- case 7: throw _d.sent();
1860
- case 8:
1861
- parsedBody = parsedOutput.body;
1862
- throwDefaultError({
1863
- output: output,
1864
- parsedBody: parsedBody,
1865
- exceptionCtor: __BaseException,
1866
- errorCode: errorCode,
1867
- });
1868
- _d.label = 9;
1869
- case 9: return [2];
1870
- }
1068
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1069
+ if (data.Site != null) {
1070
+ contents.Site = deserializeAws_restJson1Site(data.Site, context);
1071
+ }
1072
+ return contents;
1073
+ };
1074
+ const deserializeAws_restJson1GetSiteCommandError = async (output, context) => {
1075
+ const parsedOutput = {
1076
+ ...output,
1077
+ body: await parseErrorBody(output.body, context),
1078
+ };
1079
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1080
+ switch (errorCode) {
1081
+ case "AccessDeniedException":
1082
+ case "com.amazonaws.outposts#AccessDeniedException":
1083
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1084
+ case "InternalServerException":
1085
+ case "com.amazonaws.outposts#InternalServerException":
1086
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1087
+ case "NotFoundException":
1088
+ case "com.amazonaws.outposts#NotFoundException":
1089
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1090
+ case "ValidationException":
1091
+ case "com.amazonaws.outposts#ValidationException":
1092
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1093
+ default:
1094
+ const parsedBody = parsedOutput.body;
1095
+ throwDefaultError({
1096
+ output,
1097
+ parsedBody,
1098
+ exceptionCtor: __BaseException,
1099
+ errorCode,
1100
+ });
1101
+ }
1102
+ };
1103
+ export const deserializeAws_restJson1GetSiteAddressCommand = async (output, context) => {
1104
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1105
+ return deserializeAws_restJson1GetSiteAddressCommandError(output, context);
1106
+ }
1107
+ const contents = map({
1108
+ $metadata: deserializeMetadata(output),
1871
1109
  });
1872
- }); };
1873
- export var deserializeAws_restJson1ListSitesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1874
- var contents, data, _a, _b;
1875
- return __generator(this, function (_c) {
1876
- switch (_c.label) {
1877
- case 0:
1878
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1879
- return [2, deserializeAws_restJson1ListSitesCommandError(output, context)];
1880
- }
1881
- contents = map({
1882
- $metadata: deserializeMetadata(output),
1883
- });
1884
- _a = __expectNonNull;
1885
- _b = __expectObject;
1886
- return [4, parseBody(output.body, context)];
1887
- case 1:
1888
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1889
- if (data.NextToken != null) {
1890
- contents.NextToken = __expectString(data.NextToken);
1891
- }
1892
- if (data.Sites != null) {
1893
- contents.Sites = deserializeAws_restJson1siteListDefinition(data.Sites, context);
1894
- }
1895
- return [2, contents];
1896
- }
1110
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1111
+ if (data.Address != null) {
1112
+ contents.Address = deserializeAws_restJson1Address(data.Address, context);
1113
+ }
1114
+ if (data.AddressType != null) {
1115
+ contents.AddressType = __expectString(data.AddressType);
1116
+ }
1117
+ if (data.SiteId != null) {
1118
+ contents.SiteId = __expectString(data.SiteId);
1119
+ }
1120
+ return contents;
1121
+ };
1122
+ const deserializeAws_restJson1GetSiteAddressCommandError = async (output, context) => {
1123
+ const parsedOutput = {
1124
+ ...output,
1125
+ body: await parseErrorBody(output.body, context),
1126
+ };
1127
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1128
+ switch (errorCode) {
1129
+ case "AccessDeniedException":
1130
+ case "com.amazonaws.outposts#AccessDeniedException":
1131
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1132
+ case "InternalServerException":
1133
+ case "com.amazonaws.outposts#InternalServerException":
1134
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1135
+ case "NotFoundException":
1136
+ case "com.amazonaws.outposts#NotFoundException":
1137
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1138
+ case "ValidationException":
1139
+ case "com.amazonaws.outposts#ValidationException":
1140
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1141
+ default:
1142
+ const parsedBody = parsedOutput.body;
1143
+ throwDefaultError({
1144
+ output,
1145
+ parsedBody,
1146
+ exceptionCtor: __BaseException,
1147
+ errorCode,
1148
+ });
1149
+ }
1150
+ };
1151
+ export const deserializeAws_restJson1ListAssetsCommand = async (output, context) => {
1152
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1153
+ return deserializeAws_restJson1ListAssetsCommandError(output, context);
1154
+ }
1155
+ const contents = map({
1156
+ $metadata: deserializeMetadata(output),
1897
1157
  });
1898
- }); };
1899
- var deserializeAws_restJson1ListSitesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1900
- var parsedOutput, _a, errorCode, _b, parsedBody;
1901
- var _c;
1902
- return __generator(this, function (_d) {
1903
- switch (_d.label) {
1904
- case 0:
1905
- _a = [__assign({}, output)];
1906
- _c = {};
1907
- return [4, parseErrorBody(output.body, context)];
1908
- case 1:
1909
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1910
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1911
- _b = errorCode;
1912
- switch (_b) {
1913
- case "AccessDeniedException": return [3, 2];
1914
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
1915
- case "InternalServerException": return [3, 4];
1916
- case "com.amazonaws.outposts#InternalServerException": return [3, 4];
1917
- case "ValidationException": return [3, 6];
1918
- case "com.amazonaws.outposts#ValidationException": return [3, 6];
1919
- }
1920
- return [3, 8];
1921
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1922
- case 3: throw _d.sent();
1923
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1924
- case 5: throw _d.sent();
1925
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1926
- case 7: throw _d.sent();
1927
- case 8:
1928
- parsedBody = parsedOutput.body;
1929
- throwDefaultError({
1930
- output: output,
1931
- parsedBody: parsedBody,
1932
- exceptionCtor: __BaseException,
1933
- errorCode: errorCode,
1934
- });
1935
- _d.label = 9;
1936
- case 9: return [2];
1937
- }
1158
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1159
+ if (data.Assets != null) {
1160
+ contents.Assets = deserializeAws_restJson1AssetListDefinition(data.Assets, context);
1161
+ }
1162
+ if (data.NextToken != null) {
1163
+ contents.NextToken = __expectString(data.NextToken);
1164
+ }
1165
+ return contents;
1166
+ };
1167
+ const deserializeAws_restJson1ListAssetsCommandError = async (output, context) => {
1168
+ const parsedOutput = {
1169
+ ...output,
1170
+ body: await parseErrorBody(output.body, context),
1171
+ };
1172
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1173
+ switch (errorCode) {
1174
+ case "AccessDeniedException":
1175
+ case "com.amazonaws.outposts#AccessDeniedException":
1176
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1177
+ case "InternalServerException":
1178
+ case "com.amazonaws.outposts#InternalServerException":
1179
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1180
+ case "NotFoundException":
1181
+ case "com.amazonaws.outposts#NotFoundException":
1182
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1183
+ case "ValidationException":
1184
+ case "com.amazonaws.outposts#ValidationException":
1185
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1186
+ default:
1187
+ const parsedBody = parsedOutput.body;
1188
+ throwDefaultError({
1189
+ output,
1190
+ parsedBody,
1191
+ exceptionCtor: __BaseException,
1192
+ errorCode,
1193
+ });
1194
+ }
1195
+ };
1196
+ export const deserializeAws_restJson1ListCatalogItemsCommand = async (output, context) => {
1197
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1198
+ return deserializeAws_restJson1ListCatalogItemsCommandError(output, context);
1199
+ }
1200
+ const contents = map({
1201
+ $metadata: deserializeMetadata(output),
1938
1202
  });
1939
- }); };
1940
- export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1941
- var contents, data, _a, _b;
1942
- return __generator(this, function (_c) {
1943
- switch (_c.label) {
1944
- case 0:
1945
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1946
- return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1947
- }
1948
- contents = map({
1949
- $metadata: deserializeMetadata(output),
1950
- });
1951
- _a = __expectNonNull;
1952
- _b = __expectObject;
1953
- return [4, parseBody(output.body, context)];
1954
- case 1:
1955
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1956
- if (data.Tags != null) {
1957
- contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1958
- }
1959
- return [2, contents];
1960
- }
1203
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1204
+ if (data.CatalogItems != null) {
1205
+ contents.CatalogItems = deserializeAws_restJson1CatalogItemListDefinition(data.CatalogItems, context);
1206
+ }
1207
+ if (data.NextToken != null) {
1208
+ contents.NextToken = __expectString(data.NextToken);
1209
+ }
1210
+ return contents;
1211
+ };
1212
+ const deserializeAws_restJson1ListCatalogItemsCommandError = async (output, context) => {
1213
+ const parsedOutput = {
1214
+ ...output,
1215
+ body: await parseErrorBody(output.body, context),
1216
+ };
1217
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1218
+ switch (errorCode) {
1219
+ case "InternalServerException":
1220
+ case "com.amazonaws.outposts#InternalServerException":
1221
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1222
+ case "NotFoundException":
1223
+ case "com.amazonaws.outposts#NotFoundException":
1224
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1225
+ case "ValidationException":
1226
+ case "com.amazonaws.outposts#ValidationException":
1227
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1228
+ default:
1229
+ const parsedBody = parsedOutput.body;
1230
+ throwDefaultError({
1231
+ output,
1232
+ parsedBody,
1233
+ exceptionCtor: __BaseException,
1234
+ errorCode,
1235
+ });
1236
+ }
1237
+ };
1238
+ export const deserializeAws_restJson1ListOrdersCommand = async (output, context) => {
1239
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1240
+ return deserializeAws_restJson1ListOrdersCommandError(output, context);
1241
+ }
1242
+ const contents = map({
1243
+ $metadata: deserializeMetadata(output),
1961
1244
  });
1962
- }); };
1963
- var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1964
- var parsedOutput, _a, errorCode, _b, parsedBody;
1965
- var _c;
1966
- return __generator(this, function (_d) {
1967
- switch (_d.label) {
1968
- case 0:
1969
- _a = [__assign({}, output)];
1970
- _c = {};
1971
- return [4, parseErrorBody(output.body, context)];
1972
- case 1:
1973
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1974
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1975
- _b = errorCode;
1976
- switch (_b) {
1977
- case "InternalServerException": return [3, 2];
1978
- case "com.amazonaws.outposts#InternalServerException": return [3, 2];
1979
- case "NotFoundException": return [3, 4];
1980
- case "com.amazonaws.outposts#NotFoundException": return [3, 4];
1981
- case "ValidationException": return [3, 6];
1982
- case "com.amazonaws.outposts#ValidationException": return [3, 6];
1983
- }
1984
- return [3, 8];
1985
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1986
- case 3: throw _d.sent();
1987
- case 4: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1988
- case 5: throw _d.sent();
1989
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1990
- case 7: throw _d.sent();
1991
- case 8:
1992
- parsedBody = parsedOutput.body;
1993
- throwDefaultError({
1994
- output: output,
1995
- parsedBody: parsedBody,
1996
- exceptionCtor: __BaseException,
1997
- errorCode: errorCode,
1998
- });
1999
- _d.label = 9;
2000
- case 9: return [2];
2001
- }
1245
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1246
+ if (data.NextToken != null) {
1247
+ contents.NextToken = __expectString(data.NextToken);
1248
+ }
1249
+ if (data.Orders != null) {
1250
+ contents.Orders = deserializeAws_restJson1OrderSummaryListDefinition(data.Orders, context);
1251
+ }
1252
+ return contents;
1253
+ };
1254
+ const deserializeAws_restJson1ListOrdersCommandError = async (output, context) => {
1255
+ const parsedOutput = {
1256
+ ...output,
1257
+ body: await parseErrorBody(output.body, context),
1258
+ };
1259
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1260
+ switch (errorCode) {
1261
+ case "AccessDeniedException":
1262
+ case "com.amazonaws.outposts#AccessDeniedException":
1263
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1264
+ case "InternalServerException":
1265
+ case "com.amazonaws.outposts#InternalServerException":
1266
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1267
+ case "NotFoundException":
1268
+ case "com.amazonaws.outposts#NotFoundException":
1269
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1270
+ case "ValidationException":
1271
+ case "com.amazonaws.outposts#ValidationException":
1272
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1273
+ default:
1274
+ const parsedBody = parsedOutput.body;
1275
+ throwDefaultError({
1276
+ output,
1277
+ parsedBody,
1278
+ exceptionCtor: __BaseException,
1279
+ errorCode,
1280
+ });
1281
+ }
1282
+ };
1283
+ export const deserializeAws_restJson1ListOutpostsCommand = async (output, context) => {
1284
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1285
+ return deserializeAws_restJson1ListOutpostsCommandError(output, context);
1286
+ }
1287
+ const contents = map({
1288
+ $metadata: deserializeMetadata(output),
2002
1289
  });
2003
- }); };
2004
- export var deserializeAws_restJson1StartConnectionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2005
- var contents, data, _a, _b;
2006
- return __generator(this, function (_c) {
2007
- switch (_c.label) {
2008
- case 0:
2009
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2010
- return [2, deserializeAws_restJson1StartConnectionCommandError(output, context)];
2011
- }
2012
- contents = map({
2013
- $metadata: deserializeMetadata(output),
2014
- });
2015
- _a = __expectNonNull;
2016
- _b = __expectObject;
2017
- return [4, parseBody(output.body, context)];
2018
- case 1:
2019
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2020
- if (data.ConnectionId != null) {
2021
- contents.ConnectionId = __expectString(data.ConnectionId);
2022
- }
2023
- if (data.UnderlayIpAddress != null) {
2024
- contents.UnderlayIpAddress = __expectString(data.UnderlayIpAddress);
2025
- }
2026
- return [2, contents];
2027
- }
1290
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1291
+ if (data.NextToken != null) {
1292
+ contents.NextToken = __expectString(data.NextToken);
1293
+ }
1294
+ if (data.Outposts != null) {
1295
+ contents.Outposts = deserializeAws_restJson1outpostListDefinition(data.Outposts, context);
1296
+ }
1297
+ return contents;
1298
+ };
1299
+ const deserializeAws_restJson1ListOutpostsCommandError = async (output, context) => {
1300
+ const parsedOutput = {
1301
+ ...output,
1302
+ body: await parseErrorBody(output.body, context),
1303
+ };
1304
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1305
+ switch (errorCode) {
1306
+ case "AccessDeniedException":
1307
+ case "com.amazonaws.outposts#AccessDeniedException":
1308
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1309
+ case "InternalServerException":
1310
+ case "com.amazonaws.outposts#InternalServerException":
1311
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1312
+ case "ValidationException":
1313
+ case "com.amazonaws.outposts#ValidationException":
1314
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1315
+ default:
1316
+ const parsedBody = parsedOutput.body;
1317
+ throwDefaultError({
1318
+ output,
1319
+ parsedBody,
1320
+ exceptionCtor: __BaseException,
1321
+ errorCode,
1322
+ });
1323
+ }
1324
+ };
1325
+ export const deserializeAws_restJson1ListSitesCommand = async (output, context) => {
1326
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1327
+ return deserializeAws_restJson1ListSitesCommandError(output, context);
1328
+ }
1329
+ const contents = map({
1330
+ $metadata: deserializeMetadata(output),
2028
1331
  });
2029
- }); };
2030
- var deserializeAws_restJson1StartConnectionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2031
- var parsedOutput, _a, errorCode, _b, parsedBody;
2032
- var _c;
2033
- return __generator(this, function (_d) {
2034
- switch (_d.label) {
2035
- case 0:
2036
- _a = [__assign({}, output)];
2037
- _c = {};
2038
- return [4, parseErrorBody(output.body, context)];
2039
- case 1:
2040
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2041
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2042
- _b = errorCode;
2043
- switch (_b) {
2044
- case "AccessDeniedException": return [3, 2];
2045
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
2046
- case "InternalServerException": return [3, 4];
2047
- case "com.amazonaws.outposts#InternalServerException": return [3, 4];
2048
- case "NotFoundException": return [3, 6];
2049
- case "com.amazonaws.outposts#NotFoundException": return [3, 6];
2050
- case "ValidationException": return [3, 8];
2051
- case "com.amazonaws.outposts#ValidationException": return [3, 8];
2052
- }
2053
- return [3, 10];
2054
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2055
- case 3: throw _d.sent();
2056
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2057
- case 5: throw _d.sent();
2058
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
2059
- case 7: throw _d.sent();
2060
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2061
- case 9: throw _d.sent();
2062
- case 10:
2063
- parsedBody = parsedOutput.body;
2064
- throwDefaultError({
2065
- output: output,
2066
- parsedBody: parsedBody,
2067
- exceptionCtor: __BaseException,
2068
- errorCode: errorCode,
2069
- });
2070
- _d.label = 11;
2071
- case 11: return [2];
2072
- }
1332
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1333
+ if (data.NextToken != null) {
1334
+ contents.NextToken = __expectString(data.NextToken);
1335
+ }
1336
+ if (data.Sites != null) {
1337
+ contents.Sites = deserializeAws_restJson1siteListDefinition(data.Sites, context);
1338
+ }
1339
+ return contents;
1340
+ };
1341
+ const deserializeAws_restJson1ListSitesCommandError = async (output, context) => {
1342
+ const parsedOutput = {
1343
+ ...output,
1344
+ body: await parseErrorBody(output.body, context),
1345
+ };
1346
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1347
+ switch (errorCode) {
1348
+ case "AccessDeniedException":
1349
+ case "com.amazonaws.outposts#AccessDeniedException":
1350
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1351
+ case "InternalServerException":
1352
+ case "com.amazonaws.outposts#InternalServerException":
1353
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1354
+ case "ValidationException":
1355
+ case "com.amazonaws.outposts#ValidationException":
1356
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1357
+ default:
1358
+ const parsedBody = parsedOutput.body;
1359
+ throwDefaultError({
1360
+ output,
1361
+ parsedBody,
1362
+ exceptionCtor: __BaseException,
1363
+ errorCode,
1364
+ });
1365
+ }
1366
+ };
1367
+ export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1368
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1369
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1370
+ }
1371
+ const contents = map({
1372
+ $metadata: deserializeMetadata(output),
2073
1373
  });
2074
- }); };
2075
- export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2076
- var contents;
2077
- return __generator(this, function (_a) {
2078
- switch (_a.label) {
2079
- case 0:
2080
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2081
- return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
2082
- }
2083
- contents = map({
2084
- $metadata: deserializeMetadata(output),
2085
- });
2086
- return [4, collectBody(output.body, context)];
2087
- case 1:
2088
- _a.sent();
2089
- return [2, contents];
2090
- }
1374
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1375
+ if (data.Tags != null) {
1376
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1377
+ }
1378
+ return contents;
1379
+ };
1380
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
1381
+ const parsedOutput = {
1382
+ ...output,
1383
+ body: await parseErrorBody(output.body, context),
1384
+ };
1385
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1386
+ switch (errorCode) {
1387
+ case "InternalServerException":
1388
+ case "com.amazonaws.outposts#InternalServerException":
1389
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1390
+ case "NotFoundException":
1391
+ case "com.amazonaws.outposts#NotFoundException":
1392
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1393
+ case "ValidationException":
1394
+ case "com.amazonaws.outposts#ValidationException":
1395
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1396
+ default:
1397
+ const parsedBody = parsedOutput.body;
1398
+ throwDefaultError({
1399
+ output,
1400
+ parsedBody,
1401
+ exceptionCtor: __BaseException,
1402
+ errorCode,
1403
+ });
1404
+ }
1405
+ };
1406
+ export const deserializeAws_restJson1StartConnectionCommand = async (output, context) => {
1407
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1408
+ return deserializeAws_restJson1StartConnectionCommandError(output, context);
1409
+ }
1410
+ const contents = map({
1411
+ $metadata: deserializeMetadata(output),
2091
1412
  });
2092
- }); };
2093
- var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2094
- var parsedOutput, _a, errorCode, _b, parsedBody;
2095
- var _c;
2096
- return __generator(this, function (_d) {
2097
- switch (_d.label) {
2098
- case 0:
2099
- _a = [__assign({}, output)];
2100
- _c = {};
2101
- return [4, parseErrorBody(output.body, context)];
2102
- case 1:
2103
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2104
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2105
- _b = errorCode;
2106
- switch (_b) {
2107
- case "InternalServerException": return [3, 2];
2108
- case "com.amazonaws.outposts#InternalServerException": return [3, 2];
2109
- case "NotFoundException": return [3, 4];
2110
- case "com.amazonaws.outposts#NotFoundException": return [3, 4];
2111
- case "ValidationException": return [3, 6];
2112
- case "com.amazonaws.outposts#ValidationException": return [3, 6];
2113
- }
2114
- return [3, 8];
2115
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2116
- case 3: throw _d.sent();
2117
- case 4: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
2118
- case 5: throw _d.sent();
2119
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2120
- case 7: throw _d.sent();
2121
- case 8:
2122
- parsedBody = parsedOutput.body;
2123
- throwDefaultError({
2124
- output: output,
2125
- parsedBody: parsedBody,
2126
- exceptionCtor: __BaseException,
2127
- errorCode: errorCode,
2128
- });
2129
- _d.label = 9;
2130
- case 9: return [2];
2131
- }
1413
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1414
+ if (data.ConnectionId != null) {
1415
+ contents.ConnectionId = __expectString(data.ConnectionId);
1416
+ }
1417
+ if (data.UnderlayIpAddress != null) {
1418
+ contents.UnderlayIpAddress = __expectString(data.UnderlayIpAddress);
1419
+ }
1420
+ return contents;
1421
+ };
1422
+ const deserializeAws_restJson1StartConnectionCommandError = async (output, context) => {
1423
+ const parsedOutput = {
1424
+ ...output,
1425
+ body: await parseErrorBody(output.body, context),
1426
+ };
1427
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1428
+ switch (errorCode) {
1429
+ case "AccessDeniedException":
1430
+ case "com.amazonaws.outposts#AccessDeniedException":
1431
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1432
+ case "InternalServerException":
1433
+ case "com.amazonaws.outposts#InternalServerException":
1434
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1435
+ case "NotFoundException":
1436
+ case "com.amazonaws.outposts#NotFoundException":
1437
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1438
+ case "ValidationException":
1439
+ case "com.amazonaws.outposts#ValidationException":
1440
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1441
+ default:
1442
+ const parsedBody = parsedOutput.body;
1443
+ throwDefaultError({
1444
+ output,
1445
+ parsedBody,
1446
+ exceptionCtor: __BaseException,
1447
+ errorCode,
1448
+ });
1449
+ }
1450
+ };
1451
+ export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1452
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1453
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
1454
+ }
1455
+ const contents = map({
1456
+ $metadata: deserializeMetadata(output),
2132
1457
  });
2133
- }); };
2134
- export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2135
- var contents;
2136
- return __generator(this, function (_a) {
2137
- switch (_a.label) {
2138
- case 0:
2139
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2140
- return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
2141
- }
2142
- contents = map({
2143
- $metadata: deserializeMetadata(output),
2144
- });
2145
- return [4, collectBody(output.body, context)];
2146
- case 1:
2147
- _a.sent();
2148
- return [2, contents];
2149
- }
1458
+ await collectBody(output.body, context);
1459
+ return contents;
1460
+ };
1461
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
1462
+ const parsedOutput = {
1463
+ ...output,
1464
+ body: await parseErrorBody(output.body, context),
1465
+ };
1466
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1467
+ switch (errorCode) {
1468
+ case "InternalServerException":
1469
+ case "com.amazonaws.outposts#InternalServerException":
1470
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1471
+ case "NotFoundException":
1472
+ case "com.amazonaws.outposts#NotFoundException":
1473
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1474
+ case "ValidationException":
1475
+ case "com.amazonaws.outposts#ValidationException":
1476
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1477
+ default:
1478
+ const parsedBody = parsedOutput.body;
1479
+ throwDefaultError({
1480
+ output,
1481
+ parsedBody,
1482
+ exceptionCtor: __BaseException,
1483
+ errorCode,
1484
+ });
1485
+ }
1486
+ };
1487
+ export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1488
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1489
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
1490
+ }
1491
+ const contents = map({
1492
+ $metadata: deserializeMetadata(output),
2150
1493
  });
2151
- }); };
2152
- var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2153
- var parsedOutput, _a, errorCode, _b, parsedBody;
2154
- var _c;
2155
- return __generator(this, function (_d) {
2156
- switch (_d.label) {
2157
- case 0:
2158
- _a = [__assign({}, output)];
2159
- _c = {};
2160
- return [4, parseErrorBody(output.body, context)];
2161
- case 1:
2162
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2163
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2164
- _b = errorCode;
2165
- switch (_b) {
2166
- case "InternalServerException": return [3, 2];
2167
- case "com.amazonaws.outposts#InternalServerException": return [3, 2];
2168
- case "NotFoundException": return [3, 4];
2169
- case "com.amazonaws.outposts#NotFoundException": return [3, 4];
2170
- case "ValidationException": return [3, 6];
2171
- case "com.amazonaws.outposts#ValidationException": return [3, 6];
2172
- }
2173
- return [3, 8];
2174
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2175
- case 3: throw _d.sent();
2176
- case 4: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
2177
- case 5: throw _d.sent();
2178
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2179
- case 7: throw _d.sent();
2180
- case 8:
2181
- parsedBody = parsedOutput.body;
2182
- throwDefaultError({
2183
- output: output,
2184
- parsedBody: parsedBody,
2185
- exceptionCtor: __BaseException,
2186
- errorCode: errorCode,
2187
- });
2188
- _d.label = 9;
2189
- case 9: return [2];
2190
- }
1494
+ await collectBody(output.body, context);
1495
+ return contents;
1496
+ };
1497
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
1498
+ const parsedOutput = {
1499
+ ...output,
1500
+ body: await parseErrorBody(output.body, context),
1501
+ };
1502
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1503
+ switch (errorCode) {
1504
+ case "InternalServerException":
1505
+ case "com.amazonaws.outposts#InternalServerException":
1506
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1507
+ case "NotFoundException":
1508
+ case "com.amazonaws.outposts#NotFoundException":
1509
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1510
+ case "ValidationException":
1511
+ case "com.amazonaws.outposts#ValidationException":
1512
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1513
+ default:
1514
+ const parsedBody = parsedOutput.body;
1515
+ throwDefaultError({
1516
+ output,
1517
+ parsedBody,
1518
+ exceptionCtor: __BaseException,
1519
+ errorCode,
1520
+ });
1521
+ }
1522
+ };
1523
+ export const deserializeAws_restJson1UpdateOutpostCommand = async (output, context) => {
1524
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1525
+ return deserializeAws_restJson1UpdateOutpostCommandError(output, context);
1526
+ }
1527
+ const contents = map({
1528
+ $metadata: deserializeMetadata(output),
2191
1529
  });
2192
- }); };
2193
- export var deserializeAws_restJson1UpdateOutpostCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2194
- var contents, data, _a, _b;
2195
- return __generator(this, function (_c) {
2196
- switch (_c.label) {
2197
- case 0:
2198
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2199
- return [2, deserializeAws_restJson1UpdateOutpostCommandError(output, context)];
2200
- }
2201
- contents = map({
2202
- $metadata: deserializeMetadata(output),
2203
- });
2204
- _a = __expectNonNull;
2205
- _b = __expectObject;
2206
- return [4, parseBody(output.body, context)];
2207
- case 1:
2208
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2209
- if (data.Outpost != null) {
2210
- contents.Outpost = deserializeAws_restJson1Outpost(data.Outpost, context);
2211
- }
2212
- return [2, contents];
2213
- }
1530
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1531
+ if (data.Outpost != null) {
1532
+ contents.Outpost = deserializeAws_restJson1Outpost(data.Outpost, context);
1533
+ }
1534
+ return contents;
1535
+ };
1536
+ const deserializeAws_restJson1UpdateOutpostCommandError = 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.outposts#AccessDeniedException":
1545
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1546
+ case "ConflictException":
1547
+ case "com.amazonaws.outposts#ConflictException":
1548
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1549
+ case "InternalServerException":
1550
+ case "com.amazonaws.outposts#InternalServerException":
1551
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1552
+ case "NotFoundException":
1553
+ case "com.amazonaws.outposts#NotFoundException":
1554
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1555
+ case "ValidationException":
1556
+ case "com.amazonaws.outposts#ValidationException":
1557
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1558
+ default:
1559
+ const parsedBody = parsedOutput.body;
1560
+ throwDefaultError({
1561
+ output,
1562
+ parsedBody,
1563
+ exceptionCtor: __BaseException,
1564
+ errorCode,
1565
+ });
1566
+ }
1567
+ };
1568
+ export const deserializeAws_restJson1UpdateSiteCommand = async (output, context) => {
1569
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1570
+ return deserializeAws_restJson1UpdateSiteCommandError(output, context);
1571
+ }
1572
+ const contents = map({
1573
+ $metadata: deserializeMetadata(output),
2214
1574
  });
2215
- }); };
2216
- var deserializeAws_restJson1UpdateOutpostCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2217
- var parsedOutput, _a, errorCode, _b, parsedBody;
2218
- var _c;
2219
- return __generator(this, function (_d) {
2220
- switch (_d.label) {
2221
- case 0:
2222
- _a = [__assign({}, output)];
2223
- _c = {};
2224
- return [4, parseErrorBody(output.body, context)];
2225
- case 1:
2226
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2227
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2228
- _b = errorCode;
2229
- switch (_b) {
2230
- case "AccessDeniedException": return [3, 2];
2231
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
2232
- case "ConflictException": return [3, 4];
2233
- case "com.amazonaws.outposts#ConflictException": return [3, 4];
2234
- case "InternalServerException": return [3, 6];
2235
- case "com.amazonaws.outposts#InternalServerException": return [3, 6];
2236
- case "NotFoundException": return [3, 8];
2237
- case "com.amazonaws.outposts#NotFoundException": return [3, 8];
2238
- case "ValidationException": return [3, 10];
2239
- case "com.amazonaws.outposts#ValidationException": return [3, 10];
2240
- }
2241
- return [3, 12];
2242
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2243
- case 3: throw _d.sent();
2244
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2245
- case 5: throw _d.sent();
2246
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2247
- case 7: throw _d.sent();
2248
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
2249
- case 9: throw _d.sent();
2250
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2251
- case 11: throw _d.sent();
2252
- case 12:
2253
- parsedBody = parsedOutput.body;
2254
- throwDefaultError({
2255
- output: output,
2256
- parsedBody: parsedBody,
2257
- exceptionCtor: __BaseException,
2258
- errorCode: errorCode,
2259
- });
2260
- _d.label = 13;
2261
- case 13: return [2];
2262
- }
1575
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1576
+ if (data.Site != null) {
1577
+ contents.Site = deserializeAws_restJson1Site(data.Site, context);
1578
+ }
1579
+ return contents;
1580
+ };
1581
+ const deserializeAws_restJson1UpdateSiteCommandError = async (output, context) => {
1582
+ const parsedOutput = {
1583
+ ...output,
1584
+ body: await parseErrorBody(output.body, context),
1585
+ };
1586
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1587
+ switch (errorCode) {
1588
+ case "AccessDeniedException":
1589
+ case "com.amazonaws.outposts#AccessDeniedException":
1590
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1591
+ case "ConflictException":
1592
+ case "com.amazonaws.outposts#ConflictException":
1593
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1594
+ case "InternalServerException":
1595
+ case "com.amazonaws.outposts#InternalServerException":
1596
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1597
+ case "NotFoundException":
1598
+ case "com.amazonaws.outposts#NotFoundException":
1599
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1600
+ case "ValidationException":
1601
+ case "com.amazonaws.outposts#ValidationException":
1602
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1603
+ default:
1604
+ const parsedBody = parsedOutput.body;
1605
+ throwDefaultError({
1606
+ output,
1607
+ parsedBody,
1608
+ exceptionCtor: __BaseException,
1609
+ errorCode,
1610
+ });
1611
+ }
1612
+ };
1613
+ export const deserializeAws_restJson1UpdateSiteAddressCommand = async (output, context) => {
1614
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1615
+ return deserializeAws_restJson1UpdateSiteAddressCommandError(output, context);
1616
+ }
1617
+ const contents = map({
1618
+ $metadata: deserializeMetadata(output),
2263
1619
  });
2264
- }); };
2265
- export var deserializeAws_restJson1UpdateSiteCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2266
- var contents, data, _a, _b;
2267
- return __generator(this, function (_c) {
2268
- switch (_c.label) {
2269
- case 0:
2270
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2271
- return [2, deserializeAws_restJson1UpdateSiteCommandError(output, context)];
2272
- }
2273
- contents = map({
2274
- $metadata: deserializeMetadata(output),
2275
- });
2276
- _a = __expectNonNull;
2277
- _b = __expectObject;
2278
- return [4, parseBody(output.body, context)];
2279
- case 1:
2280
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2281
- if (data.Site != null) {
2282
- contents.Site = deserializeAws_restJson1Site(data.Site, context);
2283
- }
2284
- return [2, contents];
2285
- }
1620
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1621
+ if (data.Address != null) {
1622
+ contents.Address = deserializeAws_restJson1Address(data.Address, context);
1623
+ }
1624
+ if (data.AddressType != null) {
1625
+ contents.AddressType = __expectString(data.AddressType);
1626
+ }
1627
+ return contents;
1628
+ };
1629
+ const deserializeAws_restJson1UpdateSiteAddressCommandError = async (output, context) => {
1630
+ const parsedOutput = {
1631
+ ...output,
1632
+ body: await parseErrorBody(output.body, context),
1633
+ };
1634
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1635
+ switch (errorCode) {
1636
+ case "AccessDeniedException":
1637
+ case "com.amazonaws.outposts#AccessDeniedException":
1638
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1639
+ case "ConflictException":
1640
+ case "com.amazonaws.outposts#ConflictException":
1641
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1642
+ case "InternalServerException":
1643
+ case "com.amazonaws.outposts#InternalServerException":
1644
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1645
+ case "NotFoundException":
1646
+ case "com.amazonaws.outposts#NotFoundException":
1647
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1648
+ case "ValidationException":
1649
+ case "com.amazonaws.outposts#ValidationException":
1650
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1651
+ default:
1652
+ const parsedBody = parsedOutput.body;
1653
+ throwDefaultError({
1654
+ output,
1655
+ parsedBody,
1656
+ exceptionCtor: __BaseException,
1657
+ errorCode,
1658
+ });
1659
+ }
1660
+ };
1661
+ export const deserializeAws_restJson1UpdateSiteRackPhysicalPropertiesCommand = async (output, context) => {
1662
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1663
+ return deserializeAws_restJson1UpdateSiteRackPhysicalPropertiesCommandError(output, context);
1664
+ }
1665
+ const contents = map({
1666
+ $metadata: deserializeMetadata(output),
2286
1667
  });
2287
- }); };
2288
- var deserializeAws_restJson1UpdateSiteCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2289
- var parsedOutput, _a, errorCode, _b, parsedBody;
2290
- var _c;
2291
- return __generator(this, function (_d) {
2292
- switch (_d.label) {
2293
- case 0:
2294
- _a = [__assign({}, output)];
2295
- _c = {};
2296
- return [4, parseErrorBody(output.body, context)];
2297
- case 1:
2298
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2299
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2300
- _b = errorCode;
2301
- switch (_b) {
2302
- case "AccessDeniedException": return [3, 2];
2303
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
2304
- case "ConflictException": return [3, 4];
2305
- case "com.amazonaws.outposts#ConflictException": return [3, 4];
2306
- case "InternalServerException": return [3, 6];
2307
- case "com.amazonaws.outposts#InternalServerException": return [3, 6];
2308
- case "NotFoundException": return [3, 8];
2309
- case "com.amazonaws.outposts#NotFoundException": return [3, 8];
2310
- case "ValidationException": return [3, 10];
2311
- case "com.amazonaws.outposts#ValidationException": return [3, 10];
2312
- }
2313
- return [3, 12];
2314
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2315
- case 3: throw _d.sent();
2316
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2317
- case 5: throw _d.sent();
2318
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2319
- case 7: throw _d.sent();
2320
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
2321
- case 9: throw _d.sent();
2322
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2323
- case 11: throw _d.sent();
2324
- case 12:
2325
- parsedBody = parsedOutput.body;
2326
- throwDefaultError({
2327
- output: output,
2328
- parsedBody: parsedBody,
2329
- exceptionCtor: __BaseException,
2330
- errorCode: errorCode,
2331
- });
2332
- _d.label = 13;
2333
- case 13: return [2];
2334
- }
1668
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1669
+ if (data.Site != null) {
1670
+ contents.Site = deserializeAws_restJson1Site(data.Site, context);
1671
+ }
1672
+ return contents;
1673
+ };
1674
+ const deserializeAws_restJson1UpdateSiteRackPhysicalPropertiesCommandError = async (output, context) => {
1675
+ const parsedOutput = {
1676
+ ...output,
1677
+ body: await parseErrorBody(output.body, context),
1678
+ };
1679
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1680
+ switch (errorCode) {
1681
+ case "AccessDeniedException":
1682
+ case "com.amazonaws.outposts#AccessDeniedException":
1683
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1684
+ case "ConflictException":
1685
+ case "com.amazonaws.outposts#ConflictException":
1686
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1687
+ case "InternalServerException":
1688
+ case "com.amazonaws.outposts#InternalServerException":
1689
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1690
+ case "NotFoundException":
1691
+ case "com.amazonaws.outposts#NotFoundException":
1692
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1693
+ case "ValidationException":
1694
+ case "com.amazonaws.outposts#ValidationException":
1695
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1696
+ default:
1697
+ const parsedBody = parsedOutput.body;
1698
+ throwDefaultError({
1699
+ output,
1700
+ parsedBody,
1701
+ exceptionCtor: __BaseException,
1702
+ errorCode,
1703
+ });
1704
+ }
1705
+ };
1706
+ const map = __map;
1707
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1708
+ const contents = map({});
1709
+ const data = parsedOutput.body;
1710
+ if (data.Message != null) {
1711
+ contents.Message = __expectString(data.Message);
1712
+ }
1713
+ const exception = new AccessDeniedException({
1714
+ $metadata: deserializeMetadata(parsedOutput),
1715
+ ...contents,
2335
1716
  });
2336
- }); };
2337
- export var deserializeAws_restJson1UpdateSiteAddressCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2338
- var contents, data, _a, _b;
2339
- return __generator(this, function (_c) {
2340
- switch (_c.label) {
2341
- case 0:
2342
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2343
- return [2, deserializeAws_restJson1UpdateSiteAddressCommandError(output, context)];
2344
- }
2345
- contents = map({
2346
- $metadata: deserializeMetadata(output),
2347
- });
2348
- _a = __expectNonNull;
2349
- _b = __expectObject;
2350
- return [4, parseBody(output.body, context)];
2351
- case 1:
2352
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2353
- if (data.Address != null) {
2354
- contents.Address = deserializeAws_restJson1Address(data.Address, context);
2355
- }
2356
- if (data.AddressType != null) {
2357
- contents.AddressType = __expectString(data.AddressType);
2358
- }
2359
- return [2, contents];
2360
- }
1717
+ return __decorateServiceException(exception, parsedOutput.body);
1718
+ };
1719
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1720
+ const contents = map({});
1721
+ const data = parsedOutput.body;
1722
+ if (data.Message != null) {
1723
+ contents.Message = __expectString(data.Message);
1724
+ }
1725
+ if (data.ResourceId != null) {
1726
+ contents.ResourceId = __expectString(data.ResourceId);
1727
+ }
1728
+ if (data.ResourceType != null) {
1729
+ contents.ResourceType = __expectString(data.ResourceType);
1730
+ }
1731
+ const exception = new ConflictException({
1732
+ $metadata: deserializeMetadata(parsedOutput),
1733
+ ...contents,
2361
1734
  });
2362
- }); };
2363
- var deserializeAws_restJson1UpdateSiteAddressCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2364
- var parsedOutput, _a, errorCode, _b, parsedBody;
2365
- var _c;
2366
- return __generator(this, function (_d) {
2367
- switch (_d.label) {
2368
- case 0:
2369
- _a = [__assign({}, output)];
2370
- _c = {};
2371
- return [4, parseErrorBody(output.body, context)];
2372
- case 1:
2373
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2374
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2375
- _b = errorCode;
2376
- switch (_b) {
2377
- case "AccessDeniedException": return [3, 2];
2378
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
2379
- case "ConflictException": return [3, 4];
2380
- case "com.amazonaws.outposts#ConflictException": return [3, 4];
2381
- case "InternalServerException": return [3, 6];
2382
- case "com.amazonaws.outposts#InternalServerException": return [3, 6];
2383
- case "NotFoundException": return [3, 8];
2384
- case "com.amazonaws.outposts#NotFoundException": return [3, 8];
2385
- case "ValidationException": return [3, 10];
2386
- case "com.amazonaws.outposts#ValidationException": return [3, 10];
2387
- }
2388
- return [3, 12];
2389
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2390
- case 3: throw _d.sent();
2391
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2392
- case 5: throw _d.sent();
2393
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2394
- case 7: throw _d.sent();
2395
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
2396
- case 9: throw _d.sent();
2397
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2398
- case 11: throw _d.sent();
2399
- case 12:
2400
- parsedBody = parsedOutput.body;
2401
- throwDefaultError({
2402
- output: output,
2403
- parsedBody: parsedBody,
2404
- exceptionCtor: __BaseException,
2405
- errorCode: errorCode,
2406
- });
2407
- _d.label = 13;
2408
- case 13: return [2];
2409
- }
1735
+ return __decorateServiceException(exception, parsedOutput.body);
1736
+ };
1737
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
1738
+ const contents = map({});
1739
+ const data = parsedOutput.body;
1740
+ if (data.Message != null) {
1741
+ contents.Message = __expectString(data.Message);
1742
+ }
1743
+ const exception = new InternalServerException({
1744
+ $metadata: deserializeMetadata(parsedOutput),
1745
+ ...contents,
2410
1746
  });
2411
- }); };
2412
- export var deserializeAws_restJson1UpdateSiteRackPhysicalPropertiesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2413
- var contents, data, _a, _b;
2414
- return __generator(this, function (_c) {
2415
- switch (_c.label) {
2416
- case 0:
2417
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2418
- return [2, deserializeAws_restJson1UpdateSiteRackPhysicalPropertiesCommandError(output, context)];
2419
- }
2420
- contents = map({
2421
- $metadata: deserializeMetadata(output),
2422
- });
2423
- _a = __expectNonNull;
2424
- _b = __expectObject;
2425
- return [4, parseBody(output.body, context)];
2426
- case 1:
2427
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2428
- if (data.Site != null) {
2429
- contents.Site = deserializeAws_restJson1Site(data.Site, context);
2430
- }
2431
- return [2, contents];
2432
- }
1747
+ return __decorateServiceException(exception, parsedOutput.body);
1748
+ };
1749
+ const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
1750
+ const contents = map({});
1751
+ const data = parsedOutput.body;
1752
+ if (data.Message != null) {
1753
+ contents.Message = __expectString(data.Message);
1754
+ }
1755
+ const exception = new NotFoundException({
1756
+ $metadata: deserializeMetadata(parsedOutput),
1757
+ ...contents,
2433
1758
  });
2434
- }); };
2435
- var deserializeAws_restJson1UpdateSiteRackPhysicalPropertiesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2436
- var parsedOutput, _a, errorCode, _b, parsedBody;
2437
- var _c;
2438
- return __generator(this, function (_d) {
2439
- switch (_d.label) {
2440
- case 0:
2441
- _a = [__assign({}, output)];
2442
- _c = {};
2443
- return [4, parseErrorBody(output.body, context)];
2444
- case 1:
2445
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2446
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2447
- _b = errorCode;
2448
- switch (_b) {
2449
- case "AccessDeniedException": return [3, 2];
2450
- case "com.amazonaws.outposts#AccessDeniedException": return [3, 2];
2451
- case "ConflictException": return [3, 4];
2452
- case "com.amazonaws.outposts#ConflictException": return [3, 4];
2453
- case "InternalServerException": return [3, 6];
2454
- case "com.amazonaws.outposts#InternalServerException": return [3, 6];
2455
- case "NotFoundException": return [3, 8];
2456
- case "com.amazonaws.outposts#NotFoundException": return [3, 8];
2457
- case "ValidationException": return [3, 10];
2458
- case "com.amazonaws.outposts#ValidationException": return [3, 10];
2459
- }
2460
- return [3, 12];
2461
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2462
- case 3: throw _d.sent();
2463
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2464
- case 5: throw _d.sent();
2465
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2466
- case 7: throw _d.sent();
2467
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
2468
- case 9: throw _d.sent();
2469
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2470
- case 11: throw _d.sent();
2471
- case 12:
2472
- parsedBody = parsedOutput.body;
2473
- throwDefaultError({
2474
- output: output,
2475
- parsedBody: parsedBody,
2476
- exceptionCtor: __BaseException,
2477
- errorCode: errorCode,
2478
- });
2479
- _d.label = 13;
2480
- case 13: return [2];
2481
- }
1759
+ return __decorateServiceException(exception, parsedOutput.body);
1760
+ };
1761
+ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
1762
+ const contents = map({});
1763
+ const data = parsedOutput.body;
1764
+ if (data.Message != null) {
1765
+ contents.Message = __expectString(data.Message);
1766
+ }
1767
+ const exception = new ServiceQuotaExceededException({
1768
+ $metadata: deserializeMetadata(parsedOutput),
1769
+ ...contents,
2482
1770
  });
2483
- }); };
2484
- var map = __map;
2485
- var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2486
- var contents, data, exception;
2487
- return __generator(this, function (_a) {
2488
- contents = map({});
2489
- data = parsedOutput.body;
2490
- if (data.Message != null) {
2491
- contents.Message = __expectString(data.Message);
2492
- }
2493
- exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2494
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2495
- });
2496
- }); };
2497
- var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2498
- var contents, data, exception;
2499
- return __generator(this, function (_a) {
2500
- contents = map({});
2501
- data = parsedOutput.body;
2502
- if (data.Message != null) {
2503
- contents.Message = __expectString(data.Message);
2504
- }
2505
- if (data.ResourceId != null) {
2506
- contents.ResourceId = __expectString(data.ResourceId);
2507
- }
2508
- if (data.ResourceType != null) {
2509
- contents.ResourceType = __expectString(data.ResourceType);
2510
- }
2511
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2512
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2513
- });
2514
- }); };
2515
- var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2516
- var contents, data, exception;
2517
- return __generator(this, function (_a) {
2518
- contents = map({});
2519
- data = parsedOutput.body;
2520
- if (data.Message != null) {
2521
- contents.Message = __expectString(data.Message);
2522
- }
2523
- exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2524
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2525
- });
2526
- }); };
2527
- var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2528
- var contents, data, exception;
2529
- return __generator(this, function (_a) {
2530
- contents = map({});
2531
- data = parsedOutput.body;
2532
- if (data.Message != null) {
2533
- contents.Message = __expectString(data.Message);
2534
- }
2535
- exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2536
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2537
- });
2538
- }); };
2539
- var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2540
- var contents, data, exception;
2541
- return __generator(this, function (_a) {
2542
- contents = map({});
2543
- data = parsedOutput.body;
2544
- if (data.Message != null) {
2545
- contents.Message = __expectString(data.Message);
2546
- }
2547
- exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2548
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2549
- });
2550
- }); };
2551
- var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2552
- var contents, data, exception;
2553
- return __generator(this, function (_a) {
2554
- contents = map({});
2555
- data = parsedOutput.body;
2556
- if (data.Message != null) {
2557
- contents.Message = __expectString(data.Message);
2558
- }
2559
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2560
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1771
+ return __decorateServiceException(exception, parsedOutput.body);
1772
+ };
1773
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1774
+ const contents = map({});
1775
+ const data = parsedOutput.body;
1776
+ if (data.Message != null) {
1777
+ contents.Message = __expectString(data.Message);
1778
+ }
1779
+ const exception = new ValidationException({
1780
+ $metadata: deserializeMetadata(parsedOutput),
1781
+ ...contents,
2561
1782
  });
2562
- }); };
2563
- var serializeAws_restJson1Address = function (input, context) {
2564
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AddressLine1 != null && { AddressLine1: input.AddressLine1 })), (input.AddressLine2 != null && { AddressLine2: input.AddressLine2 })), (input.AddressLine3 != null && { AddressLine3: input.AddressLine3 })), (input.City != null && { City: input.City })), (input.ContactName != null && { ContactName: input.ContactName })), (input.ContactPhoneNumber != null && { ContactPhoneNumber: input.ContactPhoneNumber })), (input.CountryCode != null && { CountryCode: input.CountryCode })), (input.DistrictOrCounty != null && { DistrictOrCounty: input.DistrictOrCounty })), (input.Municipality != null && { Municipality: input.Municipality })), (input.PostalCode != null && { PostalCode: input.PostalCode })), (input.StateOrRegion != null && { StateOrRegion: input.StateOrRegion }));
1783
+ return __decorateServiceException(exception, parsedOutput.body);
2565
1784
  };
2566
- var serializeAws_restJson1LineItemRequest = function (input, context) {
2567
- return __assign(__assign({}, (input.CatalogItemId != null && { CatalogItemId: input.CatalogItemId })), (input.Quantity != null && { Quantity: input.Quantity }));
1785
+ const serializeAws_restJson1Address = (input, context) => {
1786
+ return {
1787
+ ...(input.AddressLine1 != null && { AddressLine1: input.AddressLine1 }),
1788
+ ...(input.AddressLine2 != null && { AddressLine2: input.AddressLine2 }),
1789
+ ...(input.AddressLine3 != null && { AddressLine3: input.AddressLine3 }),
1790
+ ...(input.City != null && { City: input.City }),
1791
+ ...(input.ContactName != null && { ContactName: input.ContactName }),
1792
+ ...(input.ContactPhoneNumber != null && { ContactPhoneNumber: input.ContactPhoneNumber }),
1793
+ ...(input.CountryCode != null && { CountryCode: input.CountryCode }),
1794
+ ...(input.DistrictOrCounty != null && { DistrictOrCounty: input.DistrictOrCounty }),
1795
+ ...(input.Municipality != null && { Municipality: input.Municipality }),
1796
+ ...(input.PostalCode != null && { PostalCode: input.PostalCode }),
1797
+ ...(input.StateOrRegion != null && { StateOrRegion: input.StateOrRegion }),
1798
+ };
1799
+ };
1800
+ const serializeAws_restJson1LineItemRequest = (input, context) => {
1801
+ return {
1802
+ ...(input.CatalogItemId != null && { CatalogItemId: input.CatalogItemId }),
1803
+ ...(input.Quantity != null && { Quantity: input.Quantity }),
1804
+ };
2568
1805
  };
2569
- var serializeAws_restJson1LineItemRequestListDefinition = function (input, context) {
1806
+ const serializeAws_restJson1LineItemRequestListDefinition = (input, context) => {
2570
1807
  return input
2571
- .filter(function (e) { return e != null; })
2572
- .map(function (entry) {
1808
+ .filter((e) => e != null)
1809
+ .map((entry) => {
2573
1810
  return serializeAws_restJson1LineItemRequest(entry, context);
2574
1811
  });
2575
1812
  };
2576
- var serializeAws_restJson1RackPhysicalProperties = function (input, context) {
2577
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.FiberOpticCableType != null && { FiberOpticCableType: input.FiberOpticCableType })), (input.MaximumSupportedWeightLbs != null && { MaximumSupportedWeightLbs: input.MaximumSupportedWeightLbs })), (input.OpticalStandard != null && { OpticalStandard: input.OpticalStandard })), (input.PowerConnector != null && { PowerConnector: input.PowerConnector })), (input.PowerDrawKva != null && { PowerDrawKva: input.PowerDrawKva })), (input.PowerFeedDrop != null && { PowerFeedDrop: input.PowerFeedDrop })), (input.PowerPhase != null && { PowerPhase: input.PowerPhase })), (input.UplinkCount != null && { UplinkCount: input.UplinkCount })), (input.UplinkGbps != null && { UplinkGbps: input.UplinkGbps }));
1813
+ const serializeAws_restJson1RackPhysicalProperties = (input, context) => {
1814
+ return {
1815
+ ...(input.FiberOpticCableType != null && { FiberOpticCableType: input.FiberOpticCableType }),
1816
+ ...(input.MaximumSupportedWeightLbs != null && { MaximumSupportedWeightLbs: input.MaximumSupportedWeightLbs }),
1817
+ ...(input.OpticalStandard != null && { OpticalStandard: input.OpticalStandard }),
1818
+ ...(input.PowerConnector != null && { PowerConnector: input.PowerConnector }),
1819
+ ...(input.PowerDrawKva != null && { PowerDrawKva: input.PowerDrawKva }),
1820
+ ...(input.PowerFeedDrop != null && { PowerFeedDrop: input.PowerFeedDrop }),
1821
+ ...(input.PowerPhase != null && { PowerPhase: input.PowerPhase }),
1822
+ ...(input.UplinkCount != null && { UplinkCount: input.UplinkCount }),
1823
+ ...(input.UplinkGbps != null && { UplinkGbps: input.UplinkGbps }),
1824
+ };
2578
1825
  };
2579
- var serializeAws_restJson1TagMap = function (input, context) {
2580
- return Object.entries(input).reduce(function (acc, _a) {
2581
- var _b;
2582
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1826
+ const serializeAws_restJson1TagMap = (input, context) => {
1827
+ return Object.entries(input).reduce((acc, [key, value]) => {
2583
1828
  if (value === null) {
2584
1829
  return acc;
2585
1830
  }
2586
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1831
+ return {
1832
+ ...acc,
1833
+ [key]: value,
1834
+ };
2587
1835
  }, {});
2588
1836
  };
2589
- var deserializeAws_restJson1Address = function (output, context) {
1837
+ const deserializeAws_restJson1Address = (output, context) => {
2590
1838
  return {
2591
1839
  AddressLine1: __expectString(output.AddressLine1),
2592
1840
  AddressLine2: __expectString(output.AddressLine2),
@@ -2601,7 +1849,7 @@ var deserializeAws_restJson1Address = function (output, context) {
2601
1849
  StateOrRegion: __expectString(output.StateOrRegion),
2602
1850
  };
2603
1851
  };
2604
- var deserializeAws_restJson1AssetInfo = function (output, context) {
1852
+ const deserializeAws_restJson1AssetInfo = (output, context) => {
2605
1853
  return {
2606
1854
  AssetId: __expectString(output.AssetId),
2607
1855
  AssetLocation: output.AssetLocation != null ? deserializeAws_restJson1AssetLocation(output.AssetLocation, context) : undefined,
@@ -2612,10 +1860,10 @@ var deserializeAws_restJson1AssetInfo = function (output, context) {
2612
1860
  RackId: __expectString(output.RackId),
2613
1861
  };
2614
1862
  };
2615
- var deserializeAws_restJson1AssetListDefinition = function (output, context) {
2616
- var retVal = (output || [])
2617
- .filter(function (e) { return e != null; })
2618
- .map(function (entry) {
1863
+ const deserializeAws_restJson1AssetListDefinition = (output, context) => {
1864
+ const retVal = (output || [])
1865
+ .filter((e) => e != null)
1866
+ .map((entry) => {
2619
1867
  if (entry === null) {
2620
1868
  return null;
2621
1869
  }
@@ -2623,12 +1871,12 @@ var deserializeAws_restJson1AssetListDefinition = function (output, context) {
2623
1871
  });
2624
1872
  return retVal;
2625
1873
  };
2626
- var deserializeAws_restJson1AssetLocation = function (output, context) {
1874
+ const deserializeAws_restJson1AssetLocation = (output, context) => {
2627
1875
  return {
2628
1876
  RackElevation: __limitedParseFloat32(output.RackElevation),
2629
1877
  };
2630
1878
  };
2631
- var deserializeAws_restJson1CatalogItem = function (output, context) {
1879
+ const deserializeAws_restJson1CatalogItem = (output, context) => {
2632
1880
  return {
2633
1881
  CatalogItemId: __expectString(output.CatalogItemId),
2634
1882
  EC2Capacities: output.EC2Capacities != null
@@ -2645,10 +1893,10 @@ var deserializeAws_restJson1CatalogItem = function (output, context) {
2645
1893
  WeightLbs: __expectInt32(output.WeightLbs),
2646
1894
  };
2647
1895
  };
2648
- var deserializeAws_restJson1CatalogItemListDefinition = function (output, context) {
2649
- var retVal = (output || [])
2650
- .filter(function (e) { return e != null; })
2651
- .map(function (entry) {
1896
+ const deserializeAws_restJson1CatalogItemListDefinition = (output, context) => {
1897
+ const retVal = (output || [])
1898
+ .filter((e) => e != null)
1899
+ .map((entry) => {
2652
1900
  if (entry === null) {
2653
1901
  return null;
2654
1902
  }
@@ -2656,10 +1904,10 @@ var deserializeAws_restJson1CatalogItemListDefinition = function (output, contex
2656
1904
  });
2657
1905
  return retVal;
2658
1906
  };
2659
- var deserializeAws_restJson1CIDRList = function (output, context) {
2660
- var retVal = (output || [])
2661
- .filter(function (e) { return e != null; })
2662
- .map(function (entry) {
1907
+ const deserializeAws_restJson1CIDRList = (output, context) => {
1908
+ const retVal = (output || [])
1909
+ .filter((e) => e != null)
1910
+ .map((entry) => {
2663
1911
  if (entry === null) {
2664
1912
  return null;
2665
1913
  }
@@ -2667,12 +1915,12 @@ var deserializeAws_restJson1CIDRList = function (output, context) {
2667
1915
  });
2668
1916
  return retVal;
2669
1917
  };
2670
- var deserializeAws_restJson1ComputeAttributes = function (output, context) {
1918
+ const deserializeAws_restJson1ComputeAttributes = (output, context) => {
2671
1919
  return {
2672
1920
  HostId: __expectString(output.HostId),
2673
1921
  };
2674
1922
  };
2675
- var deserializeAws_restJson1ConnectionDetails = function (output, context) {
1923
+ const deserializeAws_restJson1ConnectionDetails = (output, context) => {
2676
1924
  return {
2677
1925
  AllowedIps: output.AllowedIps != null ? deserializeAws_restJson1CIDRList(output.AllowedIps, context) : undefined,
2678
1926
  ClientPublicKey: __expectString(output.ClientPublicKey),
@@ -2682,17 +1930,17 @@ var deserializeAws_restJson1ConnectionDetails = function (output, context) {
2682
1930
  ServerTunnelAddress: __expectString(output.ServerTunnelAddress),
2683
1931
  };
2684
1932
  };
2685
- var deserializeAws_restJson1EC2Capacity = function (output, context) {
1933
+ const deserializeAws_restJson1EC2Capacity = (output, context) => {
2686
1934
  return {
2687
1935
  Family: __expectString(output.Family),
2688
1936
  MaxSize: __expectString(output.MaxSize),
2689
1937
  Quantity: __expectString(output.Quantity),
2690
1938
  };
2691
1939
  };
2692
- var deserializeAws_restJson1EC2CapacityListDefinition = function (output, context) {
2693
- var retVal = (output || [])
2694
- .filter(function (e) { return e != null; })
2695
- .map(function (entry) {
1940
+ const deserializeAws_restJson1EC2CapacityListDefinition = (output, context) => {
1941
+ const retVal = (output || [])
1942
+ .filter((e) => e != null)
1943
+ .map((entry) => {
2696
1944
  if (entry === null) {
2697
1945
  return null;
2698
1946
  }
@@ -2700,15 +1948,15 @@ var deserializeAws_restJson1EC2CapacityListDefinition = function (output, contex
2700
1948
  });
2701
1949
  return retVal;
2702
1950
  };
2703
- var deserializeAws_restJson1InstanceTypeItem = function (output, context) {
1951
+ const deserializeAws_restJson1InstanceTypeItem = (output, context) => {
2704
1952
  return {
2705
1953
  InstanceType: __expectString(output.InstanceType),
2706
1954
  };
2707
1955
  };
2708
- var deserializeAws_restJson1InstanceTypeListDefinition = function (output, context) {
2709
- var retVal = (output || [])
2710
- .filter(function (e) { return e != null; })
2711
- .map(function (entry) {
1956
+ const deserializeAws_restJson1InstanceTypeListDefinition = (output, context) => {
1957
+ const retVal = (output || [])
1958
+ .filter((e) => e != null)
1959
+ .map((entry) => {
2712
1960
  if (entry === null) {
2713
1961
  return null;
2714
1962
  }
@@ -2716,7 +1964,7 @@ var deserializeAws_restJson1InstanceTypeListDefinition = function (output, conte
2716
1964
  });
2717
1965
  return retVal;
2718
1966
  };
2719
- var deserializeAws_restJson1LineItem = function (output, context) {
1967
+ const deserializeAws_restJson1LineItem = (output, context) => {
2720
1968
  return {
2721
1969
  AssetInformationList: output.AssetInformationList != null
2722
1970
  ? deserializeAws_restJson1LineItemAssetInformationList(output.AssetInformationList, context)
@@ -2730,7 +1978,7 @@ var deserializeAws_restJson1LineItem = function (output, context) {
2730
1978
  Status: __expectString(output.Status),
2731
1979
  };
2732
1980
  };
2733
- var deserializeAws_restJson1LineItemAssetInformation = function (output, context) {
1981
+ const deserializeAws_restJson1LineItemAssetInformation = (output, context) => {
2734
1982
  return {
2735
1983
  AssetId: __expectString(output.AssetId),
2736
1984
  MacAddressList: output.MacAddressList != null
@@ -2738,10 +1986,10 @@ var deserializeAws_restJson1LineItemAssetInformation = function (output, context
2738
1986
  : undefined,
2739
1987
  };
2740
1988
  };
2741
- var deserializeAws_restJson1LineItemAssetInformationList = function (output, context) {
2742
- var retVal = (output || [])
2743
- .filter(function (e) { return e != null; })
2744
- .map(function (entry) {
1989
+ const deserializeAws_restJson1LineItemAssetInformationList = (output, context) => {
1990
+ const retVal = (output || [])
1991
+ .filter((e) => e != null)
1992
+ .map((entry) => {
2745
1993
  if (entry === null) {
2746
1994
  return null;
2747
1995
  }
@@ -2749,10 +1997,10 @@ var deserializeAws_restJson1LineItemAssetInformationList = function (output, con
2749
1997
  });
2750
1998
  return retVal;
2751
1999
  };
2752
- var deserializeAws_restJson1LineItemListDefinition = function (output, context) {
2753
- var retVal = (output || [])
2754
- .filter(function (e) { return e != null; })
2755
- .map(function (entry) {
2000
+ const deserializeAws_restJson1LineItemListDefinition = (output, context) => {
2001
+ const retVal = (output || [])
2002
+ .filter((e) => e != null)
2003
+ .map((entry) => {
2756
2004
  if (entry === null) {
2757
2005
  return null;
2758
2006
  }
@@ -2760,20 +2008,21 @@ var deserializeAws_restJson1LineItemListDefinition = function (output, context)
2760
2008
  });
2761
2009
  return retVal;
2762
2010
  };
2763
- var deserializeAws_restJson1LineItemStatusCounts = function (output, context) {
2764
- return Object.entries(output).reduce(function (acc, _a) {
2765
- var _b;
2766
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
2011
+ const deserializeAws_restJson1LineItemStatusCounts = (output, context) => {
2012
+ return Object.entries(output).reduce((acc, [key, value]) => {
2767
2013
  if (value === null) {
2768
2014
  return acc;
2769
2015
  }
2770
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectInt32(value), _b));
2016
+ return {
2017
+ ...acc,
2018
+ [key]: __expectInt32(value),
2019
+ };
2771
2020
  }, {});
2772
2021
  };
2773
- var deserializeAws_restJson1MacAddressList = function (output, context) {
2774
- var retVal = (output || [])
2775
- .filter(function (e) { return e != null; })
2776
- .map(function (entry) {
2022
+ const deserializeAws_restJson1MacAddressList = (output, context) => {
2023
+ const retVal = (output || [])
2024
+ .filter((e) => e != null)
2025
+ .map((entry) => {
2777
2026
  if (entry === null) {
2778
2027
  return null;
2779
2028
  }
@@ -2781,7 +2030,7 @@ var deserializeAws_restJson1MacAddressList = function (output, context) {
2781
2030
  });
2782
2031
  return retVal;
2783
2032
  };
2784
- var deserializeAws_restJson1Order = function (output, context) {
2033
+ const deserializeAws_restJson1Order = (output, context) => {
2785
2034
  return {
2786
2035
  LineItems: output.LineItems != null ? deserializeAws_restJson1LineItemListDefinition(output.LineItems, context) : undefined,
2787
2036
  OrderFulfilledDate: output.OrderFulfilledDate != null
@@ -2796,7 +2045,7 @@ var deserializeAws_restJson1Order = function (output, context) {
2796
2045
  Status: __expectString(output.Status),
2797
2046
  };
2798
2047
  };
2799
- var deserializeAws_restJson1OrderSummary = function (output, context) {
2048
+ const deserializeAws_restJson1OrderSummary = (output, context) => {
2800
2049
  return {
2801
2050
  LineItemCountsByStatus: output.LineItemCountsByStatus != null
2802
2051
  ? deserializeAws_restJson1LineItemStatusCounts(output.LineItemCountsByStatus, context)
@@ -2813,10 +2062,10 @@ var deserializeAws_restJson1OrderSummary = function (output, context) {
2813
2062
  Status: __expectString(output.Status),
2814
2063
  };
2815
2064
  };
2816
- var deserializeAws_restJson1OrderSummaryListDefinition = function (output, context) {
2817
- var retVal = (output || [])
2818
- .filter(function (e) { return e != null; })
2819
- .map(function (entry) {
2065
+ const deserializeAws_restJson1OrderSummaryListDefinition = (output, context) => {
2066
+ const retVal = (output || [])
2067
+ .filter((e) => e != null)
2068
+ .map((entry) => {
2820
2069
  if (entry === null) {
2821
2070
  return null;
2822
2071
  }
@@ -2824,7 +2073,7 @@ var deserializeAws_restJson1OrderSummaryListDefinition = function (output, conte
2824
2073
  });
2825
2074
  return retVal;
2826
2075
  };
2827
- var deserializeAws_restJson1Outpost = function (output, context) {
2076
+ const deserializeAws_restJson1Outpost = (output, context) => {
2828
2077
  return {
2829
2078
  AvailabilityZone: __expectString(output.AvailabilityZone),
2830
2079
  AvailabilityZoneId: __expectString(output.AvailabilityZoneId),
@@ -2840,10 +2089,10 @@ var deserializeAws_restJson1Outpost = function (output, context) {
2840
2089
  Tags: output.Tags != null ? deserializeAws_restJson1TagMap(output.Tags, context) : undefined,
2841
2090
  };
2842
2091
  };
2843
- var deserializeAws_restJson1outpostListDefinition = function (output, context) {
2844
- var retVal = (output || [])
2845
- .filter(function (e) { return e != null; })
2846
- .map(function (entry) {
2092
+ const deserializeAws_restJson1outpostListDefinition = (output, context) => {
2093
+ const retVal = (output || [])
2094
+ .filter((e) => e != null)
2095
+ .map((entry) => {
2847
2096
  if (entry === null) {
2848
2097
  return null;
2849
2098
  }
@@ -2851,7 +2100,7 @@ var deserializeAws_restJson1outpostListDefinition = function (output, context) {
2851
2100
  });
2852
2101
  return retVal;
2853
2102
  };
2854
- var deserializeAws_restJson1RackPhysicalProperties = function (output, context) {
2103
+ const deserializeAws_restJson1RackPhysicalProperties = (output, context) => {
2855
2104
  return {
2856
2105
  FiberOpticCableType: __expectString(output.FiberOpticCableType),
2857
2106
  MaximumSupportedWeightLbs: __expectString(output.MaximumSupportedWeightLbs),
@@ -2864,13 +2113,13 @@ var deserializeAws_restJson1RackPhysicalProperties = function (output, context)
2864
2113
  UplinkGbps: __expectString(output.UplinkGbps),
2865
2114
  };
2866
2115
  };
2867
- var deserializeAws_restJson1ShipmentInformation = function (output, context) {
2116
+ const deserializeAws_restJson1ShipmentInformation = (output, context) => {
2868
2117
  return {
2869
2118
  ShipmentCarrier: __expectString(output.ShipmentCarrier),
2870
2119
  ShipmentTrackingNumber: __expectString(output.ShipmentTrackingNumber),
2871
2120
  };
2872
2121
  };
2873
- var deserializeAws_restJson1Site = function (output, context) {
2122
+ const deserializeAws_restJson1Site = (output, context) => {
2874
2123
  return {
2875
2124
  AccountId: __expectString(output.AccountId),
2876
2125
  Description: __expectString(output.Description),
@@ -2887,10 +2136,10 @@ var deserializeAws_restJson1Site = function (output, context) {
2887
2136
  Tags: output.Tags != null ? deserializeAws_restJson1TagMap(output.Tags, context) : undefined,
2888
2137
  };
2889
2138
  };
2890
- var deserializeAws_restJson1siteListDefinition = function (output, context) {
2891
- var retVal = (output || [])
2892
- .filter(function (e) { return e != null; })
2893
- .map(function (entry) {
2139
+ const deserializeAws_restJson1siteListDefinition = (output, context) => {
2140
+ const retVal = (output || [])
2141
+ .filter((e) => e != null)
2142
+ .map((entry) => {
2894
2143
  if (entry === null) {
2895
2144
  return null;
2896
2145
  }
@@ -2898,10 +2147,10 @@ var deserializeAws_restJson1siteListDefinition = function (output, context) {
2898
2147
  });
2899
2148
  return retVal;
2900
2149
  };
2901
- var deserializeAws_restJson1SupportedStorageList = function (output, context) {
2902
- var retVal = (output || [])
2903
- .filter(function (e) { return e != null; })
2904
- .map(function (entry) {
2150
+ const deserializeAws_restJson1SupportedStorageList = (output, context) => {
2151
+ const retVal = (output || [])
2152
+ .filter((e) => e != null)
2153
+ .map((entry) => {
2905
2154
  if (entry === null) {
2906
2155
  return null;
2907
2156
  }
@@ -2909,10 +2158,10 @@ var deserializeAws_restJson1SupportedStorageList = function (output, context) {
2909
2158
  });
2910
2159
  return retVal;
2911
2160
  };
2912
- var deserializeAws_restJson1SupportedUplinkGbpsListDefinition = function (output, context) {
2913
- var retVal = (output || [])
2914
- .filter(function (e) { return e != null; })
2915
- .map(function (entry) {
2161
+ const deserializeAws_restJson1SupportedUplinkGbpsListDefinition = (output, context) => {
2162
+ const retVal = (output || [])
2163
+ .filter((e) => e != null)
2164
+ .map((entry) => {
2916
2165
  if (entry === null) {
2917
2166
  return null;
2918
2167
  }
@@ -2920,67 +2169,50 @@ var deserializeAws_restJson1SupportedUplinkGbpsListDefinition = function (output
2920
2169
  });
2921
2170
  return retVal;
2922
2171
  };
2923
- var deserializeAws_restJson1TagMap = function (output, context) {
2924
- return Object.entries(output).reduce(function (acc, _a) {
2925
- var _b;
2926
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
2172
+ const deserializeAws_restJson1TagMap = (output, context) => {
2173
+ return Object.entries(output).reduce((acc, [key, value]) => {
2927
2174
  if (value === null) {
2928
2175
  return acc;
2929
2176
  }
2930
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
2177
+ return {
2178
+ ...acc,
2179
+ [key]: __expectString(value),
2180
+ };
2931
2181
  }, {});
2932
2182
  };
2933
- var deserializeMetadata = function (output) {
2934
- var _a;
2935
- return ({
2936
- httpStatusCode: output.statusCode,
2937
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
2938
- extendedRequestId: output.headers["x-amz-id-2"],
2939
- cfId: output.headers["x-amz-cf-id"],
2940
- });
2941
- };
2942
- var collectBody = function (streamBody, context) {
2943
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
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) => {
2944
2190
  if (streamBody instanceof Uint8Array) {
2945
2191
  return Promise.resolve(streamBody);
2946
2192
  }
2947
2193
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2948
2194
  };
2949
- var collectBodyString = function (streamBody, context) {
2950
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
2951
- };
2952
- var isSerializableHeaderValue = function (value) {
2953
- return value !== undefined &&
2954
- value !== null &&
2955
- value !== "" &&
2956
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2957
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
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;
2958
2211
  };
2959
- var parseBody = function (streamBody, context) {
2960
- return collectBodyString(streamBody, context).then(function (encoded) {
2961
- if (encoded.length) {
2962
- return JSON.parse(encoded);
2963
- }
2964
- return {};
2965
- });
2966
- };
2967
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
2968
- var value;
2969
- var _a;
2970
- return __generator(this, function (_b) {
2971
- switch (_b.label) {
2972
- case 0: return [4, parseBody(errorBody, context)];
2973
- case 1:
2974
- value = _b.sent();
2975
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
2976
- return [2, value];
2977
- }
2978
- });
2979
- }); };
2980
- var loadRestJsonErrorCode = function (output, data) {
2981
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
2982
- var sanitizeErrorCode = function (rawValue) {
2983
- var cleanValue = rawValue;
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;
2984
2216
  if (typeof cleanValue === "number") {
2985
2217
  cleanValue = cleanValue.toString();
2986
2218
  }
@@ -2995,7 +2227,7 @@ var loadRestJsonErrorCode = function (output, data) {
2995
2227
  }
2996
2228
  return cleanValue;
2997
2229
  };
2998
- var headerKey = findKey(output.headers, "x-amzn-errortype");
2230
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
2999
2231
  if (headerKey !== undefined) {
3000
2232
  return sanitizeErrorCode(output.headers[headerKey]);
3001
2233
  }