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