@aws-sdk/client-migration-hub-refactor-spaces 3.43.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 (172) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +201 -0
  3. package/README.md +215 -0
  4. package/dist-cjs/MigrationHubRefactorSpaces.js +352 -0
  5. package/dist-cjs/MigrationHubRefactorSpacesClient.js +35 -0
  6. package/dist-cjs/commands/CreateApplicationCommand.js +36 -0
  7. package/dist-cjs/commands/CreateEnvironmentCommand.js +36 -0
  8. package/dist-cjs/commands/CreateRouteCommand.js +36 -0
  9. package/dist-cjs/commands/CreateServiceCommand.js +36 -0
  10. package/dist-cjs/commands/DeleteApplicationCommand.js +36 -0
  11. package/dist-cjs/commands/DeleteEnvironmentCommand.js +36 -0
  12. package/dist-cjs/commands/DeleteResourcePolicyCommand.js +36 -0
  13. package/dist-cjs/commands/DeleteRouteCommand.js +36 -0
  14. package/dist-cjs/commands/DeleteServiceCommand.js +36 -0
  15. package/dist-cjs/commands/GetApplicationCommand.js +36 -0
  16. package/dist-cjs/commands/GetEnvironmentCommand.js +36 -0
  17. package/dist-cjs/commands/GetResourcePolicyCommand.js +36 -0
  18. package/dist-cjs/commands/GetRouteCommand.js +36 -0
  19. package/dist-cjs/commands/GetServiceCommand.js +36 -0
  20. package/dist-cjs/commands/ListApplicationsCommand.js +36 -0
  21. package/dist-cjs/commands/ListEnvironmentVpcsCommand.js +36 -0
  22. package/dist-cjs/commands/ListEnvironmentsCommand.js +36 -0
  23. package/dist-cjs/commands/ListRoutesCommand.js +36 -0
  24. package/dist-cjs/commands/ListServicesCommand.js +36 -0
  25. package/dist-cjs/commands/ListTagsForResourceCommand.js +36 -0
  26. package/dist-cjs/commands/PutResourcePolicyCommand.js +36 -0
  27. package/dist-cjs/commands/TagResourceCommand.js +36 -0
  28. package/dist-cjs/commands/UntagResourceCommand.js +36 -0
  29. package/dist-cjs/commands/index.js +26 -0
  30. package/dist-cjs/endpoints.js +130 -0
  31. package/dist-cjs/index.js +8 -0
  32. package/dist-cjs/models/index.js +4 -0
  33. package/dist-cjs/models/models_0.js +561 -0
  34. package/dist-cjs/pagination/Interfaces.js +2 -0
  35. package/dist-cjs/pagination/ListApplicationsPaginator.js +35 -0
  36. package/dist-cjs/pagination/ListEnvironmentVpcsPaginator.js +35 -0
  37. package/dist-cjs/pagination/ListEnvironmentsPaginator.js +35 -0
  38. package/dist-cjs/pagination/ListRoutesPaginator.js +35 -0
  39. package/dist-cjs/pagination/ListServicesPaginator.js +35 -0
  40. package/dist-cjs/pagination/index.js +9 -0
  41. package/dist-cjs/protocols/Aws_restJson1.js +3834 -0
  42. package/dist-cjs/runtimeConfig.browser.js +40 -0
  43. package/dist-cjs/runtimeConfig.js +44 -0
  44. package/dist-cjs/runtimeConfig.native.js +16 -0
  45. package/dist-cjs/runtimeConfig.shared.js +17 -0
  46. package/dist-es/MigrationHubRefactorSpaces.js +355 -0
  47. package/dist-es/MigrationHubRefactorSpacesClient.js +37 -0
  48. package/dist-es/commands/CreateApplicationCommand.js +39 -0
  49. package/dist-es/commands/CreateEnvironmentCommand.js +39 -0
  50. package/dist-es/commands/CreateRouteCommand.js +39 -0
  51. package/dist-es/commands/CreateServiceCommand.js +39 -0
  52. package/dist-es/commands/DeleteApplicationCommand.js +39 -0
  53. package/dist-es/commands/DeleteEnvironmentCommand.js +39 -0
  54. package/dist-es/commands/DeleteResourcePolicyCommand.js +39 -0
  55. package/dist-es/commands/DeleteRouteCommand.js +39 -0
  56. package/dist-es/commands/DeleteServiceCommand.js +39 -0
  57. package/dist-es/commands/GetApplicationCommand.js +39 -0
  58. package/dist-es/commands/GetEnvironmentCommand.js +39 -0
  59. package/dist-es/commands/GetResourcePolicyCommand.js +39 -0
  60. package/dist-es/commands/GetRouteCommand.js +39 -0
  61. package/dist-es/commands/GetServiceCommand.js +39 -0
  62. package/dist-es/commands/ListApplicationsCommand.js +39 -0
  63. package/dist-es/commands/ListEnvironmentVpcsCommand.js +39 -0
  64. package/dist-es/commands/ListEnvironmentsCommand.js +39 -0
  65. package/dist-es/commands/ListRoutesCommand.js +39 -0
  66. package/dist-es/commands/ListServicesCommand.js +39 -0
  67. package/dist-es/commands/ListTagsForResourceCommand.js +39 -0
  68. package/dist-es/commands/PutResourcePolicyCommand.js +39 -0
  69. package/dist-es/commands/TagResourceCommand.js +39 -0
  70. package/dist-es/commands/UntagResourceCommand.js +39 -0
  71. package/dist-es/commands/index.js +23 -0
  72. package/dist-es/endpoints.js +126 -0
  73. package/dist-es/index.js +5 -0
  74. package/dist-es/models/index.js +1 -0
  75. package/dist-es/models/models_0.js +395 -0
  76. package/dist-es/pagination/Interfaces.js +1 -0
  77. package/dist-es/pagination/ListApplicationsPaginator.js +74 -0
  78. package/dist-es/pagination/ListEnvironmentVpcsPaginator.js +74 -0
  79. package/dist-es/pagination/ListEnvironmentsPaginator.js +74 -0
  80. package/dist-es/pagination/ListRoutesPaginator.js +74 -0
  81. package/dist-es/pagination/ListServicesPaginator.js +74 -0
  82. package/dist-es/pagination/index.js +6 -0
  83. package/dist-es/protocols/Aws_restJson1.js +4225 -0
  84. package/dist-es/runtimeConfig.browser.js +17 -0
  85. package/dist-es/runtimeConfig.js +21 -0
  86. package/dist-es/runtimeConfig.native.js +8 -0
  87. package/dist-es/runtimeConfig.shared.js +13 -0
  88. package/dist-types/MigrationHubRefactorSpaces.d.ts +240 -0
  89. package/dist-types/MigrationHubRefactorSpacesClient.d.ts +169 -0
  90. package/dist-types/commands/CreateApplicationCommand.d.ts +38 -0
  91. package/dist-types/commands/CreateEnvironmentCommand.d.ts +39 -0
  92. package/dist-types/commands/CreateRouteCommand.d.ts +70 -0
  93. package/dist-types/commands/CreateServiceCommand.d.ts +44 -0
  94. package/dist-types/commands/DeleteApplicationCommand.d.ts +36 -0
  95. package/dist-types/commands/DeleteEnvironmentCommand.d.ts +36 -0
  96. package/dist-types/commands/DeleteResourcePolicyCommand.d.ts +35 -0
  97. package/dist-types/commands/DeleteRouteCommand.d.ts +35 -0
  98. package/dist-types/commands/DeleteServiceCommand.d.ts +35 -0
  99. package/dist-types/commands/GetApplicationCommand.d.ts +35 -0
  100. package/dist-types/commands/GetEnvironmentCommand.d.ts +35 -0
  101. package/dist-types/commands/GetResourcePolicyCommand.d.ts +35 -0
  102. package/dist-types/commands/GetRouteCommand.d.ts +35 -0
  103. package/dist-types/commands/GetServiceCommand.d.ts +35 -0
  104. package/dist-types/commands/ListApplicationsCommand.d.ts +35 -0
  105. package/dist-types/commands/ListEnvironmentVpcsCommand.d.ts +35 -0
  106. package/dist-types/commands/ListEnvironmentsCommand.d.ts +36 -0
  107. package/dist-types/commands/ListRoutesCommand.d.ts +35 -0
  108. package/dist-types/commands/ListServicesCommand.d.ts +35 -0
  109. package/dist-types/commands/ListTagsForResourceCommand.d.ts +36 -0
  110. package/dist-types/commands/PutResourcePolicyCommand.d.ts +38 -0
  111. package/dist-types/commands/TagResourceCommand.d.ts +41 -0
  112. package/dist-types/commands/UntagResourceCommand.d.ts +37 -0
  113. package/dist-types/commands/index.d.ts +23 -0
  114. package/dist-types/endpoints.d.ts +2 -0
  115. package/dist-types/index.d.ts +5 -0
  116. package/dist-types/models/index.d.ts +1 -0
  117. package/dist-types/models/models_0.d.ts +2193 -0
  118. package/dist-types/pagination/Interfaces.d.ts +6 -0
  119. package/dist-types/pagination/ListApplicationsPaginator.d.ts +4 -0
  120. package/dist-types/pagination/ListEnvironmentVpcsPaginator.d.ts +4 -0
  121. package/dist-types/pagination/ListEnvironmentsPaginator.d.ts +4 -0
  122. package/dist-types/pagination/ListRoutesPaginator.d.ts +4 -0
  123. package/dist-types/pagination/ListServicesPaginator.d.ts +4 -0
  124. package/dist-types/pagination/index.d.ts +6 -0
  125. package/dist-types/protocols/Aws_restJson1.d.ts +71 -0
  126. package/dist-types/runtimeConfig.browser.d.ts +39 -0
  127. package/dist-types/runtimeConfig.d.ts +39 -0
  128. package/dist-types/runtimeConfig.native.d.ts +38 -0
  129. package/dist-types/runtimeConfig.shared.d.ts +13 -0
  130. package/dist-types/ts3.4/MigrationHubRefactorSpaces.d.ts +120 -0
  131. package/dist-types/ts3.4/MigrationHubRefactorSpacesClient.d.ts +94 -0
  132. package/dist-types/ts3.4/commands/CreateApplicationCommand.d.ts +17 -0
  133. package/dist-types/ts3.4/commands/CreateEnvironmentCommand.d.ts +17 -0
  134. package/dist-types/ts3.4/commands/CreateRouteCommand.d.ts +17 -0
  135. package/dist-types/ts3.4/commands/CreateServiceCommand.d.ts +17 -0
  136. package/dist-types/ts3.4/commands/DeleteApplicationCommand.d.ts +17 -0
  137. package/dist-types/ts3.4/commands/DeleteEnvironmentCommand.d.ts +17 -0
  138. package/dist-types/ts3.4/commands/DeleteResourcePolicyCommand.d.ts +17 -0
  139. package/dist-types/ts3.4/commands/DeleteRouteCommand.d.ts +17 -0
  140. package/dist-types/ts3.4/commands/DeleteServiceCommand.d.ts +17 -0
  141. package/dist-types/ts3.4/commands/GetApplicationCommand.d.ts +17 -0
  142. package/dist-types/ts3.4/commands/GetEnvironmentCommand.d.ts +17 -0
  143. package/dist-types/ts3.4/commands/GetResourcePolicyCommand.d.ts +17 -0
  144. package/dist-types/ts3.4/commands/GetRouteCommand.d.ts +17 -0
  145. package/dist-types/ts3.4/commands/GetServiceCommand.d.ts +17 -0
  146. package/dist-types/ts3.4/commands/ListApplicationsCommand.d.ts +17 -0
  147. package/dist-types/ts3.4/commands/ListEnvironmentVpcsCommand.d.ts +17 -0
  148. package/dist-types/ts3.4/commands/ListEnvironmentsCommand.d.ts +17 -0
  149. package/dist-types/ts3.4/commands/ListRoutesCommand.d.ts +17 -0
  150. package/dist-types/ts3.4/commands/ListServicesCommand.d.ts +17 -0
  151. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +17 -0
  152. package/dist-types/ts3.4/commands/PutResourcePolicyCommand.d.ts +17 -0
  153. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +17 -0
  154. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +17 -0
  155. package/dist-types/ts3.4/commands/index.d.ts +23 -0
  156. package/dist-types/ts3.4/endpoints.d.ts +2 -0
  157. package/dist-types/ts3.4/index.d.ts +5 -0
  158. package/dist-types/ts3.4/models/index.d.ts +1 -0
  159. package/dist-types/ts3.4/models/models_0.d.ts +1267 -0
  160. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  161. package/dist-types/ts3.4/pagination/ListApplicationsPaginator.d.ts +4 -0
  162. package/dist-types/ts3.4/pagination/ListEnvironmentVpcsPaginator.d.ts +4 -0
  163. package/dist-types/ts3.4/pagination/ListEnvironmentsPaginator.d.ts +4 -0
  164. package/dist-types/ts3.4/pagination/ListRoutesPaginator.d.ts +4 -0
  165. package/dist-types/ts3.4/pagination/ListServicesPaginator.d.ts +4 -0
  166. package/dist-types/ts3.4/pagination/index.d.ts +6 -0
  167. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +71 -0
  168. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +37 -0
  169. package/dist-types/ts3.4/runtimeConfig.d.ts +37 -0
  170. package/dist-types/ts3.4/runtimeConfig.native.d.ts +36 -0
  171. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
  172. package/package.json +96 -0
