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