@aws-sdk/client-simspaceweaver 3.220.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 (139) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +216 -0
  3. package/dist-cjs/SimSpaceWeaver.js +232 -0
  4. package/dist-cjs/SimSpaceWeaverClient.js +40 -0
  5. package/dist-cjs/commands/DeleteAppCommand.js +46 -0
  6. package/dist-cjs/commands/DeleteSimulationCommand.js +46 -0
  7. package/dist-cjs/commands/DescribeAppCommand.js +46 -0
  8. package/dist-cjs/commands/DescribeSimulationCommand.js +46 -0
  9. package/dist-cjs/commands/ListAppsCommand.js +46 -0
  10. package/dist-cjs/commands/ListSimulationsCommand.js +46 -0
  11. package/dist-cjs/commands/ListTagsForResourceCommand.js +46 -0
  12. package/dist-cjs/commands/StartAppCommand.js +46 -0
  13. package/dist-cjs/commands/StartClockCommand.js +46 -0
  14. package/dist-cjs/commands/StartSimulationCommand.js +46 -0
  15. package/dist-cjs/commands/StopAppCommand.js +46 -0
  16. package/dist-cjs/commands/StopClockCommand.js +46 -0
  17. package/dist-cjs/commands/StopSimulationCommand.js +46 -0
  18. package/dist-cjs/commands/TagResourceCommand.js +46 -0
  19. package/dist-cjs/commands/UntagResourceCommand.js +46 -0
  20. package/dist-cjs/commands/index.js +18 -0
  21. package/dist-cjs/endpoint/EndpointParameters.js +12 -0
  22. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  23. package/dist-cjs/endpoint/ruleset.js +312 -0
  24. package/dist-cjs/index.js +11 -0
  25. package/dist-cjs/models/SimSpaceWeaverServiceException.js +11 -0
  26. package/dist-cjs/models/index.js +4 -0
  27. package/dist-cjs/models/models_0.js +328 -0
  28. package/dist-cjs/pagination/Interfaces.js +2 -0
  29. package/dist-cjs/pagination/ListAppsPaginator.js +36 -0
  30. package/dist-cjs/pagination/ListSimulationsPaginator.js +36 -0
  31. package/dist-cjs/pagination/index.js +6 -0
  32. package/dist-cjs/protocols/Aws_restJson1.js +1384 -0
  33. package/dist-cjs/runtimeConfig.browser.js +42 -0
  34. package/dist-cjs/runtimeConfig.js +50 -0
  35. package/dist-cjs/runtimeConfig.native.js +15 -0
  36. package/dist-cjs/runtimeConfig.shared.js +18 -0
  37. package/dist-es/SimSpaceWeaver.js +228 -0
  38. package/dist-es/SimSpaceWeaverClient.js +36 -0
  39. package/dist-es/commands/DeleteAppCommand.js +42 -0
  40. package/dist-es/commands/DeleteSimulationCommand.js +42 -0
  41. package/dist-es/commands/DescribeAppCommand.js +42 -0
  42. package/dist-es/commands/DescribeSimulationCommand.js +42 -0
  43. package/dist-es/commands/ListAppsCommand.js +42 -0
  44. package/dist-es/commands/ListSimulationsCommand.js +42 -0
  45. package/dist-es/commands/ListTagsForResourceCommand.js +42 -0
  46. package/dist-es/commands/StartAppCommand.js +42 -0
  47. package/dist-es/commands/StartClockCommand.js +42 -0
  48. package/dist-es/commands/StartSimulationCommand.js +42 -0
  49. package/dist-es/commands/StopAppCommand.js +42 -0
  50. package/dist-es/commands/StopClockCommand.js +42 -0
  51. package/dist-es/commands/StopSimulationCommand.js +42 -0
  52. package/dist-es/commands/TagResourceCommand.js +42 -0
  53. package/dist-es/commands/UntagResourceCommand.js +42 -0
  54. package/dist-es/commands/index.js +15 -0
  55. package/dist-es/endpoint/EndpointParameters.js +8 -0
  56. package/dist-es/endpoint/endpointResolver.js +8 -0
  57. package/dist-es/endpoint/ruleset.js +309 -0
  58. package/dist-es/index.js +6 -0
  59. package/dist-es/models/SimSpaceWeaverServiceException.js +7 -0
  60. package/dist-es/models/index.js +1 -0
  61. package/dist-es/models/models_0.js +275 -0
  62. package/dist-es/pagination/Interfaces.js +1 -0
  63. package/dist-es/pagination/ListAppsPaginator.js +32 -0
  64. package/dist-es/pagination/ListSimulationsPaginator.js +32 -0
  65. package/dist-es/pagination/index.js +3 -0
  66. package/dist-es/protocols/Aws_restJson1.js +1351 -0
  67. package/dist-es/runtimeConfig.browser.js +37 -0
  68. package/dist-es/runtimeConfig.js +45 -0
  69. package/dist-es/runtimeConfig.native.js +11 -0
  70. package/dist-es/runtimeConfig.shared.js +14 -0
  71. package/dist-types/SimSpaceWeaver.d.ts +134 -0
  72. package/dist-types/SimSpaceWeaverClient.d.ts +167 -0
  73. package/dist-types/commands/DeleteAppCommand.d.ts +37 -0
  74. package/dist-types/commands/DeleteSimulationCommand.d.ts +41 -0
  75. package/dist-types/commands/DescribeAppCommand.d.ts +37 -0
  76. package/dist-types/commands/DescribeSimulationCommand.d.ts +37 -0
  77. package/dist-types/commands/ListAppsCommand.d.ts +37 -0
  78. package/dist-types/commands/ListSimulationsCommand.d.ts +37 -0
  79. package/dist-types/commands/ListTagsForResourceCommand.d.ts +37 -0
  80. package/dist-types/commands/StartAppCommand.d.ts +37 -0
  81. package/dist-types/commands/StartClockCommand.d.ts +37 -0
  82. package/dist-types/commands/StartSimulationCommand.d.ts +37 -0
  83. package/dist-types/commands/StopAppCommand.d.ts +37 -0
  84. package/dist-types/commands/StopClockCommand.d.ts +37 -0
  85. package/dist-types/commands/StopSimulationCommand.d.ts +42 -0
  86. package/dist-types/commands/TagResourceCommand.d.ts +38 -0
  87. package/dist-types/commands/UntagResourceCommand.d.ts +38 -0
  88. package/dist-types/commands/index.d.ts +15 -0
  89. package/dist-types/endpoint/EndpointParameters.d.ts +19 -0
  90. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  91. package/dist-types/endpoint/ruleset.d.ts +2 -0
  92. package/dist-types/index.d.ts +6 -0
  93. package/dist-types/models/SimSpaceWeaverServiceException.d.ts +10 -0
  94. package/dist-types/models/index.d.ts +1 -0
  95. package/dist-types/models/models_0.d.ts +911 -0
  96. package/dist-types/pagination/Interfaces.d.ts +6 -0
  97. package/dist-types/pagination/ListAppsPaginator.d.ts +4 -0
  98. package/dist-types/pagination/ListSimulationsPaginator.d.ts +4 -0
  99. package/dist-types/pagination/index.d.ts +3 -0
  100. package/dist-types/protocols/Aws_restJson1.d.ts +47 -0
  101. package/dist-types/runtimeConfig.browser.d.ts +42 -0
  102. package/dist-types/runtimeConfig.d.ts +42 -0
  103. package/dist-types/runtimeConfig.native.d.ts +41 -0
  104. package/dist-types/runtimeConfig.shared.d.ts +16 -0
  105. package/dist-types/ts3.4/SimSpaceWeaver.d.ts +259 -0
  106. package/dist-types/ts3.4/SimSpaceWeaverClient.d.ts +202 -0
  107. package/dist-types/ts3.4/commands/DeleteAppCommand.d.ts +34 -0
  108. package/dist-types/ts3.4/commands/DeleteSimulationCommand.d.ts +37 -0
  109. package/dist-types/ts3.4/commands/DescribeAppCommand.d.ts +34 -0
  110. package/dist-types/ts3.4/commands/DescribeSimulationCommand.d.ts +38 -0
  111. package/dist-types/ts3.4/commands/ListAppsCommand.d.ts +34 -0
  112. package/dist-types/ts3.4/commands/ListSimulationsCommand.d.ts +37 -0
  113. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +38 -0
  114. package/dist-types/ts3.4/commands/StartAppCommand.d.ts +34 -0
  115. package/dist-types/ts3.4/commands/StartClockCommand.d.ts +34 -0
  116. package/dist-types/ts3.4/commands/StartSimulationCommand.d.ts +37 -0
  117. package/dist-types/ts3.4/commands/StopAppCommand.d.ts +32 -0
  118. package/dist-types/ts3.4/commands/StopClockCommand.d.ts +34 -0
  119. package/dist-types/ts3.4/commands/StopSimulationCommand.d.ts +34 -0
  120. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +34 -0
  121. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +34 -0
  122. package/dist-types/ts3.4/commands/index.d.ts +15 -0
  123. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +34 -0
  124. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  125. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  126. package/dist-types/ts3.4/index.d.ts +6 -0
  127. package/dist-types/ts3.4/models/SimSpaceWeaverServiceException.d.ts +7 -0
  128. package/dist-types/ts3.4/models/index.d.ts +1 -0
  129. package/dist-types/ts3.4/models/models_0.d.ts +395 -0
  130. package/dist-types/ts3.4/pagination/Interfaces.d.ts +7 -0
  131. package/dist-types/ts3.4/pagination/ListAppsPaginator.d.ts +11 -0
  132. package/dist-types/ts3.4/pagination/ListSimulationsPaginator.d.ts +11 -0
  133. package/dist-types/ts3.4/pagination/index.d.ts +3 -0
  134. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +185 -0
  135. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +88 -0
  136. package/dist-types/ts3.4/runtimeConfig.d.ts +88 -0
  137. package/dist-types/ts3.4/runtimeConfig.native.d.ts +77 -0
  138. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +16 -0
  139. package/package.json +103 -0