@@ -0,0 +1,4225 @@
1
+ import { __assign, __awaiter, __generator, __read } from "tslib";
2
+ import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
+ import { expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseEpochTimestamp as __parseEpochTimestamp, strictParseInt32 as __strictParseInt32, } from "@aws-sdk/smithy-client";
4
+ import { v4 as generateIdempotencyToken } from "uuid";
5
+ export var serializeAws_restJson1CreateApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
6
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
7
+ var _c;
8
+ return __generator(this, function (_d) {
9
+ switch (_d.label) {
10
+ case 0: return [4, context.endpoint()];
11
+ case 1:
12
+ _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
+ headers = {
14
+ "content-type": "application/json",
15
+ };
16
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
17
+ "/environments/{EnvironmentIdentifier}/applications";
18
+ if (input.EnvironmentIdentifier !== undefined) {
19
+ labelValue = input.EnvironmentIdentifier;
20
+ if (labelValue.length <= 0) {
21
+ throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
22
+ }
23
+ resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", __extendedEncodeURIComponent(labelValue));
24
+ }
25
+ else {
26
+ throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
27
+ }
28
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.ApiGatewayProxy !== undefined &&
29
+ input.ApiGatewayProxy !== null && {
30
+ ApiGatewayProxy: serializeAws_restJson1ApiGatewayProxyInput(input.ApiGatewayProxy, context),
31
+ })), { ClientToken: (_c = input.ClientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }), (input.Name !== undefined && input.Name !== null && { Name: input.Name })), (input.ProxyType !== undefined && input.ProxyType !== null && { ProxyType: input.ProxyType })), (input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })), (input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId })));
32
+ return [2, new __HttpRequest({
33
+ protocol: protocol,
34
+ hostname: hostname,
35
+ port: port,
36
+ method: "POST",
37
+ headers: headers,
38
+ path: resolvedPath,
39
+ body: body,
40
+ })];
41
+ }
42
+ });
43
+ }); };
44
+ export var serializeAws_restJson1CreateEnvironmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
45
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
46
+ var _c;
47
+ return __generator(this, function (_d) {
48
+ switch (_d.label) {
49
+ case 0: return [4, context.endpoint()];
50
+ case 1:
51
+ _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
52
+ headers = {
53
+ "content-type": "application/json",
54
+ };
55
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environments";
56
+ body = JSON.stringify(__assign(__assign(__assign(__assign({ ClientToken: (_c = input.ClientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.Description !== undefined && input.Description !== null && { Description: input.Description })), (input.Name !== undefined && input.Name !== null && { Name: input.Name })), (input.NetworkFabricType !== undefined &&
57
+ input.NetworkFabricType !== null && { NetworkFabricType: input.NetworkFabricType })), (input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
58
+ return [2, new __HttpRequest({
59
+ protocol: protocol,
60
+ hostname: hostname,
61
+ port: port,
62
+ method: "POST",
63
+ headers: headers,
64
+ path: resolvedPath,
65
+ body: body,
66
+ })];
67
+ }
68
+ });
69
+ }); };
70
+ export var serializeAws_restJson1CreateRouteCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
71
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
72
+ var _c;
73
+ return __generator(this, function (_d) {
74
+ switch (_d.label) {
75
+ case 0: return [4, context.endpoint()];
76
+ case 1:
77
+ _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
78
+ headers = {
79
+ "content-type": "application/json",
80
+ };
81
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
82
+ "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/routes";
83
+ if (input.EnvironmentIdentifier !== undefined) {
84
+ labelValue = input.EnvironmentIdentifier;
85
+ if (labelValue.length <= 0) {
86
+ throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
87
+ }
88
+ resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", __extendedEncodeURIComponent(labelValue));
89
+ }
90
+ else {
91
+ throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
92
+ }
93
+ if (input.ApplicationIdentifier !== undefined) {
94
+ labelValue = input.ApplicationIdentifier;
95
+ if (labelValue.length <= 0) {
96
+ throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
97
+ }
98
+ resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", __extendedEncodeURIComponent(labelValue));
99
+ }
100
+ else {
101
+ throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
102
+ }
103
+ body = JSON.stringify(__assign(__assign(__assign(__assign({ ClientToken: (_c = input.ClientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.RouteType !== undefined && input.RouteType !== null && { RouteType: input.RouteType })), (input.ServiceIdentifier !== undefined &&
104
+ input.ServiceIdentifier !== null && { ServiceIdentifier: input.ServiceIdentifier })), (input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })), (input.UriPathRoute !== undefined &&
105
+ input.UriPathRoute !== null && {
106
+ UriPathRoute: serializeAws_restJson1UriPathRouteInput(input.UriPathRoute, context),
107
+ })));
108
+ return [2, new __HttpRequest({
109
+ protocol: protocol,
110
+ hostname: hostname,
111
+ port: port,
112
+ method: "POST",
113
+ headers: headers,
114
+ path: resolvedPath,
115
+ body: body,
116
+ })];
117
+ }
118
+ });
119
+ }); };
120
+ export var serializeAws_restJson1CreateServiceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
121
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
122
+ var _c;
123
+ return __generator(this, function (_d) {
124
+ switch (_d.label) {
125
+ case 0: return [4, context.endpoint()];
126
+ case 1:
127
+ _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
128
+ headers = {
129
+ "content-type": "application/json",
130
+ };
131
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
132
+ "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/services";
133
+ if (input.EnvironmentIdentifier !== undefined) {
134
+ labelValue = input.EnvironmentIdentifier;
135
+ if (labelValue.length <= 0) {
136
+ throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
137
+ }
138
+ resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", __extendedEncodeURIComponent(labelValue));
139
+ }
140
+ else {
141
+ throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
142
+ }
143
+ if (input.ApplicationIdentifier !== undefined) {
144
+ labelValue = input.ApplicationIdentifier;
145
+ if (labelValue.length <= 0) {
146
+ throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
147
+ }
148
+ resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", __extendedEncodeURIComponent(labelValue));
149
+ }
150
+ else {
151
+ throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
152
+ }
153
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ ClientToken: (_c = input.ClientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.Description !== undefined && input.Description !== null && { Description: input.Description })), (input.EndpointType !== undefined && input.EndpointType !== null && { EndpointType: input.EndpointType })), (input.LambdaEndpoint !== undefined &&
154
+ input.LambdaEndpoint !== null && {
155
+ LambdaEndpoint: serializeAws_restJson1LambdaEndpointInput(input.LambdaEndpoint, context),
156
+ })), (input.Name !== undefined && input.Name !== null && { Name: input.Name })), (input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })), (input.UrlEndpoint !== undefined &&
157
+ input.UrlEndpoint !== null && {
158
+ UrlEndpoint: serializeAws_restJson1UrlEndpointInput(input.UrlEndpoint, context),
159
+ })), (input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId })));
160
+ return [2, new __HttpRequest({
161
+ protocol: protocol,
162
+ hostname: hostname,
163
+ port: port,
164
+ method: "POST",
165
+ headers: headers,
166
+ path: resolvedPath,
167
+ body: body,
168
+ })];
169
+ }
170
+ });
171
+ }); };
172
+ export var serializeAws_restJson1DeleteApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
173
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
174
+ return __generator(this, function (_c) {
175
+ switch (_c.label) {
176
+ case 0: return [4, context.endpoint()];
177
+ case 1:
178
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
179
+ headers = {};
180
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
181
+ "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}";
182
+ if (input.EnvironmentIdentifier !== undefined) {
183
+ labelValue = input.EnvironmentIdentifier;
184
+ if (labelValue.length <= 0) {
185
+ throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
186
+ }
187
+ resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", __extendedEncodeURIComponent(labelValue));
188
+ }
189
+ else {
190
+ throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
191
+ }
192
+ if (input.ApplicationIdentifier !== undefined) {
193
+ labelValue = input.ApplicationIdentifier;
194
+ if (labelValue.length <= 0) {
195
+ throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
196
+ }
197
+ resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", __extendedEncodeURIComponent(labelValue));
198
+ }
199
+ else {
200
+ throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
201
+ }
202
+ return [2, new __HttpRequest({
203
+ protocol: protocol,
204
+ hostname: hostname,
205
+ port: port,
206
+ method: "DELETE",
207
+ headers: headers,
208
+ path: resolvedPath,
209
+ body: body,
210
+ })];
211
+ }
212
+ });
213
+ }); };
214
+ export var serializeAws_restJson1DeleteEnvironmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
215
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
216
+ return __generator(this, function (_c) {
217
+ switch (_c.label) {
218
+ case 0: return [4, context.endpoint()];
219
+ case 1:
220
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
221
+ headers = {};
222
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environments/{EnvironmentIdentifier}";
223
+ if (input.EnvironmentIdentifier !== undefined) {
224
+ labelValue = input.EnvironmentIdentifier;
225
+ if (labelValue.length <= 0) {
226
+ throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
227
+ }
228
+ resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", __extendedEncodeURIComponent(labelValue));
229
+ }
230
+ else {
231
+ throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
232
+ }
233
+ return [2, new __HttpRequest({
234
+ protocol: protocol,
235
+ hostname: hostname,
236
+ port: port,
237
+ method: "DELETE",
238
+ headers: headers,
239
+ path: resolvedPath,
240
+ body: body,
241
+ })];
242
+ }
243
+ });
244
+ }); };
245
+ export var serializeAws_restJson1DeleteResourcePolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
246
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
247
+ return __generator(this, function (_c) {
248
+ switch (_c.label) {
249
+ case 0: return [4, context.endpoint()];
250
+ case 1:
251
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
252
+ headers = {};
253
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/resourcepolicy/{Identifier}";
254
+ if (input.Identifier !== undefined) {
255
+ labelValue = input.Identifier;
256
+ if (labelValue.length <= 0) {
257
+ throw new Error("Empty value provided for input HTTP label: Identifier.");
258
+ }
259
+ resolvedPath = resolvedPath.replace("{Identifier}", __extendedEncodeURIComponent(labelValue));
260
+ }
261
+ else {
262
+ throw new Error("No value provided for input HTTP label: Identifier.");
263
+ }
264
+ return [2, new __HttpRequest({
265
+ protocol: protocol,
266
+ hostname: hostname,
267
+ port: port,
268
+ method: "DELETE",
269
+ headers: headers,
270
+ path: resolvedPath,
271
+ body: body,
272
+ })];
273
+ }
274
+ });
275
+ }); };
276
+ export var serializeAws_restJson1DeleteRouteCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
277
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
278
+ return __generator(this, function (_c) {
279
+ switch (_c.label) {
280
+ case 0: return [4, context.endpoint()];
281
+ case 1:
282
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
283
+ headers = {};
284
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
285
+ "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/routes/{RouteIdentifier}";
286
+ if (input.EnvironmentIdentifier !== undefined) {
287
+ labelValue = input.EnvironmentIdentifier;
288
+ if (labelValue.length <= 0) {
289
+ throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
290
+ }
291
+ resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", __extendedEncodeURIComponent(labelValue));
292
+ }
293
+ else {
294
+ throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
295
+ }
296
+ if (input.ApplicationIdentifier !== undefined) {
297
+ labelValue = input.ApplicationIdentifier;
298
+ if (labelValue.length <= 0) {
299
+ throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
300
+ }
301
+ resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", __extendedEncodeURIComponent(labelValue));
302
+ }
303
+ else {
304
+ throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
305
+ }
306
+ if (input.RouteIdentifier !== undefined) {
307
+ labelValue = input.RouteIdentifier;
308
+ if (labelValue.length <= 0) {
309
+ throw new Error("Empty value provided for input HTTP label: RouteIdentifier.");
310
+ }
311
+ resolvedPath = resolvedPath.replace("{RouteIdentifier}", __extendedEncodeURIComponent(labelValue));
312
+ }
313
+ else {
314
+ throw new Error("No value provided for input HTTP label: RouteIdentifier.");
315
+ }
316
+ return [2, new __HttpRequest({
317
+ protocol: protocol,
318
+ hostname: hostname,
319
+ port: port,
320
+ method: "DELETE",
321
+ headers: headers,
322
+ path: resolvedPath,
323
+ body: body,
324
+ })];
325
+ }
326
+ });
327
+ }); };
328
+ export var serializeAws_restJson1DeleteServiceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
329
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
330
+ return __generator(this, function (_c) {
331
+ switch (_c.label) {
332
+ case 0: return [4, context.endpoint()];
333
+ case 1:
334
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
335
+ headers = {};
336
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
337
+ "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/services/{ServiceIdentifier}";
338
+ if (input.EnvironmentIdentifier !== undefined) {
339
+ labelValue = input.EnvironmentIdentifier;
340
+ if (labelValue.length <= 0) {
341
+ throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
342
+ }
343
+ resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", __extendedEncodeURIComponent(labelValue));
344
+ }
345
+ else {
346
+ throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
347
+ }
348
+ if (input.ApplicationIdentifier !== undefined) {
349
+ labelValue = input.ApplicationIdentifier;
350
+ if (labelValue.length <= 0) {
351
+ throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
352
+ }
353
+ resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", __extendedEncodeURIComponent(labelValue));
354
+ }
355
+ else {
356
+ throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
357
+ }
358
+ if (input.ServiceIdentifier !== undefined) {
359
+ labelValue = input.ServiceIdentifier;
360
+ if (labelValue.length <= 0) {
361
+ throw new Error("Empty value provided for input HTTP label: ServiceIdentifier.");
362
+ }
363
+ resolvedPath = resolvedPath.replace("{ServiceIdentifier}", __extendedEncodeURIComponent(labelValue));
364
+ }
365
+ else {
366
+ throw new Error("No value provided for input HTTP label: ServiceIdentifier.");
367
+ }
368
+ return [2, new __HttpRequest({
369
+ protocol: protocol,
370
+ hostname: hostname,
371
+ port: port,
372
+ method: "DELETE",
373
+ headers: headers,
374
+ path: resolvedPath,
375
+ body: body,
376
+ })];
377
+ }
378
+ });
379
+ }); };
380
+ export var serializeAws_restJson1GetApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
381
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
382
+ return __generator(this, function (_c) {
383
+ switch (_c.label) {
384
+ case 0: return [4, context.endpoint()];
385
+ case 1:
386
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
387
+ headers = {};
388
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
389
+ "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}";
390
+ if (input.EnvironmentIdentifier !== undefined) {
391
+ labelValue = input.EnvironmentIdentifier;
392
+ if (labelValue.length <= 0) {
393
+ throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
394
+ }
395
+ resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", __extendedEncodeURIComponent(labelValue));
396
+ }
397
+ else {
398
+ throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
399
+ }
400
+ if (input.ApplicationIdentifier !== undefined) {
401
+ labelValue = input.ApplicationIdentifier;
402
+ if (labelValue.length <= 0) {
403
+ throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
404
+ }
405
+ resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", __extendedEncodeURIComponent(labelValue));
406
+ }
407
+ else {
408
+ throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
409
+ }
410
+ return [2, new __HttpRequest({
411
+ protocol: protocol,
412
+ hostname: hostname,
413
+ port: port,
414
+ method: "GET",
415
+ headers: headers,
416
+ path: resolvedPath,
417
+ body: body,
418
+ })];
419
+ }
420
+ });
421
+ }); };
422
+ export var serializeAws_restJson1GetEnvironmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
423
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
424
+ return __generator(this, function (_c) {
425
+ switch (_c.label) {
426
+ case 0: return [4, context.endpoint()];
427
+ case 1:
428
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
429
+ headers = {};
430
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environments/{EnvironmentIdentifier}";
431
+ if (input.EnvironmentIdentifier !== undefined) {
432
+ labelValue = input.EnvironmentIdentifier;
433
+ if (labelValue.length <= 0) {
434
+ throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
435
+ }
436
+ resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", __extendedEncodeURIComponent(labelValue));
437
+ }
438
+ else {
439
+ throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
440
+ }
441
+ return [2, new __HttpRequest({
442
+ protocol: protocol,
443
+ hostname: hostname,
444
+ port: port,
445
+ method: "GET",
446
+ headers: headers,
447
+ path: resolvedPath,
448
+ body: body,
449
+ })];
450
+ }
451
+ });
452
+ }); };
453
+ export var serializeAws_restJson1GetResourcePolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
454
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, 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 = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/resourcepolicy/{Identifier}";
462
+ if (input.Identifier !== undefined) {
463
+ labelValue = input.Identifier;
464
+ if (labelValue.length <= 0) {
465
+ throw new Error("Empty value provided for input HTTP label: Identifier.");
466
+ }
467
+ resolvedPath = resolvedPath.replace("{Identifier}", __extendedEncodeURIComponent(labelValue));
468
+ }
469
+ else {
470
+ throw new Error("No value provided for input HTTP label: Identifier.");
471
+ }
472
+ return [2, new __HttpRequest({
473
+ protocol: protocol,
474
+ hostname: hostname,
475
+ port: port,
476
+ method: "GET",
477
+ headers: headers,
478
+ path: resolvedPath,
479
+ body: body,
480
+ })];
481
+ }
482
+ });
483
+ }); };
484
+ export var serializeAws_restJson1GetRouteCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
485
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
486
+ return __generator(this, function (_c) {
487
+ switch (_c.label) {
488
+ case 0: return [4, context.endpoint()];
489
+ case 1:
490
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
491
+ headers = {};
492
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
493
+ "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/routes/{RouteIdentifier}";
494
+ if (input.EnvironmentIdentifier !== undefined) {
495
+ labelValue = input.EnvironmentIdentifier;
496
+ if (labelValue.length <= 0) {
497
+ throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
498
+ }
499
+ resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", __extendedEncodeURIComponent(labelValue));
500
+ }
501
+ else {
502
+ throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
503
+ }
504
+ if (input.ApplicationIdentifier !== undefined) {
505
+ labelValue = input.ApplicationIdentifier;
506
+ if (labelValue.length <= 0) {
507
+ throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
508
+ }
509
+ resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", __extendedEncodeURIComponent(labelValue));
510
+ }
511
+ else {
512
+ throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
513
+ }
514
+ if (input.RouteIdentifier !== undefined) {
515
+ labelValue = input.RouteIdentifier;
516
+ if (labelValue.length <= 0) {
517
+ throw new Error("Empty value provided for input HTTP label: RouteIdentifier.");
518
+ }
519
+ resolvedPath = resolvedPath.replace("{RouteIdentifier}", __extendedEncodeURIComponent(labelValue));
520
+ }
521
+ else {
522
+ throw new Error("No value provided for input HTTP label: RouteIdentifier.");
523
+ }
524
+ return [2, new __HttpRequest({
525
+ protocol: protocol,
526
+ hostname: hostname,
527
+ port: port,
528
+ method: "GET",
529
+ headers: headers,
530
+ path: resolvedPath,
531
+ body: body,
532
+ })];
533
+ }
534
+ });
535
+ }); };
536
+ export var serializeAws_restJson1GetServiceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
537
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
538
+ return __generator(this, function (_c) {
539
+ switch (_c.label) {
540
+ case 0: return [4, context.endpoint()];
541
+ case 1:
542
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
543
+ headers = {};
544
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
545
+ "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/services/{ServiceIdentifier}";
546
+ if (input.EnvironmentIdentifier !== undefined) {
547
+ labelValue = input.EnvironmentIdentifier;
548
+ if (labelValue.length <= 0) {
549
+ throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
550
+ }
551
+ resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", __extendedEncodeURIComponent(labelValue));
552
+ }
553
+ else {
554
+ throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
555
+ }
556
+ if (input.ApplicationIdentifier !== undefined) {
557
+ labelValue = input.ApplicationIdentifier;
558
+ if (labelValue.length <= 0) {
559
+ throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
560
+ }
561
+ resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", __extendedEncodeURIComponent(labelValue));
562
+ }
563
+ else {
564
+ throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
565
+ }
566
+ if (input.ServiceIdentifier !== undefined) {
567
+ labelValue = input.ServiceIdentifier;
568
+ if (labelValue.length <= 0) {
569
+ throw new Error("Empty value provided for input HTTP label: ServiceIdentifier.");
570
+ }
571
+ resolvedPath = resolvedPath.replace("{ServiceIdentifier}", __extendedEncodeURIComponent(labelValue));
572
+ }
573
+ else {
574
+ throw new Error("No value provided for input HTTP label: ServiceIdentifier.");
575
+ }
576
+ return [2, new __HttpRequest({
577
+ protocol: protocol,
578
+ hostname: hostname,
579
+ port: port,
580
+ method: "GET",
581
+ headers: headers,
582
+ path: resolvedPath,
583
+ body: body,
584
+ })];
585
+ }
586
+ });
587
+ }); };
588
+ export var serializeAws_restJson1ListApplicationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
589
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
590
+ return __generator(this, function (_c) {
591
+ switch (_c.label) {
592
+ case 0: return [4, context.endpoint()];
593
+ case 1:
594
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
595
+ headers = {};
596
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
597
+ "/environments/{EnvironmentIdentifier}/applications";
598
+ if (input.EnvironmentIdentifier !== undefined) {
599
+ labelValue = input.EnvironmentIdentifier;
600
+ if (labelValue.length <= 0) {
601
+ throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
602
+ }
603
+ resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", __extendedEncodeURIComponent(labelValue));
604
+ }
605
+ else {
606
+ throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
607
+ }
608
+ query = __assign(__assign({}, (input.NextToken !== undefined && { nextToken: input.NextToken })), (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }));
609
+ return [2, new __HttpRequest({
610
+ protocol: protocol,
611
+ hostname: hostname,
612
+ port: port,
613
+ method: "GET",
614
+ headers: headers,
615
+ path: resolvedPath,
616
+ query: query,
617
+ body: body,
618
+ })];
619
+ }
620
+ });
621
+ }); };
622
+ export var serializeAws_restJson1ListEnvironmentsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
623
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
624
+ return __generator(this, function (_c) {
625
+ switch (_c.label) {
626
+ case 0: return [4, context.endpoint()];
627
+ case 1:
628
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
629
+ headers = {};
630
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environments";
631
+ query = __assign(__assign({}, (input.NextToken !== undefined && { nextToken: input.NextToken })), (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }));
632
+ return [2, new __HttpRequest({
633
+ protocol: protocol,
634
+ hostname: hostname,
635
+ port: port,
636
+ method: "GET",
637
+ headers: headers,
638
+ path: resolvedPath,
639
+ query: query,
640
+ body: body,
641
+ })];
642
+ }
643
+ });
644
+ }); };
645
+ export var serializeAws_restJson1ListEnvironmentVpcsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
646
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
647
+ return __generator(this, function (_c) {
648
+ switch (_c.label) {
649
+ case 0: return [4, context.endpoint()];
650
+ case 1:
651
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
652
+ headers = {};
653
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
654
+ "/environments/{EnvironmentIdentifier}/vpcs";
655
+ if (input.EnvironmentIdentifier !== undefined) {
656
+ labelValue = input.EnvironmentIdentifier;
657
+ if (labelValue.length <= 0) {
658
+ throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
659
+ }
660
+ resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", __extendedEncodeURIComponent(labelValue));
661
+ }
662
+ else {
663
+ throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
664
+ }
665
+ query = __assign(__assign({}, (input.NextToken !== undefined && { nextToken: input.NextToken })), (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }));
666
+ return [2, new __HttpRequest({
667
+ protocol: protocol,
668
+ hostname: hostname,
669
+ port: port,
670
+ method: "GET",
671
+ headers: headers,
672
+ path: resolvedPath,
673
+ query: query,
674
+ body: body,
675
+ })];
676
+ }
677
+ });
678
+ }); };
679
+ export var serializeAws_restJson1ListRoutesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
680
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
681
+ return __generator(this, function (_c) {
682
+ switch (_c.label) {
683
+ case 0: return [4, context.endpoint()];
684
+ case 1:
685
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
686
+ headers = {};
687
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
688
+ "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/routes";
689
+ if (input.EnvironmentIdentifier !== undefined) {
690
+ labelValue = input.EnvironmentIdentifier;
691
+ if (labelValue.length <= 0) {
692
+ throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
693
+ }
694
+ resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", __extendedEncodeURIComponent(labelValue));
695
+ }
696
+ else {
697
+ throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
698
+ }
699
+ if (input.ApplicationIdentifier !== undefined) {
700
+ labelValue = input.ApplicationIdentifier;
701
+ if (labelValue.length <= 0) {
702
+ throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
703
+ }
704
+ resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", __extendedEncodeURIComponent(labelValue));
705
+ }
706
+ else {
707
+ throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
708
+ }
709
+ query = __assign(__assign({}, (input.NextToken !== undefined && { nextToken: input.NextToken })), (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }));
710
+ return [2, new __HttpRequest({
711
+ protocol: protocol,
712
+ hostname: hostname,
713
+ port: port,
714
+ method: "GET",
715
+ headers: headers,
716
+ path: resolvedPath,
717
+ query: query,
718
+ body: body,
719
+ })];
720
+ }
721
+ });
722
+ }); };
723
+ export var serializeAws_restJson1ListServicesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
724
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
725
+ return __generator(this, function (_c) {
726
+ switch (_c.label) {
727
+ case 0: return [4, context.endpoint()];
728
+ case 1:
729
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
730
+ headers = {};
731
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
732
+ "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/services";
733
+ if (input.EnvironmentIdentifier !== undefined) {
734
+ labelValue = input.EnvironmentIdentifier;
735
+ if (labelValue.length <= 0) {
736
+ throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
737
+ }
738
+ resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", __extendedEncodeURIComponent(labelValue));
739
+ }
740
+ else {
741
+ throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
742
+ }
743
+ if (input.ApplicationIdentifier !== undefined) {
744
+ labelValue = input.ApplicationIdentifier;
745
+ if (labelValue.length <= 0) {
746
+ throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
747
+ }
748
+ resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", __extendedEncodeURIComponent(labelValue));
749
+ }
750
+ else {
751
+ throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
752
+ }
753
+ query = __assign(__assign({}, (input.NextToken !== undefined && { nextToken: input.NextToken })), (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }));
754
+ return [2, new __HttpRequest({
755
+ protocol: protocol,
756
+ hostname: hostname,
757
+ port: port,
758
+ method: "GET",
759
+ headers: headers,
760
+ path: resolvedPath,
761
+ query: query,
762
+ body: body,
763
+ })];
764
+ }
765
+ });
766
+ }); };
767
+ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
768
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
769
+ return __generator(this, function (_c) {
770
+ switch (_c.label) {
771
+ case 0: return [4, context.endpoint()];
772
+ case 1:
773
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
774
+ headers = {};
775
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
776
+ if (input.ResourceArn !== undefined) {
777
+ labelValue = input.ResourceArn;
778
+ if (labelValue.length <= 0) {
779
+ throw new Error("Empty value provided for input HTTP label: ResourceArn.");
780
+ }
781
+ resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
782
+ }
783
+ else {
784
+ throw new Error("No value provided for input HTTP label: ResourceArn.");
785
+ }
786
+ return [2, new __HttpRequest({
787
+ protocol: protocol,
788
+ hostname: hostname,
789
+ port: port,
790
+ method: "GET",
791
+ headers: headers,
792
+ path: resolvedPath,
793
+ body: body,
794
+ })];
795
+ }
796
+ });
797
+ }); };
798
+ export var serializeAws_restJson1PutResourcePolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
799
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
800
+ return __generator(this, function (_c) {
801
+ switch (_c.label) {
802
+ case 0: return [4, context.endpoint()];
803
+ case 1:
804
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
805
+ headers = {
806
+ "content-type": "application/json",
807
+ };
808
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/resourcepolicy";
809
+ body = JSON.stringify(__assign(__assign({}, (input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy })), (input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn })));
810
+ return [2, new __HttpRequest({
811
+ protocol: protocol,
812
+ hostname: hostname,
813
+ port: port,
814
+ method: "PUT",
815
+ headers: headers,
816
+ path: resolvedPath,
817
+ body: body,
818
+ })];
819
+ }
820
+ });
821
+ }); };
822
+ export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
823
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
824
+ return __generator(this, function (_c) {
825
+ switch (_c.label) {
826
+ case 0: return [4, context.endpoint()];
827
+ case 1:
828
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
829
+ headers = {
830
+ "content-type": "application/json",
831
+ };
832
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
833
+ if (input.ResourceArn !== undefined) {
834
+ labelValue = input.ResourceArn;
835
+ if (labelValue.length <= 0) {
836
+ throw new Error("Empty value provided for input HTTP label: ResourceArn.");
837
+ }
838
+ resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
839
+ }
840
+ else {
841
+ throw new Error("No value provided for input HTTP label: ResourceArn.");
842
+ }
843
+ body = JSON.stringify(__assign({}, (input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
844
+ return [2, new __HttpRequest({
845
+ protocol: protocol,
846
+ hostname: hostname,
847
+ port: port,
848
+ method: "POST",
849
+ headers: headers,
850
+ path: resolvedPath,
851
+ body: body,
852
+ })];
853
+ }
854
+ });
855
+ }); };
856
+ export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
857
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
858
+ return __generator(this, function (_c) {
859
+ switch (_c.label) {
860
+ case 0: return [4, context.endpoint()];
861
+ case 1:
862
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
863
+ headers = {};
864
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
865
+ if (input.ResourceArn !== undefined) {
866
+ labelValue = input.ResourceArn;
867
+ if (labelValue.length <= 0) {
868
+ throw new Error("Empty value provided for input HTTP label: ResourceArn.");
869
+ }
870
+ resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
871
+ }
872
+ else {
873
+ throw new Error("No value provided for input HTTP label: ResourceArn.");
874
+ }
875
+ query = __assign({}, (input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map(function (_entry) { return _entry; }) }));
876
+ return [2, new __HttpRequest({
877
+ protocol: protocol,
878
+ hostname: hostname,
879
+ port: port,
880
+ method: "DELETE",
881
+ headers: headers,
882
+ path: resolvedPath,
883
+ query: query,
884
+ body: body,
885
+ })];
886
+ }
887
+ });
888
+ }); };
889
+ export var deserializeAws_restJson1CreateApplicationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
890
+ var contents, data, _a, _b;
891
+ return __generator(this, function (_c) {
892
+ switch (_c.label) {
893
+ case 0:
894
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
895
+ return [2, deserializeAws_restJson1CreateApplicationCommandError(output, context)];
896
+ }
897
+ contents = {
898
+ $metadata: deserializeMetadata(output),
899
+ ApiGatewayProxy: undefined,
900
+ ApplicationId: undefined,
901
+ Arn: undefined,
902
+ CreatedByAccountId: undefined,
903
+ CreatedTime: undefined,
904
+ EnvironmentId: undefined,
905
+ LastUpdatedTime: undefined,
906
+ Name: undefined,
907
+ OwnerAccountId: undefined,
908
+ ProxyType: undefined,
909
+ State: undefined,
910
+ Tags: undefined,
911
+ VpcId: undefined,
912
+ };
913
+ _a = __expectNonNull;
914
+ _b = __expectObject;
915
+ return [4, parseBody(output.body, context)];
916
+ case 1:
917
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
918
+ if (data.ApiGatewayProxy !== undefined && data.ApiGatewayProxy !== null) {
919
+ contents.ApiGatewayProxy = deserializeAws_restJson1ApiGatewayProxyInput(data.ApiGatewayProxy, context);
920
+ }
921
+ if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
922
+ contents.ApplicationId = __expectString(data.ApplicationId);
923
+ }
924
+ if (data.Arn !== undefined && data.Arn !== null) {
925
+ contents.Arn = __expectString(data.Arn);
926
+ }
927
+ if (data.CreatedByAccountId !== undefined && data.CreatedByAccountId !== null) {
928
+ contents.CreatedByAccountId = __expectString(data.CreatedByAccountId);
929
+ }
930
+ if (data.CreatedTime !== undefined && data.CreatedTime !== null) {
931
+ contents.CreatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreatedTime)));
932
+ }
933
+ if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
934
+ contents.EnvironmentId = __expectString(data.EnvironmentId);
935
+ }
936
+ if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
937
+ contents.LastUpdatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastUpdatedTime)));
938
+ }
939
+ if (data.Name !== undefined && data.Name !== null) {
940
+ contents.Name = __expectString(data.Name);
941
+ }
942
+ if (data.OwnerAccountId !== undefined && data.OwnerAccountId !== null) {
943
+ contents.OwnerAccountId = __expectString(data.OwnerAccountId);
944
+ }
945
+ if (data.ProxyType !== undefined && data.ProxyType !== null) {
946
+ contents.ProxyType = __expectString(data.ProxyType);
947
+ }
948
+ if (data.State !== undefined && data.State !== null) {
949
+ contents.State = __expectString(data.State);
950
+ }
951
+ if (data.Tags !== undefined && data.Tags !== null) {
952
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
953
+ }
954
+ if (data.VpcId !== undefined && data.VpcId !== null) {
955
+ contents.VpcId = __expectString(data.VpcId);
956
+ }
957
+ return [2, Promise.resolve(contents)];
958
+ }
959
+ });
960
+ }); };
961
+ var deserializeAws_restJson1CreateApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
962
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;
963
+ var _k;
964
+ return __generator(this, function (_l) {
965
+ switch (_l.label) {
966
+ case 0:
967
+ _a = [__assign({}, output)];
968
+ _k = {};
969
+ return [4, parseBody(output.body, context)];
970
+ case 1:
971
+ parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));
972
+ errorCode = "UnknownError";
973
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
974
+ _b = errorCode;
975
+ switch (_b) {
976
+ case "AccessDeniedException": return [3, 2];
977
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
978
+ case "ConflictException": return [3, 4];
979
+ case "com.amazonaws.migrationhubrefactorspaces#ConflictException": return [3, 4];
980
+ case "InternalServerException": return [3, 6];
981
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 6];
982
+ case "ResourceNotFoundException": return [3, 8];
983
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 8];
984
+ case "ServiceQuotaExceededException": return [3, 10];
985
+ case "com.amazonaws.migrationhubrefactorspaces#ServiceQuotaExceededException": return [3, 10];
986
+ case "ThrottlingException": return [3, 12];
987
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 12];
988
+ case "ValidationException": return [3, 14];
989
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 14];
990
+ }
991
+ return [3, 16];
992
+ case 2:
993
+ _c = [{}];
994
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
995
+ case 3:
996
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
997
+ return [3, 17];
998
+ case 4:
999
+ _d = [{}];
1000
+ return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1001
+ case 5:
1002
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1003
+ return [3, 17];
1004
+ case 6:
1005
+ _e = [{}];
1006
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1007
+ case 7:
1008
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1009
+ return [3, 17];
1010
+ case 8:
1011
+ _f = [{}];
1012
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1013
+ case 9:
1014
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1015
+ return [3, 17];
1016
+ case 10:
1017
+ _g = [{}];
1018
+ return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
1019
+ case 11:
1020
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1021
+ return [3, 17];
1022
+ case 12:
1023
+ _h = [{}];
1024
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1025
+ case 13:
1026
+ response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1027
+ return [3, 17];
1028
+ case 14:
1029
+ _j = [{}];
1030
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1031
+ case 15:
1032
+ response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1033
+ return [3, 17];
1034
+ case 16:
1035
+ parsedBody = parsedOutput.body;
1036
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1037
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
1038
+ _l.label = 17;
1039
+ case 17:
1040
+ message = response.message || response.Message || errorCode;
1041
+ response.message = message;
1042
+ delete response.Message;
1043
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
1044
+ }
1045
+ });
1046
+ }); };
1047
+ export var deserializeAws_restJson1CreateEnvironmentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1048
+ var contents, data, _a, _b;
1049
+ return __generator(this, function (_c) {
1050
+ switch (_c.label) {
1051
+ case 0:
1052
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1053
+ return [2, deserializeAws_restJson1CreateEnvironmentCommandError(output, context)];
1054
+ }
1055
+ contents = {
1056
+ $metadata: deserializeMetadata(output),
1057
+ Arn: undefined,
1058
+ CreatedTime: undefined,
1059
+ Description: undefined,
1060
+ EnvironmentId: undefined,
1061
+ LastUpdatedTime: undefined,
1062
+ Name: undefined,
1063
+ NetworkFabricType: undefined,
1064
+ OwnerAccountId: undefined,
1065
+ State: undefined,
1066
+ Tags: undefined,
1067
+ };
1068
+ _a = __expectNonNull;
1069
+ _b = __expectObject;
1070
+ return [4, parseBody(output.body, context)];
1071
+ case 1:
1072
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1073
+ if (data.Arn !== undefined && data.Arn !== null) {
1074
+ contents.Arn = __expectString(data.Arn);
1075
+ }
1076
+ if (data.CreatedTime !== undefined && data.CreatedTime !== null) {
1077
+ contents.CreatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreatedTime)));
1078
+ }
1079
+ if (data.Description !== undefined && data.Description !== null) {
1080
+ contents.Description = __expectString(data.Description);
1081
+ }
1082
+ if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
1083
+ contents.EnvironmentId = __expectString(data.EnvironmentId);
1084
+ }
1085
+ if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
1086
+ contents.LastUpdatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastUpdatedTime)));
1087
+ }
1088
+ if (data.Name !== undefined && data.Name !== null) {
1089
+ contents.Name = __expectString(data.Name);
1090
+ }
1091
+ if (data.NetworkFabricType !== undefined && data.NetworkFabricType !== null) {
1092
+ contents.NetworkFabricType = __expectString(data.NetworkFabricType);
1093
+ }
1094
+ if (data.OwnerAccountId !== undefined && data.OwnerAccountId !== null) {
1095
+ contents.OwnerAccountId = __expectString(data.OwnerAccountId);
1096
+ }
1097
+ if (data.State !== undefined && data.State !== null) {
1098
+ contents.State = __expectString(data.State);
1099
+ }
1100
+ if (data.Tags !== undefined && data.Tags !== null) {
1101
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1102
+ }
1103
+ return [2, Promise.resolve(contents)];
1104
+ }
1105
+ });
1106
+ }); };
1107
+ var deserializeAws_restJson1CreateEnvironmentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1108
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;
1109
+ var _k;
1110
+ return __generator(this, function (_l) {
1111
+ switch (_l.label) {
1112
+ case 0:
1113
+ _a = [__assign({}, output)];
1114
+ _k = {};
1115
+ return [4, parseBody(output.body, context)];
1116
+ case 1:
1117
+ parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));
1118
+ errorCode = "UnknownError";
1119
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1120
+ _b = errorCode;
1121
+ switch (_b) {
1122
+ case "AccessDeniedException": return [3, 2];
1123
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
1124
+ case "ConflictException": return [3, 4];
1125
+ case "com.amazonaws.migrationhubrefactorspaces#ConflictException": return [3, 4];
1126
+ case "InternalServerException": return [3, 6];
1127
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 6];
1128
+ case "ResourceNotFoundException": return [3, 8];
1129
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 8];
1130
+ case "ServiceQuotaExceededException": return [3, 10];
1131
+ case "com.amazonaws.migrationhubrefactorspaces#ServiceQuotaExceededException": return [3, 10];
1132
+ case "ThrottlingException": return [3, 12];
1133
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 12];
1134
+ case "ValidationException": return [3, 14];
1135
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 14];
1136
+ }
1137
+ return [3, 16];
1138
+ case 2:
1139
+ _c = [{}];
1140
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1141
+ case 3:
1142
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1143
+ return [3, 17];
1144
+ case 4:
1145
+ _d = [{}];
1146
+ return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1147
+ case 5:
1148
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1149
+ return [3, 17];
1150
+ case 6:
1151
+ _e = [{}];
1152
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1153
+ case 7:
1154
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1155
+ return [3, 17];
1156
+ case 8:
1157
+ _f = [{}];
1158
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1159
+ case 9:
1160
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1161
+ return [3, 17];
1162
+ case 10:
1163
+ _g = [{}];
1164
+ return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
1165
+ case 11:
1166
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1167
+ return [3, 17];
1168
+ case 12:
1169
+ _h = [{}];
1170
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1171
+ case 13:
1172
+ response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1173
+ return [3, 17];
1174
+ case 14:
1175
+ _j = [{}];
1176
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1177
+ case 15:
1178
+ response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1179
+ return [3, 17];
1180
+ case 16:
1181
+ parsedBody = parsedOutput.body;
1182
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1183
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
1184
+ _l.label = 17;
1185
+ case 17:
1186
+ message = response.message || response.Message || errorCode;
1187
+ response.message = message;
1188
+ delete response.Message;
1189
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
1190
+ }
1191
+ });
1192
+ }); };
1193
+ export var deserializeAws_restJson1CreateRouteCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1194
+ var contents, data, _a, _b;
1195
+ return __generator(this, function (_c) {
1196
+ switch (_c.label) {
1197
+ case 0:
1198
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1199
+ return [2, deserializeAws_restJson1CreateRouteCommandError(output, context)];
1200
+ }
1201
+ contents = {
1202
+ $metadata: deserializeMetadata(output),
1203
+ ApplicationId: undefined,
1204
+ Arn: undefined,
1205
+ CreatedByAccountId: undefined,
1206
+ CreatedTime: undefined,
1207
+ LastUpdatedTime: undefined,
1208
+ OwnerAccountId: undefined,
1209
+ RouteId: undefined,
1210
+ RouteType: undefined,
1211
+ ServiceId: undefined,
1212
+ State: undefined,
1213
+ Tags: undefined,
1214
+ UriPathRoute: undefined,
1215
+ };
1216
+ _a = __expectNonNull;
1217
+ _b = __expectObject;
1218
+ return [4, parseBody(output.body, context)];
1219
+ case 1:
1220
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1221
+ if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
1222
+ contents.ApplicationId = __expectString(data.ApplicationId);
1223
+ }
1224
+ if (data.Arn !== undefined && data.Arn !== null) {
1225
+ contents.Arn = __expectString(data.Arn);
1226
+ }
1227
+ if (data.CreatedByAccountId !== undefined && data.CreatedByAccountId !== null) {
1228
+ contents.CreatedByAccountId = __expectString(data.CreatedByAccountId);
1229
+ }
1230
+ if (data.CreatedTime !== undefined && data.CreatedTime !== null) {
1231
+ contents.CreatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreatedTime)));
1232
+ }
1233
+ if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
1234
+ contents.LastUpdatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastUpdatedTime)));
1235
+ }
1236
+ if (data.OwnerAccountId !== undefined && data.OwnerAccountId !== null) {
1237
+ contents.OwnerAccountId = __expectString(data.OwnerAccountId);
1238
+ }
1239
+ if (data.RouteId !== undefined && data.RouteId !== null) {
1240
+ contents.RouteId = __expectString(data.RouteId);
1241
+ }
1242
+ if (data.RouteType !== undefined && data.RouteType !== null) {
1243
+ contents.RouteType = __expectString(data.RouteType);
1244
+ }
1245
+ if (data.ServiceId !== undefined && data.ServiceId !== null) {
1246
+ contents.ServiceId = __expectString(data.ServiceId);
1247
+ }
1248
+ if (data.State !== undefined && data.State !== null) {
1249
+ contents.State = __expectString(data.State);
1250
+ }
1251
+ if (data.Tags !== undefined && data.Tags !== null) {
1252
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1253
+ }
1254
+ if (data.UriPathRoute !== undefined && data.UriPathRoute !== null) {
1255
+ contents.UriPathRoute = deserializeAws_restJson1UriPathRouteInput(data.UriPathRoute, context);
1256
+ }
1257
+ return [2, Promise.resolve(contents)];
1258
+ }
1259
+ });
1260
+ }); };
1261
+ var deserializeAws_restJson1CreateRouteCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1262
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;
1263
+ var _k;
1264
+ return __generator(this, function (_l) {
1265
+ switch (_l.label) {
1266
+ case 0:
1267
+ _a = [__assign({}, output)];
1268
+ _k = {};
1269
+ return [4, parseBody(output.body, context)];
1270
+ case 1:
1271
+ parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));
1272
+ errorCode = "UnknownError";
1273
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1274
+ _b = errorCode;
1275
+ switch (_b) {
1276
+ case "AccessDeniedException": return [3, 2];
1277
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
1278
+ case "ConflictException": return [3, 4];
1279
+ case "com.amazonaws.migrationhubrefactorspaces#ConflictException": return [3, 4];
1280
+ case "InternalServerException": return [3, 6];
1281
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 6];
1282
+ case "ResourceNotFoundException": return [3, 8];
1283
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 8];
1284
+ case "ServiceQuotaExceededException": return [3, 10];
1285
+ case "com.amazonaws.migrationhubrefactorspaces#ServiceQuotaExceededException": return [3, 10];
1286
+ case "ThrottlingException": return [3, 12];
1287
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 12];
1288
+ case "ValidationException": return [3, 14];
1289
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 14];
1290
+ }
1291
+ return [3, 16];
1292
+ case 2:
1293
+ _c = [{}];
1294
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1295
+ case 3:
1296
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1297
+ return [3, 17];
1298
+ case 4:
1299
+ _d = [{}];
1300
+ return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1301
+ case 5:
1302
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1303
+ return [3, 17];
1304
+ case 6:
1305
+ _e = [{}];
1306
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1307
+ case 7:
1308
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1309
+ return [3, 17];
1310
+ case 8:
1311
+ _f = [{}];
1312
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1313
+ case 9:
1314
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1315
+ return [3, 17];
1316
+ case 10:
1317
+ _g = [{}];
1318
+ return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
1319
+ case 11:
1320
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1321
+ return [3, 17];
1322
+ case 12:
1323
+ _h = [{}];
1324
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1325
+ case 13:
1326
+ response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1327
+ return [3, 17];
1328
+ case 14:
1329
+ _j = [{}];
1330
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1331
+ case 15:
1332
+ response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1333
+ return [3, 17];
1334
+ case 16:
1335
+ parsedBody = parsedOutput.body;
1336
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1337
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
1338
+ _l.label = 17;
1339
+ case 17:
1340
+ message = response.message || response.Message || errorCode;
1341
+ response.message = message;
1342
+ delete response.Message;
1343
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
1344
+ }
1345
+ });
1346
+ }); };
1347
+ export var deserializeAws_restJson1CreateServiceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1348
+ var contents, data, _a, _b;
1349
+ return __generator(this, function (_c) {
1350
+ switch (_c.label) {
1351
+ case 0:
1352
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1353
+ return [2, deserializeAws_restJson1CreateServiceCommandError(output, context)];
1354
+ }
1355
+ contents = {
1356
+ $metadata: deserializeMetadata(output),
1357
+ ApplicationId: undefined,
1358
+ Arn: undefined,
1359
+ CreatedByAccountId: undefined,
1360
+ CreatedTime: undefined,
1361
+ Description: undefined,
1362
+ EndpointType: undefined,
1363
+ EnvironmentId: undefined,
1364
+ LambdaEndpoint: undefined,
1365
+ LastUpdatedTime: undefined,
1366
+ Name: undefined,
1367
+ OwnerAccountId: undefined,
1368
+ ServiceId: undefined,
1369
+ State: undefined,
1370
+ Tags: undefined,
1371
+ UrlEndpoint: undefined,
1372
+ VpcId: undefined,
1373
+ };
1374
+ _a = __expectNonNull;
1375
+ _b = __expectObject;
1376
+ return [4, parseBody(output.body, context)];
1377
+ case 1:
1378
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1379
+ if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
1380
+ contents.ApplicationId = __expectString(data.ApplicationId);
1381
+ }
1382
+ if (data.Arn !== undefined && data.Arn !== null) {
1383
+ contents.Arn = __expectString(data.Arn);
1384
+ }
1385
+ if (data.CreatedByAccountId !== undefined && data.CreatedByAccountId !== null) {
1386
+ contents.CreatedByAccountId = __expectString(data.CreatedByAccountId);
1387
+ }
1388
+ if (data.CreatedTime !== undefined && data.CreatedTime !== null) {
1389
+ contents.CreatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreatedTime)));
1390
+ }
1391
+ if (data.Description !== undefined && data.Description !== null) {
1392
+ contents.Description = __expectString(data.Description);
1393
+ }
1394
+ if (data.EndpointType !== undefined && data.EndpointType !== null) {
1395
+ contents.EndpointType = __expectString(data.EndpointType);
1396
+ }
1397
+ if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
1398
+ contents.EnvironmentId = __expectString(data.EnvironmentId);
1399
+ }
1400
+ if (data.LambdaEndpoint !== undefined && data.LambdaEndpoint !== null) {
1401
+ contents.LambdaEndpoint = deserializeAws_restJson1LambdaEndpointInput(data.LambdaEndpoint, context);
1402
+ }
1403
+ if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
1404
+ contents.LastUpdatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastUpdatedTime)));
1405
+ }
1406
+ if (data.Name !== undefined && data.Name !== null) {
1407
+ contents.Name = __expectString(data.Name);
1408
+ }
1409
+ if (data.OwnerAccountId !== undefined && data.OwnerAccountId !== null) {
1410
+ contents.OwnerAccountId = __expectString(data.OwnerAccountId);
1411
+ }
1412
+ if (data.ServiceId !== undefined && data.ServiceId !== null) {
1413
+ contents.ServiceId = __expectString(data.ServiceId);
1414
+ }
1415
+ if (data.State !== undefined && data.State !== null) {
1416
+ contents.State = __expectString(data.State);
1417
+ }
1418
+ if (data.Tags !== undefined && data.Tags !== null) {
1419
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1420
+ }
1421
+ if (data.UrlEndpoint !== undefined && data.UrlEndpoint !== null) {
1422
+ contents.UrlEndpoint = deserializeAws_restJson1UrlEndpointInput(data.UrlEndpoint, context);
1423
+ }
1424
+ if (data.VpcId !== undefined && data.VpcId !== null) {
1425
+ contents.VpcId = __expectString(data.VpcId);
1426
+ }
1427
+ return [2, Promise.resolve(contents)];
1428
+ }
1429
+ });
1430
+ }); };
1431
+ var deserializeAws_restJson1CreateServiceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1432
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;
1433
+ var _k;
1434
+ return __generator(this, function (_l) {
1435
+ switch (_l.label) {
1436
+ case 0:
1437
+ _a = [__assign({}, output)];
1438
+ _k = {};
1439
+ return [4, parseBody(output.body, context)];
1440
+ case 1:
1441
+ parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));
1442
+ errorCode = "UnknownError";
1443
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1444
+ _b = errorCode;
1445
+ switch (_b) {
1446
+ case "AccessDeniedException": return [3, 2];
1447
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
1448
+ case "ConflictException": return [3, 4];
1449
+ case "com.amazonaws.migrationhubrefactorspaces#ConflictException": return [3, 4];
1450
+ case "InternalServerException": return [3, 6];
1451
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 6];
1452
+ case "ResourceNotFoundException": return [3, 8];
1453
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 8];
1454
+ case "ServiceQuotaExceededException": return [3, 10];
1455
+ case "com.amazonaws.migrationhubrefactorspaces#ServiceQuotaExceededException": return [3, 10];
1456
+ case "ThrottlingException": return [3, 12];
1457
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 12];
1458
+ case "ValidationException": return [3, 14];
1459
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 14];
1460
+ }
1461
+ return [3, 16];
1462
+ case 2:
1463
+ _c = [{}];
1464
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1465
+ case 3:
1466
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1467
+ return [3, 17];
1468
+ case 4:
1469
+ _d = [{}];
1470
+ return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1471
+ case 5:
1472
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1473
+ return [3, 17];
1474
+ case 6:
1475
+ _e = [{}];
1476
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1477
+ case 7:
1478
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1479
+ return [3, 17];
1480
+ case 8:
1481
+ _f = [{}];
1482
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1483
+ case 9:
1484
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1485
+ return [3, 17];
1486
+ case 10:
1487
+ _g = [{}];
1488
+ return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
1489
+ case 11:
1490
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1491
+ return [3, 17];
1492
+ case 12:
1493
+ _h = [{}];
1494
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1495
+ case 13:
1496
+ response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1497
+ return [3, 17];
1498
+ case 14:
1499
+ _j = [{}];
1500
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1501
+ case 15:
1502
+ response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1503
+ return [3, 17];
1504
+ case 16:
1505
+ parsedBody = parsedOutput.body;
1506
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1507
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
1508
+ _l.label = 17;
1509
+ case 17:
1510
+ message = response.message || response.Message || errorCode;
1511
+ response.message = message;
1512
+ delete response.Message;
1513
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
1514
+ }
1515
+ });
1516
+ }); };
1517
+ export var deserializeAws_restJson1DeleteApplicationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1518
+ var contents, data, _a, _b;
1519
+ return __generator(this, function (_c) {
1520
+ switch (_c.label) {
1521
+ case 0:
1522
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1523
+ return [2, deserializeAws_restJson1DeleteApplicationCommandError(output, context)];
1524
+ }
1525
+ contents = {
1526
+ $metadata: deserializeMetadata(output),
1527
+ ApplicationId: undefined,
1528
+ Arn: undefined,
1529
+ EnvironmentId: undefined,
1530
+ LastUpdatedTime: undefined,
1531
+ Name: undefined,
1532
+ State: undefined,
1533
+ };
1534
+ _a = __expectNonNull;
1535
+ _b = __expectObject;
1536
+ return [4, parseBody(output.body, context)];
1537
+ case 1:
1538
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1539
+ if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
1540
+ contents.ApplicationId = __expectString(data.ApplicationId);
1541
+ }
1542
+ if (data.Arn !== undefined && data.Arn !== null) {
1543
+ contents.Arn = __expectString(data.Arn);
1544
+ }
1545
+ if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
1546
+ contents.EnvironmentId = __expectString(data.EnvironmentId);
1547
+ }
1548
+ if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
1549
+ contents.LastUpdatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastUpdatedTime)));
1550
+ }
1551
+ if (data.Name !== undefined && data.Name !== null) {
1552
+ contents.Name = __expectString(data.Name);
1553
+ }
1554
+ if (data.State !== undefined && data.State !== null) {
1555
+ contents.State = __expectString(data.State);
1556
+ }
1557
+ return [2, Promise.resolve(contents)];
1558
+ }
1559
+ });
1560
+ }); };
1561
+ var deserializeAws_restJson1DeleteApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1562
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;
1563
+ var _j;
1564
+ return __generator(this, function (_k) {
1565
+ switch (_k.label) {
1566
+ case 0:
1567
+ _a = [__assign({}, output)];
1568
+ _j = {};
1569
+ return [4, parseBody(output.body, context)];
1570
+ case 1:
1571
+ parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));
1572
+ errorCode = "UnknownError";
1573
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1574
+ _b = errorCode;
1575
+ switch (_b) {
1576
+ case "AccessDeniedException": return [3, 2];
1577
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
1578
+ case "ConflictException": return [3, 4];
1579
+ case "com.amazonaws.migrationhubrefactorspaces#ConflictException": return [3, 4];
1580
+ case "InternalServerException": return [3, 6];
1581
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 6];
1582
+ case "ResourceNotFoundException": return [3, 8];
1583
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 8];
1584
+ case "ThrottlingException": return [3, 10];
1585
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 10];
1586
+ case "ValidationException": return [3, 12];
1587
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 12];
1588
+ }
1589
+ return [3, 14];
1590
+ case 2:
1591
+ _c = [{}];
1592
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1593
+ case 3:
1594
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1595
+ return [3, 15];
1596
+ case 4:
1597
+ _d = [{}];
1598
+ return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1599
+ case 5:
1600
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1601
+ return [3, 15];
1602
+ case 6:
1603
+ _e = [{}];
1604
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1605
+ case 7:
1606
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1607
+ return [3, 15];
1608
+ case 8:
1609
+ _f = [{}];
1610
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1611
+ case 9:
1612
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1613
+ return [3, 15];
1614
+ case 10:
1615
+ _g = [{}];
1616
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1617
+ case 11:
1618
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1619
+ return [3, 15];
1620
+ case 12:
1621
+ _h = [{}];
1622
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1623
+ case 13:
1624
+ response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1625
+ return [3, 15];
1626
+ case 14:
1627
+ parsedBody = parsedOutput.body;
1628
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1629
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
1630
+ _k.label = 15;
1631
+ case 15:
1632
+ message = response.message || response.Message || errorCode;
1633
+ response.message = message;
1634
+ delete response.Message;
1635
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
1636
+ }
1637
+ });
1638
+ }); };
1639
+ export var deserializeAws_restJson1DeleteEnvironmentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1640
+ var contents, data, _a, _b;
1641
+ return __generator(this, function (_c) {
1642
+ switch (_c.label) {
1643
+ case 0:
1644
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1645
+ return [2, deserializeAws_restJson1DeleteEnvironmentCommandError(output, context)];
1646
+ }
1647
+ contents = {
1648
+ $metadata: deserializeMetadata(output),
1649
+ Arn: undefined,
1650
+ EnvironmentId: undefined,
1651
+ LastUpdatedTime: undefined,
1652
+ Name: undefined,
1653
+ State: undefined,
1654
+ };
1655
+ _a = __expectNonNull;
1656
+ _b = __expectObject;
1657
+ return [4, parseBody(output.body, context)];
1658
+ case 1:
1659
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1660
+ if (data.Arn !== undefined && data.Arn !== null) {
1661
+ contents.Arn = __expectString(data.Arn);
1662
+ }
1663
+ if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
1664
+ contents.EnvironmentId = __expectString(data.EnvironmentId);
1665
+ }
1666
+ if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
1667
+ contents.LastUpdatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastUpdatedTime)));
1668
+ }
1669
+ if (data.Name !== undefined && data.Name !== null) {
1670
+ contents.Name = __expectString(data.Name);
1671
+ }
1672
+ if (data.State !== undefined && data.State !== null) {
1673
+ contents.State = __expectString(data.State);
1674
+ }
1675
+ return [2, Promise.resolve(contents)];
1676
+ }
1677
+ });
1678
+ }); };
1679
+ var deserializeAws_restJson1DeleteEnvironmentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1680
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;
1681
+ var _j;
1682
+ return __generator(this, function (_k) {
1683
+ switch (_k.label) {
1684
+ case 0:
1685
+ _a = [__assign({}, output)];
1686
+ _j = {};
1687
+ return [4, parseBody(output.body, context)];
1688
+ case 1:
1689
+ parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));
1690
+ errorCode = "UnknownError";
1691
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1692
+ _b = errorCode;
1693
+ switch (_b) {
1694
+ case "AccessDeniedException": return [3, 2];
1695
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
1696
+ case "ConflictException": return [3, 4];
1697
+ case "com.amazonaws.migrationhubrefactorspaces#ConflictException": return [3, 4];
1698
+ case "InternalServerException": return [3, 6];
1699
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 6];
1700
+ case "ResourceNotFoundException": return [3, 8];
1701
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 8];
1702
+ case "ThrottlingException": return [3, 10];
1703
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 10];
1704
+ case "ValidationException": return [3, 12];
1705
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 12];
1706
+ }
1707
+ return [3, 14];
1708
+ case 2:
1709
+ _c = [{}];
1710
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1711
+ case 3:
1712
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1713
+ return [3, 15];
1714
+ case 4:
1715
+ _d = [{}];
1716
+ return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1717
+ case 5:
1718
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1719
+ return [3, 15];
1720
+ case 6:
1721
+ _e = [{}];
1722
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1723
+ case 7:
1724
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1725
+ return [3, 15];
1726
+ case 8:
1727
+ _f = [{}];
1728
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1729
+ case 9:
1730
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1731
+ return [3, 15];
1732
+ case 10:
1733
+ _g = [{}];
1734
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1735
+ case 11:
1736
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1737
+ return [3, 15];
1738
+ case 12:
1739
+ _h = [{}];
1740
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1741
+ case 13:
1742
+ response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1743
+ return [3, 15];
1744
+ case 14:
1745
+ parsedBody = parsedOutput.body;
1746
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1747
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
1748
+ _k.label = 15;
1749
+ case 15:
1750
+ message = response.message || response.Message || errorCode;
1751
+ response.message = message;
1752
+ delete response.Message;
1753
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
1754
+ }
1755
+ });
1756
+ }); };
1757
+ export var deserializeAws_restJson1DeleteResourcePolicyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1758
+ var contents;
1759
+ return __generator(this, function (_a) {
1760
+ switch (_a.label) {
1761
+ case 0:
1762
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1763
+ return [2, deserializeAws_restJson1DeleteResourcePolicyCommandError(output, context)];
1764
+ }
1765
+ contents = {
1766
+ $metadata: deserializeMetadata(output),
1767
+ };
1768
+ return [4, collectBody(output.body, context)];
1769
+ case 1:
1770
+ _a.sent();
1771
+ return [2, Promise.resolve(contents)];
1772
+ }
1773
+ });
1774
+ }); };
1775
+ var deserializeAws_restJson1DeleteResourcePolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1776
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
1777
+ var _h;
1778
+ return __generator(this, function (_j) {
1779
+ switch (_j.label) {
1780
+ case 0:
1781
+ _a = [__assign({}, output)];
1782
+ _h = {};
1783
+ return [4, parseBody(output.body, context)];
1784
+ case 1:
1785
+ parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
1786
+ errorCode = "UnknownError";
1787
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1788
+ _b = errorCode;
1789
+ switch (_b) {
1790
+ case "AccessDeniedException": return [3, 2];
1791
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
1792
+ case "InternalServerException": return [3, 4];
1793
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 4];
1794
+ case "ResourceNotFoundException": return [3, 6];
1795
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 6];
1796
+ case "ThrottlingException": return [3, 8];
1797
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 8];
1798
+ case "ValidationException": return [3, 10];
1799
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 10];
1800
+ }
1801
+ return [3, 12];
1802
+ case 2:
1803
+ _c = [{}];
1804
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1805
+ case 3:
1806
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1807
+ return [3, 13];
1808
+ case 4:
1809
+ _d = [{}];
1810
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1811
+ case 5:
1812
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1813
+ return [3, 13];
1814
+ case 6:
1815
+ _e = [{}];
1816
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1817
+ case 7:
1818
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1819
+ return [3, 13];
1820
+ case 8:
1821
+ _f = [{}];
1822
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1823
+ case 9:
1824
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1825
+ return [3, 13];
1826
+ case 10:
1827
+ _g = [{}];
1828
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1829
+ case 11:
1830
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1831
+ return [3, 13];
1832
+ case 12:
1833
+ parsedBody = parsedOutput.body;
1834
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1835
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
1836
+ _j.label = 13;
1837
+ case 13:
1838
+ message = response.message || response.Message || errorCode;
1839
+ response.message = message;
1840
+ delete response.Message;
1841
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
1842
+ }
1843
+ });
1844
+ }); };
1845
+ export var deserializeAws_restJson1DeleteRouteCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1846
+ var contents, data, _a, _b;
1847
+ return __generator(this, function (_c) {
1848
+ switch (_c.label) {
1849
+ case 0:
1850
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1851
+ return [2, deserializeAws_restJson1DeleteRouteCommandError(output, context)];
1852
+ }
1853
+ contents = {
1854
+ $metadata: deserializeMetadata(output),
1855
+ ApplicationId: undefined,
1856
+ Arn: undefined,
1857
+ LastUpdatedTime: undefined,
1858
+ RouteId: undefined,
1859
+ ServiceId: undefined,
1860
+ State: undefined,
1861
+ };
1862
+ _a = __expectNonNull;
1863
+ _b = __expectObject;
1864
+ return [4, parseBody(output.body, context)];
1865
+ case 1:
1866
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1867
+ if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
1868
+ contents.ApplicationId = __expectString(data.ApplicationId);
1869
+ }
1870
+ if (data.Arn !== undefined && data.Arn !== null) {
1871
+ contents.Arn = __expectString(data.Arn);
1872
+ }
1873
+ if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
1874
+ contents.LastUpdatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastUpdatedTime)));
1875
+ }
1876
+ if (data.RouteId !== undefined && data.RouteId !== null) {
1877
+ contents.RouteId = __expectString(data.RouteId);
1878
+ }
1879
+ if (data.ServiceId !== undefined && data.ServiceId !== null) {
1880
+ contents.ServiceId = __expectString(data.ServiceId);
1881
+ }
1882
+ if (data.State !== undefined && data.State !== null) {
1883
+ contents.State = __expectString(data.State);
1884
+ }
1885
+ return [2, Promise.resolve(contents)];
1886
+ }
1887
+ });
1888
+ }); };
1889
+ var deserializeAws_restJson1DeleteRouteCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1890
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;
1891
+ var _j;
1892
+ return __generator(this, function (_k) {
1893
+ switch (_k.label) {
1894
+ case 0:
1895
+ _a = [__assign({}, output)];
1896
+ _j = {};
1897
+ return [4, parseBody(output.body, context)];
1898
+ case 1:
1899
+ parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));
1900
+ errorCode = "UnknownError";
1901
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1902
+ _b = errorCode;
1903
+ switch (_b) {
1904
+ case "AccessDeniedException": return [3, 2];
1905
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
1906
+ case "ConflictException": return [3, 4];
1907
+ case "com.amazonaws.migrationhubrefactorspaces#ConflictException": return [3, 4];
1908
+ case "InternalServerException": return [3, 6];
1909
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 6];
1910
+ case "ResourceNotFoundException": return [3, 8];
1911
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 8];
1912
+ case "ThrottlingException": return [3, 10];
1913
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 10];
1914
+ case "ValidationException": return [3, 12];
1915
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 12];
1916
+ }
1917
+ return [3, 14];
1918
+ case 2:
1919
+ _c = [{}];
1920
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1921
+ case 3:
1922
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1923
+ return [3, 15];
1924
+ case 4:
1925
+ _d = [{}];
1926
+ return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1927
+ case 5:
1928
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1929
+ return [3, 15];
1930
+ case 6:
1931
+ _e = [{}];
1932
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1933
+ case 7:
1934
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1935
+ return [3, 15];
1936
+ case 8:
1937
+ _f = [{}];
1938
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1939
+ case 9:
1940
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1941
+ return [3, 15];
1942
+ case 10:
1943
+ _g = [{}];
1944
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1945
+ case 11:
1946
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1947
+ return [3, 15];
1948
+ case 12:
1949
+ _h = [{}];
1950
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1951
+ case 13:
1952
+ response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1953
+ return [3, 15];
1954
+ case 14:
1955
+ parsedBody = parsedOutput.body;
1956
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1957
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
1958
+ _k.label = 15;
1959
+ case 15:
1960
+ message = response.message || response.Message || errorCode;
1961
+ response.message = message;
1962
+ delete response.Message;
1963
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
1964
+ }
1965
+ });
1966
+ }); };
1967
+ export var deserializeAws_restJson1DeleteServiceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1968
+ var contents, data, _a, _b;
1969
+ return __generator(this, function (_c) {
1970
+ switch (_c.label) {
1971
+ case 0:
1972
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1973
+ return [2, deserializeAws_restJson1DeleteServiceCommandError(output, context)];
1974
+ }
1975
+ contents = {
1976
+ $metadata: deserializeMetadata(output),
1977
+ ApplicationId: undefined,
1978
+ Arn: undefined,
1979
+ EnvironmentId: undefined,
1980
+ LastUpdatedTime: undefined,
1981
+ Name: undefined,
1982
+ ServiceId: undefined,
1983
+ State: undefined,
1984
+ };
1985
+ _a = __expectNonNull;
1986
+ _b = __expectObject;
1987
+ return [4, parseBody(output.body, context)];
1988
+ case 1:
1989
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1990
+ if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
1991
+ contents.ApplicationId = __expectString(data.ApplicationId);
1992
+ }
1993
+ if (data.Arn !== undefined && data.Arn !== null) {
1994
+ contents.Arn = __expectString(data.Arn);
1995
+ }
1996
+ if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
1997
+ contents.EnvironmentId = __expectString(data.EnvironmentId);
1998
+ }
1999
+ if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
2000
+ contents.LastUpdatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastUpdatedTime)));
2001
+ }
2002
+ if (data.Name !== undefined && data.Name !== null) {
2003
+ contents.Name = __expectString(data.Name);
2004
+ }
2005
+ if (data.ServiceId !== undefined && data.ServiceId !== null) {
2006
+ contents.ServiceId = __expectString(data.ServiceId);
2007
+ }
2008
+ if (data.State !== undefined && data.State !== null) {
2009
+ contents.State = __expectString(data.State);
2010
+ }
2011
+ return [2, Promise.resolve(contents)];
2012
+ }
2013
+ });
2014
+ }); };
2015
+ var deserializeAws_restJson1DeleteServiceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2016
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;
2017
+ var _j;
2018
+ return __generator(this, function (_k) {
2019
+ switch (_k.label) {
2020
+ case 0:
2021
+ _a = [__assign({}, output)];
2022
+ _j = {};
2023
+ return [4, parseBody(output.body, context)];
2024
+ case 1:
2025
+ parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));
2026
+ errorCode = "UnknownError";
2027
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2028
+ _b = errorCode;
2029
+ switch (_b) {
2030
+ case "AccessDeniedException": return [3, 2];
2031
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
2032
+ case "ConflictException": return [3, 4];
2033
+ case "com.amazonaws.migrationhubrefactorspaces#ConflictException": return [3, 4];
2034
+ case "InternalServerException": return [3, 6];
2035
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 6];
2036
+ case "ResourceNotFoundException": return [3, 8];
2037
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 8];
2038
+ case "ThrottlingException": return [3, 10];
2039
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 10];
2040
+ case "ValidationException": return [3, 12];
2041
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 12];
2042
+ }
2043
+ return [3, 14];
2044
+ case 2:
2045
+ _c = [{}];
2046
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2047
+ case 3:
2048
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2049
+ return [3, 15];
2050
+ case 4:
2051
+ _d = [{}];
2052
+ return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2053
+ case 5:
2054
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2055
+ return [3, 15];
2056
+ case 6:
2057
+ _e = [{}];
2058
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2059
+ case 7:
2060
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2061
+ return [3, 15];
2062
+ case 8:
2063
+ _f = [{}];
2064
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2065
+ case 9:
2066
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2067
+ return [3, 15];
2068
+ case 10:
2069
+ _g = [{}];
2070
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2071
+ case 11:
2072
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2073
+ return [3, 15];
2074
+ case 12:
2075
+ _h = [{}];
2076
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2077
+ case 13:
2078
+ response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2079
+ return [3, 15];
2080
+ case 14:
2081
+ parsedBody = parsedOutput.body;
2082
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
2083
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
2084
+ _k.label = 15;
2085
+ case 15:
2086
+ message = response.message || response.Message || errorCode;
2087
+ response.message = message;
2088
+ delete response.Message;
2089
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
2090
+ }
2091
+ });
2092
+ }); };
2093
+ export var deserializeAws_restJson1GetApplicationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2094
+ var contents, data, _a, _b;
2095
+ return __generator(this, function (_c) {
2096
+ switch (_c.label) {
2097
+ case 0:
2098
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2099
+ return [2, deserializeAws_restJson1GetApplicationCommandError(output, context)];
2100
+ }
2101
+ contents = {
2102
+ $metadata: deserializeMetadata(output),
2103
+ ApiGatewayProxy: undefined,
2104
+ ApplicationId: undefined,
2105
+ Arn: undefined,
2106
+ CreatedByAccountId: undefined,
2107
+ CreatedTime: undefined,
2108
+ EnvironmentId: undefined,
2109
+ Error: undefined,
2110
+ LastUpdatedTime: undefined,
2111
+ Name: undefined,
2112
+ OwnerAccountId: undefined,
2113
+ ProxyType: undefined,
2114
+ State: undefined,
2115
+ Tags: undefined,
2116
+ VpcId: undefined,
2117
+ };
2118
+ _a = __expectNonNull;
2119
+ _b = __expectObject;
2120
+ return [4, parseBody(output.body, context)];
2121
+ case 1:
2122
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2123
+ if (data.ApiGatewayProxy !== undefined && data.ApiGatewayProxy !== null) {
2124
+ contents.ApiGatewayProxy = deserializeAws_restJson1ApiGatewayProxyConfig(data.ApiGatewayProxy, context);
2125
+ }
2126
+ if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
2127
+ contents.ApplicationId = __expectString(data.ApplicationId);
2128
+ }
2129
+ if (data.Arn !== undefined && data.Arn !== null) {
2130
+ contents.Arn = __expectString(data.Arn);
2131
+ }
2132
+ if (data.CreatedByAccountId !== undefined && data.CreatedByAccountId !== null) {
2133
+ contents.CreatedByAccountId = __expectString(data.CreatedByAccountId);
2134
+ }
2135
+ if (data.CreatedTime !== undefined && data.CreatedTime !== null) {
2136
+ contents.CreatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreatedTime)));
2137
+ }
2138
+ if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
2139
+ contents.EnvironmentId = __expectString(data.EnvironmentId);
2140
+ }
2141
+ if (data.Error !== undefined && data.Error !== null) {
2142
+ contents.Error = deserializeAws_restJson1ErrorResponse(data.Error, context);
2143
+ }
2144
+ if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
2145
+ contents.LastUpdatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastUpdatedTime)));
2146
+ }
2147
+ if (data.Name !== undefined && data.Name !== null) {
2148
+ contents.Name = __expectString(data.Name);
2149
+ }
2150
+ if (data.OwnerAccountId !== undefined && data.OwnerAccountId !== null) {
2151
+ contents.OwnerAccountId = __expectString(data.OwnerAccountId);
2152
+ }
2153
+ if (data.ProxyType !== undefined && data.ProxyType !== null) {
2154
+ contents.ProxyType = __expectString(data.ProxyType);
2155
+ }
2156
+ if (data.State !== undefined && data.State !== null) {
2157
+ contents.State = __expectString(data.State);
2158
+ }
2159
+ if (data.Tags !== undefined && data.Tags !== null) {
2160
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
2161
+ }
2162
+ if (data.VpcId !== undefined && data.VpcId !== null) {
2163
+ contents.VpcId = __expectString(data.VpcId);
2164
+ }
2165
+ return [2, Promise.resolve(contents)];
2166
+ }
2167
+ });
2168
+ }); };
2169
+ var deserializeAws_restJson1GetApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2170
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
2171
+ var _h;
2172
+ return __generator(this, function (_j) {
2173
+ switch (_j.label) {
2174
+ case 0:
2175
+ _a = [__assign({}, output)];
2176
+ _h = {};
2177
+ return [4, parseBody(output.body, context)];
2178
+ case 1:
2179
+ parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
2180
+ errorCode = "UnknownError";
2181
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2182
+ _b = errorCode;
2183
+ switch (_b) {
2184
+ case "AccessDeniedException": return [3, 2];
2185
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
2186
+ case "InternalServerException": return [3, 4];
2187
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 4];
2188
+ case "ResourceNotFoundException": return [3, 6];
2189
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 6];
2190
+ case "ThrottlingException": return [3, 8];
2191
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 8];
2192
+ case "ValidationException": return [3, 10];
2193
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 10];
2194
+ }
2195
+ return [3, 12];
2196
+ case 2:
2197
+ _c = [{}];
2198
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2199
+ case 3:
2200
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2201
+ return [3, 13];
2202
+ case 4:
2203
+ _d = [{}];
2204
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2205
+ case 5:
2206
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2207
+ return [3, 13];
2208
+ case 6:
2209
+ _e = [{}];
2210
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2211
+ case 7:
2212
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2213
+ return [3, 13];
2214
+ case 8:
2215
+ _f = [{}];
2216
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2217
+ case 9:
2218
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2219
+ return [3, 13];
2220
+ case 10:
2221
+ _g = [{}];
2222
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2223
+ case 11:
2224
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2225
+ return [3, 13];
2226
+ case 12:
2227
+ parsedBody = parsedOutput.body;
2228
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
2229
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
2230
+ _j.label = 13;
2231
+ case 13:
2232
+ message = response.message || response.Message || errorCode;
2233
+ response.message = message;
2234
+ delete response.Message;
2235
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
2236
+ }
2237
+ });
2238
+ }); };
2239
+ export var deserializeAws_restJson1GetEnvironmentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2240
+ var contents, data, _a, _b;
2241
+ return __generator(this, function (_c) {
2242
+ switch (_c.label) {
2243
+ case 0:
2244
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2245
+ return [2, deserializeAws_restJson1GetEnvironmentCommandError(output, context)];
2246
+ }
2247
+ contents = {
2248
+ $metadata: deserializeMetadata(output),
2249
+ Arn: undefined,
2250
+ CreatedTime: undefined,
2251
+ Description: undefined,
2252
+ EnvironmentId: undefined,
2253
+ Error: undefined,
2254
+ LastUpdatedTime: undefined,
2255
+ Name: undefined,
2256
+ NetworkFabricType: undefined,
2257
+ OwnerAccountId: undefined,
2258
+ State: undefined,
2259
+ Tags: undefined,
2260
+ TransitGatewayId: undefined,
2261
+ };
2262
+ _a = __expectNonNull;
2263
+ _b = __expectObject;
2264
+ return [4, parseBody(output.body, context)];
2265
+ case 1:
2266
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2267
+ if (data.Arn !== undefined && data.Arn !== null) {
2268
+ contents.Arn = __expectString(data.Arn);
2269
+ }
2270
+ if (data.CreatedTime !== undefined && data.CreatedTime !== null) {
2271
+ contents.CreatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreatedTime)));
2272
+ }
2273
+ if (data.Description !== undefined && data.Description !== null) {
2274
+ contents.Description = __expectString(data.Description);
2275
+ }
2276
+ if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
2277
+ contents.EnvironmentId = __expectString(data.EnvironmentId);
2278
+ }
2279
+ if (data.Error !== undefined && data.Error !== null) {
2280
+ contents.Error = deserializeAws_restJson1ErrorResponse(data.Error, context);
2281
+ }
2282
+ if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
2283
+ contents.LastUpdatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastUpdatedTime)));
2284
+ }
2285
+ if (data.Name !== undefined && data.Name !== null) {
2286
+ contents.Name = __expectString(data.Name);
2287
+ }
2288
+ if (data.NetworkFabricType !== undefined && data.NetworkFabricType !== null) {
2289
+ contents.NetworkFabricType = __expectString(data.NetworkFabricType);
2290
+ }
2291
+ if (data.OwnerAccountId !== undefined && data.OwnerAccountId !== null) {
2292
+ contents.OwnerAccountId = __expectString(data.OwnerAccountId);
2293
+ }
2294
+ if (data.State !== undefined && data.State !== null) {
2295
+ contents.State = __expectString(data.State);
2296
+ }
2297
+ if (data.Tags !== undefined && data.Tags !== null) {
2298
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
2299
+ }
2300
+ if (data.TransitGatewayId !== undefined && data.TransitGatewayId !== null) {
2301
+ contents.TransitGatewayId = __expectString(data.TransitGatewayId);
2302
+ }
2303
+ return [2, Promise.resolve(contents)];
2304
+ }
2305
+ });
2306
+ }); };
2307
+ var deserializeAws_restJson1GetEnvironmentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2308
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
2309
+ var _h;
2310
+ return __generator(this, function (_j) {
2311
+ switch (_j.label) {
2312
+ case 0:
2313
+ _a = [__assign({}, output)];
2314
+ _h = {};
2315
+ return [4, parseBody(output.body, context)];
2316
+ case 1:
2317
+ parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
2318
+ errorCode = "UnknownError";
2319
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2320
+ _b = errorCode;
2321
+ switch (_b) {
2322
+ case "AccessDeniedException": return [3, 2];
2323
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
2324
+ case "InternalServerException": return [3, 4];
2325
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 4];
2326
+ case "ResourceNotFoundException": return [3, 6];
2327
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 6];
2328
+ case "ThrottlingException": return [3, 8];
2329
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 8];
2330
+ case "ValidationException": return [3, 10];
2331
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 10];
2332
+ }
2333
+ return [3, 12];
2334
+ case 2:
2335
+ _c = [{}];
2336
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2337
+ case 3:
2338
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2339
+ return [3, 13];
2340
+ case 4:
2341
+ _d = [{}];
2342
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2343
+ case 5:
2344
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2345
+ return [3, 13];
2346
+ case 6:
2347
+ _e = [{}];
2348
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2349
+ case 7:
2350
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2351
+ return [3, 13];
2352
+ case 8:
2353
+ _f = [{}];
2354
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2355
+ case 9:
2356
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2357
+ return [3, 13];
2358
+ case 10:
2359
+ _g = [{}];
2360
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2361
+ case 11:
2362
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2363
+ return [3, 13];
2364
+ case 12:
2365
+ parsedBody = parsedOutput.body;
2366
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
2367
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
2368
+ _j.label = 13;
2369
+ case 13:
2370
+ message = response.message || response.Message || errorCode;
2371
+ response.message = message;
2372
+ delete response.Message;
2373
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
2374
+ }
2375
+ });
2376
+ }); };
2377
+ export var deserializeAws_restJson1GetResourcePolicyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2378
+ var contents, data, _a, _b;
2379
+ return __generator(this, function (_c) {
2380
+ switch (_c.label) {
2381
+ case 0:
2382
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2383
+ return [2, deserializeAws_restJson1GetResourcePolicyCommandError(output, context)];
2384
+ }
2385
+ contents = {
2386
+ $metadata: deserializeMetadata(output),
2387
+ Policy: undefined,
2388
+ };
2389
+ _a = __expectNonNull;
2390
+ _b = __expectObject;
2391
+ return [4, parseBody(output.body, context)];
2392
+ case 1:
2393
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2394
+ if (data.Policy !== undefined && data.Policy !== null) {
2395
+ contents.Policy = __expectString(data.Policy);
2396
+ }
2397
+ return [2, Promise.resolve(contents)];
2398
+ }
2399
+ });
2400
+ }); };
2401
+ var deserializeAws_restJson1GetResourcePolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2402
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
2403
+ var _h;
2404
+ return __generator(this, function (_j) {
2405
+ switch (_j.label) {
2406
+ case 0:
2407
+ _a = [__assign({}, output)];
2408
+ _h = {};
2409
+ return [4, parseBody(output.body, context)];
2410
+ case 1:
2411
+ parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
2412
+ errorCode = "UnknownError";
2413
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2414
+ _b = errorCode;
2415
+ switch (_b) {
2416
+ case "AccessDeniedException": return [3, 2];
2417
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
2418
+ case "InternalServerException": return [3, 4];
2419
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 4];
2420
+ case "ResourceNotFoundException": return [3, 6];
2421
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 6];
2422
+ case "ThrottlingException": return [3, 8];
2423
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 8];
2424
+ case "ValidationException": return [3, 10];
2425
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 10];
2426
+ }
2427
+ return [3, 12];
2428
+ case 2:
2429
+ _c = [{}];
2430
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2431
+ case 3:
2432
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2433
+ return [3, 13];
2434
+ case 4:
2435
+ _d = [{}];
2436
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2437
+ case 5:
2438
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2439
+ return [3, 13];
2440
+ case 6:
2441
+ _e = [{}];
2442
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2443
+ case 7:
2444
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2445
+ return [3, 13];
2446
+ case 8:
2447
+ _f = [{}];
2448
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2449
+ case 9:
2450
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2451
+ return [3, 13];
2452
+ case 10:
2453
+ _g = [{}];
2454
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2455
+ case 11:
2456
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2457
+ return [3, 13];
2458
+ case 12:
2459
+ parsedBody = parsedOutput.body;
2460
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
2461
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
2462
+ _j.label = 13;
2463
+ case 13:
2464
+ message = response.message || response.Message || errorCode;
2465
+ response.message = message;
2466
+ delete response.Message;
2467
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
2468
+ }
2469
+ });
2470
+ }); };
2471
+ export var deserializeAws_restJson1GetRouteCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2472
+ var contents, data, _a, _b;
2473
+ return __generator(this, function (_c) {
2474
+ switch (_c.label) {
2475
+ case 0:
2476
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2477
+ return [2, deserializeAws_restJson1GetRouteCommandError(output, context)];
2478
+ }
2479
+ contents = {
2480
+ $metadata: deserializeMetadata(output),
2481
+ ApplicationId: undefined,
2482
+ Arn: undefined,
2483
+ CreatedByAccountId: undefined,
2484
+ CreatedTime: undefined,
2485
+ EnvironmentId: undefined,
2486
+ Error: undefined,
2487
+ IncludeChildPaths: undefined,
2488
+ LastUpdatedTime: undefined,
2489
+ Methods: undefined,
2490
+ OwnerAccountId: undefined,
2491
+ PathResourceToId: undefined,
2492
+ RouteId: undefined,
2493
+ RouteType: undefined,
2494
+ ServiceId: undefined,
2495
+ SourcePath: undefined,
2496
+ State: undefined,
2497
+ Tags: undefined,
2498
+ };
2499
+ _a = __expectNonNull;
2500
+ _b = __expectObject;
2501
+ return [4, parseBody(output.body, context)];
2502
+ case 1:
2503
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2504
+ if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
2505
+ contents.ApplicationId = __expectString(data.ApplicationId);
2506
+ }
2507
+ if (data.Arn !== undefined && data.Arn !== null) {
2508
+ contents.Arn = __expectString(data.Arn);
2509
+ }
2510
+ if (data.CreatedByAccountId !== undefined && data.CreatedByAccountId !== null) {
2511
+ contents.CreatedByAccountId = __expectString(data.CreatedByAccountId);
2512
+ }
2513
+ if (data.CreatedTime !== undefined && data.CreatedTime !== null) {
2514
+ contents.CreatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreatedTime)));
2515
+ }
2516
+ if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
2517
+ contents.EnvironmentId = __expectString(data.EnvironmentId);
2518
+ }
2519
+ if (data.Error !== undefined && data.Error !== null) {
2520
+ contents.Error = deserializeAws_restJson1ErrorResponse(data.Error, context);
2521
+ }
2522
+ if (data.IncludeChildPaths !== undefined && data.IncludeChildPaths !== null) {
2523
+ contents.IncludeChildPaths = __expectBoolean(data.IncludeChildPaths);
2524
+ }
2525
+ if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
2526
+ contents.LastUpdatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastUpdatedTime)));
2527
+ }
2528
+ if (data.Methods !== undefined && data.Methods !== null) {
2529
+ contents.Methods = deserializeAws_restJson1HttpMethods(data.Methods, context);
2530
+ }
2531
+ if (data.OwnerAccountId !== undefined && data.OwnerAccountId !== null) {
2532
+ contents.OwnerAccountId = __expectString(data.OwnerAccountId);
2533
+ }
2534
+ if (data.PathResourceToId !== undefined && data.PathResourceToId !== null) {
2535
+ contents.PathResourceToId = deserializeAws_restJson1PathResourceToId(data.PathResourceToId, context);
2536
+ }
2537
+ if (data.RouteId !== undefined && data.RouteId !== null) {
2538
+ contents.RouteId = __expectString(data.RouteId);
2539
+ }
2540
+ if (data.RouteType !== undefined && data.RouteType !== null) {
2541
+ contents.RouteType = __expectString(data.RouteType);
2542
+ }
2543
+ if (data.ServiceId !== undefined && data.ServiceId !== null) {
2544
+ contents.ServiceId = __expectString(data.ServiceId);
2545
+ }
2546
+ if (data.SourcePath !== undefined && data.SourcePath !== null) {
2547
+ contents.SourcePath = __expectString(data.SourcePath);
2548
+ }
2549
+ if (data.State !== undefined && data.State !== null) {
2550
+ contents.State = __expectString(data.State);
2551
+ }
2552
+ if (data.Tags !== undefined && data.Tags !== null) {
2553
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
2554
+ }
2555
+ return [2, Promise.resolve(contents)];
2556
+ }
2557
+ });
2558
+ }); };
2559
+ var deserializeAws_restJson1GetRouteCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2560
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
2561
+ var _h;
2562
+ return __generator(this, function (_j) {
2563
+ switch (_j.label) {
2564
+ case 0:
2565
+ _a = [__assign({}, output)];
2566
+ _h = {};
2567
+ return [4, parseBody(output.body, context)];
2568
+ case 1:
2569
+ parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
2570
+ errorCode = "UnknownError";
2571
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2572
+ _b = errorCode;
2573
+ switch (_b) {
2574
+ case "AccessDeniedException": return [3, 2];
2575
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
2576
+ case "InternalServerException": return [3, 4];
2577
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 4];
2578
+ case "ResourceNotFoundException": return [3, 6];
2579
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 6];
2580
+ case "ThrottlingException": return [3, 8];
2581
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 8];
2582
+ case "ValidationException": return [3, 10];
2583
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 10];
2584
+ }
2585
+ return [3, 12];
2586
+ case 2:
2587
+ _c = [{}];
2588
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2589
+ case 3:
2590
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2591
+ return [3, 13];
2592
+ case 4:
2593
+ _d = [{}];
2594
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2595
+ case 5:
2596
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2597
+ return [3, 13];
2598
+ case 6:
2599
+ _e = [{}];
2600
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2601
+ case 7:
2602
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2603
+ return [3, 13];
2604
+ case 8:
2605
+ _f = [{}];
2606
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2607
+ case 9:
2608
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2609
+ return [3, 13];
2610
+ case 10:
2611
+ _g = [{}];
2612
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2613
+ case 11:
2614
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2615
+ return [3, 13];
2616
+ case 12:
2617
+ parsedBody = parsedOutput.body;
2618
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
2619
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
2620
+ _j.label = 13;
2621
+ case 13:
2622
+ message = response.message || response.Message || errorCode;
2623
+ response.message = message;
2624
+ delete response.Message;
2625
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
2626
+ }
2627
+ });
2628
+ }); };
2629
+ export var deserializeAws_restJson1GetServiceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2630
+ var contents, data, _a, _b;
2631
+ return __generator(this, function (_c) {
2632
+ switch (_c.label) {
2633
+ case 0:
2634
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2635
+ return [2, deserializeAws_restJson1GetServiceCommandError(output, context)];
2636
+ }
2637
+ contents = {
2638
+ $metadata: deserializeMetadata(output),
2639
+ ApplicationId: undefined,
2640
+ Arn: undefined,
2641
+ CreatedByAccountId: undefined,
2642
+ CreatedTime: undefined,
2643
+ Description: undefined,
2644
+ EndpointType: undefined,
2645
+ EnvironmentId: undefined,
2646
+ Error: undefined,
2647
+ LambdaEndpoint: undefined,
2648
+ LastUpdatedTime: undefined,
2649
+ Name: undefined,
2650
+ OwnerAccountId: undefined,
2651
+ ServiceId: undefined,
2652
+ State: undefined,
2653
+ Tags: undefined,
2654
+ UrlEndpoint: undefined,
2655
+ VpcId: undefined,
2656
+ };
2657
+ _a = __expectNonNull;
2658
+ _b = __expectObject;
2659
+ return [4, parseBody(output.body, context)];
2660
+ case 1:
2661
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2662
+ if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
2663
+ contents.ApplicationId = __expectString(data.ApplicationId);
2664
+ }
2665
+ if (data.Arn !== undefined && data.Arn !== null) {
2666
+ contents.Arn = __expectString(data.Arn);
2667
+ }
2668
+ if (data.CreatedByAccountId !== undefined && data.CreatedByAccountId !== null) {
2669
+ contents.CreatedByAccountId = __expectString(data.CreatedByAccountId);
2670
+ }
2671
+ if (data.CreatedTime !== undefined && data.CreatedTime !== null) {
2672
+ contents.CreatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreatedTime)));
2673
+ }
2674
+ if (data.Description !== undefined && data.Description !== null) {
2675
+ contents.Description = __expectString(data.Description);
2676
+ }
2677
+ if (data.EndpointType !== undefined && data.EndpointType !== null) {
2678
+ contents.EndpointType = __expectString(data.EndpointType);
2679
+ }
2680
+ if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
2681
+ contents.EnvironmentId = __expectString(data.EnvironmentId);
2682
+ }
2683
+ if (data.Error !== undefined && data.Error !== null) {
2684
+ contents.Error = deserializeAws_restJson1ErrorResponse(data.Error, context);
2685
+ }
2686
+ if (data.LambdaEndpoint !== undefined && data.LambdaEndpoint !== null) {
2687
+ contents.LambdaEndpoint = deserializeAws_restJson1LambdaEndpointConfig(data.LambdaEndpoint, context);
2688
+ }
2689
+ if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
2690
+ contents.LastUpdatedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastUpdatedTime)));
2691
+ }
2692
+ if (data.Name !== undefined && data.Name !== null) {
2693
+ contents.Name = __expectString(data.Name);
2694
+ }
2695
+ if (data.OwnerAccountId !== undefined && data.OwnerAccountId !== null) {
2696
+ contents.OwnerAccountId = __expectString(data.OwnerAccountId);
2697
+ }
2698
+ if (data.ServiceId !== undefined && data.ServiceId !== null) {
2699
+ contents.ServiceId = __expectString(data.ServiceId);
2700
+ }
2701
+ if (data.State !== undefined && data.State !== null) {
2702
+ contents.State = __expectString(data.State);
2703
+ }
2704
+ if (data.Tags !== undefined && data.Tags !== null) {
2705
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
2706
+ }
2707
+ if (data.UrlEndpoint !== undefined && data.UrlEndpoint !== null) {
2708
+ contents.UrlEndpoint = deserializeAws_restJson1UrlEndpointConfig(data.UrlEndpoint, context);
2709
+ }
2710
+ if (data.VpcId !== undefined && data.VpcId !== null) {
2711
+ contents.VpcId = __expectString(data.VpcId);
2712
+ }
2713
+ return [2, Promise.resolve(contents)];
2714
+ }
2715
+ });
2716
+ }); };
2717
+ var deserializeAws_restJson1GetServiceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2718
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
2719
+ var _h;
2720
+ return __generator(this, function (_j) {
2721
+ switch (_j.label) {
2722
+ case 0:
2723
+ _a = [__assign({}, output)];
2724
+ _h = {};
2725
+ return [4, parseBody(output.body, context)];
2726
+ case 1:
2727
+ parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
2728
+ errorCode = "UnknownError";
2729
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2730
+ _b = errorCode;
2731
+ switch (_b) {
2732
+ case "AccessDeniedException": return [3, 2];
2733
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
2734
+ case "InternalServerException": return [3, 4];
2735
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 4];
2736
+ case "ResourceNotFoundException": return [3, 6];
2737
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 6];
2738
+ case "ThrottlingException": return [3, 8];
2739
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 8];
2740
+ case "ValidationException": return [3, 10];
2741
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 10];
2742
+ }
2743
+ return [3, 12];
2744
+ case 2:
2745
+ _c = [{}];
2746
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2747
+ case 3:
2748
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2749
+ return [3, 13];
2750
+ case 4:
2751
+ _d = [{}];
2752
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2753
+ case 5:
2754
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2755
+ return [3, 13];
2756
+ case 6:
2757
+ _e = [{}];
2758
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2759
+ case 7:
2760
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2761
+ return [3, 13];
2762
+ case 8:
2763
+ _f = [{}];
2764
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2765
+ case 9:
2766
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2767
+ return [3, 13];
2768
+ case 10:
2769
+ _g = [{}];
2770
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2771
+ case 11:
2772
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2773
+ return [3, 13];
2774
+ case 12:
2775
+ parsedBody = parsedOutput.body;
2776
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
2777
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
2778
+ _j.label = 13;
2779
+ case 13:
2780
+ message = response.message || response.Message || errorCode;
2781
+ response.message = message;
2782
+ delete response.Message;
2783
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
2784
+ }
2785
+ });
2786
+ }); };
2787
+ export var deserializeAws_restJson1ListApplicationsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2788
+ var contents, data, _a, _b;
2789
+ return __generator(this, function (_c) {
2790
+ switch (_c.label) {
2791
+ case 0:
2792
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2793
+ return [2, deserializeAws_restJson1ListApplicationsCommandError(output, context)];
2794
+ }
2795
+ contents = {
2796
+ $metadata: deserializeMetadata(output),
2797
+ ApplicationSummaryList: undefined,
2798
+ NextToken: undefined,
2799
+ };
2800
+ _a = __expectNonNull;
2801
+ _b = __expectObject;
2802
+ return [4, parseBody(output.body, context)];
2803
+ case 1:
2804
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2805
+ if (data.ApplicationSummaryList !== undefined && data.ApplicationSummaryList !== null) {
2806
+ contents.ApplicationSummaryList = deserializeAws_restJson1ApplicationSummaries(data.ApplicationSummaryList, context);
2807
+ }
2808
+ if (data.NextToken !== undefined && data.NextToken !== null) {
2809
+ contents.NextToken = __expectString(data.NextToken);
2810
+ }
2811
+ return [2, Promise.resolve(contents)];
2812
+ }
2813
+ });
2814
+ }); };
2815
+ var deserializeAws_restJson1ListApplicationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2816
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;
2817
+ var _k;
2818
+ return __generator(this, function (_l) {
2819
+ switch (_l.label) {
2820
+ case 0:
2821
+ _a = [__assign({}, output)];
2822
+ _k = {};
2823
+ return [4, parseBody(output.body, context)];
2824
+ case 1:
2825
+ parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));
2826
+ errorCode = "UnknownError";
2827
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2828
+ _b = errorCode;
2829
+ switch (_b) {
2830
+ case "AccessDeniedException": return [3, 2];
2831
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
2832
+ case "ConflictException": return [3, 4];
2833
+ case "com.amazonaws.migrationhubrefactorspaces#ConflictException": return [3, 4];
2834
+ case "InternalServerException": return [3, 6];
2835
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 6];
2836
+ case "ResourceNotFoundException": return [3, 8];
2837
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 8];
2838
+ case "ServiceQuotaExceededException": return [3, 10];
2839
+ case "com.amazonaws.migrationhubrefactorspaces#ServiceQuotaExceededException": return [3, 10];
2840
+ case "ThrottlingException": return [3, 12];
2841
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 12];
2842
+ case "ValidationException": return [3, 14];
2843
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 14];
2844
+ }
2845
+ return [3, 16];
2846
+ case 2:
2847
+ _c = [{}];
2848
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2849
+ case 3:
2850
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2851
+ return [3, 17];
2852
+ case 4:
2853
+ _d = [{}];
2854
+ return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2855
+ case 5:
2856
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2857
+ return [3, 17];
2858
+ case 6:
2859
+ _e = [{}];
2860
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2861
+ case 7:
2862
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2863
+ return [3, 17];
2864
+ case 8:
2865
+ _f = [{}];
2866
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2867
+ case 9:
2868
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2869
+ return [3, 17];
2870
+ case 10:
2871
+ _g = [{}];
2872
+ return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
2873
+ case 11:
2874
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2875
+ return [3, 17];
2876
+ case 12:
2877
+ _h = [{}];
2878
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2879
+ case 13:
2880
+ response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2881
+ return [3, 17];
2882
+ case 14:
2883
+ _j = [{}];
2884
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2885
+ case 15:
2886
+ response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2887
+ return [3, 17];
2888
+ case 16:
2889
+ parsedBody = parsedOutput.body;
2890
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
2891
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
2892
+ _l.label = 17;
2893
+ case 17:
2894
+ message = response.message || response.Message || errorCode;
2895
+ response.message = message;
2896
+ delete response.Message;
2897
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
2898
+ }
2899
+ });
2900
+ }); };
2901
+ export var deserializeAws_restJson1ListEnvironmentsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2902
+ var contents, data, _a, _b;
2903
+ return __generator(this, function (_c) {
2904
+ switch (_c.label) {
2905
+ case 0:
2906
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2907
+ return [2, deserializeAws_restJson1ListEnvironmentsCommandError(output, context)];
2908
+ }
2909
+ contents = {
2910
+ $metadata: deserializeMetadata(output),
2911
+ EnvironmentSummaryList: undefined,
2912
+ NextToken: undefined,
2913
+ };
2914
+ _a = __expectNonNull;
2915
+ _b = __expectObject;
2916
+ return [4, parseBody(output.body, context)];
2917
+ case 1:
2918
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2919
+ if (data.EnvironmentSummaryList !== undefined && data.EnvironmentSummaryList !== null) {
2920
+ contents.EnvironmentSummaryList = deserializeAws_restJson1EnvironmentSummaries(data.EnvironmentSummaryList, context);
2921
+ }
2922
+ if (data.NextToken !== undefined && data.NextToken !== null) {
2923
+ contents.NextToken = __expectString(data.NextToken);
2924
+ }
2925
+ return [2, Promise.resolve(contents)];
2926
+ }
2927
+ });
2928
+ }); };
2929
+ var deserializeAws_restJson1ListEnvironmentsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2930
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
2931
+ var _h;
2932
+ return __generator(this, function (_j) {
2933
+ switch (_j.label) {
2934
+ case 0:
2935
+ _a = [__assign({}, output)];
2936
+ _h = {};
2937
+ return [4, parseBody(output.body, context)];
2938
+ case 1:
2939
+ parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
2940
+ errorCode = "UnknownError";
2941
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2942
+ _b = errorCode;
2943
+ switch (_b) {
2944
+ case "AccessDeniedException": return [3, 2];
2945
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
2946
+ case "InternalServerException": return [3, 4];
2947
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 4];
2948
+ case "ResourceNotFoundException": return [3, 6];
2949
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 6];
2950
+ case "ThrottlingException": return [3, 8];
2951
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 8];
2952
+ case "ValidationException": return [3, 10];
2953
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 10];
2954
+ }
2955
+ return [3, 12];
2956
+ case 2:
2957
+ _c = [{}];
2958
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2959
+ case 3:
2960
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2961
+ return [3, 13];
2962
+ case 4:
2963
+ _d = [{}];
2964
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2965
+ case 5:
2966
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2967
+ return [3, 13];
2968
+ case 6:
2969
+ _e = [{}];
2970
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2971
+ case 7:
2972
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2973
+ return [3, 13];
2974
+ case 8:
2975
+ _f = [{}];
2976
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2977
+ case 9:
2978
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2979
+ return [3, 13];
2980
+ case 10:
2981
+ _g = [{}];
2982
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2983
+ case 11:
2984
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2985
+ return [3, 13];
2986
+ case 12:
2987
+ parsedBody = parsedOutput.body;
2988
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
2989
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
2990
+ _j.label = 13;
2991
+ case 13:
2992
+ message = response.message || response.Message || errorCode;
2993
+ response.message = message;
2994
+ delete response.Message;
2995
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
2996
+ }
2997
+ });
2998
+ }); };
2999
+ export var deserializeAws_restJson1ListEnvironmentVpcsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3000
+ var contents, data, _a, _b;
3001
+ return __generator(this, function (_c) {
3002
+ switch (_c.label) {
3003
+ case 0:
3004
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3005
+ return [2, deserializeAws_restJson1ListEnvironmentVpcsCommandError(output, context)];
3006
+ }
3007
+ contents = {
3008
+ $metadata: deserializeMetadata(output),
3009
+ EnvironmentVpcList: undefined,
3010
+ NextToken: undefined,
3011
+ };
3012
+ _a = __expectNonNull;
3013
+ _b = __expectObject;
3014
+ return [4, parseBody(output.body, context)];
3015
+ case 1:
3016
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3017
+ if (data.EnvironmentVpcList !== undefined && data.EnvironmentVpcList !== null) {
3018
+ contents.EnvironmentVpcList = deserializeAws_restJson1EnvironmentVpcs(data.EnvironmentVpcList, context);
3019
+ }
3020
+ if (data.NextToken !== undefined && data.NextToken !== null) {
3021
+ contents.NextToken = __expectString(data.NextToken);
3022
+ }
3023
+ return [2, Promise.resolve(contents)];
3024
+ }
3025
+ });
3026
+ }); };
3027
+ var deserializeAws_restJson1ListEnvironmentVpcsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3028
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
3029
+ var _h;
3030
+ return __generator(this, function (_j) {
3031
+ switch (_j.label) {
3032
+ case 0:
3033
+ _a = [__assign({}, output)];
3034
+ _h = {};
3035
+ return [4, parseBody(output.body, context)];
3036
+ case 1:
3037
+ parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
3038
+ errorCode = "UnknownError";
3039
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3040
+ _b = errorCode;
3041
+ switch (_b) {
3042
+ case "AccessDeniedException": return [3, 2];
3043
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
3044
+ case "InternalServerException": return [3, 4];
3045
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 4];
3046
+ case "ResourceNotFoundException": return [3, 6];
3047
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 6];
3048
+ case "ThrottlingException": return [3, 8];
3049
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 8];
3050
+ case "ValidationException": return [3, 10];
3051
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 10];
3052
+ }
3053
+ return [3, 12];
3054
+ case 2:
3055
+ _c = [{}];
3056
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
3057
+ case 3:
3058
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3059
+ return [3, 13];
3060
+ case 4:
3061
+ _d = [{}];
3062
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
3063
+ case 5:
3064
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3065
+ return [3, 13];
3066
+ case 6:
3067
+ _e = [{}];
3068
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
3069
+ case 7:
3070
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3071
+ return [3, 13];
3072
+ case 8:
3073
+ _f = [{}];
3074
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
3075
+ case 9:
3076
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3077
+ return [3, 13];
3078
+ case 10:
3079
+ _g = [{}];
3080
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
3081
+ case 11:
3082
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3083
+ return [3, 13];
3084
+ case 12:
3085
+ parsedBody = parsedOutput.body;
3086
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
3087
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
3088
+ _j.label = 13;
3089
+ case 13:
3090
+ message = response.message || response.Message || errorCode;
3091
+ response.message = message;
3092
+ delete response.Message;
3093
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
3094
+ }
3095
+ });
3096
+ }); };
3097
+ export var deserializeAws_restJson1ListRoutesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3098
+ var contents, data, _a, _b;
3099
+ return __generator(this, function (_c) {
3100
+ switch (_c.label) {
3101
+ case 0:
3102
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3103
+ return [2, deserializeAws_restJson1ListRoutesCommandError(output, context)];
3104
+ }
3105
+ contents = {
3106
+ $metadata: deserializeMetadata(output),
3107
+ NextToken: undefined,
3108
+ RouteSummaryList: undefined,
3109
+ };
3110
+ _a = __expectNonNull;
3111
+ _b = __expectObject;
3112
+ return [4, parseBody(output.body, context)];
3113
+ case 1:
3114
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3115
+ if (data.NextToken !== undefined && data.NextToken !== null) {
3116
+ contents.NextToken = __expectString(data.NextToken);
3117
+ }
3118
+ if (data.RouteSummaryList !== undefined && data.RouteSummaryList !== null) {
3119
+ contents.RouteSummaryList = deserializeAws_restJson1RouteSummaries(data.RouteSummaryList, context);
3120
+ }
3121
+ return [2, Promise.resolve(contents)];
3122
+ }
3123
+ });
3124
+ }); };
3125
+ var deserializeAws_restJson1ListRoutesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3126
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;
3127
+ var _k;
3128
+ return __generator(this, function (_l) {
3129
+ switch (_l.label) {
3130
+ case 0:
3131
+ _a = [__assign({}, output)];
3132
+ _k = {};
3133
+ return [4, parseBody(output.body, context)];
3134
+ case 1:
3135
+ parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));
3136
+ errorCode = "UnknownError";
3137
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3138
+ _b = errorCode;
3139
+ switch (_b) {
3140
+ case "AccessDeniedException": return [3, 2];
3141
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
3142
+ case "ConflictException": return [3, 4];
3143
+ case "com.amazonaws.migrationhubrefactorspaces#ConflictException": return [3, 4];
3144
+ case "InternalServerException": return [3, 6];
3145
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 6];
3146
+ case "ResourceNotFoundException": return [3, 8];
3147
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 8];
3148
+ case "ServiceQuotaExceededException": return [3, 10];
3149
+ case "com.amazonaws.migrationhubrefactorspaces#ServiceQuotaExceededException": return [3, 10];
3150
+ case "ThrottlingException": return [3, 12];
3151
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 12];
3152
+ case "ValidationException": return [3, 14];
3153
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 14];
3154
+ }
3155
+ return [3, 16];
3156
+ case 2:
3157
+ _c = [{}];
3158
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
3159
+ case 3:
3160
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3161
+ return [3, 17];
3162
+ case 4:
3163
+ _d = [{}];
3164
+ return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
3165
+ case 5:
3166
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3167
+ return [3, 17];
3168
+ case 6:
3169
+ _e = [{}];
3170
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
3171
+ case 7:
3172
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3173
+ return [3, 17];
3174
+ case 8:
3175
+ _f = [{}];
3176
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
3177
+ case 9:
3178
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3179
+ return [3, 17];
3180
+ case 10:
3181
+ _g = [{}];
3182
+ return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
3183
+ case 11:
3184
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3185
+ return [3, 17];
3186
+ case 12:
3187
+ _h = [{}];
3188
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
3189
+ case 13:
3190
+ response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3191
+ return [3, 17];
3192
+ case 14:
3193
+ _j = [{}];
3194
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
3195
+ case 15:
3196
+ response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3197
+ return [3, 17];
3198
+ case 16:
3199
+ parsedBody = parsedOutput.body;
3200
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
3201
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
3202
+ _l.label = 17;
3203
+ case 17:
3204
+ message = response.message || response.Message || errorCode;
3205
+ response.message = message;
3206
+ delete response.Message;
3207
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
3208
+ }
3209
+ });
3210
+ }); };
3211
+ export var deserializeAws_restJson1ListServicesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3212
+ var contents, data, _a, _b;
3213
+ return __generator(this, function (_c) {
3214
+ switch (_c.label) {
3215
+ case 0:
3216
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3217
+ return [2, deserializeAws_restJson1ListServicesCommandError(output, context)];
3218
+ }
3219
+ contents = {
3220
+ $metadata: deserializeMetadata(output),
3221
+ NextToken: undefined,
3222
+ ServiceSummaryList: undefined,
3223
+ };
3224
+ _a = __expectNonNull;
3225
+ _b = __expectObject;
3226
+ return [4, parseBody(output.body, context)];
3227
+ case 1:
3228
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3229
+ if (data.NextToken !== undefined && data.NextToken !== null) {
3230
+ contents.NextToken = __expectString(data.NextToken);
3231
+ }
3232
+ if (data.ServiceSummaryList !== undefined && data.ServiceSummaryList !== null) {
3233
+ contents.ServiceSummaryList = deserializeAws_restJson1ServiceSummaries(data.ServiceSummaryList, context);
3234
+ }
3235
+ return [2, Promise.resolve(contents)];
3236
+ }
3237
+ });
3238
+ }); };
3239
+ var deserializeAws_restJson1ListServicesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3240
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;
3241
+ var _k;
3242
+ return __generator(this, function (_l) {
3243
+ switch (_l.label) {
3244
+ case 0:
3245
+ _a = [__assign({}, output)];
3246
+ _k = {};
3247
+ return [4, parseBody(output.body, context)];
3248
+ case 1:
3249
+ parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));
3250
+ errorCode = "UnknownError";
3251
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3252
+ _b = errorCode;
3253
+ switch (_b) {
3254
+ case "AccessDeniedException": return [3, 2];
3255
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
3256
+ case "ConflictException": return [3, 4];
3257
+ case "com.amazonaws.migrationhubrefactorspaces#ConflictException": return [3, 4];
3258
+ case "InternalServerException": return [3, 6];
3259
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 6];
3260
+ case "ResourceNotFoundException": return [3, 8];
3261
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 8];
3262
+ case "ServiceQuotaExceededException": return [3, 10];
3263
+ case "com.amazonaws.migrationhubrefactorspaces#ServiceQuotaExceededException": return [3, 10];
3264
+ case "ThrottlingException": return [3, 12];
3265
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 12];
3266
+ case "ValidationException": return [3, 14];
3267
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 14];
3268
+ }
3269
+ return [3, 16];
3270
+ case 2:
3271
+ _c = [{}];
3272
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
3273
+ case 3:
3274
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3275
+ return [3, 17];
3276
+ case 4:
3277
+ _d = [{}];
3278
+ return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
3279
+ case 5:
3280
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3281
+ return [3, 17];
3282
+ case 6:
3283
+ _e = [{}];
3284
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
3285
+ case 7:
3286
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3287
+ return [3, 17];
3288
+ case 8:
3289
+ _f = [{}];
3290
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
3291
+ case 9:
3292
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3293
+ return [3, 17];
3294
+ case 10:
3295
+ _g = [{}];
3296
+ return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
3297
+ case 11:
3298
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3299
+ return [3, 17];
3300
+ case 12:
3301
+ _h = [{}];
3302
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
3303
+ case 13:
3304
+ response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3305
+ return [3, 17];
3306
+ case 14:
3307
+ _j = [{}];
3308
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
3309
+ case 15:
3310
+ response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3311
+ return [3, 17];
3312
+ case 16:
3313
+ parsedBody = parsedOutput.body;
3314
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
3315
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
3316
+ _l.label = 17;
3317
+ case 17:
3318
+ message = response.message || response.Message || errorCode;
3319
+ response.message = message;
3320
+ delete response.Message;
3321
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
3322
+ }
3323
+ });
3324
+ }); };
3325
+ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3326
+ var contents, data, _a, _b;
3327
+ return __generator(this, function (_c) {
3328
+ switch (_c.label) {
3329
+ case 0:
3330
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3331
+ return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
3332
+ }
3333
+ contents = {
3334
+ $metadata: deserializeMetadata(output),
3335
+ Tags: undefined,
3336
+ };
3337
+ _a = __expectNonNull;
3338
+ _b = __expectObject;
3339
+ return [4, parseBody(output.body, context)];
3340
+ case 1:
3341
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3342
+ if (data.Tags !== undefined && data.Tags !== null) {
3343
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
3344
+ }
3345
+ return [2, Promise.resolve(contents)];
3346
+ }
3347
+ });
3348
+ }); };
3349
+ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3350
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, parsedBody, message;
3351
+ var _f;
3352
+ return __generator(this, function (_g) {
3353
+ switch (_g.label) {
3354
+ case 0:
3355
+ _a = [__assign({}, output)];
3356
+ _f = {};
3357
+ return [4, parseBody(output.body, context)];
3358
+ case 1:
3359
+ parsedOutput = __assign.apply(void 0, _a.concat([(_f.body = _g.sent(), _f)]));
3360
+ errorCode = "UnknownError";
3361
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3362
+ _b = errorCode;
3363
+ switch (_b) {
3364
+ case "InternalServerException": return [3, 2];
3365
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 2];
3366
+ case "ResourceNotFoundException": return [3, 4];
3367
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 4];
3368
+ case "ValidationException": return [3, 6];
3369
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 6];
3370
+ }
3371
+ return [3, 8];
3372
+ case 2:
3373
+ _c = [{}];
3374
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
3375
+ case 3:
3376
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3377
+ return [3, 9];
3378
+ case 4:
3379
+ _d = [{}];
3380
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
3381
+ case 5:
3382
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3383
+ return [3, 9];
3384
+ case 6:
3385
+ _e = [{}];
3386
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
3387
+ case 7:
3388
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3389
+ return [3, 9];
3390
+ case 8:
3391
+ parsedBody = parsedOutput.body;
3392
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
3393
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
3394
+ _g.label = 9;
3395
+ case 9:
3396
+ message = response.message || response.Message || errorCode;
3397
+ response.message = message;
3398
+ delete response.Message;
3399
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
3400
+ }
3401
+ });
3402
+ }); };
3403
+ export var deserializeAws_restJson1PutResourcePolicyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3404
+ var contents;
3405
+ return __generator(this, function (_a) {
3406
+ switch (_a.label) {
3407
+ case 0:
3408
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3409
+ return [2, deserializeAws_restJson1PutResourcePolicyCommandError(output, context)];
3410
+ }
3411
+ contents = {
3412
+ $metadata: deserializeMetadata(output),
3413
+ };
3414
+ return [4, collectBody(output.body, context)];
3415
+ case 1:
3416
+ _a.sent();
3417
+ return [2, Promise.resolve(contents)];
3418
+ }
3419
+ });
3420
+ }); };
3421
+ var deserializeAws_restJson1PutResourcePolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3422
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;
3423
+ var _j;
3424
+ return __generator(this, function (_k) {
3425
+ switch (_k.label) {
3426
+ case 0:
3427
+ _a = [__assign({}, output)];
3428
+ _j = {};
3429
+ return [4, parseBody(output.body, context)];
3430
+ case 1:
3431
+ parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));
3432
+ errorCode = "UnknownError";
3433
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3434
+ _b = errorCode;
3435
+ switch (_b) {
3436
+ case "AccessDeniedException": return [3, 2];
3437
+ case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": return [3, 2];
3438
+ case "InternalServerException": return [3, 4];
3439
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 4];
3440
+ case "InvalidResourcePolicyException": return [3, 6];
3441
+ case "com.amazonaws.migrationhubrefactorspaces#InvalidResourcePolicyException": return [3, 6];
3442
+ case "ResourceNotFoundException": return [3, 8];
3443
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 8];
3444
+ case "ThrottlingException": return [3, 10];
3445
+ case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": return [3, 10];
3446
+ case "ValidationException": return [3, 12];
3447
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 12];
3448
+ }
3449
+ return [3, 14];
3450
+ case 2:
3451
+ _c = [{}];
3452
+ return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
3453
+ case 3:
3454
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3455
+ return [3, 15];
3456
+ case 4:
3457
+ _d = [{}];
3458
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
3459
+ case 5:
3460
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3461
+ return [3, 15];
3462
+ case 6:
3463
+ _e = [{}];
3464
+ return [4, deserializeAws_restJson1InvalidResourcePolicyExceptionResponse(parsedOutput, context)];
3465
+ case 7:
3466
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3467
+ return [3, 15];
3468
+ case 8:
3469
+ _f = [{}];
3470
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
3471
+ case 9:
3472
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3473
+ return [3, 15];
3474
+ case 10:
3475
+ _g = [{}];
3476
+ return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
3477
+ case 11:
3478
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3479
+ return [3, 15];
3480
+ case 12:
3481
+ _h = [{}];
3482
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
3483
+ case 13:
3484
+ response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3485
+ return [3, 15];
3486
+ case 14:
3487
+ parsedBody = parsedOutput.body;
3488
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
3489
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
3490
+ _k.label = 15;
3491
+ case 15:
3492
+ message = response.message || response.Message || errorCode;
3493
+ response.message = message;
3494
+ delete response.Message;
3495
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
3496
+ }
3497
+ });
3498
+ }); };
3499
+ export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3500
+ var contents;
3501
+ return __generator(this, function (_a) {
3502
+ switch (_a.label) {
3503
+ case 0:
3504
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3505
+ return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
3506
+ }
3507
+ contents = {
3508
+ $metadata: deserializeMetadata(output),
3509
+ };
3510
+ return [4, collectBody(output.body, context)];
3511
+ case 1:
3512
+ _a.sent();
3513
+ return [2, Promise.resolve(contents)];
3514
+ }
3515
+ });
3516
+ }); };
3517
+ var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3518
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, parsedBody, message;
3519
+ var _f;
3520
+ return __generator(this, function (_g) {
3521
+ switch (_g.label) {
3522
+ case 0:
3523
+ _a = [__assign({}, output)];
3524
+ _f = {};
3525
+ return [4, parseBody(output.body, context)];
3526
+ case 1:
3527
+ parsedOutput = __assign.apply(void 0, _a.concat([(_f.body = _g.sent(), _f)]));
3528
+ errorCode = "UnknownError";
3529
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3530
+ _b = errorCode;
3531
+ switch (_b) {
3532
+ case "InternalServerException": return [3, 2];
3533
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 2];
3534
+ case "ResourceNotFoundException": return [3, 4];
3535
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 4];
3536
+ case "ValidationException": return [3, 6];
3537
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 6];
3538
+ }
3539
+ return [3, 8];
3540
+ case 2:
3541
+ _c = [{}];
3542
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
3543
+ case 3:
3544
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3545
+ return [3, 9];
3546
+ case 4:
3547
+ _d = [{}];
3548
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
3549
+ case 5:
3550
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3551
+ return [3, 9];
3552
+ case 6:
3553
+ _e = [{}];
3554
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
3555
+ case 7:
3556
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3557
+ return [3, 9];
3558
+ case 8:
3559
+ parsedBody = parsedOutput.body;
3560
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
3561
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
3562
+ _g.label = 9;
3563
+ case 9:
3564
+ message = response.message || response.Message || errorCode;
3565
+ response.message = message;
3566
+ delete response.Message;
3567
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
3568
+ }
3569
+ });
3570
+ }); };
3571
+ export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3572
+ var contents;
3573
+ return __generator(this, function (_a) {
3574
+ switch (_a.label) {
3575
+ case 0:
3576
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3577
+ return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
3578
+ }
3579
+ contents = {
3580
+ $metadata: deserializeMetadata(output),
3581
+ };
3582
+ return [4, collectBody(output.body, context)];
3583
+ case 1:
3584
+ _a.sent();
3585
+ return [2, Promise.resolve(contents)];
3586
+ }
3587
+ });
3588
+ }); };
3589
+ var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3590
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, parsedBody, message;
3591
+ var _f;
3592
+ return __generator(this, function (_g) {
3593
+ switch (_g.label) {
3594
+ case 0:
3595
+ _a = [__assign({}, output)];
3596
+ _f = {};
3597
+ return [4, parseBody(output.body, context)];
3598
+ case 1:
3599
+ parsedOutput = __assign.apply(void 0, _a.concat([(_f.body = _g.sent(), _f)]));
3600
+ errorCode = "UnknownError";
3601
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3602
+ _b = errorCode;
3603
+ switch (_b) {
3604
+ case "InternalServerException": return [3, 2];
3605
+ case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": return [3, 2];
3606
+ case "ResourceNotFoundException": return [3, 4];
3607
+ case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": return [3, 4];
3608
+ case "ValidationException": return [3, 6];
3609
+ case "com.amazonaws.migrationhubrefactorspaces#ValidationException": return [3, 6];
3610
+ }
3611
+ return [3, 8];
3612
+ case 2:
3613
+ _c = [{}];
3614
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
3615
+ case 3:
3616
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3617
+ return [3, 9];
3618
+ case 4:
3619
+ _d = [{}];
3620
+ return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
3621
+ case 5:
3622
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3623
+ return [3, 9];
3624
+ case 6:
3625
+ _e = [{}];
3626
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
3627
+ case 7:
3628
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
3629
+ return [3, 9];
3630
+ case 8:
3631
+ parsedBody = parsedOutput.body;
3632
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
3633
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
3634
+ _g.label = 9;
3635
+ case 9:
3636
+ message = response.message || response.Message || errorCode;
3637
+ response.message = message;
3638
+ delete response.Message;
3639
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
3640
+ }
3641
+ });
3642
+ }); };
3643
+ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3644
+ var contents, data;
3645
+ return __generator(this, function (_a) {
3646
+ contents = {
3647
+ name: "AccessDeniedException",
3648
+ $fault: "client",
3649
+ $metadata: deserializeMetadata(parsedOutput),
3650
+ Message: undefined,
3651
+ };
3652
+ data = parsedOutput.body;
3653
+ if (data.Message !== undefined && data.Message !== null) {
3654
+ contents.Message = __expectString(data.Message);
3655
+ }
3656
+ return [2, contents];
3657
+ });
3658
+ }); };
3659
+ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3660
+ var contents, data;
3661
+ return __generator(this, function (_a) {
3662
+ contents = {
3663
+ name: "ConflictException",
3664
+ $fault: "client",
3665
+ $metadata: deserializeMetadata(parsedOutput),
3666
+ Message: undefined,
3667
+ ResourceId: undefined,
3668
+ ResourceType: undefined,
3669
+ };
3670
+ data = parsedOutput.body;
3671
+ if (data.Message !== undefined && data.Message !== null) {
3672
+ contents.Message = __expectString(data.Message);
3673
+ }
3674
+ if (data.ResourceId !== undefined && data.ResourceId !== null) {
3675
+ contents.ResourceId = __expectString(data.ResourceId);
3676
+ }
3677
+ if (data.ResourceType !== undefined && data.ResourceType !== null) {
3678
+ contents.ResourceType = __expectString(data.ResourceType);
3679
+ }
3680
+ return [2, contents];
3681
+ });
3682
+ }); };
3683
+ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3684
+ var contents, data;
3685
+ return __generator(this, function (_a) {
3686
+ contents = {
3687
+ name: "InternalServerException",
3688
+ $fault: "server",
3689
+ $metadata: deserializeMetadata(parsedOutput),
3690
+ Message: undefined,
3691
+ };
3692
+ data = parsedOutput.body;
3693
+ if (data.Message !== undefined && data.Message !== null) {
3694
+ contents.Message = __expectString(data.Message);
3695
+ }
3696
+ return [2, contents];
3697
+ });
3698
+ }); };
3699
+ var deserializeAws_restJson1InvalidResourcePolicyExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3700
+ var contents, data;
3701
+ return __generator(this, function (_a) {
3702
+ contents = {
3703
+ name: "InvalidResourcePolicyException",
3704
+ $fault: "client",
3705
+ $metadata: deserializeMetadata(parsedOutput),
3706
+ Message: undefined,
3707
+ };
3708
+ data = parsedOutput.body;
3709
+ if (data.Message !== undefined && data.Message !== null) {
3710
+ contents.Message = __expectString(data.Message);
3711
+ }
3712
+ return [2, contents];
3713
+ });
3714
+ }); };
3715
+ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3716
+ var contents, data;
3717
+ return __generator(this, function (_a) {
3718
+ contents = {
3719
+ name: "ResourceNotFoundException",
3720
+ $fault: "client",
3721
+ $metadata: deserializeMetadata(parsedOutput),
3722
+ Message: undefined,
3723
+ ResourceId: undefined,
3724
+ ResourceType: undefined,
3725
+ };
3726
+ data = parsedOutput.body;
3727
+ if (data.Message !== undefined && data.Message !== null) {
3728
+ contents.Message = __expectString(data.Message);
3729
+ }
3730
+ if (data.ResourceId !== undefined && data.ResourceId !== null) {
3731
+ contents.ResourceId = __expectString(data.ResourceId);
3732
+ }
3733
+ if (data.ResourceType !== undefined && data.ResourceType !== null) {
3734
+ contents.ResourceType = __expectString(data.ResourceType);
3735
+ }
3736
+ return [2, contents];
3737
+ });
3738
+ }); };
3739
+ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3740
+ var contents, data;
3741
+ return __generator(this, function (_a) {
3742
+ contents = {
3743
+ name: "ServiceQuotaExceededException",
3744
+ $fault: "client",
3745
+ $metadata: deserializeMetadata(parsedOutput),
3746
+ Message: undefined,
3747
+ QuotaCode: undefined,
3748
+ ResourceId: undefined,
3749
+ ResourceType: undefined,
3750
+ ServiceCode: undefined,
3751
+ };
3752
+ data = parsedOutput.body;
3753
+ if (data.Message !== undefined && data.Message !== null) {
3754
+ contents.Message = __expectString(data.Message);
3755
+ }
3756
+ if (data.QuotaCode !== undefined && data.QuotaCode !== null) {
3757
+ contents.QuotaCode = __expectString(data.QuotaCode);
3758
+ }
3759
+ if (data.ResourceId !== undefined && data.ResourceId !== null) {
3760
+ contents.ResourceId = __expectString(data.ResourceId);
3761
+ }
3762
+ if (data.ResourceType !== undefined && data.ResourceType !== null) {
3763
+ contents.ResourceType = __expectString(data.ResourceType);
3764
+ }
3765
+ if (data.ServiceCode !== undefined && data.ServiceCode !== null) {
3766
+ contents.ServiceCode = __expectString(data.ServiceCode);
3767
+ }
3768
+ return [2, contents];
3769
+ });
3770
+ }); };
3771
+ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3772
+ var contents, data;
3773
+ return __generator(this, function (_a) {
3774
+ contents = {
3775
+ name: "ThrottlingException",
3776
+ $fault: "client",
3777
+ $metadata: deserializeMetadata(parsedOutput),
3778
+ Message: undefined,
3779
+ QuotaCode: undefined,
3780
+ RetryAfterSeconds: undefined,
3781
+ ServiceCode: undefined,
3782
+ };
3783
+ if (parsedOutput.headers["retry-after"] !== undefined) {
3784
+ contents.RetryAfterSeconds = __strictParseInt32(parsedOutput.headers["retry-after"]);
3785
+ }
3786
+ data = parsedOutput.body;
3787
+ if (data.Message !== undefined && data.Message !== null) {
3788
+ contents.Message = __expectString(data.Message);
3789
+ }
3790
+ if (data.QuotaCode !== undefined && data.QuotaCode !== null) {
3791
+ contents.QuotaCode = __expectString(data.QuotaCode);
3792
+ }
3793
+ if (data.ServiceCode !== undefined && data.ServiceCode !== null) {
3794
+ contents.ServiceCode = __expectString(data.ServiceCode);
3795
+ }
3796
+ return [2, contents];
3797
+ });
3798
+ }); };
3799
+ var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3800
+ var contents, data;
3801
+ return __generator(this, function (_a) {
3802
+ contents = {
3803
+ name: "ValidationException",
3804
+ $fault: "client",
3805
+ $metadata: deserializeMetadata(parsedOutput),
3806
+ Message: undefined,
3807
+ };
3808
+ data = parsedOutput.body;
3809
+ if (data.Message !== undefined && data.Message !== null) {
3810
+ contents.Message = __expectString(data.Message);
3811
+ }
3812
+ return [2, contents];
3813
+ });
3814
+ }); };
3815
+ var serializeAws_restJson1ApiGatewayProxyInput = function (input, context) {
3816
+ return __assign(__assign({}, (input.EndpointType !== undefined && input.EndpointType !== null && { EndpointType: input.EndpointType })), (input.StageName !== undefined && input.StageName !== null && { StageName: input.StageName }));
3817
+ };
3818
+ var serializeAws_restJson1HttpMethods = function (input, context) {
3819
+ return input
3820
+ .filter(function (e) { return e != null; })
3821
+ .map(function (entry) {
3822
+ if (entry === null) {
3823
+ return null;
3824
+ }
3825
+ return entry;
3826
+ });
3827
+ };
3828
+ var serializeAws_restJson1LambdaEndpointInput = function (input, context) {
3829
+ return __assign({}, (input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }));
3830
+ };
3831
+ var serializeAws_restJson1TagMap = function (input, context) {
3832
+ return Object.entries(input).reduce(function (acc, _a) {
3833
+ var _b;
3834
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
3835
+ if (value === null) {
3836
+ return acc;
3837
+ }
3838
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
3839
+ }, {});
3840
+ };
3841
+ var serializeAws_restJson1UriPathRouteInput = function (input, context) {
3842
+ return __assign(__assign(__assign(__assign({}, (input.ActivationState !== undefined &&
3843
+ input.ActivationState !== null && { ActivationState: input.ActivationState })), (input.IncludeChildPaths !== undefined &&
3844
+ input.IncludeChildPaths !== null && { IncludeChildPaths: input.IncludeChildPaths })), (input.Methods !== undefined &&
3845
+ input.Methods !== null && { Methods: serializeAws_restJson1HttpMethods(input.Methods, context) })), (input.SourcePath !== undefined && input.SourcePath !== null && { SourcePath: input.SourcePath }));
3846
+ };
3847
+ var serializeAws_restJson1UrlEndpointInput = function (input, context) {
3848
+ return __assign(__assign({}, (input.HealthUrl !== undefined && input.HealthUrl !== null && { HealthUrl: input.HealthUrl })), (input.Url !== undefined && input.Url !== null && { Url: input.Url }));
3849
+ };
3850
+ var deserializeAws_restJson1AdditionalDetails = function (output, context) {
3851
+ return Object.entries(output).reduce(function (acc, _a) {
3852
+ var _b;
3853
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
3854
+ if (value === null) {
3855
+ return acc;
3856
+ }
3857
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
3858
+ }, {});
3859
+ };
3860
+ var deserializeAws_restJson1ApiGatewayProxyConfig = function (output, context) {
3861
+ return {
3862
+ ApiGatewayId: __expectString(output.ApiGatewayId),
3863
+ EndpointType: __expectString(output.EndpointType),
3864
+ NlbArn: __expectString(output.NlbArn),
3865
+ NlbName: __expectString(output.NlbName),
3866
+ ProxyUrl: __expectString(output.ProxyUrl),
3867
+ StageName: __expectString(output.StageName),
3868
+ VpcLinkId: __expectString(output.VpcLinkId),
3869
+ };
3870
+ };
3871
+ var deserializeAws_restJson1ApiGatewayProxyInput = function (output, context) {
3872
+ return {
3873
+ EndpointType: __expectString(output.EndpointType),
3874
+ StageName: __expectString(output.StageName),
3875
+ };
3876
+ };
3877
+ var deserializeAws_restJson1ApiGatewayProxySummary = function (output, context) {
3878
+ return {
3879
+ ApiGatewayId: __expectString(output.ApiGatewayId),
3880
+ EndpointType: __expectString(output.EndpointType),
3881
+ NlbArn: __expectString(output.NlbArn),
3882
+ NlbName: __expectString(output.NlbName),
3883
+ ProxyUrl: __expectString(output.ProxyUrl),
3884
+ StageName: __expectString(output.StageName),
3885
+ VpcLinkId: __expectString(output.VpcLinkId),
3886
+ };
3887
+ };
3888
+ var deserializeAws_restJson1ApplicationSummaries = function (output, context) {
3889
+ return (output || [])
3890
+ .filter(function (e) { return e != null; })
3891
+ .map(function (entry) {
3892
+ if (entry === null) {
3893
+ return null;
3894
+ }
3895
+ return deserializeAws_restJson1ApplicationSummary(entry, context);
3896
+ });
3897
+ };
3898
+ var deserializeAws_restJson1ApplicationSummary = function (output, context) {
3899
+ return {
3900
+ ApiGatewayProxy: output.ApiGatewayProxy !== undefined && output.ApiGatewayProxy !== null
3901
+ ? deserializeAws_restJson1ApiGatewayProxySummary(output.ApiGatewayProxy, context)
3902
+ : undefined,
3903
+ ApplicationId: __expectString(output.ApplicationId),
3904
+ Arn: __expectString(output.Arn),
3905
+ CreatedByAccountId: __expectString(output.CreatedByAccountId),
3906
+ CreatedTime: output.CreatedTime !== undefined && output.CreatedTime !== null
3907
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedTime)))
3908
+ : undefined,
3909
+ EnvironmentId: __expectString(output.EnvironmentId),
3910
+ Error: output.Error !== undefined && output.Error !== null
3911
+ ? deserializeAws_restJson1ErrorResponse(output.Error, context)
3912
+ : undefined,
3913
+ LastUpdatedTime: output.LastUpdatedTime !== undefined && output.LastUpdatedTime !== null
3914
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedTime)))
3915
+ : undefined,
3916
+ Name: __expectString(output.Name),
3917
+ OwnerAccountId: __expectString(output.OwnerAccountId),
3918
+ ProxyType: __expectString(output.ProxyType),
3919
+ State: __expectString(output.State),
3920
+ Tags: output.Tags !== undefined && output.Tags !== null
3921
+ ? deserializeAws_restJson1TagMap(output.Tags, context)
3922
+ : undefined,
3923
+ VpcId: __expectString(output.VpcId),
3924
+ };
3925
+ };
3926
+ var deserializeAws_restJson1CidrBlocks = function (output, context) {
3927
+ return (output || [])
3928
+ .filter(function (e) { return e != null; })
3929
+ .map(function (entry) {
3930
+ if (entry === null) {
3931
+ return null;
3932
+ }
3933
+ return __expectString(entry);
3934
+ });
3935
+ };
3936
+ var deserializeAws_restJson1EnvironmentSummaries = function (output, context) {
3937
+ return (output || [])
3938
+ .filter(function (e) { return e != null; })
3939
+ .map(function (entry) {
3940
+ if (entry === null) {
3941
+ return null;
3942
+ }
3943
+ return deserializeAws_restJson1EnvironmentSummary(entry, context);
3944
+ });
3945
+ };
3946
+ var deserializeAws_restJson1EnvironmentSummary = function (output, context) {
3947
+ return {
3948
+ Arn: __expectString(output.Arn),
3949
+ CreatedTime: output.CreatedTime !== undefined && output.CreatedTime !== null
3950
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedTime)))
3951
+ : undefined,
3952
+ Description: __expectString(output.Description),
3953
+ EnvironmentId: __expectString(output.EnvironmentId),
3954
+ Error: output.Error !== undefined && output.Error !== null
3955
+ ? deserializeAws_restJson1ErrorResponse(output.Error, context)
3956
+ : undefined,
3957
+ LastUpdatedTime: output.LastUpdatedTime !== undefined && output.LastUpdatedTime !== null
3958
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedTime)))
3959
+ : undefined,
3960
+ Name: __expectString(output.Name),
3961
+ NetworkFabricType: __expectString(output.NetworkFabricType),
3962
+ OwnerAccountId: __expectString(output.OwnerAccountId),
3963
+ State: __expectString(output.State),
3964
+ Tags: output.Tags !== undefined && output.Tags !== null
3965
+ ? deserializeAws_restJson1TagMap(output.Tags, context)
3966
+ : undefined,
3967
+ TransitGatewayId: __expectString(output.TransitGatewayId),
3968
+ };
3969
+ };
3970
+ var deserializeAws_restJson1EnvironmentVpc = function (output, context) {
3971
+ return {
3972
+ AccountId: __expectString(output.AccountId),
3973
+ CidrBlocks: output.CidrBlocks !== undefined && output.CidrBlocks !== null
3974
+ ? deserializeAws_restJson1CidrBlocks(output.CidrBlocks, context)
3975
+ : undefined,
3976
+ CreatedTime: output.CreatedTime !== undefined && output.CreatedTime !== null
3977
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedTime)))
3978
+ : undefined,
3979
+ EnvironmentId: __expectString(output.EnvironmentId),
3980
+ LastUpdatedTime: output.LastUpdatedTime !== undefined && output.LastUpdatedTime !== null
3981
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedTime)))
3982
+ : undefined,
3983
+ VpcId: __expectString(output.VpcId),
3984
+ VpcName: __expectString(output.VpcName),
3985
+ };
3986
+ };
3987
+ var deserializeAws_restJson1EnvironmentVpcs = function (output, context) {
3988
+ return (output || [])
3989
+ .filter(function (e) { return e != null; })
3990
+ .map(function (entry) {
3991
+ if (entry === null) {
3992
+ return null;
3993
+ }
3994
+ return deserializeAws_restJson1EnvironmentVpc(entry, context);
3995
+ });
3996
+ };
3997
+ var deserializeAws_restJson1ErrorResponse = function (output, context) {
3998
+ return {
3999
+ AccountId: __expectString(output.AccountId),
4000
+ AdditionalDetails: output.AdditionalDetails !== undefined && output.AdditionalDetails !== null
4001
+ ? deserializeAws_restJson1AdditionalDetails(output.AdditionalDetails, context)
4002
+ : undefined,
4003
+ Code: __expectString(output.Code),
4004
+ Message: __expectString(output.Message),
4005
+ ResourceIdentifier: __expectString(output.ResourceIdentifier),
4006
+ ResourceType: __expectString(output.ResourceType),
4007
+ };
4008
+ };
4009
+ var deserializeAws_restJson1HttpMethods = function (output, context) {
4010
+ return (output || [])
4011
+ .filter(function (e) { return e != null; })
4012
+ .map(function (entry) {
4013
+ if (entry === null) {
4014
+ return null;
4015
+ }
4016
+ return __expectString(entry);
4017
+ });
4018
+ };
4019
+ var deserializeAws_restJson1LambdaEndpointConfig = function (output, context) {
4020
+ return {
4021
+ Arn: __expectString(output.Arn),
4022
+ };
4023
+ };
4024
+ var deserializeAws_restJson1LambdaEndpointInput = function (output, context) {
4025
+ return {
4026
+ Arn: __expectString(output.Arn),
4027
+ };
4028
+ };
4029
+ var deserializeAws_restJson1LambdaEndpointSummary = function (output, context) {
4030
+ return {
4031
+ Arn: __expectString(output.Arn),
4032
+ };
4033
+ };
4034
+ var deserializeAws_restJson1PathResourceToId = function (output, context) {
4035
+ return Object.entries(output).reduce(function (acc, _a) {
4036
+ var _b;
4037
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
4038
+ if (value === null) {
4039
+ return acc;
4040
+ }
4041
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
4042
+ }, {});
4043
+ };
4044
+ var deserializeAws_restJson1RouteSummaries = function (output, context) {
4045
+ return (output || [])
4046
+ .filter(function (e) { return e != null; })
4047
+ .map(function (entry) {
4048
+ if (entry === null) {
4049
+ return null;
4050
+ }
4051
+ return deserializeAws_restJson1RouteSummary(entry, context);
4052
+ });
4053
+ };
4054
+ var deserializeAws_restJson1RouteSummary = function (output, context) {
4055
+ return {
4056
+ ApplicationId: __expectString(output.ApplicationId),
4057
+ Arn: __expectString(output.Arn),
4058
+ CreatedByAccountId: __expectString(output.CreatedByAccountId),
4059
+ CreatedTime: output.CreatedTime !== undefined && output.CreatedTime !== null
4060
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedTime)))
4061
+ : undefined,
4062
+ EnvironmentId: __expectString(output.EnvironmentId),
4063
+ Error: output.Error !== undefined && output.Error !== null
4064
+ ? deserializeAws_restJson1ErrorResponse(output.Error, context)
4065
+ : undefined,
4066
+ IncludeChildPaths: __expectBoolean(output.IncludeChildPaths),
4067
+ LastUpdatedTime: output.LastUpdatedTime !== undefined && output.LastUpdatedTime !== null
4068
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedTime)))
4069
+ : undefined,
4070
+ Methods: output.Methods !== undefined && output.Methods !== null
4071
+ ? deserializeAws_restJson1HttpMethods(output.Methods, context)
4072
+ : undefined,
4073
+ OwnerAccountId: __expectString(output.OwnerAccountId),
4074
+ PathResourceToId: output.PathResourceToId !== undefined && output.PathResourceToId !== null
4075
+ ? deserializeAws_restJson1PathResourceToId(output.PathResourceToId, context)
4076
+ : undefined,
4077
+ RouteId: __expectString(output.RouteId),
4078
+ RouteType: __expectString(output.RouteType),
4079
+ ServiceId: __expectString(output.ServiceId),
4080
+ SourcePath: __expectString(output.SourcePath),
4081
+ State: __expectString(output.State),
4082
+ Tags: output.Tags !== undefined && output.Tags !== null
4083
+ ? deserializeAws_restJson1TagMap(output.Tags, context)
4084
+ : undefined,
4085
+ };
4086
+ };
4087
+ var deserializeAws_restJson1ServiceSummaries = function (output, context) {
4088
+ return (output || [])
4089
+ .filter(function (e) { return e != null; })
4090
+ .map(function (entry) {
4091
+ if (entry === null) {
4092
+ return null;
4093
+ }
4094
+ return deserializeAws_restJson1ServiceSummary(entry, context);
4095
+ });
4096
+ };
4097
+ var deserializeAws_restJson1ServiceSummary = function (output, context) {
4098
+ return {
4099
+ ApplicationId: __expectString(output.ApplicationId),
4100
+ Arn: __expectString(output.Arn),
4101
+ CreatedByAccountId: __expectString(output.CreatedByAccountId),
4102
+ CreatedTime: output.CreatedTime !== undefined && output.CreatedTime !== null
4103
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedTime)))
4104
+ : undefined,
4105
+ Description: __expectString(output.Description),
4106
+ EndpointType: __expectString(output.EndpointType),
4107
+ EnvironmentId: __expectString(output.EnvironmentId),
4108
+ Error: output.Error !== undefined && output.Error !== null
4109
+ ? deserializeAws_restJson1ErrorResponse(output.Error, context)
4110
+ : undefined,
4111
+ LambdaEndpoint: output.LambdaEndpoint !== undefined && output.LambdaEndpoint !== null
4112
+ ? deserializeAws_restJson1LambdaEndpointSummary(output.LambdaEndpoint, context)
4113
+ : undefined,
4114
+ LastUpdatedTime: output.LastUpdatedTime !== undefined && output.LastUpdatedTime !== null
4115
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedTime)))
4116
+ : undefined,
4117
+ Name: __expectString(output.Name),
4118
+ OwnerAccountId: __expectString(output.OwnerAccountId),
4119
+ ServiceId: __expectString(output.ServiceId),
4120
+ State: __expectString(output.State),
4121
+ Tags: output.Tags !== undefined && output.Tags !== null
4122
+ ? deserializeAws_restJson1TagMap(output.Tags, context)
4123
+ : undefined,
4124
+ UrlEndpoint: output.UrlEndpoint !== undefined && output.UrlEndpoint !== null
4125
+ ? deserializeAws_restJson1UrlEndpointSummary(output.UrlEndpoint, context)
4126
+ : undefined,
4127
+ VpcId: __expectString(output.VpcId),
4128
+ };
4129
+ };
4130
+ var deserializeAws_restJson1TagMap = function (output, context) {
4131
+ return Object.entries(output).reduce(function (acc, _a) {
4132
+ var _b;
4133
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
4134
+ if (value === null) {
4135
+ return acc;
4136
+ }
4137
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
4138
+ }, {});
4139
+ };
4140
+ var deserializeAws_restJson1UriPathRouteInput = function (output, context) {
4141
+ return {
4142
+ ActivationState: __expectString(output.ActivationState),
4143
+ IncludeChildPaths: __expectBoolean(output.IncludeChildPaths),
4144
+ Methods: output.Methods !== undefined && output.Methods !== null
4145
+ ? deserializeAws_restJson1HttpMethods(output.Methods, context)
4146
+ : undefined,
4147
+ SourcePath: __expectString(output.SourcePath),
4148
+ };
4149
+ };
4150
+ var deserializeAws_restJson1UrlEndpointConfig = function (output, context) {
4151
+ return {
4152
+ HealthUrl: __expectString(output.HealthUrl),
4153
+ Url: __expectString(output.Url),
4154
+ };
4155
+ };
4156
+ var deserializeAws_restJson1UrlEndpointInput = function (output, context) {
4157
+ return {
4158
+ HealthUrl: __expectString(output.HealthUrl),
4159
+ Url: __expectString(output.Url),
4160
+ };
4161
+ };
4162
+ var deserializeAws_restJson1UrlEndpointSummary = function (output, context) {
4163
+ return {
4164
+ HealthUrl: __expectString(output.HealthUrl),
4165
+ Url: __expectString(output.Url),
4166
+ };
4167
+ };
4168
+ var deserializeMetadata = function (output) {
4169
+ var _a;
4170
+ return ({
4171
+ httpStatusCode: output.statusCode,
4172
+ requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
4173
+ extendedRequestId: output.headers["x-amz-id-2"],
4174
+ cfId: output.headers["x-amz-cf-id"],
4175
+ });
4176
+ };
4177
+ var collectBody = function (streamBody, context) {
4178
+ if (streamBody === void 0) { streamBody = new Uint8Array(); }
4179
+ if (streamBody instanceof Uint8Array) {
4180
+ return Promise.resolve(streamBody);
4181
+ }
4182
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
4183
+ };
4184
+ var collectBodyString = function (streamBody, context) {
4185
+ return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
4186
+ };
4187
+ var isSerializableHeaderValue = function (value) {
4188
+ return value !== undefined &&
4189
+ value !== null &&
4190
+ value !== "" &&
4191
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
4192
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
4193
+ };
4194
+ var parseBody = function (streamBody, context) {
4195
+ return collectBodyString(streamBody, context).then(function (encoded) {
4196
+ if (encoded.length) {
4197
+ return JSON.parse(encoded);
4198
+ }
4199
+ return {};
4200
+ });
4201
+ };
4202
+ var loadRestJsonErrorCode = function (output, data) {
4203
+ var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
4204
+ var sanitizeErrorCode = function (rawValue) {
4205
+ var cleanValue = rawValue;
4206
+ if (cleanValue.indexOf(":") >= 0) {
4207
+ cleanValue = cleanValue.split(":")[0];
4208
+ }
4209
+ if (cleanValue.indexOf("#") >= 0) {
4210
+ cleanValue = cleanValue.split("#")[1];
4211
+ }
4212
+ return cleanValue;
4213
+ };
4214
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
4215
+ if (headerKey !== undefined) {
4216
+ return sanitizeErrorCode(output.headers[headerKey]);
4217
+ }
4218
+ if (data.code !== undefined) {
4219
+ return sanitizeErrorCode(data.code);
4220
+ }
4221
+ if (data["__type"] !== undefined) {
4222
+ return sanitizeErrorCode(data["__type"]);
4223
+ }
4224
+ return "";
4225
+ };