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