@@ -0,0 +1,1384 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1StopSimulationCommand = exports.deserializeAws_restJson1StopClockCommand = exports.deserializeAws_restJson1StopAppCommand = exports.deserializeAws_restJson1StartSimulationCommand = exports.deserializeAws_restJson1StartClockCommand = exports.deserializeAws_restJson1StartAppCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListSimulationsCommand = exports.deserializeAws_restJson1ListAppsCommand = exports.deserializeAws_restJson1DescribeSimulationCommand = exports.deserializeAws_restJson1DescribeAppCommand = exports.deserializeAws_restJson1DeleteSimulationCommand = exports.deserializeAws_restJson1DeleteAppCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1StopSimulationCommand = exports.serializeAws_restJson1StopClockCommand = exports.serializeAws_restJson1StopAppCommand = exports.serializeAws_restJson1StartSimulationCommand = exports.serializeAws_restJson1StartClockCommand = exports.serializeAws_restJson1StartAppCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListSimulationsCommand = exports.serializeAws_restJson1ListAppsCommand = exports.serializeAws_restJson1DescribeSimulationCommand = exports.serializeAws_restJson1DescribeAppCommand = exports.serializeAws_restJson1DeleteSimulationCommand = exports.serializeAws_restJson1DeleteAppCommand = 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 models_0_1 = require("../models/models_0");
8
+ const SimSpaceWeaverServiceException_1 = require("../models/SimSpaceWeaverServiceException");
9
+ const serializeAws_restJson1DeleteAppCommand = async (input, context) => {
10
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
11
+ const headers = {};
12
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/deleteapp";
13
+ const query = map({
14
+ simulation: [, (0, smithy_client_1.expectNonNull)(input.Simulation, `Simulation`)],
15
+ domain: [, (0, smithy_client_1.expectNonNull)(input.Domain, `Domain`)],
16
+ app: [, (0, smithy_client_1.expectNonNull)(input.App, `App`)],
17
+ });
18
+ let body;
19
+ return new protocol_http_1.HttpRequest({
20
+ protocol,
21
+ hostname,
22
+ port,
23
+ method: "DELETE",
24
+ headers,
25
+ path: resolvedPath,
26
+ query,
27
+ body,
28
+ });
29
+ };
30
+ exports.serializeAws_restJson1DeleteAppCommand = serializeAws_restJson1DeleteAppCommand;
31
+ const serializeAws_restJson1DeleteSimulationCommand = async (input, context) => {
32
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
33
+ const headers = {};
34
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/deletesimulation";
35
+ const query = map({
36
+ simulation: [, (0, smithy_client_1.expectNonNull)(input.Simulation, `Simulation`)],
37
+ });
38
+ let body;
39
+ return new protocol_http_1.HttpRequest({
40
+ protocol,
41
+ hostname,
42
+ port,
43
+ method: "DELETE",
44
+ headers,
45
+ path: resolvedPath,
46
+ query,
47
+ body,
48
+ });
49
+ };
50
+ exports.serializeAws_restJson1DeleteSimulationCommand = serializeAws_restJson1DeleteSimulationCommand;
51
+ const serializeAws_restJson1DescribeAppCommand = async (input, context) => {
52
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
53
+ const headers = {};
54
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/describeapp";
55
+ const query = map({
56
+ simulation: [, (0, smithy_client_1.expectNonNull)(input.Simulation, `Simulation`)],
57
+ domain: [, (0, smithy_client_1.expectNonNull)(input.Domain, `Domain`)],
58
+ app: [, (0, smithy_client_1.expectNonNull)(input.App, `App`)],
59
+ });
60
+ let body;
61
+ return new protocol_http_1.HttpRequest({
62
+ protocol,
63
+ hostname,
64
+ port,
65
+ method: "GET",
66
+ headers,
67
+ path: resolvedPath,
68
+ query,
69
+ body,
70
+ });
71
+ };
72
+ exports.serializeAws_restJson1DescribeAppCommand = serializeAws_restJson1DescribeAppCommand;
73
+ const serializeAws_restJson1DescribeSimulationCommand = async (input, context) => {
74
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
75
+ const headers = {};
76
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/describesimulation";
77
+ const query = map({
78
+ simulation: [, (0, smithy_client_1.expectNonNull)(input.Simulation, `Simulation`)],
79
+ });
80
+ let body;
81
+ return new protocol_http_1.HttpRequest({
82
+ protocol,
83
+ hostname,
84
+ port,
85
+ method: "GET",
86
+ headers,
87
+ path: resolvedPath,
88
+ query,
89
+ body,
90
+ });
91
+ };
92
+ exports.serializeAws_restJson1DescribeSimulationCommand = serializeAws_restJson1DescribeSimulationCommand;
93
+ const serializeAws_restJson1ListAppsCommand = async (input, context) => {
94
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
95
+ const headers = {};
96
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listapps";
97
+ const query = map({
98
+ simulation: [, (0, smithy_client_1.expectNonNull)(input.Simulation, `Simulation`)],
99
+ domain: [, input.Domain],
100
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
101
+ nextToken: [, input.NextToken],
102
+ });
103
+ let body;
104
+ return new protocol_http_1.HttpRequest({
105
+ protocol,
106
+ hostname,
107
+ port,
108
+ method: "GET",
109
+ headers,
110
+ path: resolvedPath,
111
+ query,
112
+ body,
113
+ });
114
+ };
115
+ exports.serializeAws_restJson1ListAppsCommand = serializeAws_restJson1ListAppsCommand;
116
+ const serializeAws_restJson1ListSimulationsCommand = async (input, context) => {
117
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
118
+ const headers = {};
119
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listsimulations";
120
+ const query = map({
121
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
122
+ nextToken: [, input.NextToken],
123
+ });
124
+ let body;
125
+ return new protocol_http_1.HttpRequest({
126
+ protocol,
127
+ hostname,
128
+ port,
129
+ method: "GET",
130
+ headers,
131
+ path: resolvedPath,
132
+ query,
133
+ body,
134
+ });
135
+ };
136
+ exports.serializeAws_restJson1ListSimulationsCommand = serializeAws_restJson1ListSimulationsCommand;
137
+ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
138
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
139
+ const headers = {};
140
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
141
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
142
+ let body;
143
+ return new protocol_http_1.HttpRequest({
144
+ protocol,
145
+ hostname,
146
+ port,
147
+ method: "GET",
148
+ headers,
149
+ path: resolvedPath,
150
+ body,
151
+ });
152
+ };
153
+ exports.serializeAws_restJson1ListTagsForResourceCommand = serializeAws_restJson1ListTagsForResourceCommand;
154
+ const serializeAws_restJson1StartAppCommand = async (input, context) => {
155
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
156
+ const headers = {
157
+ "content-type": "application/json",
158
+ };
159
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/startapp";
160
+ let body;
161
+ body = JSON.stringify({
162
+ ClientToken: input.ClientToken ?? (0, uuid_1.v4)(),
163
+ ...(input.Description != null && { Description: input.Description }),
164
+ ...(input.Domain != null && { Domain: input.Domain }),
165
+ ...(input.LaunchOverrides != null && {
166
+ LaunchOverrides: serializeAws_restJson1LaunchOverrides(input.LaunchOverrides, context),
167
+ }),
168
+ ...(input.Name != null && { Name: input.Name }),
169
+ ...(input.Simulation != null && { Simulation: input.Simulation }),
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_restJson1StartAppCommand = serializeAws_restJson1StartAppCommand;
182
+ const serializeAws_restJson1StartClockCommand = async (input, context) => {
183
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
184
+ const headers = {
185
+ "content-type": "application/json",
186
+ };
187
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/startclock";
188
+ let body;
189
+ body = JSON.stringify({
190
+ ...(input.Simulation != null && { Simulation: input.Simulation }),
191
+ });
192
+ return new protocol_http_1.HttpRequest({
193
+ protocol,
194
+ hostname,
195
+ port,
196
+ method: "POST",
197
+ headers,
198
+ path: resolvedPath,
199
+ body,
200
+ });
201
+ };
202
+ exports.serializeAws_restJson1StartClockCommand = serializeAws_restJson1StartClockCommand;
203
+ const serializeAws_restJson1StartSimulationCommand = async (input, context) => {
204
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
205
+ const headers = {
206
+ "content-type": "application/json",
207
+ };
208
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/startsimulation";
209
+ let body;
210
+ body = JSON.stringify({
211
+ ClientToken: input.ClientToken ?? (0, uuid_1.v4)(),
212
+ ...(input.Description != null && { Description: input.Description }),
213
+ ...(input.MaximumDuration != null && { MaximumDuration: input.MaximumDuration }),
214
+ ...(input.Name != null && { Name: input.Name }),
215
+ ...(input.RoleArn != null && { RoleArn: input.RoleArn }),
216
+ ...(input.SchemaS3Location != null && {
217
+ SchemaS3Location: serializeAws_restJson1S3Location(input.SchemaS3Location, context),
218
+ }),
219
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
220
+ });
221
+ return new protocol_http_1.HttpRequest({
222
+ protocol,
223
+ hostname,
224
+ port,
225
+ method: "POST",
226
+ headers,
227
+ path: resolvedPath,
228
+ body,
229
+ });
230
+ };
231
+ exports.serializeAws_restJson1StartSimulationCommand = serializeAws_restJson1StartSimulationCommand;
232
+ const serializeAws_restJson1StopAppCommand = async (input, context) => {
233
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
234
+ const headers = {
235
+ "content-type": "application/json",
236
+ };
237
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/stopapp";
238
+ let body;
239
+ body = JSON.stringify({
240
+ ...(input.App != null && { App: input.App }),
241
+ ...(input.Domain != null && { Domain: input.Domain }),
242
+ ...(input.Simulation != null && { Simulation: input.Simulation }),
243
+ });
244
+ return new protocol_http_1.HttpRequest({
245
+ protocol,
246
+ hostname,
247
+ port,
248
+ method: "POST",
249
+ headers,
250
+ path: resolvedPath,
251
+ body,
252
+ });
253
+ };
254
+ exports.serializeAws_restJson1StopAppCommand = serializeAws_restJson1StopAppCommand;
255
+ const serializeAws_restJson1StopClockCommand = async (input, context) => {
256
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
257
+ const headers = {
258
+ "content-type": "application/json",
259
+ };
260
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/stopclock";
261
+ let body;
262
+ body = JSON.stringify({
263
+ ...(input.Simulation != null && { Simulation: input.Simulation }),
264
+ });
265
+ return new protocol_http_1.HttpRequest({
266
+ protocol,
267
+ hostname,
268
+ port,
269
+ method: "POST",
270
+ headers,
271
+ path: resolvedPath,
272
+ body,
273
+ });
274
+ };
275
+ exports.serializeAws_restJson1StopClockCommand = serializeAws_restJson1StopClockCommand;
276
+ const serializeAws_restJson1StopSimulationCommand = async (input, context) => {
277
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
278
+ const headers = {
279
+ "content-type": "application/json",
280
+ };
281
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/stopsimulation";
282
+ let body;
283
+ body = JSON.stringify({
284
+ ...(input.Simulation != null && { Simulation: input.Simulation }),
285
+ });
286
+ return new protocol_http_1.HttpRequest({
287
+ protocol,
288
+ hostname,
289
+ port,
290
+ method: "POST",
291
+ headers,
292
+ path: resolvedPath,
293
+ body,
294
+ });
295
+ };
296
+ exports.serializeAws_restJson1StopSimulationCommand = serializeAws_restJson1StopSimulationCommand;
297
+ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
298
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
299
+ const headers = {
300
+ "content-type": "application/json",
301
+ };
302
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
303
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
304
+ let body;
305
+ body = JSON.stringify({
306
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
307
+ });
308
+ return new protocol_http_1.HttpRequest({
309
+ protocol,
310
+ hostname,
311
+ port,
312
+ method: "POST",
313
+ headers,
314
+ path: resolvedPath,
315
+ body,
316
+ });
317
+ };
318
+ exports.serializeAws_restJson1TagResourceCommand = serializeAws_restJson1TagResourceCommand;
319
+ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
320
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
321
+ const headers = {};
322
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
323
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
324
+ const query = map({
325
+ tagKeys: [
326
+ (0, smithy_client_1.expectNonNull)(input.TagKeys, `TagKeys`) != null,
327
+ () => (input.TagKeys || []).map((_entry) => _entry),
328
+ ],
329
+ });
330
+ let body;
331
+ return new protocol_http_1.HttpRequest({
332
+ protocol,
333
+ hostname,
334
+ port,
335
+ method: "DELETE",
336
+ headers,
337
+ path: resolvedPath,
338
+ query,
339
+ body,
340
+ });
341
+ };
342
+ exports.serializeAws_restJson1UntagResourceCommand = serializeAws_restJson1UntagResourceCommand;
343
+ const deserializeAws_restJson1DeleteAppCommand = async (output, context) => {
344
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
345
+ return deserializeAws_restJson1DeleteAppCommandError(output, context);
346
+ }
347
+ const contents = map({
348
+ $metadata: deserializeMetadata(output),
349
+ });
350
+ await collectBody(output.body, context);
351
+ return contents;
352
+ };
353
+ exports.deserializeAws_restJson1DeleteAppCommand = deserializeAws_restJson1DeleteAppCommand;
354
+ const deserializeAws_restJson1DeleteAppCommandError = async (output, context) => {
355
+ const parsedOutput = {
356
+ ...output,
357
+ body: await parseErrorBody(output.body, context),
358
+ };
359
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
360
+ switch (errorCode) {
361
+ case "AccessDeniedException":
362
+ case "com.amazonaws.simspaceweaver#AccessDeniedException":
363
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
364
+ case "ConflictException":
365
+ case "com.amazonaws.simspaceweaver#ConflictException":
366
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
367
+ case "InternalServerException":
368
+ case "com.amazonaws.simspaceweaver#InternalServerException":
369
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
370
+ case "ResourceNotFoundException":
371
+ case "com.amazonaws.simspaceweaver#ResourceNotFoundException":
372
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
373
+ case "ValidationException":
374
+ case "com.amazonaws.simspaceweaver#ValidationException":
375
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
376
+ default:
377
+ const parsedBody = parsedOutput.body;
378
+ (0, smithy_client_1.throwDefaultError)({
379
+ output,
380
+ parsedBody,
381
+ exceptionCtor: SimSpaceWeaverServiceException_1.SimSpaceWeaverServiceException,
382
+ errorCode,
383
+ });
384
+ }
385
+ };
386
+ const deserializeAws_restJson1DeleteSimulationCommand = async (output, context) => {
387
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
388
+ return deserializeAws_restJson1DeleteSimulationCommandError(output, context);
389
+ }
390
+ const contents = map({
391
+ $metadata: deserializeMetadata(output),
392
+ });
393
+ await collectBody(output.body, context);
394
+ return contents;
395
+ };
396
+ exports.deserializeAws_restJson1DeleteSimulationCommand = deserializeAws_restJson1DeleteSimulationCommand;
397
+ const deserializeAws_restJson1DeleteSimulationCommandError = async (output, context) => {
398
+ const parsedOutput = {
399
+ ...output,
400
+ body: await parseErrorBody(output.body, context),
401
+ };
402
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
403
+ switch (errorCode) {
404
+ case "AccessDeniedException":
405
+ case "com.amazonaws.simspaceweaver#AccessDeniedException":
406
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
407
+ case "ConflictException":
408
+ case "com.amazonaws.simspaceweaver#ConflictException":
409
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
410
+ case "InternalServerException":
411
+ case "com.amazonaws.simspaceweaver#InternalServerException":
412
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
413
+ case "ResourceNotFoundException":
414
+ case "com.amazonaws.simspaceweaver#ResourceNotFoundException":
415
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
416
+ case "ValidationException":
417
+ case "com.amazonaws.simspaceweaver#ValidationException":
418
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
419
+ default:
420
+ const parsedBody = parsedOutput.body;
421
+ (0, smithy_client_1.throwDefaultError)({
422
+ output,
423
+ parsedBody,
424
+ exceptionCtor: SimSpaceWeaverServiceException_1.SimSpaceWeaverServiceException,
425
+ errorCode,
426
+ });
427
+ }
428
+ };
429
+ const deserializeAws_restJson1DescribeAppCommand = async (output, context) => {
430
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
431
+ return deserializeAws_restJson1DescribeAppCommandError(output, context);
432
+ }
433
+ const contents = map({
434
+ $metadata: deserializeMetadata(output),
435
+ });
436
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
437
+ if (data.Description != null) {
438
+ contents.Description = (0, smithy_client_1.expectString)(data.Description);
439
+ }
440
+ if (data.Domain != null) {
441
+ contents.Domain = (0, smithy_client_1.expectString)(data.Domain);
442
+ }
443
+ if (data.EndpointInfo != null) {
444
+ contents.EndpointInfo = deserializeAws_restJson1SimulationAppEndpointInfo(data.EndpointInfo, context);
445
+ }
446
+ if (data.LaunchOverrides != null) {
447
+ contents.LaunchOverrides = deserializeAws_restJson1LaunchOverrides(data.LaunchOverrides, context);
448
+ }
449
+ if (data.Name != null) {
450
+ contents.Name = (0, smithy_client_1.expectString)(data.Name);
451
+ }
452
+ if (data.Simulation != null) {
453
+ contents.Simulation = (0, smithy_client_1.expectString)(data.Simulation);
454
+ }
455
+ if (data.Status != null) {
456
+ contents.Status = (0, smithy_client_1.expectString)(data.Status);
457
+ }
458
+ if (data.TargetStatus != null) {
459
+ contents.TargetStatus = (0, smithy_client_1.expectString)(data.TargetStatus);
460
+ }
461
+ return contents;
462
+ };
463
+ exports.deserializeAws_restJson1DescribeAppCommand = deserializeAws_restJson1DescribeAppCommand;
464
+ const deserializeAws_restJson1DescribeAppCommandError = async (output, context) => {
465
+ const parsedOutput = {
466
+ ...output,
467
+ body: await parseErrorBody(output.body, context),
468
+ };
469
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
470
+ switch (errorCode) {
471
+ case "AccessDeniedException":
472
+ case "com.amazonaws.simspaceweaver#AccessDeniedException":
473
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
474
+ case "InternalServerException":
475
+ case "com.amazonaws.simspaceweaver#InternalServerException":
476
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
477
+ case "ResourceNotFoundException":
478
+ case "com.amazonaws.simspaceweaver#ResourceNotFoundException":
479
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
480
+ case "ValidationException":
481
+ case "com.amazonaws.simspaceweaver#ValidationException":
482
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
483
+ default:
484
+ const parsedBody = parsedOutput.body;
485
+ (0, smithy_client_1.throwDefaultError)({
486
+ output,
487
+ parsedBody,
488
+ exceptionCtor: SimSpaceWeaverServiceException_1.SimSpaceWeaverServiceException,
489
+ errorCode,
490
+ });
491
+ }
492
+ };
493
+ const deserializeAws_restJson1DescribeSimulationCommand = async (output, context) => {
494
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
495
+ return deserializeAws_restJson1DescribeSimulationCommandError(output, context);
496
+ }
497
+ const contents = map({
498
+ $metadata: deserializeMetadata(output),
499
+ });
500
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
501
+ if (data.Arn != null) {
502
+ contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
503
+ }
504
+ if (data.CreationTime != null) {
505
+ contents.CreationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreationTime)));
506
+ }
507
+ if (data.Description != null) {
508
+ contents.Description = (0, smithy_client_1.expectString)(data.Description);
509
+ }
510
+ if (data.ExecutionId != null) {
511
+ contents.ExecutionId = (0, smithy_client_1.expectString)(data.ExecutionId);
512
+ }
513
+ if (data.LiveSimulationState != null) {
514
+ contents.LiveSimulationState = deserializeAws_restJson1LiveSimulationState(data.LiveSimulationState, context);
515
+ }
516
+ if (data.LoggingConfiguration != null) {
517
+ contents.LoggingConfiguration = deserializeAws_restJson1LoggingConfiguration(data.LoggingConfiguration, context);
518
+ }
519
+ if (data.MaximumDuration != null) {
520
+ contents.MaximumDuration = (0, smithy_client_1.expectString)(data.MaximumDuration);
521
+ }
522
+ if (data.Name != null) {
523
+ contents.Name = (0, smithy_client_1.expectString)(data.Name);
524
+ }
525
+ if (data.RoleArn != null) {
526
+ contents.RoleArn = (0, smithy_client_1.expectString)(data.RoleArn);
527
+ }
528
+ if (data.SchemaError != null) {
529
+ contents.SchemaError = (0, smithy_client_1.expectString)(data.SchemaError);
530
+ }
531
+ if (data.SchemaS3Location != null) {
532
+ contents.SchemaS3Location = deserializeAws_restJson1S3Location(data.SchemaS3Location, context);
533
+ }
534
+ if (data.Status != null) {
535
+ contents.Status = (0, smithy_client_1.expectString)(data.Status);
536
+ }
537
+ if (data.TargetStatus != null) {
538
+ contents.TargetStatus = (0, smithy_client_1.expectString)(data.TargetStatus);
539
+ }
540
+ return contents;
541
+ };
542
+ exports.deserializeAws_restJson1DescribeSimulationCommand = deserializeAws_restJson1DescribeSimulationCommand;
543
+ const deserializeAws_restJson1DescribeSimulationCommandError = async (output, context) => {
544
+ const parsedOutput = {
545
+ ...output,
546
+ body: await parseErrorBody(output.body, context),
547
+ };
548
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
549
+ switch (errorCode) {
550
+ case "AccessDeniedException":
551
+ case "com.amazonaws.simspaceweaver#AccessDeniedException":
552
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
553
+ case "InternalServerException":
554
+ case "com.amazonaws.simspaceweaver#InternalServerException":
555
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
556
+ case "ResourceNotFoundException":
557
+ case "com.amazonaws.simspaceweaver#ResourceNotFoundException":
558
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
559
+ case "ValidationException":
560
+ case "com.amazonaws.simspaceweaver#ValidationException":
561
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
562
+ default:
563
+ const parsedBody = parsedOutput.body;
564
+ (0, smithy_client_1.throwDefaultError)({
565
+ output,
566
+ parsedBody,
567
+ exceptionCtor: SimSpaceWeaverServiceException_1.SimSpaceWeaverServiceException,
568
+ errorCode,
569
+ });
570
+ }
571
+ };
572
+ const deserializeAws_restJson1ListAppsCommand = async (output, context) => {
573
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
574
+ return deserializeAws_restJson1ListAppsCommandError(output, context);
575
+ }
576
+ const contents = map({
577
+ $metadata: deserializeMetadata(output),
578
+ });
579
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
580
+ if (data.Apps != null) {
581
+ contents.Apps = deserializeAws_restJson1SimulationAppList(data.Apps, context);
582
+ }
583
+ if (data.NextToken != null) {
584
+ contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
585
+ }
586
+ return contents;
587
+ };
588
+ exports.deserializeAws_restJson1ListAppsCommand = deserializeAws_restJson1ListAppsCommand;
589
+ const deserializeAws_restJson1ListAppsCommandError = async (output, context) => {
590
+ const parsedOutput = {
591
+ ...output,
592
+ body: await parseErrorBody(output.body, context),
593
+ };
594
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
595
+ switch (errorCode) {
596
+ case "AccessDeniedException":
597
+ case "com.amazonaws.simspaceweaver#AccessDeniedException":
598
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
599
+ case "InternalServerException":
600
+ case "com.amazonaws.simspaceweaver#InternalServerException":
601
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
602
+ case "ResourceNotFoundException":
603
+ case "com.amazonaws.simspaceweaver#ResourceNotFoundException":
604
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
605
+ case "ValidationException":
606
+ case "com.amazonaws.simspaceweaver#ValidationException":
607
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
608
+ default:
609
+ const parsedBody = parsedOutput.body;
610
+ (0, smithy_client_1.throwDefaultError)({
611
+ output,
612
+ parsedBody,
613
+ exceptionCtor: SimSpaceWeaverServiceException_1.SimSpaceWeaverServiceException,
614
+ errorCode,
615
+ });
616
+ }
617
+ };
618
+ const deserializeAws_restJson1ListSimulationsCommand = async (output, context) => {
619
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
620
+ return deserializeAws_restJson1ListSimulationsCommandError(output, context);
621
+ }
622
+ const contents = map({
623
+ $metadata: deserializeMetadata(output),
624
+ });
625
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
626
+ if (data.NextToken != null) {
627
+ contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
628
+ }
629
+ if (data.Simulations != null) {
630
+ contents.Simulations = deserializeAws_restJson1SimulationList(data.Simulations, context);
631
+ }
632
+ return contents;
633
+ };
634
+ exports.deserializeAws_restJson1ListSimulationsCommand = deserializeAws_restJson1ListSimulationsCommand;
635
+ const deserializeAws_restJson1ListSimulationsCommandError = async (output, context) => {
636
+ const parsedOutput = {
637
+ ...output,
638
+ body: await parseErrorBody(output.body, context),
639
+ };
640
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
641
+ switch (errorCode) {
642
+ case "AccessDeniedException":
643
+ case "com.amazonaws.simspaceweaver#AccessDeniedException":
644
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
645
+ case "InternalServerException":
646
+ case "com.amazonaws.simspaceweaver#InternalServerException":
647
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
648
+ case "ValidationException":
649
+ case "com.amazonaws.simspaceweaver#ValidationException":
650
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
651
+ default:
652
+ const parsedBody = parsedOutput.body;
653
+ (0, smithy_client_1.throwDefaultError)({
654
+ output,
655
+ parsedBody,
656
+ exceptionCtor: SimSpaceWeaverServiceException_1.SimSpaceWeaverServiceException,
657
+ errorCode,
658
+ });
659
+ }
660
+ };
661
+ const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
662
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
663
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
664
+ }
665
+ const contents = map({
666
+ $metadata: deserializeMetadata(output),
667
+ });
668
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
669
+ if (data.Tags != null) {
670
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
671
+ }
672
+ return contents;
673
+ };
674
+ exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
675
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
676
+ const parsedOutput = {
677
+ ...output,
678
+ body: await parseErrorBody(output.body, context),
679
+ };
680
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
681
+ switch (errorCode) {
682
+ case "ResourceNotFoundException":
683
+ case "com.amazonaws.simspaceweaver#ResourceNotFoundException":
684
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
685
+ case "ValidationException":
686
+ case "com.amazonaws.simspaceweaver#ValidationException":
687
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
688
+ default:
689
+ const parsedBody = parsedOutput.body;
690
+ (0, smithy_client_1.throwDefaultError)({
691
+ output,
692
+ parsedBody,
693
+ exceptionCtor: SimSpaceWeaverServiceException_1.SimSpaceWeaverServiceException,
694
+ errorCode,
695
+ });
696
+ }
697
+ };
698
+ const deserializeAws_restJson1StartAppCommand = async (output, context) => {
699
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
700
+ return deserializeAws_restJson1StartAppCommandError(output, context);
701
+ }
702
+ const contents = map({
703
+ $metadata: deserializeMetadata(output),
704
+ });
705
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
706
+ if (data.Domain != null) {
707
+ contents.Domain = (0, smithy_client_1.expectString)(data.Domain);
708
+ }
709
+ if (data.Name != null) {
710
+ contents.Name = (0, smithy_client_1.expectString)(data.Name);
711
+ }
712
+ if (data.Simulation != null) {
713
+ contents.Simulation = (0, smithy_client_1.expectString)(data.Simulation);
714
+ }
715
+ return contents;
716
+ };
717
+ exports.deserializeAws_restJson1StartAppCommand = deserializeAws_restJson1StartAppCommand;
718
+ const deserializeAws_restJson1StartAppCommandError = async (output, context) => {
719
+ const parsedOutput = {
720
+ ...output,
721
+ body: await parseErrorBody(output.body, context),
722
+ };
723
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
724
+ switch (errorCode) {
725
+ case "AccessDeniedException":
726
+ case "com.amazonaws.simspaceweaver#AccessDeniedException":
727
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
728
+ case "ConflictException":
729
+ case "com.amazonaws.simspaceweaver#ConflictException":
730
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
731
+ case "InternalServerException":
732
+ case "com.amazonaws.simspaceweaver#InternalServerException":
733
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
734
+ case "ServiceQuotaExceededException":
735
+ case "com.amazonaws.simspaceweaver#ServiceQuotaExceededException":
736
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
737
+ case "ValidationException":
738
+ case "com.amazonaws.simspaceweaver#ValidationException":
739
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
740
+ default:
741
+ const parsedBody = parsedOutput.body;
742
+ (0, smithy_client_1.throwDefaultError)({
743
+ output,
744
+ parsedBody,
745
+ exceptionCtor: SimSpaceWeaverServiceException_1.SimSpaceWeaverServiceException,
746
+ errorCode,
747
+ });
748
+ }
749
+ };
750
+ const deserializeAws_restJson1StartClockCommand = async (output, context) => {
751
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
752
+ return deserializeAws_restJson1StartClockCommandError(output, context);
753
+ }
754
+ const contents = map({
755
+ $metadata: deserializeMetadata(output),
756
+ });
757
+ await collectBody(output.body, context);
758
+ return contents;
759
+ };
760
+ exports.deserializeAws_restJson1StartClockCommand = deserializeAws_restJson1StartClockCommand;
761
+ const deserializeAws_restJson1StartClockCommandError = async (output, context) => {
762
+ const parsedOutput = {
763
+ ...output,
764
+ body: await parseErrorBody(output.body, context),
765
+ };
766
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
767
+ switch (errorCode) {
768
+ case "AccessDeniedException":
769
+ case "com.amazonaws.simspaceweaver#AccessDeniedException":
770
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
771
+ case "ConflictException":
772
+ case "com.amazonaws.simspaceweaver#ConflictException":
773
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
774
+ case "InternalServerException":
775
+ case "com.amazonaws.simspaceweaver#InternalServerException":
776
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
777
+ case "ResourceNotFoundException":
778
+ case "com.amazonaws.simspaceweaver#ResourceNotFoundException":
779
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
780
+ case "ValidationException":
781
+ case "com.amazonaws.simspaceweaver#ValidationException":
782
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
783
+ default:
784
+ const parsedBody = parsedOutput.body;
785
+ (0, smithy_client_1.throwDefaultError)({
786
+ output,
787
+ parsedBody,
788
+ exceptionCtor: SimSpaceWeaverServiceException_1.SimSpaceWeaverServiceException,
789
+ errorCode,
790
+ });
791
+ }
792
+ };
793
+ const deserializeAws_restJson1StartSimulationCommand = async (output, context) => {
794
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
795
+ return deserializeAws_restJson1StartSimulationCommandError(output, context);
796
+ }
797
+ const contents = map({
798
+ $metadata: deserializeMetadata(output),
799
+ });
800
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
801
+ if (data.Arn != null) {
802
+ contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
803
+ }
804
+ if (data.CreationTime != null) {
805
+ contents.CreationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreationTime)));
806
+ }
807
+ if (data.ExecutionId != null) {
808
+ contents.ExecutionId = (0, smithy_client_1.expectString)(data.ExecutionId);
809
+ }
810
+ return contents;
811
+ };
812
+ exports.deserializeAws_restJson1StartSimulationCommand = deserializeAws_restJson1StartSimulationCommand;
813
+ const deserializeAws_restJson1StartSimulationCommandError = async (output, context) => {
814
+ const parsedOutput = {
815
+ ...output,
816
+ body: await parseErrorBody(output.body, context),
817
+ };
818
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
819
+ switch (errorCode) {
820
+ case "AccessDeniedException":
821
+ case "com.amazonaws.simspaceweaver#AccessDeniedException":
822
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
823
+ case "ConflictException":
824
+ case "com.amazonaws.simspaceweaver#ConflictException":
825
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
826
+ case "InternalServerException":
827
+ case "com.amazonaws.simspaceweaver#InternalServerException":
828
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
829
+ case "ServiceQuotaExceededException":
830
+ case "com.amazonaws.simspaceweaver#ServiceQuotaExceededException":
831
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
832
+ case "ValidationException":
833
+ case "com.amazonaws.simspaceweaver#ValidationException":
834
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
835
+ default:
836
+ const parsedBody = parsedOutput.body;
837
+ (0, smithy_client_1.throwDefaultError)({
838
+ output,
839
+ parsedBody,
840
+ exceptionCtor: SimSpaceWeaverServiceException_1.SimSpaceWeaverServiceException,
841
+ errorCode,
842
+ });
843
+ }
844
+ };
845
+ const deserializeAws_restJson1StopAppCommand = async (output, context) => {
846
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
847
+ return deserializeAws_restJson1StopAppCommandError(output, context);
848
+ }
849
+ const contents = map({
850
+ $metadata: deserializeMetadata(output),
851
+ });
852
+ await collectBody(output.body, context);
853
+ return contents;
854
+ };
855
+ exports.deserializeAws_restJson1StopAppCommand = deserializeAws_restJson1StopAppCommand;
856
+ const deserializeAws_restJson1StopAppCommandError = async (output, context) => {
857
+ const parsedOutput = {
858
+ ...output,
859
+ body: await parseErrorBody(output.body, context),
860
+ };
861
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
862
+ switch (errorCode) {
863
+ case "AccessDeniedException":
864
+ case "com.amazonaws.simspaceweaver#AccessDeniedException":
865
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
866
+ case "ConflictException":
867
+ case "com.amazonaws.simspaceweaver#ConflictException":
868
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
869
+ case "InternalServerException":
870
+ case "com.amazonaws.simspaceweaver#InternalServerException":
871
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
872
+ case "ResourceNotFoundException":
873
+ case "com.amazonaws.simspaceweaver#ResourceNotFoundException":
874
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
875
+ case "ValidationException":
876
+ case "com.amazonaws.simspaceweaver#ValidationException":
877
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
878
+ default:
879
+ const parsedBody = parsedOutput.body;
880
+ (0, smithy_client_1.throwDefaultError)({
881
+ output,
882
+ parsedBody,
883
+ exceptionCtor: SimSpaceWeaverServiceException_1.SimSpaceWeaverServiceException,
884
+ errorCode,
885
+ });
886
+ }
887
+ };
888
+ const deserializeAws_restJson1StopClockCommand = async (output, context) => {
889
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
890
+ return deserializeAws_restJson1StopClockCommandError(output, context);
891
+ }
892
+ const contents = map({
893
+ $metadata: deserializeMetadata(output),
894
+ });
895
+ await collectBody(output.body, context);
896
+ return contents;
897
+ };
898
+ exports.deserializeAws_restJson1StopClockCommand = deserializeAws_restJson1StopClockCommand;
899
+ const deserializeAws_restJson1StopClockCommandError = async (output, context) => {
900
+ const parsedOutput = {
901
+ ...output,
902
+ body: await parseErrorBody(output.body, context),
903
+ };
904
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
905
+ switch (errorCode) {
906
+ case "AccessDeniedException":
907
+ case "com.amazonaws.simspaceweaver#AccessDeniedException":
908
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
909
+ case "ConflictException":
910
+ case "com.amazonaws.simspaceweaver#ConflictException":
911
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
912
+ case "InternalServerException":
913
+ case "com.amazonaws.simspaceweaver#InternalServerException":
914
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
915
+ case "ResourceNotFoundException":
916
+ case "com.amazonaws.simspaceweaver#ResourceNotFoundException":
917
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
918
+ case "ValidationException":
919
+ case "com.amazonaws.simspaceweaver#ValidationException":
920
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
921
+ default:
922
+ const parsedBody = parsedOutput.body;
923
+ (0, smithy_client_1.throwDefaultError)({
924
+ output,
925
+ parsedBody,
926
+ exceptionCtor: SimSpaceWeaverServiceException_1.SimSpaceWeaverServiceException,
927
+ errorCode,
928
+ });
929
+ }
930
+ };
931
+ const deserializeAws_restJson1StopSimulationCommand = async (output, context) => {
932
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
933
+ return deserializeAws_restJson1StopSimulationCommandError(output, context);
934
+ }
935
+ const contents = map({
936
+ $metadata: deserializeMetadata(output),
937
+ });
938
+ await collectBody(output.body, context);
939
+ return contents;
940
+ };
941
+ exports.deserializeAws_restJson1StopSimulationCommand = deserializeAws_restJson1StopSimulationCommand;
942
+ const deserializeAws_restJson1StopSimulationCommandError = async (output, context) => {
943
+ const parsedOutput = {
944
+ ...output,
945
+ body: await parseErrorBody(output.body, context),
946
+ };
947
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
948
+ switch (errorCode) {
949
+ case "AccessDeniedException":
950
+ case "com.amazonaws.simspaceweaver#AccessDeniedException":
951
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
952
+ case "ConflictException":
953
+ case "com.amazonaws.simspaceweaver#ConflictException":
954
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
955
+ case "InternalServerException":
956
+ case "com.amazonaws.simspaceweaver#InternalServerException":
957
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
958
+ case "ResourceNotFoundException":
959
+ case "com.amazonaws.simspaceweaver#ResourceNotFoundException":
960
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
961
+ case "ValidationException":
962
+ case "com.amazonaws.simspaceweaver#ValidationException":
963
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
964
+ default:
965
+ const parsedBody = parsedOutput.body;
966
+ (0, smithy_client_1.throwDefaultError)({
967
+ output,
968
+ parsedBody,
969
+ exceptionCtor: SimSpaceWeaverServiceException_1.SimSpaceWeaverServiceException,
970
+ errorCode,
971
+ });
972
+ }
973
+ };
974
+ const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
975
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
976
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
977
+ }
978
+ const contents = map({
979
+ $metadata: deserializeMetadata(output),
980
+ });
981
+ await collectBody(output.body, context);
982
+ return contents;
983
+ };
984
+ exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
985
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
986
+ const parsedOutput = {
987
+ ...output,
988
+ body: await parseErrorBody(output.body, context),
989
+ };
990
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
991
+ switch (errorCode) {
992
+ case "ResourceNotFoundException":
993
+ case "com.amazonaws.simspaceweaver#ResourceNotFoundException":
994
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
995
+ case "TooManyTagsException":
996
+ case "com.amazonaws.simspaceweaver#TooManyTagsException":
997
+ throw await deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context);
998
+ case "ValidationException":
999
+ case "com.amazonaws.simspaceweaver#ValidationException":
1000
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1001
+ default:
1002
+ const parsedBody = parsedOutput.body;
1003
+ (0, smithy_client_1.throwDefaultError)({
1004
+ output,
1005
+ parsedBody,
1006
+ exceptionCtor: SimSpaceWeaverServiceException_1.SimSpaceWeaverServiceException,
1007
+ errorCode,
1008
+ });
1009
+ }
1010
+ };
1011
+ const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1012
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1013
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
1014
+ }
1015
+ const contents = map({
1016
+ $metadata: deserializeMetadata(output),
1017
+ });
1018
+ await collectBody(output.body, context);
1019
+ return contents;
1020
+ };
1021
+ exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
1022
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
1023
+ const parsedOutput = {
1024
+ ...output,
1025
+ body: await parseErrorBody(output.body, context),
1026
+ };
1027
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1028
+ switch (errorCode) {
1029
+ case "ResourceNotFoundException":
1030
+ case "com.amazonaws.simspaceweaver#ResourceNotFoundException":
1031
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1032
+ case "ValidationException":
1033
+ case "com.amazonaws.simspaceweaver#ValidationException":
1034
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1035
+ default:
1036
+ const parsedBody = parsedOutput.body;
1037
+ (0, smithy_client_1.throwDefaultError)({
1038
+ output,
1039
+ parsedBody,
1040
+ exceptionCtor: SimSpaceWeaverServiceException_1.SimSpaceWeaverServiceException,
1041
+ errorCode,
1042
+ });
1043
+ }
1044
+ };
1045
+ const map = smithy_client_1.map;
1046
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1047
+ const contents = map({});
1048
+ const data = parsedOutput.body;
1049
+ if (data.Message != null) {
1050
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1051
+ }
1052
+ const exception = new models_0_1.AccessDeniedException({
1053
+ $metadata: deserializeMetadata(parsedOutput),
1054
+ ...contents,
1055
+ });
1056
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1057
+ };
1058
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1059
+ const contents = map({});
1060
+ const data = parsedOutput.body;
1061
+ if (data.Message != null) {
1062
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1063
+ }
1064
+ const exception = new models_0_1.ConflictException({
1065
+ $metadata: deserializeMetadata(parsedOutput),
1066
+ ...contents,
1067
+ });
1068
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1069
+ };
1070
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
1071
+ const contents = map({});
1072
+ const data = parsedOutput.body;
1073
+ if (data.Message != null) {
1074
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1075
+ }
1076
+ const exception = new models_0_1.InternalServerException({
1077
+ $metadata: deserializeMetadata(parsedOutput),
1078
+ ...contents,
1079
+ });
1080
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1081
+ };
1082
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1083
+ const contents = map({});
1084
+ const data = parsedOutput.body;
1085
+ if (data.Message != null) {
1086
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1087
+ }
1088
+ const exception = new models_0_1.ResourceNotFoundException({
1089
+ $metadata: deserializeMetadata(parsedOutput),
1090
+ ...contents,
1091
+ });
1092
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1093
+ };
1094
+ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
1095
+ const contents = map({});
1096
+ const data = parsedOutput.body;
1097
+ if (data.Message != null) {
1098
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1099
+ }
1100
+ const exception = new models_0_1.ServiceQuotaExceededException({
1101
+ $metadata: deserializeMetadata(parsedOutput),
1102
+ ...contents,
1103
+ });
1104
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1105
+ };
1106
+ const deserializeAws_restJson1TooManyTagsExceptionResponse = async (parsedOutput, context) => {
1107
+ const contents = map({});
1108
+ const data = parsedOutput.body;
1109
+ if (data.Message != null) {
1110
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1111
+ }
1112
+ const exception = new models_0_1.TooManyTagsException({
1113
+ $metadata: deserializeMetadata(parsedOutput),
1114
+ ...contents,
1115
+ });
1116
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1117
+ };
1118
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1119
+ const contents = map({});
1120
+ const data = parsedOutput.body;
1121
+ if (data.Message != null) {
1122
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1123
+ }
1124
+ const exception = new models_0_1.ValidationException({
1125
+ $metadata: deserializeMetadata(parsedOutput),
1126
+ ...contents,
1127
+ });
1128
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1129
+ };
1130
+ const serializeAws_restJson1LaunchCommandList = (input, context) => {
1131
+ return input
1132
+ .filter((e) => e != null)
1133
+ .map((entry) => {
1134
+ return entry;
1135
+ });
1136
+ };
1137
+ const serializeAws_restJson1LaunchOverrides = (input, context) => {
1138
+ return {
1139
+ ...(input.LaunchCommands != null && {
1140
+ LaunchCommands: serializeAws_restJson1LaunchCommandList(input.LaunchCommands, context),
1141
+ }),
1142
+ };
1143
+ };
1144
+ const serializeAws_restJson1S3Location = (input, context) => {
1145
+ return {
1146
+ ...(input.BucketName != null && { BucketName: input.BucketName }),
1147
+ ...(input.ObjectKey != null && { ObjectKey: input.ObjectKey }),
1148
+ };
1149
+ };
1150
+ const serializeAws_restJson1TagMap = (input, context) => {
1151
+ return Object.entries(input).reduce((acc, [key, value]) => {
1152
+ if (value === null) {
1153
+ return acc;
1154
+ }
1155
+ acc[key] = value;
1156
+ return acc;
1157
+ }, {});
1158
+ };
1159
+ const deserializeAws_restJson1AppPortMappings = (output, context) => {
1160
+ const retVal = (output || [])
1161
+ .filter((e) => e != null)
1162
+ .map((entry) => {
1163
+ if (entry === null) {
1164
+ return null;
1165
+ }
1166
+ return deserializeAws_restJson1SimulationAppPortMapping(entry, context);
1167
+ });
1168
+ return retVal;
1169
+ };
1170
+ const deserializeAws_restJson1CloudWatchLogsLogGroup = (output, context) => {
1171
+ return {
1172
+ LogGroupArn: (0, smithy_client_1.expectString)(output.LogGroupArn),
1173
+ };
1174
+ };
1175
+ const deserializeAws_restJson1Domain = (output, context) => {
1176
+ return {
1177
+ Lifecycle: (0, smithy_client_1.expectString)(output.Lifecycle),
1178
+ Name: (0, smithy_client_1.expectString)(output.Name),
1179
+ };
1180
+ };
1181
+ const deserializeAws_restJson1DomainList = (output, context) => {
1182
+ const retVal = (output || [])
1183
+ .filter((e) => e != null)
1184
+ .map((entry) => {
1185
+ if (entry === null) {
1186
+ return null;
1187
+ }
1188
+ return deserializeAws_restJson1Domain(entry, context);
1189
+ });
1190
+ return retVal;
1191
+ };
1192
+ const deserializeAws_restJson1LaunchCommandList = (output, context) => {
1193
+ const retVal = (output || [])
1194
+ .filter((e) => e != null)
1195
+ .map((entry) => {
1196
+ if (entry === null) {
1197
+ return null;
1198
+ }
1199
+ return (0, smithy_client_1.expectString)(entry);
1200
+ });
1201
+ return retVal;
1202
+ };
1203
+ const deserializeAws_restJson1LaunchOverrides = (output, context) => {
1204
+ return {
1205
+ LaunchCommands: output.LaunchCommands != null
1206
+ ? deserializeAws_restJson1LaunchCommandList(output.LaunchCommands, context)
1207
+ : undefined,
1208
+ };
1209
+ };
1210
+ const deserializeAws_restJson1LiveSimulationState = (output, context) => {
1211
+ return {
1212
+ Clocks: output.Clocks != null ? deserializeAws_restJson1SimulationClockList(output.Clocks, context) : undefined,
1213
+ Domains: output.Domains != null ? deserializeAws_restJson1DomainList(output.Domains, context) : undefined,
1214
+ };
1215
+ };
1216
+ const deserializeAws_restJson1LogDestination = (output, context) => {
1217
+ return {
1218
+ CloudWatchLogsLogGroup: output.CloudWatchLogsLogGroup != null
1219
+ ? deserializeAws_restJson1CloudWatchLogsLogGroup(output.CloudWatchLogsLogGroup, context)
1220
+ : undefined,
1221
+ };
1222
+ };
1223
+ const deserializeAws_restJson1LogDestinations = (output, context) => {
1224
+ const retVal = (output || [])
1225
+ .filter((e) => e != null)
1226
+ .map((entry) => {
1227
+ if (entry === null) {
1228
+ return null;
1229
+ }
1230
+ return deserializeAws_restJson1LogDestination(entry, context);
1231
+ });
1232
+ return retVal;
1233
+ };
1234
+ const deserializeAws_restJson1LoggingConfiguration = (output, context) => {
1235
+ return {
1236
+ Destinations: output.Destinations != null ? deserializeAws_restJson1LogDestinations(output.Destinations, context) : undefined,
1237
+ };
1238
+ };
1239
+ const deserializeAws_restJson1S3Location = (output, context) => {
1240
+ return {
1241
+ BucketName: (0, smithy_client_1.expectString)(output.BucketName),
1242
+ ObjectKey: (0, smithy_client_1.expectString)(output.ObjectKey),
1243
+ };
1244
+ };
1245
+ const deserializeAws_restJson1SimulationAppEndpointInfo = (output, context) => {
1246
+ return {
1247
+ Address: (0, smithy_client_1.expectString)(output.Address),
1248
+ IngressPortMappings: output.IngressPortMappings != null
1249
+ ? deserializeAws_restJson1AppPortMappings(output.IngressPortMappings, context)
1250
+ : undefined,
1251
+ };
1252
+ };
1253
+ const deserializeAws_restJson1SimulationAppList = (output, context) => {
1254
+ const retVal = (output || [])
1255
+ .filter((e) => e != null)
1256
+ .map((entry) => {
1257
+ if (entry === null) {
1258
+ return null;
1259
+ }
1260
+ return deserializeAws_restJson1SimulationAppMetadata(entry, context);
1261
+ });
1262
+ return retVal;
1263
+ };
1264
+ const deserializeAws_restJson1SimulationAppMetadata = (output, context) => {
1265
+ return {
1266
+ Domain: (0, smithy_client_1.expectString)(output.Domain),
1267
+ Name: (0, smithy_client_1.expectString)(output.Name),
1268
+ Simulation: (0, smithy_client_1.expectString)(output.Simulation),
1269
+ Status: (0, smithy_client_1.expectString)(output.Status),
1270
+ TargetStatus: (0, smithy_client_1.expectString)(output.TargetStatus),
1271
+ };
1272
+ };
1273
+ const deserializeAws_restJson1SimulationAppPortMapping = (output, context) => {
1274
+ return {
1275
+ Actual: (0, smithy_client_1.expectInt32)(output.Actual),
1276
+ Declared: (0, smithy_client_1.expectInt32)(output.Declared),
1277
+ };
1278
+ };
1279
+ const deserializeAws_restJson1SimulationClock = (output, context) => {
1280
+ return {
1281
+ Status: (0, smithy_client_1.expectString)(output.Status),
1282
+ TargetStatus: (0, smithy_client_1.expectString)(output.TargetStatus),
1283
+ };
1284
+ };
1285
+ const deserializeAws_restJson1SimulationClockList = (output, context) => {
1286
+ const retVal = (output || [])
1287
+ .filter((e) => e != null)
1288
+ .map((entry) => {
1289
+ if (entry === null) {
1290
+ return null;
1291
+ }
1292
+ return deserializeAws_restJson1SimulationClock(entry, context);
1293
+ });
1294
+ return retVal;
1295
+ };
1296
+ const deserializeAws_restJson1SimulationList = (output, context) => {
1297
+ const retVal = (output || [])
1298
+ .filter((e) => e != null)
1299
+ .map((entry) => {
1300
+ if (entry === null) {
1301
+ return null;
1302
+ }
1303
+ return deserializeAws_restJson1SimulationMetadata(entry, context);
1304
+ });
1305
+ return retVal;
1306
+ };
1307
+ const deserializeAws_restJson1SimulationMetadata = (output, context) => {
1308
+ return {
1309
+ Arn: (0, smithy_client_1.expectString)(output.Arn),
1310
+ CreationTime: output.CreationTime != null
1311
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreationTime)))
1312
+ : undefined,
1313
+ Name: (0, smithy_client_1.expectString)(output.Name),
1314
+ Status: (0, smithy_client_1.expectString)(output.Status),
1315
+ TargetStatus: (0, smithy_client_1.expectString)(output.TargetStatus),
1316
+ };
1317
+ };
1318
+ const deserializeAws_restJson1TagMap = (output, context) => {
1319
+ return Object.entries(output).reduce((acc, [key, value]) => {
1320
+ if (value === null) {
1321
+ return acc;
1322
+ }
1323
+ acc[key] = (0, smithy_client_1.expectString)(value);
1324
+ return acc;
1325
+ }, {});
1326
+ };
1327
+ const deserializeMetadata = (output) => ({
1328
+ httpStatusCode: output.statusCode,
1329
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1330
+ extendedRequestId: output.headers["x-amz-id-2"],
1331
+ cfId: output.headers["x-amz-cf-id"],
1332
+ });
1333
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1334
+ if (streamBody instanceof Uint8Array) {
1335
+ return Promise.resolve(streamBody);
1336
+ }
1337
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1338
+ };
1339
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1340
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1341
+ value !== null &&
1342
+ value !== "" &&
1343
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1344
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1345
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1346
+ if (encoded.length) {
1347
+ return JSON.parse(encoded);
1348
+ }
1349
+ return {};
1350
+ });
1351
+ const parseErrorBody = async (errorBody, context) => {
1352
+ const value = await parseBody(errorBody, context);
1353
+ value.message = value.message ?? value.Message;
1354
+ return value;
1355
+ };
1356
+ const loadRestJsonErrorCode = (output, data) => {
1357
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1358
+ const sanitizeErrorCode = (rawValue) => {
1359
+ let cleanValue = rawValue;
1360
+ if (typeof cleanValue === "number") {
1361
+ cleanValue = cleanValue.toString();
1362
+ }
1363
+ if (cleanValue.indexOf(",") >= 0) {
1364
+ cleanValue = cleanValue.split(",")[0];
1365
+ }
1366
+ if (cleanValue.indexOf(":") >= 0) {
1367
+ cleanValue = cleanValue.split(":")[0];
1368
+ }
1369
+ if (cleanValue.indexOf("#") >= 0) {
1370
+ cleanValue = cleanValue.split("#")[1];
1371
+ }
1372
+ return cleanValue;
1373
+ };
1374
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1375
+ if (headerKey !== undefined) {
1376
+ return sanitizeErrorCode(output.headers[headerKey]);
1377
+ }
1378
+ if (data.code !== undefined) {
1379
+ return sanitizeErrorCode(data.code);
1380
+ }
1381
+ if (data["__type"] !== undefined) {
1382
+ return sanitizeErrorCode(data["__type"]);
1383
+ }
1384
+ };