@aws-sdk/client-codecatalyst 3.222.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 (195) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +312 -0
  3. package/dist-cjs/CodeCatalyst.js +367 -0
  4. package/dist-cjs/CodeCatalystClient.js +40 -0
  5. package/dist-cjs/commands/CreateAccessTokenCommand.js +45 -0
  6. package/dist-cjs/commands/CreateDevEnvironmentCommand.js +45 -0
  7. package/dist-cjs/commands/CreateProjectCommand.js +45 -0
  8. package/dist-cjs/commands/CreateSourceRepositoryBranchCommand.js +45 -0
  9. package/dist-cjs/commands/DeleteAccessTokenCommand.js +45 -0
  10. package/dist-cjs/commands/DeleteDevEnvironmentCommand.js +45 -0
  11. package/dist-cjs/commands/GetDevEnvironmentCommand.js +45 -0
  12. package/dist-cjs/commands/GetProjectCommand.js +45 -0
  13. package/dist-cjs/commands/GetSourceRepositoryCloneUrlsCommand.js +45 -0
  14. package/dist-cjs/commands/GetSpaceCommand.js +45 -0
  15. package/dist-cjs/commands/GetSubscriptionCommand.js +45 -0
  16. package/dist-cjs/commands/GetUserDetailsCommand.js +45 -0
  17. package/dist-cjs/commands/ListAccessTokensCommand.js +45 -0
  18. package/dist-cjs/commands/ListDevEnvironmentsCommand.js +45 -0
  19. package/dist-cjs/commands/ListEventLogsCommand.js +45 -0
  20. package/dist-cjs/commands/ListProjectsCommand.js +45 -0
  21. package/dist-cjs/commands/ListSourceRepositoriesCommand.js +45 -0
  22. package/dist-cjs/commands/ListSourceRepositoryBranchesCommand.js +45 -0
  23. package/dist-cjs/commands/ListSpacesCommand.js +45 -0
  24. package/dist-cjs/commands/StartDevEnvironmentCommand.js +45 -0
  25. package/dist-cjs/commands/StartDevEnvironmentSessionCommand.js +45 -0
  26. package/dist-cjs/commands/StopDevEnvironmentCommand.js +45 -0
  27. package/dist-cjs/commands/UpdateDevEnvironmentCommand.js +45 -0
  28. package/dist-cjs/commands/VerifySessionCommand.js +45 -0
  29. package/dist-cjs/commands/index.js +27 -0
  30. package/dist-cjs/endpoint/EndpointParameters.js +11 -0
  31. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  32. package/dist-cjs/endpoint/ruleset.js +214 -0
  33. package/dist-cjs/index.js +11 -0
  34. package/dist-cjs/models/CodeCatalystServiceException.js +11 -0
  35. package/dist-cjs/models/index.js +4 -0
  36. package/dist-cjs/models/models_0.js +416 -0
  37. package/dist-cjs/pagination/Interfaces.js +2 -0
  38. package/dist-cjs/pagination/ListAccessTokensPaginator.js +36 -0
  39. package/dist-cjs/pagination/ListDevEnvironmentsPaginator.js +36 -0
  40. package/dist-cjs/pagination/ListEventLogsPaginator.js +36 -0
  41. package/dist-cjs/pagination/ListProjectsPaginator.js +36 -0
  42. package/dist-cjs/pagination/ListSourceRepositoriesPaginator.js +36 -0
  43. package/dist-cjs/pagination/ListSourceRepositoryBranchesPaginator.js +36 -0
  44. package/dist-cjs/pagination/ListSpacesPaginator.js +35 -0
  45. package/dist-cjs/pagination/index.js +11 -0
  46. package/dist-cjs/protocols/Aws_restJson1.js +2372 -0
  47. package/dist-cjs/runtimeConfig.browser.js +39 -0
  48. package/dist-cjs/runtimeConfig.js +46 -0
  49. package/dist-cjs/runtimeConfig.native.js +15 -0
  50. package/dist-cjs/runtimeConfig.shared.js +18 -0
  51. package/dist-es/CodeCatalyst.js +363 -0
  52. package/dist-es/CodeCatalystClient.js +36 -0
  53. package/dist-es/commands/CreateAccessTokenCommand.js +41 -0
  54. package/dist-es/commands/CreateDevEnvironmentCommand.js +41 -0
  55. package/dist-es/commands/CreateProjectCommand.js +41 -0
  56. package/dist-es/commands/CreateSourceRepositoryBranchCommand.js +41 -0
  57. package/dist-es/commands/DeleteAccessTokenCommand.js +41 -0
  58. package/dist-es/commands/DeleteDevEnvironmentCommand.js +41 -0
  59. package/dist-es/commands/GetDevEnvironmentCommand.js +41 -0
  60. package/dist-es/commands/GetProjectCommand.js +41 -0
  61. package/dist-es/commands/GetSourceRepositoryCloneUrlsCommand.js +41 -0
  62. package/dist-es/commands/GetSpaceCommand.js +41 -0
  63. package/dist-es/commands/GetSubscriptionCommand.js +41 -0
  64. package/dist-es/commands/GetUserDetailsCommand.js +41 -0
  65. package/dist-es/commands/ListAccessTokensCommand.js +41 -0
  66. package/dist-es/commands/ListDevEnvironmentsCommand.js +41 -0
  67. package/dist-es/commands/ListEventLogsCommand.js +41 -0
  68. package/dist-es/commands/ListProjectsCommand.js +41 -0
  69. package/dist-es/commands/ListSourceRepositoriesCommand.js +41 -0
  70. package/dist-es/commands/ListSourceRepositoryBranchesCommand.js +41 -0
  71. package/dist-es/commands/ListSpacesCommand.js +41 -0
  72. package/dist-es/commands/StartDevEnvironmentCommand.js +41 -0
  73. package/dist-es/commands/StartDevEnvironmentSessionCommand.js +41 -0
  74. package/dist-es/commands/StopDevEnvironmentCommand.js +41 -0
  75. package/dist-es/commands/UpdateDevEnvironmentCommand.js +41 -0
  76. package/dist-es/commands/VerifySessionCommand.js +41 -0
  77. package/dist-es/commands/index.js +24 -0
  78. package/dist-es/endpoint/EndpointParameters.js +7 -0
  79. package/dist-es/endpoint/endpointResolver.js +8 -0
  80. package/dist-es/endpoint/ruleset.js +211 -0
  81. package/dist-es/index.js +6 -0
  82. package/dist-es/models/CodeCatalystServiceException.js +7 -0
  83. package/dist-es/models/index.js +1 -0
  84. package/dist-es/models/models_0.js +337 -0
  85. package/dist-es/pagination/Interfaces.js +1 -0
  86. package/dist-es/pagination/ListAccessTokensPaginator.js +32 -0
  87. package/dist-es/pagination/ListDevEnvironmentsPaginator.js +32 -0
  88. package/dist-es/pagination/ListEventLogsPaginator.js +32 -0
  89. package/dist-es/pagination/ListProjectsPaginator.js +32 -0
  90. package/dist-es/pagination/ListSourceRepositoriesPaginator.js +32 -0
  91. package/dist-es/pagination/ListSourceRepositoryBranchesPaginator.js +32 -0
  92. package/dist-es/pagination/ListSpacesPaginator.js +31 -0
  93. package/dist-es/pagination/index.js +8 -0
  94. package/dist-es/protocols/Aws_restJson1.js +2321 -0
  95. package/dist-es/runtimeConfig.browser.js +34 -0
  96. package/dist-es/runtimeConfig.js +41 -0
  97. package/dist-es/runtimeConfig.native.js +11 -0
  98. package/dist-es/runtimeConfig.shared.js +14 -0
  99. package/dist-types/CodeCatalyst.d.ts +291 -0
  100. package/dist-types/CodeCatalystClient.d.ts +263 -0
  101. package/dist-types/commands/CreateAccessTokenCommand.d.ts +40 -0
  102. package/dist-types/commands/CreateDevEnvironmentCommand.d.ts +38 -0
  103. package/dist-types/commands/CreateProjectCommand.d.ts +37 -0
  104. package/dist-types/commands/CreateSourceRepositoryBranchCommand.d.ts +40 -0
  105. package/dist-types/commands/DeleteAccessTokenCommand.d.ts +37 -0
  106. package/dist-types/commands/DeleteDevEnvironmentCommand.d.ts +37 -0
  107. package/dist-types/commands/GetDevEnvironmentCommand.d.ts +37 -0
  108. package/dist-types/commands/GetProjectCommand.d.ts +37 -0
  109. package/dist-types/commands/GetSourceRepositoryCloneUrlsCommand.d.ts +38 -0
  110. package/dist-types/commands/GetSpaceCommand.d.ts +37 -0
  111. package/dist-types/commands/GetSubscriptionCommand.d.ts +38 -0
  112. package/dist-types/commands/GetUserDetailsCommand.d.ts +37 -0
  113. package/dist-types/commands/ListAccessTokensCommand.d.ts +37 -0
  114. package/dist-types/commands/ListDevEnvironmentsCommand.d.ts +37 -0
  115. package/dist-types/commands/ListEventLogsCommand.d.ts +37 -0
  116. package/dist-types/commands/ListProjectsCommand.d.ts +37 -0
  117. package/dist-types/commands/ListSourceRepositoriesCommand.d.ts +37 -0
  118. package/dist-types/commands/ListSourceRepositoryBranchesCommand.d.ts +37 -0
  119. package/dist-types/commands/ListSpacesCommand.d.ts +37 -0
  120. package/dist-types/commands/StartDevEnvironmentCommand.d.ts +37 -0
  121. package/dist-types/commands/StartDevEnvironmentSessionCommand.d.ts +37 -0
  122. package/dist-types/commands/StopDevEnvironmentCommand.d.ts +37 -0
  123. package/dist-types/commands/UpdateDevEnvironmentCommand.d.ts +37 -0
  124. package/dist-types/commands/VerifySessionCommand.d.ts +37 -0
  125. package/dist-types/commands/index.d.ts +24 -0
  126. package/dist-types/endpoint/EndpointParameters.d.ts +17 -0
  127. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  128. package/dist-types/endpoint/ruleset.d.ts +2 -0
  129. package/dist-types/index.d.ts +6 -0
  130. package/dist-types/models/CodeCatalystServiceException.d.ts +10 -0
  131. package/dist-types/models/index.d.ts +1 -0
  132. package/dist-types/models/models_0.d.ts +1601 -0
  133. package/dist-types/pagination/Interfaces.d.ts +6 -0
  134. package/dist-types/pagination/ListAccessTokensPaginator.d.ts +4 -0
  135. package/dist-types/pagination/ListDevEnvironmentsPaginator.d.ts +4 -0
  136. package/dist-types/pagination/ListEventLogsPaginator.d.ts +4 -0
  137. package/dist-types/pagination/ListProjectsPaginator.d.ts +4 -0
  138. package/dist-types/pagination/ListSourceRepositoriesPaginator.d.ts +4 -0
  139. package/dist-types/pagination/ListSourceRepositoryBranchesPaginator.d.ts +4 -0
  140. package/dist-types/pagination/ListSpacesPaginator.d.ts +4 -0
  141. package/dist-types/pagination/index.d.ts +8 -0
  142. package/dist-types/protocols/Aws_restJson1.d.ts +74 -0
  143. package/dist-types/runtimeConfig.browser.d.ts +36 -0
  144. package/dist-types/runtimeConfig.d.ts +36 -0
  145. package/dist-types/runtimeConfig.native.d.ts +35 -0
  146. package/dist-types/runtimeConfig.shared.d.ts +16 -0
  147. package/dist-types/ts3.4/CodeCatalyst.d.ts +412 -0
  148. package/dist-types/ts3.4/CodeCatalystClient.d.ts +253 -0
  149. package/dist-types/ts3.4/commands/CreateAccessTokenCommand.d.ts +38 -0
  150. package/dist-types/ts3.4/commands/CreateDevEnvironmentCommand.d.ts +41 -0
  151. package/dist-types/ts3.4/commands/CreateProjectCommand.d.ts +37 -0
  152. package/dist-types/ts3.4/commands/CreateSourceRepositoryBranchCommand.d.ts +41 -0
  153. package/dist-types/ts3.4/commands/DeleteAccessTokenCommand.d.ts +38 -0
  154. package/dist-types/ts3.4/commands/DeleteDevEnvironmentCommand.d.ts +41 -0
  155. package/dist-types/ts3.4/commands/GetDevEnvironmentCommand.d.ts +38 -0
  156. package/dist-types/ts3.4/commands/GetProjectCommand.d.ts +34 -0
  157. package/dist-types/ts3.4/commands/GetSourceRepositoryCloneUrlsCommand.d.ts +41 -0
  158. package/dist-types/ts3.4/commands/GetSpaceCommand.d.ts +34 -0
  159. package/dist-types/ts3.4/commands/GetSubscriptionCommand.d.ts +37 -0
  160. package/dist-types/ts3.4/commands/GetUserDetailsCommand.d.ts +37 -0
  161. package/dist-types/ts3.4/commands/ListAccessTokensCommand.d.ts +37 -0
  162. package/dist-types/ts3.4/commands/ListDevEnvironmentsCommand.d.ts +38 -0
  163. package/dist-types/ts3.4/commands/ListEventLogsCommand.d.ts +37 -0
  164. package/dist-types/ts3.4/commands/ListProjectsCommand.d.ts +34 -0
  165. package/dist-types/ts3.4/commands/ListSourceRepositoriesCommand.d.ts +41 -0
  166. package/dist-types/ts3.4/commands/ListSourceRepositoryBranchesCommand.d.ts +41 -0
  167. package/dist-types/ts3.4/commands/ListSpacesCommand.d.ts +34 -0
  168. package/dist-types/ts3.4/commands/StartDevEnvironmentCommand.d.ts +38 -0
  169. package/dist-types/ts3.4/commands/StartDevEnvironmentSessionCommand.d.ts +41 -0
  170. package/dist-types/ts3.4/commands/StopDevEnvironmentCommand.d.ts +38 -0
  171. package/dist-types/ts3.4/commands/UpdateDevEnvironmentCommand.d.ts +41 -0
  172. package/dist-types/ts3.4/commands/VerifySessionCommand.d.ts +34 -0
  173. package/dist-types/ts3.4/commands/index.d.ts +24 -0
  174. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +32 -0
  175. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  176. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  177. package/dist-types/ts3.4/index.d.ts +6 -0
  178. package/dist-types/ts3.4/models/CodeCatalystServiceException.d.ts +7 -0
  179. package/dist-types/ts3.4/models/index.d.ts +1 -0
  180. package/dist-types/ts3.4/models/models_0.d.ts +662 -0
  181. package/dist-types/ts3.4/pagination/Interfaces.d.ts +7 -0
  182. package/dist-types/ts3.4/pagination/ListAccessTokensPaginator.d.ts +11 -0
  183. package/dist-types/ts3.4/pagination/ListDevEnvironmentsPaginator.d.ts +11 -0
  184. package/dist-types/ts3.4/pagination/ListEventLogsPaginator.d.ts +11 -0
  185. package/dist-types/ts3.4/pagination/ListProjectsPaginator.d.ts +11 -0
  186. package/dist-types/ts3.4/pagination/ListSourceRepositoriesPaginator.d.ts +11 -0
  187. package/dist-types/ts3.4/pagination/ListSourceRepositoryBranchesPaginator.d.ts +11 -0
  188. package/dist-types/ts3.4/pagination/ListSpacesPaginator.d.ts +11 -0
  189. package/dist-types/ts3.4/pagination/index.d.ts +8 -0
  190. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +293 -0
  191. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +68 -0
  192. package/dist-types/ts3.4/runtimeConfig.d.ts +68 -0
  193. package/dist-types/ts3.4/runtimeConfig.native.d.ts +57 -0
  194. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +16 -0
  195. package/package.json +100 -0
@@ -0,0 +1,2372 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deserializeAws_restJson1VerifySessionCommand = exports.deserializeAws_restJson1UpdateDevEnvironmentCommand = exports.deserializeAws_restJson1StopDevEnvironmentCommand = exports.deserializeAws_restJson1StartDevEnvironmentSessionCommand = exports.deserializeAws_restJson1StartDevEnvironmentCommand = exports.deserializeAws_restJson1ListSpacesCommand = exports.deserializeAws_restJson1ListSourceRepositoryBranchesCommand = exports.deserializeAws_restJson1ListSourceRepositoriesCommand = exports.deserializeAws_restJson1ListProjectsCommand = exports.deserializeAws_restJson1ListEventLogsCommand = exports.deserializeAws_restJson1ListDevEnvironmentsCommand = exports.deserializeAws_restJson1ListAccessTokensCommand = exports.deserializeAws_restJson1GetUserDetailsCommand = exports.deserializeAws_restJson1GetSubscriptionCommand = exports.deserializeAws_restJson1GetSpaceCommand = exports.deserializeAws_restJson1GetSourceRepositoryCloneUrlsCommand = exports.deserializeAws_restJson1GetProjectCommand = exports.deserializeAws_restJson1GetDevEnvironmentCommand = exports.deserializeAws_restJson1DeleteDevEnvironmentCommand = exports.deserializeAws_restJson1DeleteAccessTokenCommand = exports.deserializeAws_restJson1CreateSourceRepositoryBranchCommand = exports.deserializeAws_restJson1CreateProjectCommand = exports.deserializeAws_restJson1CreateDevEnvironmentCommand = exports.deserializeAws_restJson1CreateAccessTokenCommand = exports.serializeAws_restJson1VerifySessionCommand = exports.serializeAws_restJson1UpdateDevEnvironmentCommand = exports.serializeAws_restJson1StopDevEnvironmentCommand = exports.serializeAws_restJson1StartDevEnvironmentSessionCommand = exports.serializeAws_restJson1StartDevEnvironmentCommand = exports.serializeAws_restJson1ListSpacesCommand = exports.serializeAws_restJson1ListSourceRepositoryBranchesCommand = exports.serializeAws_restJson1ListSourceRepositoriesCommand = exports.serializeAws_restJson1ListProjectsCommand = exports.serializeAws_restJson1ListEventLogsCommand = exports.serializeAws_restJson1ListDevEnvironmentsCommand = exports.serializeAws_restJson1ListAccessTokensCommand = exports.serializeAws_restJson1GetUserDetailsCommand = exports.serializeAws_restJson1GetSubscriptionCommand = exports.serializeAws_restJson1GetSpaceCommand = exports.serializeAws_restJson1GetSourceRepositoryCloneUrlsCommand = exports.serializeAws_restJson1GetProjectCommand = exports.serializeAws_restJson1GetDevEnvironmentCommand = exports.serializeAws_restJson1DeleteDevEnvironmentCommand = exports.serializeAws_restJson1DeleteAccessTokenCommand = exports.serializeAws_restJson1CreateSourceRepositoryBranchCommand = exports.serializeAws_restJson1CreateProjectCommand = exports.serializeAws_restJson1CreateDevEnvironmentCommand = exports.serializeAws_restJson1CreateAccessTokenCommand = void 0;
4
+ const protocol_http_1 = require("@aws-sdk/protocol-http");
5
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const CodeCatalystServiceException_1 = require("../models/CodeCatalystServiceException");
7
+ const models_0_1 = require("../models/models_0");
8
+ const serializeAws_restJson1CreateAccessTokenCommand = async (input, context) => {
9
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
+ const headers = {
11
+ "content-type": "application/json",
12
+ };
13
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/accessTokens";
14
+ let body;
15
+ body = JSON.stringify({
16
+ ...(input.expiresTime != null && { expiresTime: input.expiresTime.toISOString().split(".")[0] + "Z" }),
17
+ ...(input.name != null && { name: input.name }),
18
+ });
19
+ return new protocol_http_1.HttpRequest({
20
+ protocol,
21
+ hostname,
22
+ port,
23
+ method: "PUT",
24
+ headers,
25
+ path: resolvedPath,
26
+ body,
27
+ });
28
+ };
29
+ exports.serializeAws_restJson1CreateAccessTokenCommand = serializeAws_restJson1CreateAccessTokenCommand;
30
+ const serializeAws_restJson1CreateDevEnvironmentCommand = async (input, context) => {
31
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
32
+ const headers = {
33
+ "content-type": "application/json",
34
+ };
35
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
36
+ "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments";
37
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
38
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
39
+ let body;
40
+ body = JSON.stringify({
41
+ ...(input.alias != null && { alias: input.alias }),
42
+ ...(input.clientToken != null && { clientToken: input.clientToken }),
43
+ ...(input.ides != null && { ides: serializeAws_restJson1IdeConfigurationList(input.ides, context) }),
44
+ ...(input.inactivityTimeoutMinutes != null && { inactivityTimeoutMinutes: input.inactivityTimeoutMinutes }),
45
+ ...(input.instanceType != null && { instanceType: input.instanceType }),
46
+ ...(input.persistentStorage != null && {
47
+ persistentStorage: serializeAws_restJson1PersistentStorageConfiguration(input.persistentStorage, context),
48
+ }),
49
+ ...(input.repositories != null && {
50
+ repositories: serializeAws_restJson1RepositoriesInput(input.repositories, context),
51
+ }),
52
+ });
53
+ return new protocol_http_1.HttpRequest({
54
+ protocol,
55
+ hostname,
56
+ port,
57
+ method: "PUT",
58
+ headers,
59
+ path: resolvedPath,
60
+ body,
61
+ });
62
+ };
63
+ exports.serializeAws_restJson1CreateDevEnvironmentCommand = serializeAws_restJson1CreateDevEnvironmentCommand;
64
+ const serializeAws_restJson1CreateProjectCommand = async (input, context) => {
65
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
66
+ const headers = {
67
+ "content-type": "application/json",
68
+ };
69
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/spaces/{spaceName}/projects";
70
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
71
+ let body;
72
+ body = JSON.stringify({
73
+ ...(input.description != null && { description: input.description }),
74
+ ...(input.displayName != null && { displayName: input.displayName }),
75
+ });
76
+ return new protocol_http_1.HttpRequest({
77
+ protocol,
78
+ hostname,
79
+ port,
80
+ method: "PUT",
81
+ headers,
82
+ path: resolvedPath,
83
+ body,
84
+ });
85
+ };
86
+ exports.serializeAws_restJson1CreateProjectCommand = serializeAws_restJson1CreateProjectCommand;
87
+ const serializeAws_restJson1CreateSourceRepositoryBranchCommand = async (input, context) => {
88
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
89
+ const headers = {
90
+ "content-type": "application/json",
91
+ };
92
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
93
+ "/v1/spaces/{spaceName}/projects/{projectName}/sourceRepositories/{sourceRepositoryName}/branches/{name}";
94
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
95
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
96
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "sourceRepositoryName", () => input.sourceRepositoryName, "{sourceRepositoryName}", false);
97
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "name", () => input.name, "{name}", false);
98
+ let body;
99
+ body = JSON.stringify({
100
+ ...(input.headCommitId != null && { headCommitId: input.headCommitId }),
101
+ });
102
+ return new protocol_http_1.HttpRequest({
103
+ protocol,
104
+ hostname,
105
+ port,
106
+ method: "PUT",
107
+ headers,
108
+ path: resolvedPath,
109
+ body,
110
+ });
111
+ };
112
+ exports.serializeAws_restJson1CreateSourceRepositoryBranchCommand = serializeAws_restJson1CreateSourceRepositoryBranchCommand;
113
+ const serializeAws_restJson1DeleteAccessTokenCommand = async (input, context) => {
114
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
115
+ const headers = {};
116
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/accessTokens/{id}";
117
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "id", () => input.id, "{id}", false);
118
+ let body;
119
+ return new protocol_http_1.HttpRequest({
120
+ protocol,
121
+ hostname,
122
+ port,
123
+ method: "DELETE",
124
+ headers,
125
+ path: resolvedPath,
126
+ body,
127
+ });
128
+ };
129
+ exports.serializeAws_restJson1DeleteAccessTokenCommand = serializeAws_restJson1DeleteAccessTokenCommand;
130
+ const serializeAws_restJson1DeleteDevEnvironmentCommand = async (input, context) => {
131
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
132
+ const headers = {};
133
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
134
+ "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}";
135
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
136
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
137
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "id", () => input.id, "{id}", false);
138
+ let body;
139
+ return new protocol_http_1.HttpRequest({
140
+ protocol,
141
+ hostname,
142
+ port,
143
+ method: "DELETE",
144
+ headers,
145
+ path: resolvedPath,
146
+ body,
147
+ });
148
+ };
149
+ exports.serializeAws_restJson1DeleteDevEnvironmentCommand = serializeAws_restJson1DeleteDevEnvironmentCommand;
150
+ const serializeAws_restJson1GetDevEnvironmentCommand = async (input, context) => {
151
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
152
+ const headers = {};
153
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
154
+ "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}";
155
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
156
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
157
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "id", () => input.id, "{id}", false);
158
+ let body;
159
+ return new protocol_http_1.HttpRequest({
160
+ protocol,
161
+ hostname,
162
+ port,
163
+ method: "GET",
164
+ headers,
165
+ path: resolvedPath,
166
+ body,
167
+ });
168
+ };
169
+ exports.serializeAws_restJson1GetDevEnvironmentCommand = serializeAws_restJson1GetDevEnvironmentCommand;
170
+ const serializeAws_restJson1GetProjectCommand = async (input, context) => {
171
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
172
+ const headers = {};
173
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/spaces/{spaceName}/projects/{name}";
174
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
175
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "name", () => input.name, "{name}", false);
176
+ let body;
177
+ return new protocol_http_1.HttpRequest({
178
+ protocol,
179
+ hostname,
180
+ port,
181
+ method: "GET",
182
+ headers,
183
+ path: resolvedPath,
184
+ body,
185
+ });
186
+ };
187
+ exports.serializeAws_restJson1GetProjectCommand = serializeAws_restJson1GetProjectCommand;
188
+ const serializeAws_restJson1GetSourceRepositoryCloneUrlsCommand = async (input, context) => {
189
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
190
+ const headers = {};
191
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
192
+ "/v1/spaces/{spaceName}/projects/{projectName}/sourceRepositories/{sourceRepositoryName}/cloneUrls";
193
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
194
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
195
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "sourceRepositoryName", () => input.sourceRepositoryName, "{sourceRepositoryName}", false);
196
+ let body;
197
+ return new protocol_http_1.HttpRequest({
198
+ protocol,
199
+ hostname,
200
+ port,
201
+ method: "GET",
202
+ headers,
203
+ path: resolvedPath,
204
+ body,
205
+ });
206
+ };
207
+ exports.serializeAws_restJson1GetSourceRepositoryCloneUrlsCommand = serializeAws_restJson1GetSourceRepositoryCloneUrlsCommand;
208
+ const serializeAws_restJson1GetSpaceCommand = async (input, context) => {
209
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
210
+ const headers = {};
211
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/spaces/{name}";
212
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "name", () => input.name, "{name}", false);
213
+ let body;
214
+ return new protocol_http_1.HttpRequest({
215
+ protocol,
216
+ hostname,
217
+ port,
218
+ method: "GET",
219
+ headers,
220
+ path: resolvedPath,
221
+ body,
222
+ });
223
+ };
224
+ exports.serializeAws_restJson1GetSpaceCommand = serializeAws_restJson1GetSpaceCommand;
225
+ const serializeAws_restJson1GetSubscriptionCommand = async (input, context) => {
226
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
227
+ const headers = {};
228
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/spaces/{spaceName}/subscription";
229
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
230
+ let body;
231
+ return new protocol_http_1.HttpRequest({
232
+ protocol,
233
+ hostname,
234
+ port,
235
+ method: "GET",
236
+ headers,
237
+ path: resolvedPath,
238
+ body,
239
+ });
240
+ };
241
+ exports.serializeAws_restJson1GetSubscriptionCommand = serializeAws_restJson1GetSubscriptionCommand;
242
+ const serializeAws_restJson1GetUserDetailsCommand = async (input, context) => {
243
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
244
+ const headers = {};
245
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/userDetails";
246
+ const query = map({
247
+ id: [, input.id],
248
+ userName: [, input.userName],
249
+ });
250
+ let body;
251
+ return new protocol_http_1.HttpRequest({
252
+ protocol,
253
+ hostname,
254
+ port,
255
+ method: "GET",
256
+ headers,
257
+ path: resolvedPath,
258
+ query,
259
+ body,
260
+ });
261
+ };
262
+ exports.serializeAws_restJson1GetUserDetailsCommand = serializeAws_restJson1GetUserDetailsCommand;
263
+ const serializeAws_restJson1ListAccessTokensCommand = async (input, context) => {
264
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
265
+ const headers = {
266
+ "content-type": "application/json",
267
+ };
268
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/accessTokens";
269
+ let body;
270
+ body = JSON.stringify({
271
+ ...(input.maxResults != null && { maxResults: input.maxResults }),
272
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
273
+ });
274
+ return new protocol_http_1.HttpRequest({
275
+ protocol,
276
+ hostname,
277
+ port,
278
+ method: "POST",
279
+ headers,
280
+ path: resolvedPath,
281
+ body,
282
+ });
283
+ };
284
+ exports.serializeAws_restJson1ListAccessTokensCommand = serializeAws_restJson1ListAccessTokensCommand;
285
+ const serializeAws_restJson1ListDevEnvironmentsCommand = async (input, context) => {
286
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
287
+ const headers = {
288
+ "content-type": "application/json",
289
+ };
290
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
291
+ "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments";
292
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
293
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
294
+ let body;
295
+ body = JSON.stringify({
296
+ ...(input.filters != null && { filters: serializeAws_restJson1Filters(input.filters, context) }),
297
+ ...(input.maxResults != null && { maxResults: input.maxResults }),
298
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
299
+ });
300
+ return new protocol_http_1.HttpRequest({
301
+ protocol,
302
+ hostname,
303
+ port,
304
+ method: "POST",
305
+ headers,
306
+ path: resolvedPath,
307
+ body,
308
+ });
309
+ };
310
+ exports.serializeAws_restJson1ListDevEnvironmentsCommand = serializeAws_restJson1ListDevEnvironmentsCommand;
311
+ const serializeAws_restJson1ListEventLogsCommand = async (input, context) => {
312
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
313
+ const headers = {
314
+ "content-type": "application/json",
315
+ };
316
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/spaces/{spaceName}/eventLogs";
317
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
318
+ let body;
319
+ body = JSON.stringify({
320
+ ...(input.endTime != null && { endTime: input.endTime.toISOString().split(".")[0] + "Z" }),
321
+ ...(input.eventName != null && { eventName: input.eventName }),
322
+ ...(input.maxResults != null && { maxResults: input.maxResults }),
323
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
324
+ ...(input.startTime != null && { startTime: input.startTime.toISOString().split(".")[0] + "Z" }),
325
+ });
326
+ return new protocol_http_1.HttpRequest({
327
+ protocol,
328
+ hostname,
329
+ port,
330
+ method: "POST",
331
+ headers,
332
+ path: resolvedPath,
333
+ body,
334
+ });
335
+ };
336
+ exports.serializeAws_restJson1ListEventLogsCommand = serializeAws_restJson1ListEventLogsCommand;
337
+ const serializeAws_restJson1ListProjectsCommand = async (input, context) => {
338
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
339
+ const headers = {
340
+ "content-type": "application/json",
341
+ };
342
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/spaces/{spaceName}/projects";
343
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
344
+ let body;
345
+ body = JSON.stringify({
346
+ ...(input.filters != null && { filters: serializeAws_restJson1ProjectListFilters(input.filters, context) }),
347
+ ...(input.maxResults != null && { maxResults: input.maxResults }),
348
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
349
+ });
350
+ return new protocol_http_1.HttpRequest({
351
+ protocol,
352
+ hostname,
353
+ port,
354
+ method: "POST",
355
+ headers,
356
+ path: resolvedPath,
357
+ body,
358
+ });
359
+ };
360
+ exports.serializeAws_restJson1ListProjectsCommand = serializeAws_restJson1ListProjectsCommand;
361
+ const serializeAws_restJson1ListSourceRepositoriesCommand = async (input, context) => {
362
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
363
+ const headers = {
364
+ "content-type": "application/json",
365
+ };
366
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
367
+ "/v1/spaces/{spaceName}/projects/{projectName}/sourceRepositories";
368
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
369
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
370
+ let body;
371
+ body = JSON.stringify({
372
+ ...(input.maxResults != null && { maxResults: input.maxResults }),
373
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
374
+ });
375
+ return new protocol_http_1.HttpRequest({
376
+ protocol,
377
+ hostname,
378
+ port,
379
+ method: "POST",
380
+ headers,
381
+ path: resolvedPath,
382
+ body,
383
+ });
384
+ };
385
+ exports.serializeAws_restJson1ListSourceRepositoriesCommand = serializeAws_restJson1ListSourceRepositoriesCommand;
386
+ const serializeAws_restJson1ListSourceRepositoryBranchesCommand = async (input, context) => {
387
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
388
+ const headers = {
389
+ "content-type": "application/json",
390
+ };
391
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
392
+ "/v1/spaces/{spaceName}/projects/{projectName}/sourceRepositories/{sourceRepositoryName}/branches";
393
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
394
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
395
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "sourceRepositoryName", () => input.sourceRepositoryName, "{sourceRepositoryName}", false);
396
+ let body;
397
+ body = JSON.stringify({
398
+ ...(input.maxResults != null && { maxResults: input.maxResults }),
399
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
400
+ });
401
+ return new protocol_http_1.HttpRequest({
402
+ protocol,
403
+ hostname,
404
+ port,
405
+ method: "POST",
406
+ headers,
407
+ path: resolvedPath,
408
+ body,
409
+ });
410
+ };
411
+ exports.serializeAws_restJson1ListSourceRepositoryBranchesCommand = serializeAws_restJson1ListSourceRepositoryBranchesCommand;
412
+ const serializeAws_restJson1ListSpacesCommand = async (input, context) => {
413
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
414
+ const headers = {
415
+ "content-type": "application/json",
416
+ };
417
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/spaces";
418
+ let body;
419
+ body = JSON.stringify({
420
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
421
+ });
422
+ return new protocol_http_1.HttpRequest({
423
+ protocol,
424
+ hostname,
425
+ port,
426
+ method: "POST",
427
+ headers,
428
+ path: resolvedPath,
429
+ body,
430
+ });
431
+ };
432
+ exports.serializeAws_restJson1ListSpacesCommand = serializeAws_restJson1ListSpacesCommand;
433
+ const serializeAws_restJson1StartDevEnvironmentCommand = async (input, context) => {
434
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
435
+ const headers = {
436
+ "content-type": "application/json",
437
+ };
438
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
439
+ "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}/start";
440
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
441
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
442
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "id", () => input.id, "{id}", false);
443
+ let body;
444
+ body = JSON.stringify({
445
+ ...(input.ides != null && { ides: serializeAws_restJson1IdeConfigurationList(input.ides, context) }),
446
+ ...(input.inactivityTimeoutMinutes != null && { inactivityTimeoutMinutes: input.inactivityTimeoutMinutes }),
447
+ ...(input.instanceType != null && { instanceType: input.instanceType }),
448
+ });
449
+ return new protocol_http_1.HttpRequest({
450
+ protocol,
451
+ hostname,
452
+ port,
453
+ method: "PUT",
454
+ headers,
455
+ path: resolvedPath,
456
+ body,
457
+ });
458
+ };
459
+ exports.serializeAws_restJson1StartDevEnvironmentCommand = serializeAws_restJson1StartDevEnvironmentCommand;
460
+ const serializeAws_restJson1StartDevEnvironmentSessionCommand = async (input, context) => {
461
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
462
+ const headers = {
463
+ "content-type": "application/json",
464
+ };
465
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
466
+ "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}/session";
467
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
468
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
469
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "id", () => input.id, "{id}", false);
470
+ let body;
471
+ body = JSON.stringify({
472
+ ...(input.sessionConfiguration != null && {
473
+ sessionConfiguration: serializeAws_restJson1DevEnvironmentSessionConfiguration(input.sessionConfiguration, context),
474
+ }),
475
+ });
476
+ return new protocol_http_1.HttpRequest({
477
+ protocol,
478
+ hostname,
479
+ port,
480
+ method: "PUT",
481
+ headers,
482
+ path: resolvedPath,
483
+ body,
484
+ });
485
+ };
486
+ exports.serializeAws_restJson1StartDevEnvironmentSessionCommand = serializeAws_restJson1StartDevEnvironmentSessionCommand;
487
+ const serializeAws_restJson1StopDevEnvironmentCommand = async (input, context) => {
488
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
489
+ const headers = {};
490
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
491
+ "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}/stop";
492
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
493
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
494
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "id", () => input.id, "{id}", false);
495
+ let body;
496
+ return new protocol_http_1.HttpRequest({
497
+ protocol,
498
+ hostname,
499
+ port,
500
+ method: "PUT",
501
+ headers,
502
+ path: resolvedPath,
503
+ body,
504
+ });
505
+ };
506
+ exports.serializeAws_restJson1StopDevEnvironmentCommand = serializeAws_restJson1StopDevEnvironmentCommand;
507
+ const serializeAws_restJson1UpdateDevEnvironmentCommand = async (input, context) => {
508
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
509
+ const headers = {
510
+ "content-type": "application/json",
511
+ };
512
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
513
+ "/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}";
514
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "spaceName", () => input.spaceName, "{spaceName}", false);
515
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "projectName", () => input.projectName, "{projectName}", false);
516
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "id", () => input.id, "{id}", false);
517
+ let body;
518
+ body = JSON.stringify({
519
+ ...(input.alias != null && { alias: input.alias }),
520
+ ...(input.clientToken != null && { clientToken: input.clientToken }),
521
+ ...(input.ides != null && { ides: serializeAws_restJson1IdeConfigurationList(input.ides, context) }),
522
+ ...(input.inactivityTimeoutMinutes != null && { inactivityTimeoutMinutes: input.inactivityTimeoutMinutes }),
523
+ ...(input.instanceType != null && { instanceType: input.instanceType }),
524
+ });
525
+ return new protocol_http_1.HttpRequest({
526
+ protocol,
527
+ hostname,
528
+ port,
529
+ method: "PATCH",
530
+ headers,
531
+ path: resolvedPath,
532
+ body,
533
+ });
534
+ };
535
+ exports.serializeAws_restJson1UpdateDevEnvironmentCommand = serializeAws_restJson1UpdateDevEnvironmentCommand;
536
+ const serializeAws_restJson1VerifySessionCommand = async (input, context) => {
537
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
538
+ const headers = {
539
+ "content-type": "application/json",
540
+ };
541
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/session";
542
+ let body;
543
+ body = "";
544
+ return new protocol_http_1.HttpRequest({
545
+ protocol,
546
+ hostname,
547
+ port,
548
+ method: "GET",
549
+ headers,
550
+ path: resolvedPath,
551
+ body,
552
+ });
553
+ };
554
+ exports.serializeAws_restJson1VerifySessionCommand = serializeAws_restJson1VerifySessionCommand;
555
+ const deserializeAws_restJson1CreateAccessTokenCommand = async (output, context) => {
556
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
557
+ return deserializeAws_restJson1CreateAccessTokenCommandError(output, context);
558
+ }
559
+ const contents = map({
560
+ $metadata: deserializeMetadata(output),
561
+ });
562
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
563
+ if (data.expiresTime != null) {
564
+ contents.expiresTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.expiresTime));
565
+ }
566
+ if (data.name != null) {
567
+ contents.name = (0, smithy_client_1.expectString)(data.name);
568
+ }
569
+ if (data.secret != null) {
570
+ contents.secret = (0, smithy_client_1.expectString)(data.secret);
571
+ }
572
+ return contents;
573
+ };
574
+ exports.deserializeAws_restJson1CreateAccessTokenCommand = deserializeAws_restJson1CreateAccessTokenCommand;
575
+ const deserializeAws_restJson1CreateAccessTokenCommandError = async (output, context) => {
576
+ const parsedOutput = {
577
+ ...output,
578
+ body: await parseErrorBody(output.body, context),
579
+ };
580
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
581
+ switch (errorCode) {
582
+ case "AccessDeniedException":
583
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
584
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
585
+ case "ConflictException":
586
+ case "com.amazonaws.codecatalyst#ConflictException":
587
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
588
+ case "ResourceNotFoundException":
589
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
590
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
591
+ case "ServiceQuotaExceededException":
592
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
593
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
594
+ case "ThrottlingException":
595
+ case "com.amazonaws.codecatalyst#ThrottlingException":
596
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
597
+ case "ValidationException":
598
+ case "com.amazonaws.codecatalyst#ValidationException":
599
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
600
+ default:
601
+ const parsedBody = parsedOutput.body;
602
+ (0, smithy_client_1.throwDefaultError)({
603
+ output,
604
+ parsedBody,
605
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
606
+ errorCode,
607
+ });
608
+ }
609
+ };
610
+ const deserializeAws_restJson1CreateDevEnvironmentCommand = async (output, context) => {
611
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
612
+ return deserializeAws_restJson1CreateDevEnvironmentCommandError(output, context);
613
+ }
614
+ const contents = map({
615
+ $metadata: deserializeMetadata(output),
616
+ });
617
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
618
+ if (data.id != null) {
619
+ contents.id = (0, smithy_client_1.expectString)(data.id);
620
+ }
621
+ if (data.projectName != null) {
622
+ contents.projectName = (0, smithy_client_1.expectString)(data.projectName);
623
+ }
624
+ if (data.spaceName != null) {
625
+ contents.spaceName = (0, smithy_client_1.expectString)(data.spaceName);
626
+ }
627
+ return contents;
628
+ };
629
+ exports.deserializeAws_restJson1CreateDevEnvironmentCommand = deserializeAws_restJson1CreateDevEnvironmentCommand;
630
+ const deserializeAws_restJson1CreateDevEnvironmentCommandError = async (output, context) => {
631
+ const parsedOutput = {
632
+ ...output,
633
+ body: await parseErrorBody(output.body, context),
634
+ };
635
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
636
+ switch (errorCode) {
637
+ case "AccessDeniedException":
638
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
639
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
640
+ case "ConflictException":
641
+ case "com.amazonaws.codecatalyst#ConflictException":
642
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
643
+ case "ResourceNotFoundException":
644
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
645
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
646
+ case "ServiceQuotaExceededException":
647
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
648
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
649
+ case "ThrottlingException":
650
+ case "com.amazonaws.codecatalyst#ThrottlingException":
651
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
652
+ case "ValidationException":
653
+ case "com.amazonaws.codecatalyst#ValidationException":
654
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
655
+ default:
656
+ const parsedBody = parsedOutput.body;
657
+ (0, smithy_client_1.throwDefaultError)({
658
+ output,
659
+ parsedBody,
660
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
661
+ errorCode,
662
+ });
663
+ }
664
+ };
665
+ const deserializeAws_restJson1CreateProjectCommand = async (output, context) => {
666
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
667
+ return deserializeAws_restJson1CreateProjectCommandError(output, context);
668
+ }
669
+ const contents = map({
670
+ $metadata: deserializeMetadata(output),
671
+ });
672
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
673
+ if (data.description != null) {
674
+ contents.description = (0, smithy_client_1.expectString)(data.description);
675
+ }
676
+ if (data.displayName != null) {
677
+ contents.displayName = (0, smithy_client_1.expectString)(data.displayName);
678
+ }
679
+ if (data.name != null) {
680
+ contents.name = (0, smithy_client_1.expectString)(data.name);
681
+ }
682
+ if (data.spaceName != null) {
683
+ contents.spaceName = (0, smithy_client_1.expectString)(data.spaceName);
684
+ }
685
+ return contents;
686
+ };
687
+ exports.deserializeAws_restJson1CreateProjectCommand = deserializeAws_restJson1CreateProjectCommand;
688
+ const deserializeAws_restJson1CreateProjectCommandError = async (output, context) => {
689
+ const parsedOutput = {
690
+ ...output,
691
+ body: await parseErrorBody(output.body, context),
692
+ };
693
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
694
+ switch (errorCode) {
695
+ case "AccessDeniedException":
696
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
697
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
698
+ case "ConflictException":
699
+ case "com.amazonaws.codecatalyst#ConflictException":
700
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
701
+ case "ResourceNotFoundException":
702
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
703
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
704
+ case "ServiceQuotaExceededException":
705
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
706
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
707
+ case "ThrottlingException":
708
+ case "com.amazonaws.codecatalyst#ThrottlingException":
709
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
710
+ case "ValidationException":
711
+ case "com.amazonaws.codecatalyst#ValidationException":
712
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
713
+ default:
714
+ const parsedBody = parsedOutput.body;
715
+ (0, smithy_client_1.throwDefaultError)({
716
+ output,
717
+ parsedBody,
718
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
719
+ errorCode,
720
+ });
721
+ }
722
+ };
723
+ const deserializeAws_restJson1CreateSourceRepositoryBranchCommand = async (output, context) => {
724
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
725
+ return deserializeAws_restJson1CreateSourceRepositoryBranchCommandError(output, context);
726
+ }
727
+ const contents = map({
728
+ $metadata: deserializeMetadata(output),
729
+ });
730
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
731
+ if (data.headCommitId != null) {
732
+ contents.headCommitId = (0, smithy_client_1.expectString)(data.headCommitId);
733
+ }
734
+ if (data.lastUpdatedTime != null) {
735
+ contents.lastUpdatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.lastUpdatedTime));
736
+ }
737
+ if (data.name != null) {
738
+ contents.name = (0, smithy_client_1.expectString)(data.name);
739
+ }
740
+ if (data.ref != null) {
741
+ contents.ref = (0, smithy_client_1.expectString)(data.ref);
742
+ }
743
+ return contents;
744
+ };
745
+ exports.deserializeAws_restJson1CreateSourceRepositoryBranchCommand = deserializeAws_restJson1CreateSourceRepositoryBranchCommand;
746
+ const deserializeAws_restJson1CreateSourceRepositoryBranchCommandError = async (output, context) => {
747
+ const parsedOutput = {
748
+ ...output,
749
+ body: await parseErrorBody(output.body, context),
750
+ };
751
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
752
+ switch (errorCode) {
753
+ case "AccessDeniedException":
754
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
755
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
756
+ case "ConflictException":
757
+ case "com.amazonaws.codecatalyst#ConflictException":
758
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
759
+ case "ResourceNotFoundException":
760
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
761
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
762
+ case "ServiceQuotaExceededException":
763
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
764
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
765
+ case "ThrottlingException":
766
+ case "com.amazonaws.codecatalyst#ThrottlingException":
767
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
768
+ case "ValidationException":
769
+ case "com.amazonaws.codecatalyst#ValidationException":
770
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
771
+ default:
772
+ const parsedBody = parsedOutput.body;
773
+ (0, smithy_client_1.throwDefaultError)({
774
+ output,
775
+ parsedBody,
776
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
777
+ errorCode,
778
+ });
779
+ }
780
+ };
781
+ const deserializeAws_restJson1DeleteAccessTokenCommand = async (output, context) => {
782
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
783
+ return deserializeAws_restJson1DeleteAccessTokenCommandError(output, context);
784
+ }
785
+ const contents = map({
786
+ $metadata: deserializeMetadata(output),
787
+ });
788
+ await collectBody(output.body, context);
789
+ return contents;
790
+ };
791
+ exports.deserializeAws_restJson1DeleteAccessTokenCommand = deserializeAws_restJson1DeleteAccessTokenCommand;
792
+ const deserializeAws_restJson1DeleteAccessTokenCommandError = async (output, context) => {
793
+ const parsedOutput = {
794
+ ...output,
795
+ body: await parseErrorBody(output.body, context),
796
+ };
797
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
798
+ switch (errorCode) {
799
+ case "AccessDeniedException":
800
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
801
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
802
+ case "ConflictException":
803
+ case "com.amazonaws.codecatalyst#ConflictException":
804
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
805
+ case "ResourceNotFoundException":
806
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
807
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
808
+ case "ServiceQuotaExceededException":
809
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
810
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
811
+ case "ThrottlingException":
812
+ case "com.amazonaws.codecatalyst#ThrottlingException":
813
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
814
+ case "ValidationException":
815
+ case "com.amazonaws.codecatalyst#ValidationException":
816
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
817
+ default:
818
+ const parsedBody = parsedOutput.body;
819
+ (0, smithy_client_1.throwDefaultError)({
820
+ output,
821
+ parsedBody,
822
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
823
+ errorCode,
824
+ });
825
+ }
826
+ };
827
+ const deserializeAws_restJson1DeleteDevEnvironmentCommand = async (output, context) => {
828
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
829
+ return deserializeAws_restJson1DeleteDevEnvironmentCommandError(output, context);
830
+ }
831
+ const contents = map({
832
+ $metadata: deserializeMetadata(output),
833
+ });
834
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
835
+ if (data.id != null) {
836
+ contents.id = (0, smithy_client_1.expectString)(data.id);
837
+ }
838
+ if (data.projectName != null) {
839
+ contents.projectName = (0, smithy_client_1.expectString)(data.projectName);
840
+ }
841
+ if (data.spaceName != null) {
842
+ contents.spaceName = (0, smithy_client_1.expectString)(data.spaceName);
843
+ }
844
+ return contents;
845
+ };
846
+ exports.deserializeAws_restJson1DeleteDevEnvironmentCommand = deserializeAws_restJson1DeleteDevEnvironmentCommand;
847
+ const deserializeAws_restJson1DeleteDevEnvironmentCommandError = async (output, context) => {
848
+ const parsedOutput = {
849
+ ...output,
850
+ body: await parseErrorBody(output.body, context),
851
+ };
852
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
853
+ switch (errorCode) {
854
+ case "AccessDeniedException":
855
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
856
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
857
+ case "ConflictException":
858
+ case "com.amazonaws.codecatalyst#ConflictException":
859
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
860
+ case "ResourceNotFoundException":
861
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
862
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
863
+ case "ServiceQuotaExceededException":
864
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
865
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
866
+ case "ThrottlingException":
867
+ case "com.amazonaws.codecatalyst#ThrottlingException":
868
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
869
+ case "ValidationException":
870
+ case "com.amazonaws.codecatalyst#ValidationException":
871
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
872
+ default:
873
+ const parsedBody = parsedOutput.body;
874
+ (0, smithy_client_1.throwDefaultError)({
875
+ output,
876
+ parsedBody,
877
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
878
+ errorCode,
879
+ });
880
+ }
881
+ };
882
+ const deserializeAws_restJson1GetDevEnvironmentCommand = async (output, context) => {
883
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
884
+ return deserializeAws_restJson1GetDevEnvironmentCommandError(output, context);
885
+ }
886
+ const contents = map({
887
+ $metadata: deserializeMetadata(output),
888
+ });
889
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
890
+ if (data.alias != null) {
891
+ contents.alias = (0, smithy_client_1.expectString)(data.alias);
892
+ }
893
+ if (data.creatorId != null) {
894
+ contents.creatorId = (0, smithy_client_1.expectString)(data.creatorId);
895
+ }
896
+ if (data.id != null) {
897
+ contents.id = (0, smithy_client_1.expectString)(data.id);
898
+ }
899
+ if (data.ides != null) {
900
+ contents.ides = deserializeAws_restJson1Ides(data.ides, context);
901
+ }
902
+ if (data.inactivityTimeoutMinutes != null) {
903
+ contents.inactivityTimeoutMinutes = (0, smithy_client_1.expectInt32)(data.inactivityTimeoutMinutes);
904
+ }
905
+ if (data.instanceType != null) {
906
+ contents.instanceType = (0, smithy_client_1.expectString)(data.instanceType);
907
+ }
908
+ if (data.lastUpdatedTime != null) {
909
+ contents.lastUpdatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.lastUpdatedTime));
910
+ }
911
+ if (data.persistentStorage != null) {
912
+ contents.persistentStorage = deserializeAws_restJson1PersistentStorage(data.persistentStorage, context);
913
+ }
914
+ if (data.projectName != null) {
915
+ contents.projectName = (0, smithy_client_1.expectString)(data.projectName);
916
+ }
917
+ if (data.repositories != null) {
918
+ contents.repositories = deserializeAws_restJson1DevEnvironmentRepositorySummaries(data.repositories, context);
919
+ }
920
+ if (data.spaceName != null) {
921
+ contents.spaceName = (0, smithy_client_1.expectString)(data.spaceName);
922
+ }
923
+ if (data.status != null) {
924
+ contents.status = (0, smithy_client_1.expectString)(data.status);
925
+ }
926
+ if (data.statusReason != null) {
927
+ contents.statusReason = (0, smithy_client_1.expectString)(data.statusReason);
928
+ }
929
+ return contents;
930
+ };
931
+ exports.deserializeAws_restJson1GetDevEnvironmentCommand = deserializeAws_restJson1GetDevEnvironmentCommand;
932
+ const deserializeAws_restJson1GetDevEnvironmentCommandError = async (output, context) => {
933
+ const parsedOutput = {
934
+ ...output,
935
+ body: await parseErrorBody(output.body, context),
936
+ };
937
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
938
+ switch (errorCode) {
939
+ case "AccessDeniedException":
940
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
941
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
942
+ case "ConflictException":
943
+ case "com.amazonaws.codecatalyst#ConflictException":
944
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
945
+ case "ResourceNotFoundException":
946
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
947
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
948
+ case "ServiceQuotaExceededException":
949
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
950
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
951
+ case "ThrottlingException":
952
+ case "com.amazonaws.codecatalyst#ThrottlingException":
953
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
954
+ case "ValidationException":
955
+ case "com.amazonaws.codecatalyst#ValidationException":
956
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
957
+ default:
958
+ const parsedBody = parsedOutput.body;
959
+ (0, smithy_client_1.throwDefaultError)({
960
+ output,
961
+ parsedBody,
962
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
963
+ errorCode,
964
+ });
965
+ }
966
+ };
967
+ const deserializeAws_restJson1GetProjectCommand = async (output, context) => {
968
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
969
+ return deserializeAws_restJson1GetProjectCommandError(output, context);
970
+ }
971
+ const contents = map({
972
+ $metadata: deserializeMetadata(output),
973
+ });
974
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
975
+ if (data.description != null) {
976
+ contents.description = (0, smithy_client_1.expectString)(data.description);
977
+ }
978
+ if (data.displayName != null) {
979
+ contents.displayName = (0, smithy_client_1.expectString)(data.displayName);
980
+ }
981
+ if (data.name != null) {
982
+ contents.name = (0, smithy_client_1.expectString)(data.name);
983
+ }
984
+ if (data.spaceName != null) {
985
+ contents.spaceName = (0, smithy_client_1.expectString)(data.spaceName);
986
+ }
987
+ return contents;
988
+ };
989
+ exports.deserializeAws_restJson1GetProjectCommand = deserializeAws_restJson1GetProjectCommand;
990
+ const deserializeAws_restJson1GetProjectCommandError = async (output, context) => {
991
+ const parsedOutput = {
992
+ ...output,
993
+ body: await parseErrorBody(output.body, context),
994
+ };
995
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
996
+ switch (errorCode) {
997
+ case "AccessDeniedException":
998
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
999
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1000
+ case "ConflictException":
1001
+ case "com.amazonaws.codecatalyst#ConflictException":
1002
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1003
+ case "ResourceNotFoundException":
1004
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1005
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1006
+ case "ServiceQuotaExceededException":
1007
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1008
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1009
+ case "ThrottlingException":
1010
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1011
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1012
+ case "ValidationException":
1013
+ case "com.amazonaws.codecatalyst#ValidationException":
1014
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1015
+ default:
1016
+ const parsedBody = parsedOutput.body;
1017
+ (0, smithy_client_1.throwDefaultError)({
1018
+ output,
1019
+ parsedBody,
1020
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1021
+ errorCode,
1022
+ });
1023
+ }
1024
+ };
1025
+ const deserializeAws_restJson1GetSourceRepositoryCloneUrlsCommand = async (output, context) => {
1026
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1027
+ return deserializeAws_restJson1GetSourceRepositoryCloneUrlsCommandError(output, context);
1028
+ }
1029
+ const contents = map({
1030
+ $metadata: deserializeMetadata(output),
1031
+ });
1032
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1033
+ if (data.https != null) {
1034
+ contents.https = (0, smithy_client_1.expectString)(data.https);
1035
+ }
1036
+ return contents;
1037
+ };
1038
+ exports.deserializeAws_restJson1GetSourceRepositoryCloneUrlsCommand = deserializeAws_restJson1GetSourceRepositoryCloneUrlsCommand;
1039
+ const deserializeAws_restJson1GetSourceRepositoryCloneUrlsCommandError = async (output, context) => {
1040
+ const parsedOutput = {
1041
+ ...output,
1042
+ body: await parseErrorBody(output.body, context),
1043
+ };
1044
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1045
+ switch (errorCode) {
1046
+ case "AccessDeniedException":
1047
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
1048
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1049
+ case "ConflictException":
1050
+ case "com.amazonaws.codecatalyst#ConflictException":
1051
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1052
+ case "ResourceNotFoundException":
1053
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1054
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1055
+ case "ServiceQuotaExceededException":
1056
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1057
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1058
+ case "ThrottlingException":
1059
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1060
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1061
+ case "ValidationException":
1062
+ case "com.amazonaws.codecatalyst#ValidationException":
1063
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1064
+ default:
1065
+ const parsedBody = parsedOutput.body;
1066
+ (0, smithy_client_1.throwDefaultError)({
1067
+ output,
1068
+ parsedBody,
1069
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1070
+ errorCode,
1071
+ });
1072
+ }
1073
+ };
1074
+ const deserializeAws_restJson1GetSpaceCommand = async (output, context) => {
1075
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1076
+ return deserializeAws_restJson1GetSpaceCommandError(output, context);
1077
+ }
1078
+ const contents = map({
1079
+ $metadata: deserializeMetadata(output),
1080
+ });
1081
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1082
+ if (data.description != null) {
1083
+ contents.description = (0, smithy_client_1.expectString)(data.description);
1084
+ }
1085
+ if (data.displayName != null) {
1086
+ contents.displayName = (0, smithy_client_1.expectString)(data.displayName);
1087
+ }
1088
+ if (data.name != null) {
1089
+ contents.name = (0, smithy_client_1.expectString)(data.name);
1090
+ }
1091
+ if (data.regionName != null) {
1092
+ contents.regionName = (0, smithy_client_1.expectString)(data.regionName);
1093
+ }
1094
+ return contents;
1095
+ };
1096
+ exports.deserializeAws_restJson1GetSpaceCommand = deserializeAws_restJson1GetSpaceCommand;
1097
+ const deserializeAws_restJson1GetSpaceCommandError = async (output, context) => {
1098
+ const parsedOutput = {
1099
+ ...output,
1100
+ body: await parseErrorBody(output.body, context),
1101
+ };
1102
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1103
+ switch (errorCode) {
1104
+ case "AccessDeniedException":
1105
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
1106
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1107
+ case "ConflictException":
1108
+ case "com.amazonaws.codecatalyst#ConflictException":
1109
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1110
+ case "ResourceNotFoundException":
1111
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1112
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1113
+ case "ServiceQuotaExceededException":
1114
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1115
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1116
+ case "ThrottlingException":
1117
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1118
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1119
+ case "ValidationException":
1120
+ case "com.amazonaws.codecatalyst#ValidationException":
1121
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1122
+ default:
1123
+ const parsedBody = parsedOutput.body;
1124
+ (0, smithy_client_1.throwDefaultError)({
1125
+ output,
1126
+ parsedBody,
1127
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1128
+ errorCode,
1129
+ });
1130
+ }
1131
+ };
1132
+ const deserializeAws_restJson1GetSubscriptionCommand = async (output, context) => {
1133
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1134
+ return deserializeAws_restJson1GetSubscriptionCommandError(output, context);
1135
+ }
1136
+ const contents = map({
1137
+ $metadata: deserializeMetadata(output),
1138
+ });
1139
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1140
+ if (data.awsAccountName != null) {
1141
+ contents.awsAccountName = (0, smithy_client_1.expectString)(data.awsAccountName);
1142
+ }
1143
+ if (data.subscriptionType != null) {
1144
+ contents.subscriptionType = (0, smithy_client_1.expectString)(data.subscriptionType);
1145
+ }
1146
+ return contents;
1147
+ };
1148
+ exports.deserializeAws_restJson1GetSubscriptionCommand = deserializeAws_restJson1GetSubscriptionCommand;
1149
+ const deserializeAws_restJson1GetSubscriptionCommandError = async (output, context) => {
1150
+ const parsedOutput = {
1151
+ ...output,
1152
+ body: await parseErrorBody(output.body, context),
1153
+ };
1154
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1155
+ switch (errorCode) {
1156
+ case "AccessDeniedException":
1157
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
1158
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1159
+ case "ConflictException":
1160
+ case "com.amazonaws.codecatalyst#ConflictException":
1161
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1162
+ case "ResourceNotFoundException":
1163
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1164
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1165
+ case "ServiceQuotaExceededException":
1166
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1167
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1168
+ case "ThrottlingException":
1169
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1170
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1171
+ case "ValidationException":
1172
+ case "com.amazonaws.codecatalyst#ValidationException":
1173
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1174
+ default:
1175
+ const parsedBody = parsedOutput.body;
1176
+ (0, smithy_client_1.throwDefaultError)({
1177
+ output,
1178
+ parsedBody,
1179
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1180
+ errorCode,
1181
+ });
1182
+ }
1183
+ };
1184
+ const deserializeAws_restJson1GetUserDetailsCommand = async (output, context) => {
1185
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1186
+ return deserializeAws_restJson1GetUserDetailsCommandError(output, context);
1187
+ }
1188
+ const contents = map({
1189
+ $metadata: deserializeMetadata(output),
1190
+ });
1191
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1192
+ if (data.displayName != null) {
1193
+ contents.displayName = (0, smithy_client_1.expectString)(data.displayName);
1194
+ }
1195
+ if (data.primaryEmail != null) {
1196
+ contents.primaryEmail = deserializeAws_restJson1EmailAddress(data.primaryEmail, context);
1197
+ }
1198
+ if (data.userId != null) {
1199
+ contents.userId = (0, smithy_client_1.expectString)(data.userId);
1200
+ }
1201
+ if (data.userName != null) {
1202
+ contents.userName = (0, smithy_client_1.expectString)(data.userName);
1203
+ }
1204
+ if (data.version != null) {
1205
+ contents.version = (0, smithy_client_1.expectString)(data.version);
1206
+ }
1207
+ return contents;
1208
+ };
1209
+ exports.deserializeAws_restJson1GetUserDetailsCommand = deserializeAws_restJson1GetUserDetailsCommand;
1210
+ const deserializeAws_restJson1GetUserDetailsCommandError = async (output, context) => {
1211
+ const parsedOutput = {
1212
+ ...output,
1213
+ body: await parseErrorBody(output.body, context),
1214
+ };
1215
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1216
+ switch (errorCode) {
1217
+ case "AccessDeniedException":
1218
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
1219
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1220
+ case "ConflictException":
1221
+ case "com.amazonaws.codecatalyst#ConflictException":
1222
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1223
+ case "ResourceNotFoundException":
1224
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1225
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1226
+ case "ServiceQuotaExceededException":
1227
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1228
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1229
+ case "ThrottlingException":
1230
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1231
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1232
+ case "ValidationException":
1233
+ case "com.amazonaws.codecatalyst#ValidationException":
1234
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1235
+ default:
1236
+ const parsedBody = parsedOutput.body;
1237
+ (0, smithy_client_1.throwDefaultError)({
1238
+ output,
1239
+ parsedBody,
1240
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1241
+ errorCode,
1242
+ });
1243
+ }
1244
+ };
1245
+ const deserializeAws_restJson1ListAccessTokensCommand = async (output, context) => {
1246
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1247
+ return deserializeAws_restJson1ListAccessTokensCommandError(output, context);
1248
+ }
1249
+ const contents = map({
1250
+ $metadata: deserializeMetadata(output),
1251
+ });
1252
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1253
+ if (data.items != null) {
1254
+ contents.items = deserializeAws_restJson1AccessTokenSummaries(data.items, context);
1255
+ }
1256
+ if (data.nextToken != null) {
1257
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1258
+ }
1259
+ return contents;
1260
+ };
1261
+ exports.deserializeAws_restJson1ListAccessTokensCommand = deserializeAws_restJson1ListAccessTokensCommand;
1262
+ const deserializeAws_restJson1ListAccessTokensCommandError = async (output, context) => {
1263
+ const parsedOutput = {
1264
+ ...output,
1265
+ body: await parseErrorBody(output.body, context),
1266
+ };
1267
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1268
+ switch (errorCode) {
1269
+ case "AccessDeniedException":
1270
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
1271
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1272
+ case "ConflictException":
1273
+ case "com.amazonaws.codecatalyst#ConflictException":
1274
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1275
+ case "ResourceNotFoundException":
1276
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1277
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1278
+ case "ServiceQuotaExceededException":
1279
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1280
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1281
+ case "ThrottlingException":
1282
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1283
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1284
+ case "ValidationException":
1285
+ case "com.amazonaws.codecatalyst#ValidationException":
1286
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1287
+ default:
1288
+ const parsedBody = parsedOutput.body;
1289
+ (0, smithy_client_1.throwDefaultError)({
1290
+ output,
1291
+ parsedBody,
1292
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1293
+ errorCode,
1294
+ });
1295
+ }
1296
+ };
1297
+ const deserializeAws_restJson1ListDevEnvironmentsCommand = async (output, context) => {
1298
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1299
+ return deserializeAws_restJson1ListDevEnvironmentsCommandError(output, context);
1300
+ }
1301
+ const contents = map({
1302
+ $metadata: deserializeMetadata(output),
1303
+ });
1304
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1305
+ if (data.items != null) {
1306
+ contents.items = deserializeAws_restJson1DevEnvironmentSummaryList(data.items, context);
1307
+ }
1308
+ if (data.nextToken != null) {
1309
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1310
+ }
1311
+ return contents;
1312
+ };
1313
+ exports.deserializeAws_restJson1ListDevEnvironmentsCommand = deserializeAws_restJson1ListDevEnvironmentsCommand;
1314
+ const deserializeAws_restJson1ListDevEnvironmentsCommandError = async (output, context) => {
1315
+ const parsedOutput = {
1316
+ ...output,
1317
+ body: await parseErrorBody(output.body, context),
1318
+ };
1319
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1320
+ switch (errorCode) {
1321
+ case "AccessDeniedException":
1322
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
1323
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1324
+ case "ConflictException":
1325
+ case "com.amazonaws.codecatalyst#ConflictException":
1326
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1327
+ case "ResourceNotFoundException":
1328
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1329
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1330
+ case "ServiceQuotaExceededException":
1331
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1332
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1333
+ case "ThrottlingException":
1334
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1335
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1336
+ case "ValidationException":
1337
+ case "com.amazonaws.codecatalyst#ValidationException":
1338
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1339
+ default:
1340
+ const parsedBody = parsedOutput.body;
1341
+ (0, smithy_client_1.throwDefaultError)({
1342
+ output,
1343
+ parsedBody,
1344
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1345
+ errorCode,
1346
+ });
1347
+ }
1348
+ };
1349
+ const deserializeAws_restJson1ListEventLogsCommand = async (output, context) => {
1350
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1351
+ return deserializeAws_restJson1ListEventLogsCommandError(output, context);
1352
+ }
1353
+ const contents = map({
1354
+ $metadata: deserializeMetadata(output),
1355
+ });
1356
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1357
+ if (data.items != null) {
1358
+ contents.items = deserializeAws_restJson1EventLogEntries(data.items, context);
1359
+ }
1360
+ if (data.nextToken != null) {
1361
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1362
+ }
1363
+ return contents;
1364
+ };
1365
+ exports.deserializeAws_restJson1ListEventLogsCommand = deserializeAws_restJson1ListEventLogsCommand;
1366
+ const deserializeAws_restJson1ListEventLogsCommandError = async (output, context) => {
1367
+ const parsedOutput = {
1368
+ ...output,
1369
+ body: await parseErrorBody(output.body, context),
1370
+ };
1371
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1372
+ switch (errorCode) {
1373
+ case "AccessDeniedException":
1374
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
1375
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1376
+ case "ConflictException":
1377
+ case "com.amazonaws.codecatalyst#ConflictException":
1378
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1379
+ case "ResourceNotFoundException":
1380
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1381
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1382
+ case "ServiceQuotaExceededException":
1383
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1384
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1385
+ case "ThrottlingException":
1386
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1387
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1388
+ case "ValidationException":
1389
+ case "com.amazonaws.codecatalyst#ValidationException":
1390
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1391
+ default:
1392
+ const parsedBody = parsedOutput.body;
1393
+ (0, smithy_client_1.throwDefaultError)({
1394
+ output,
1395
+ parsedBody,
1396
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1397
+ errorCode,
1398
+ });
1399
+ }
1400
+ };
1401
+ const deserializeAws_restJson1ListProjectsCommand = async (output, context) => {
1402
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1403
+ return deserializeAws_restJson1ListProjectsCommandError(output, context);
1404
+ }
1405
+ const contents = map({
1406
+ $metadata: deserializeMetadata(output),
1407
+ });
1408
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1409
+ if (data.items != null) {
1410
+ contents.items = deserializeAws_restJson1ProjectSummaries(data.items, context);
1411
+ }
1412
+ if (data.nextToken != null) {
1413
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1414
+ }
1415
+ return contents;
1416
+ };
1417
+ exports.deserializeAws_restJson1ListProjectsCommand = deserializeAws_restJson1ListProjectsCommand;
1418
+ const deserializeAws_restJson1ListProjectsCommandError = async (output, context) => {
1419
+ const parsedOutput = {
1420
+ ...output,
1421
+ body: await parseErrorBody(output.body, context),
1422
+ };
1423
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1424
+ switch (errorCode) {
1425
+ case "AccessDeniedException":
1426
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
1427
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1428
+ case "ConflictException":
1429
+ case "com.amazonaws.codecatalyst#ConflictException":
1430
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1431
+ case "ResourceNotFoundException":
1432
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1433
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1434
+ case "ServiceQuotaExceededException":
1435
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1436
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1437
+ case "ThrottlingException":
1438
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1439
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1440
+ case "ValidationException":
1441
+ case "com.amazonaws.codecatalyst#ValidationException":
1442
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1443
+ default:
1444
+ const parsedBody = parsedOutput.body;
1445
+ (0, smithy_client_1.throwDefaultError)({
1446
+ output,
1447
+ parsedBody,
1448
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1449
+ errorCode,
1450
+ });
1451
+ }
1452
+ };
1453
+ const deserializeAws_restJson1ListSourceRepositoriesCommand = async (output, context) => {
1454
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1455
+ return deserializeAws_restJson1ListSourceRepositoriesCommandError(output, context);
1456
+ }
1457
+ const contents = map({
1458
+ $metadata: deserializeMetadata(output),
1459
+ });
1460
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1461
+ if (data.items != null) {
1462
+ contents.items = deserializeAws_restJson1ListSourceRepositoriesItems(data.items, context);
1463
+ }
1464
+ if (data.nextToken != null) {
1465
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1466
+ }
1467
+ return contents;
1468
+ };
1469
+ exports.deserializeAws_restJson1ListSourceRepositoriesCommand = deserializeAws_restJson1ListSourceRepositoriesCommand;
1470
+ const deserializeAws_restJson1ListSourceRepositoriesCommandError = async (output, context) => {
1471
+ const parsedOutput = {
1472
+ ...output,
1473
+ body: await parseErrorBody(output.body, context),
1474
+ };
1475
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1476
+ switch (errorCode) {
1477
+ case "AccessDeniedException":
1478
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
1479
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1480
+ case "ConflictException":
1481
+ case "com.amazonaws.codecatalyst#ConflictException":
1482
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1483
+ case "ResourceNotFoundException":
1484
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1485
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1486
+ case "ServiceQuotaExceededException":
1487
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1488
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1489
+ case "ThrottlingException":
1490
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1491
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1492
+ case "ValidationException":
1493
+ case "com.amazonaws.codecatalyst#ValidationException":
1494
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1495
+ default:
1496
+ const parsedBody = parsedOutput.body;
1497
+ (0, smithy_client_1.throwDefaultError)({
1498
+ output,
1499
+ parsedBody,
1500
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1501
+ errorCode,
1502
+ });
1503
+ }
1504
+ };
1505
+ const deserializeAws_restJson1ListSourceRepositoryBranchesCommand = async (output, context) => {
1506
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1507
+ return deserializeAws_restJson1ListSourceRepositoryBranchesCommandError(output, context);
1508
+ }
1509
+ const contents = map({
1510
+ $metadata: deserializeMetadata(output),
1511
+ });
1512
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1513
+ if (data.items != null) {
1514
+ contents.items = deserializeAws_restJson1ListSourceRepositoryBranchesItems(data.items, context);
1515
+ }
1516
+ if (data.nextToken != null) {
1517
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1518
+ }
1519
+ return contents;
1520
+ };
1521
+ exports.deserializeAws_restJson1ListSourceRepositoryBranchesCommand = deserializeAws_restJson1ListSourceRepositoryBranchesCommand;
1522
+ const deserializeAws_restJson1ListSourceRepositoryBranchesCommandError = async (output, context) => {
1523
+ const parsedOutput = {
1524
+ ...output,
1525
+ body: await parseErrorBody(output.body, context),
1526
+ };
1527
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1528
+ switch (errorCode) {
1529
+ case "AccessDeniedException":
1530
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
1531
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1532
+ case "ConflictException":
1533
+ case "com.amazonaws.codecatalyst#ConflictException":
1534
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1535
+ case "ResourceNotFoundException":
1536
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1537
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1538
+ case "ServiceQuotaExceededException":
1539
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1540
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1541
+ case "ThrottlingException":
1542
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1543
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1544
+ case "ValidationException":
1545
+ case "com.amazonaws.codecatalyst#ValidationException":
1546
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1547
+ default:
1548
+ const parsedBody = parsedOutput.body;
1549
+ (0, smithy_client_1.throwDefaultError)({
1550
+ output,
1551
+ parsedBody,
1552
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1553
+ errorCode,
1554
+ });
1555
+ }
1556
+ };
1557
+ const deserializeAws_restJson1ListSpacesCommand = async (output, context) => {
1558
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1559
+ return deserializeAws_restJson1ListSpacesCommandError(output, context);
1560
+ }
1561
+ const contents = map({
1562
+ $metadata: deserializeMetadata(output),
1563
+ });
1564
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1565
+ if (data.items != null) {
1566
+ contents.items = deserializeAws_restJson1SpaceSummaries(data.items, context);
1567
+ }
1568
+ if (data.nextToken != null) {
1569
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1570
+ }
1571
+ return contents;
1572
+ };
1573
+ exports.deserializeAws_restJson1ListSpacesCommand = deserializeAws_restJson1ListSpacesCommand;
1574
+ const deserializeAws_restJson1ListSpacesCommandError = async (output, context) => {
1575
+ const parsedOutput = {
1576
+ ...output,
1577
+ body: await parseErrorBody(output.body, context),
1578
+ };
1579
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1580
+ switch (errorCode) {
1581
+ case "AccessDeniedException":
1582
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
1583
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1584
+ case "ConflictException":
1585
+ case "com.amazonaws.codecatalyst#ConflictException":
1586
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1587
+ case "ResourceNotFoundException":
1588
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1589
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1590
+ case "ServiceQuotaExceededException":
1591
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1592
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1593
+ case "ThrottlingException":
1594
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1595
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1596
+ case "ValidationException":
1597
+ case "com.amazonaws.codecatalyst#ValidationException":
1598
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1599
+ default:
1600
+ const parsedBody = parsedOutput.body;
1601
+ (0, smithy_client_1.throwDefaultError)({
1602
+ output,
1603
+ parsedBody,
1604
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1605
+ errorCode,
1606
+ });
1607
+ }
1608
+ };
1609
+ const deserializeAws_restJson1StartDevEnvironmentCommand = async (output, context) => {
1610
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1611
+ return deserializeAws_restJson1StartDevEnvironmentCommandError(output, context);
1612
+ }
1613
+ const contents = map({
1614
+ $metadata: deserializeMetadata(output),
1615
+ });
1616
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1617
+ if (data.id != null) {
1618
+ contents.id = (0, smithy_client_1.expectString)(data.id);
1619
+ }
1620
+ if (data.projectName != null) {
1621
+ contents.projectName = (0, smithy_client_1.expectString)(data.projectName);
1622
+ }
1623
+ if (data.spaceName != null) {
1624
+ contents.spaceName = (0, smithy_client_1.expectString)(data.spaceName);
1625
+ }
1626
+ if (data.status != null) {
1627
+ contents.status = (0, smithy_client_1.expectString)(data.status);
1628
+ }
1629
+ return contents;
1630
+ };
1631
+ exports.deserializeAws_restJson1StartDevEnvironmentCommand = deserializeAws_restJson1StartDevEnvironmentCommand;
1632
+ const deserializeAws_restJson1StartDevEnvironmentCommandError = async (output, context) => {
1633
+ const parsedOutput = {
1634
+ ...output,
1635
+ body: await parseErrorBody(output.body, context),
1636
+ };
1637
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1638
+ switch (errorCode) {
1639
+ case "AccessDeniedException":
1640
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
1641
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1642
+ case "ConflictException":
1643
+ case "com.amazonaws.codecatalyst#ConflictException":
1644
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1645
+ case "ResourceNotFoundException":
1646
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1647
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1648
+ case "ServiceQuotaExceededException":
1649
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1650
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1651
+ case "ThrottlingException":
1652
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1653
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1654
+ case "ValidationException":
1655
+ case "com.amazonaws.codecatalyst#ValidationException":
1656
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1657
+ default:
1658
+ const parsedBody = parsedOutput.body;
1659
+ (0, smithy_client_1.throwDefaultError)({
1660
+ output,
1661
+ parsedBody,
1662
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1663
+ errorCode,
1664
+ });
1665
+ }
1666
+ };
1667
+ const deserializeAws_restJson1StartDevEnvironmentSessionCommand = async (output, context) => {
1668
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1669
+ return deserializeAws_restJson1StartDevEnvironmentSessionCommandError(output, context);
1670
+ }
1671
+ const contents = map({
1672
+ $metadata: deserializeMetadata(output),
1673
+ });
1674
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1675
+ if (data.accessDetails != null) {
1676
+ contents.accessDetails = deserializeAws_restJson1DevEnvironmentAccessDetails(data.accessDetails, context);
1677
+ }
1678
+ if (data.id != null) {
1679
+ contents.id = (0, smithy_client_1.expectString)(data.id);
1680
+ }
1681
+ if (data.projectName != null) {
1682
+ contents.projectName = (0, smithy_client_1.expectString)(data.projectName);
1683
+ }
1684
+ if (data.sessionId != null) {
1685
+ contents.sessionId = (0, smithy_client_1.expectString)(data.sessionId);
1686
+ }
1687
+ if (data.spaceName != null) {
1688
+ contents.spaceName = (0, smithy_client_1.expectString)(data.spaceName);
1689
+ }
1690
+ return contents;
1691
+ };
1692
+ exports.deserializeAws_restJson1StartDevEnvironmentSessionCommand = deserializeAws_restJson1StartDevEnvironmentSessionCommand;
1693
+ const deserializeAws_restJson1StartDevEnvironmentSessionCommandError = async (output, context) => {
1694
+ const parsedOutput = {
1695
+ ...output,
1696
+ body: await parseErrorBody(output.body, context),
1697
+ };
1698
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1699
+ switch (errorCode) {
1700
+ case "AccessDeniedException":
1701
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
1702
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1703
+ case "ConflictException":
1704
+ case "com.amazonaws.codecatalyst#ConflictException":
1705
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1706
+ case "ResourceNotFoundException":
1707
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1708
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1709
+ case "ServiceQuotaExceededException":
1710
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1711
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1712
+ case "ThrottlingException":
1713
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1714
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1715
+ case "ValidationException":
1716
+ case "com.amazonaws.codecatalyst#ValidationException":
1717
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1718
+ default:
1719
+ const parsedBody = parsedOutput.body;
1720
+ (0, smithy_client_1.throwDefaultError)({
1721
+ output,
1722
+ parsedBody,
1723
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1724
+ errorCode,
1725
+ });
1726
+ }
1727
+ };
1728
+ const deserializeAws_restJson1StopDevEnvironmentCommand = async (output, context) => {
1729
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1730
+ return deserializeAws_restJson1StopDevEnvironmentCommandError(output, context);
1731
+ }
1732
+ const contents = map({
1733
+ $metadata: deserializeMetadata(output),
1734
+ });
1735
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1736
+ if (data.id != null) {
1737
+ contents.id = (0, smithy_client_1.expectString)(data.id);
1738
+ }
1739
+ if (data.projectName != null) {
1740
+ contents.projectName = (0, smithy_client_1.expectString)(data.projectName);
1741
+ }
1742
+ if (data.spaceName != null) {
1743
+ contents.spaceName = (0, smithy_client_1.expectString)(data.spaceName);
1744
+ }
1745
+ if (data.status != null) {
1746
+ contents.status = (0, smithy_client_1.expectString)(data.status);
1747
+ }
1748
+ return contents;
1749
+ };
1750
+ exports.deserializeAws_restJson1StopDevEnvironmentCommand = deserializeAws_restJson1StopDevEnvironmentCommand;
1751
+ const deserializeAws_restJson1StopDevEnvironmentCommandError = async (output, context) => {
1752
+ const parsedOutput = {
1753
+ ...output,
1754
+ body: await parseErrorBody(output.body, context),
1755
+ };
1756
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1757
+ switch (errorCode) {
1758
+ case "AccessDeniedException":
1759
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
1760
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1761
+ case "ConflictException":
1762
+ case "com.amazonaws.codecatalyst#ConflictException":
1763
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1764
+ case "ResourceNotFoundException":
1765
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1766
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1767
+ case "ServiceQuotaExceededException":
1768
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1769
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1770
+ case "ThrottlingException":
1771
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1772
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1773
+ case "ValidationException":
1774
+ case "com.amazonaws.codecatalyst#ValidationException":
1775
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1776
+ default:
1777
+ const parsedBody = parsedOutput.body;
1778
+ (0, smithy_client_1.throwDefaultError)({
1779
+ output,
1780
+ parsedBody,
1781
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1782
+ errorCode,
1783
+ });
1784
+ }
1785
+ };
1786
+ const deserializeAws_restJson1UpdateDevEnvironmentCommand = async (output, context) => {
1787
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1788
+ return deserializeAws_restJson1UpdateDevEnvironmentCommandError(output, context);
1789
+ }
1790
+ const contents = map({
1791
+ $metadata: deserializeMetadata(output),
1792
+ });
1793
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1794
+ if (data.alias != null) {
1795
+ contents.alias = (0, smithy_client_1.expectString)(data.alias);
1796
+ }
1797
+ if (data.clientToken != null) {
1798
+ contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
1799
+ }
1800
+ if (data.id != null) {
1801
+ contents.id = (0, smithy_client_1.expectString)(data.id);
1802
+ }
1803
+ if (data.ides != null) {
1804
+ contents.ides = deserializeAws_restJson1IdeConfigurationList(data.ides, context);
1805
+ }
1806
+ if (data.inactivityTimeoutMinutes != null) {
1807
+ contents.inactivityTimeoutMinutes = (0, smithy_client_1.expectInt32)(data.inactivityTimeoutMinutes);
1808
+ }
1809
+ if (data.instanceType != null) {
1810
+ contents.instanceType = (0, smithy_client_1.expectString)(data.instanceType);
1811
+ }
1812
+ if (data.projectName != null) {
1813
+ contents.projectName = (0, smithy_client_1.expectString)(data.projectName);
1814
+ }
1815
+ if (data.spaceName != null) {
1816
+ contents.spaceName = (0, smithy_client_1.expectString)(data.spaceName);
1817
+ }
1818
+ return contents;
1819
+ };
1820
+ exports.deserializeAws_restJson1UpdateDevEnvironmentCommand = deserializeAws_restJson1UpdateDevEnvironmentCommand;
1821
+ const deserializeAws_restJson1UpdateDevEnvironmentCommandError = async (output, context) => {
1822
+ const parsedOutput = {
1823
+ ...output,
1824
+ body: await parseErrorBody(output.body, context),
1825
+ };
1826
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1827
+ switch (errorCode) {
1828
+ case "AccessDeniedException":
1829
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
1830
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1831
+ case "ConflictException":
1832
+ case "com.amazonaws.codecatalyst#ConflictException":
1833
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1834
+ case "ResourceNotFoundException":
1835
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1836
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1837
+ case "ServiceQuotaExceededException":
1838
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1839
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1840
+ case "ThrottlingException":
1841
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1842
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1843
+ case "ValidationException":
1844
+ case "com.amazonaws.codecatalyst#ValidationException":
1845
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1846
+ default:
1847
+ const parsedBody = parsedOutput.body;
1848
+ (0, smithy_client_1.throwDefaultError)({
1849
+ output,
1850
+ parsedBody,
1851
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1852
+ errorCode,
1853
+ });
1854
+ }
1855
+ };
1856
+ const deserializeAws_restJson1VerifySessionCommand = async (output, context) => {
1857
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1858
+ return deserializeAws_restJson1VerifySessionCommandError(output, context);
1859
+ }
1860
+ const contents = map({
1861
+ $metadata: deserializeMetadata(output),
1862
+ });
1863
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1864
+ if (data.identity != null) {
1865
+ contents.identity = (0, smithy_client_1.expectString)(data.identity);
1866
+ }
1867
+ return contents;
1868
+ };
1869
+ exports.deserializeAws_restJson1VerifySessionCommand = deserializeAws_restJson1VerifySessionCommand;
1870
+ const deserializeAws_restJson1VerifySessionCommandError = async (output, context) => {
1871
+ const parsedOutput = {
1872
+ ...output,
1873
+ body: await parseErrorBody(output.body, context),
1874
+ };
1875
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1876
+ switch (errorCode) {
1877
+ case "AccessDeniedException":
1878
+ case "com.amazonaws.codecatalyst#AccessDeniedException":
1879
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1880
+ case "ConflictException":
1881
+ case "com.amazonaws.codecatalyst#ConflictException":
1882
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1883
+ case "ResourceNotFoundException":
1884
+ case "com.amazonaws.codecatalyst#ResourceNotFoundException":
1885
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1886
+ case "ServiceQuotaExceededException":
1887
+ case "com.amazonaws.codecatalyst#ServiceQuotaExceededException":
1888
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1889
+ case "ThrottlingException":
1890
+ case "com.amazonaws.codecatalyst#ThrottlingException":
1891
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1892
+ case "ValidationException":
1893
+ case "com.amazonaws.codecatalyst#ValidationException":
1894
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1895
+ default:
1896
+ const parsedBody = parsedOutput.body;
1897
+ (0, smithy_client_1.throwDefaultError)({
1898
+ output,
1899
+ parsedBody,
1900
+ exceptionCtor: CodeCatalystServiceException_1.CodeCatalystServiceException,
1901
+ errorCode,
1902
+ });
1903
+ }
1904
+ };
1905
+ const map = smithy_client_1.map;
1906
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1907
+ const contents = map({});
1908
+ const data = parsedOutput.body;
1909
+ if (data.message != null) {
1910
+ contents.message = (0, smithy_client_1.expectString)(data.message);
1911
+ }
1912
+ const exception = new models_0_1.AccessDeniedException({
1913
+ $metadata: deserializeMetadata(parsedOutput),
1914
+ ...contents,
1915
+ });
1916
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1917
+ };
1918
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1919
+ const contents = map({});
1920
+ const data = parsedOutput.body;
1921
+ if (data.message != null) {
1922
+ contents.message = (0, smithy_client_1.expectString)(data.message);
1923
+ }
1924
+ const exception = new models_0_1.ConflictException({
1925
+ $metadata: deserializeMetadata(parsedOutput),
1926
+ ...contents,
1927
+ });
1928
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1929
+ };
1930
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1931
+ const contents = map({});
1932
+ const data = parsedOutput.body;
1933
+ if (data.message != null) {
1934
+ contents.message = (0, smithy_client_1.expectString)(data.message);
1935
+ }
1936
+ const exception = new models_0_1.ResourceNotFoundException({
1937
+ $metadata: deserializeMetadata(parsedOutput),
1938
+ ...contents,
1939
+ });
1940
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1941
+ };
1942
+ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
1943
+ const contents = map({});
1944
+ const data = parsedOutput.body;
1945
+ if (data.message != null) {
1946
+ contents.message = (0, smithy_client_1.expectString)(data.message);
1947
+ }
1948
+ const exception = new models_0_1.ServiceQuotaExceededException({
1949
+ $metadata: deserializeMetadata(parsedOutput),
1950
+ ...contents,
1951
+ });
1952
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1953
+ };
1954
+ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
1955
+ const contents = map({});
1956
+ const data = parsedOutput.body;
1957
+ if (data.message != null) {
1958
+ contents.message = (0, smithy_client_1.expectString)(data.message);
1959
+ }
1960
+ const exception = new models_0_1.ThrottlingException({
1961
+ $metadata: deserializeMetadata(parsedOutput),
1962
+ ...contents,
1963
+ });
1964
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1965
+ };
1966
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1967
+ const contents = map({});
1968
+ const data = parsedOutput.body;
1969
+ if (data.message != null) {
1970
+ contents.message = (0, smithy_client_1.expectString)(data.message);
1971
+ }
1972
+ const exception = new models_0_1.ValidationException({
1973
+ $metadata: deserializeMetadata(parsedOutput),
1974
+ ...contents,
1975
+ });
1976
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1977
+ };
1978
+ const serializeAws_restJson1DevEnvironmentSessionConfiguration = (input, context) => {
1979
+ return {
1980
+ ...(input.executeCommandSessionConfiguration != null && {
1981
+ executeCommandSessionConfiguration: serializeAws_restJson1ExecuteCommandSessionConfiguration(input.executeCommandSessionConfiguration, context),
1982
+ }),
1983
+ ...(input.sessionType != null && { sessionType: input.sessionType }),
1984
+ };
1985
+ };
1986
+ const serializeAws_restJson1ExecuteCommandSessionConfiguration = (input, context) => {
1987
+ return {
1988
+ ...(input.arguments != null && {
1989
+ arguments: serializeAws_restJson1ExecuteCommandSessionConfigurationArguments(input.arguments, context),
1990
+ }),
1991
+ ...(input.command != null && { command: input.command }),
1992
+ };
1993
+ };
1994
+ const serializeAws_restJson1ExecuteCommandSessionConfigurationArguments = (input, context) => {
1995
+ return input
1996
+ .filter((e) => e != null)
1997
+ .map((entry) => {
1998
+ return entry;
1999
+ });
2000
+ };
2001
+ const serializeAws_restJson1Filter = (input, context) => {
2002
+ return {
2003
+ ...(input.comparisonOperator != null && { comparisonOperator: input.comparisonOperator }),
2004
+ ...(input.key != null && { key: input.key }),
2005
+ ...(input.values != null && { values: serializeAws_restJson1StringList(input.values, context) }),
2006
+ };
2007
+ };
2008
+ const serializeAws_restJson1Filters = (input, context) => {
2009
+ return input
2010
+ .filter((e) => e != null)
2011
+ .map((entry) => {
2012
+ return serializeAws_restJson1Filter(entry, context);
2013
+ });
2014
+ };
2015
+ const serializeAws_restJson1IdeConfiguration = (input, context) => {
2016
+ return {
2017
+ ...(input.name != null && { name: input.name }),
2018
+ ...(input.runtime != null && { runtime: input.runtime }),
2019
+ };
2020
+ };
2021
+ const serializeAws_restJson1IdeConfigurationList = (input, context) => {
2022
+ return input
2023
+ .filter((e) => e != null)
2024
+ .map((entry) => {
2025
+ return serializeAws_restJson1IdeConfiguration(entry, context);
2026
+ });
2027
+ };
2028
+ const serializeAws_restJson1PersistentStorageConfiguration = (input, context) => {
2029
+ return {
2030
+ ...(input.sizeInGiB != null && { sizeInGiB: input.sizeInGiB }),
2031
+ };
2032
+ };
2033
+ const serializeAws_restJson1ProjectListFilter = (input, context) => {
2034
+ return {
2035
+ ...(input.comparisonOperator != null && { comparisonOperator: input.comparisonOperator }),
2036
+ ...(input.key != null && { key: input.key }),
2037
+ ...(input.values != null && { values: serializeAws_restJson1StringList(input.values, context) }),
2038
+ };
2039
+ };
2040
+ const serializeAws_restJson1ProjectListFilters = (input, context) => {
2041
+ return input
2042
+ .filter((e) => e != null)
2043
+ .map((entry) => {
2044
+ return serializeAws_restJson1ProjectListFilter(entry, context);
2045
+ });
2046
+ };
2047
+ const serializeAws_restJson1RepositoriesInput = (input, context) => {
2048
+ return input
2049
+ .filter((e) => e != null)
2050
+ .map((entry) => {
2051
+ return serializeAws_restJson1RepositoryInput(entry, context);
2052
+ });
2053
+ };
2054
+ const serializeAws_restJson1RepositoryInput = (input, context) => {
2055
+ return {
2056
+ ...(input.branchName != null && { branchName: input.branchName }),
2057
+ ...(input.repositoryName != null && { repositoryName: input.repositoryName }),
2058
+ };
2059
+ };
2060
+ const serializeAws_restJson1StringList = (input, context) => {
2061
+ return input
2062
+ .filter((e) => e != null)
2063
+ .map((entry) => {
2064
+ return entry;
2065
+ });
2066
+ };
2067
+ const deserializeAws_restJson1AccessTokenSummaries = (output, context) => {
2068
+ const retVal = (output || [])
2069
+ .filter((e) => e != null)
2070
+ .map((entry) => {
2071
+ if (entry === null) {
2072
+ return null;
2073
+ }
2074
+ return deserializeAws_restJson1AccessTokenSummary(entry, context);
2075
+ });
2076
+ return retVal;
2077
+ };
2078
+ const deserializeAws_restJson1AccessTokenSummary = (output, context) => {
2079
+ return {
2080
+ expiresTime: output.expiresTime != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.expiresTime)) : undefined,
2081
+ id: (0, smithy_client_1.expectString)(output.id),
2082
+ name: (0, smithy_client_1.expectString)(output.name),
2083
+ };
2084
+ };
2085
+ const deserializeAws_restJson1DevEnvironmentAccessDetails = (output, context) => {
2086
+ return {
2087
+ streamUrl: (0, smithy_client_1.expectString)(output.streamUrl),
2088
+ tokenValue: (0, smithy_client_1.expectString)(output.tokenValue),
2089
+ };
2090
+ };
2091
+ const deserializeAws_restJson1DevEnvironmentRepositorySummaries = (output, context) => {
2092
+ const retVal = (output || [])
2093
+ .filter((e) => e != null)
2094
+ .map((entry) => {
2095
+ if (entry === null) {
2096
+ return null;
2097
+ }
2098
+ return deserializeAws_restJson1DevEnvironmentRepositorySummary(entry, context);
2099
+ });
2100
+ return retVal;
2101
+ };
2102
+ const deserializeAws_restJson1DevEnvironmentRepositorySummary = (output, context) => {
2103
+ return {
2104
+ branchName: (0, smithy_client_1.expectString)(output.branchName),
2105
+ repositoryName: (0, smithy_client_1.expectString)(output.repositoryName),
2106
+ };
2107
+ };
2108
+ const deserializeAws_restJson1DevEnvironmentSummary = (output, context) => {
2109
+ return {
2110
+ alias: (0, smithy_client_1.expectString)(output.alias),
2111
+ creatorId: (0, smithy_client_1.expectString)(output.creatorId),
2112
+ id: (0, smithy_client_1.expectString)(output.id),
2113
+ ides: output.ides != null ? deserializeAws_restJson1Ides(output.ides, context) : undefined,
2114
+ inactivityTimeoutMinutes: (0, smithy_client_1.expectInt32)(output.inactivityTimeoutMinutes),
2115
+ instanceType: (0, smithy_client_1.expectString)(output.instanceType),
2116
+ lastUpdatedTime: output.lastUpdatedTime != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.lastUpdatedTime)) : undefined,
2117
+ persistentStorage: output.persistentStorage != null
2118
+ ? deserializeAws_restJson1PersistentStorage(output.persistentStorage, context)
2119
+ : undefined,
2120
+ projectName: (0, smithy_client_1.expectString)(output.projectName),
2121
+ repositories: output.repositories != null
2122
+ ? deserializeAws_restJson1DevEnvironmentRepositorySummaries(output.repositories, context)
2123
+ : undefined,
2124
+ spaceName: (0, smithy_client_1.expectString)(output.spaceName),
2125
+ status: (0, smithy_client_1.expectString)(output.status),
2126
+ statusReason: (0, smithy_client_1.expectString)(output.statusReason),
2127
+ };
2128
+ };
2129
+ const deserializeAws_restJson1DevEnvironmentSummaryList = (output, context) => {
2130
+ const retVal = (output || [])
2131
+ .filter((e) => e != null)
2132
+ .map((entry) => {
2133
+ if (entry === null) {
2134
+ return null;
2135
+ }
2136
+ return deserializeAws_restJson1DevEnvironmentSummary(entry, context);
2137
+ });
2138
+ return retVal;
2139
+ };
2140
+ const deserializeAws_restJson1EmailAddress = (output, context) => {
2141
+ return {
2142
+ email: (0, smithy_client_1.expectString)(output.email),
2143
+ verified: (0, smithy_client_1.expectBoolean)(output.verified),
2144
+ };
2145
+ };
2146
+ const deserializeAws_restJson1EventLogEntries = (output, context) => {
2147
+ const retVal = (output || [])
2148
+ .filter((e) => e != null)
2149
+ .map((entry) => {
2150
+ if (entry === null) {
2151
+ return null;
2152
+ }
2153
+ return deserializeAws_restJson1EventLogEntry(entry, context);
2154
+ });
2155
+ return retVal;
2156
+ };
2157
+ const deserializeAws_restJson1EventLogEntry = (output, context) => {
2158
+ return {
2159
+ errorCode: (0, smithy_client_1.expectString)(output.errorCode),
2160
+ eventCategory: (0, smithy_client_1.expectString)(output.eventCategory),
2161
+ eventName: (0, smithy_client_1.expectString)(output.eventName),
2162
+ eventSource: (0, smithy_client_1.expectString)(output.eventSource),
2163
+ eventTime: output.eventTime != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.eventTime)) : undefined,
2164
+ eventType: (0, smithy_client_1.expectString)(output.eventType),
2165
+ id: (0, smithy_client_1.expectString)(output.id),
2166
+ operationType: (0, smithy_client_1.expectString)(output.operationType),
2167
+ projectInformation: output.projectInformation != null
2168
+ ? deserializeAws_restJson1ProjectInformation(output.projectInformation, context)
2169
+ : undefined,
2170
+ requestId: (0, smithy_client_1.expectString)(output.requestId),
2171
+ requestPayload: output.requestPayload != null ? deserializeAws_restJson1EventPayload(output.requestPayload, context) : undefined,
2172
+ responsePayload: output.responsePayload != null
2173
+ ? deserializeAws_restJson1EventPayload(output.responsePayload, context)
2174
+ : undefined,
2175
+ sourceIpAddress: (0, smithy_client_1.expectString)(output.sourceIpAddress),
2176
+ userAgent: (0, smithy_client_1.expectString)(output.userAgent),
2177
+ userIdentity: output.userIdentity != null ? deserializeAws_restJson1UserIdentity(output.userIdentity, context) : undefined,
2178
+ };
2179
+ };
2180
+ const deserializeAws_restJson1EventPayload = (output, context) => {
2181
+ return {
2182
+ contentType: (0, smithy_client_1.expectString)(output.contentType),
2183
+ data: (0, smithy_client_1.expectString)(output.data),
2184
+ };
2185
+ };
2186
+ const deserializeAws_restJson1Ide = (output, context) => {
2187
+ return {
2188
+ name: (0, smithy_client_1.expectString)(output.name),
2189
+ runtime: (0, smithy_client_1.expectString)(output.runtime),
2190
+ };
2191
+ };
2192
+ const deserializeAws_restJson1IdeConfiguration = (output, context) => {
2193
+ return {
2194
+ name: (0, smithy_client_1.expectString)(output.name),
2195
+ runtime: (0, smithy_client_1.expectString)(output.runtime),
2196
+ };
2197
+ };
2198
+ const deserializeAws_restJson1IdeConfigurationList = (output, context) => {
2199
+ const retVal = (output || [])
2200
+ .filter((e) => e != null)
2201
+ .map((entry) => {
2202
+ if (entry === null) {
2203
+ return null;
2204
+ }
2205
+ return deserializeAws_restJson1IdeConfiguration(entry, context);
2206
+ });
2207
+ return retVal;
2208
+ };
2209
+ const deserializeAws_restJson1Ides = (output, context) => {
2210
+ const retVal = (output || [])
2211
+ .filter((e) => e != null)
2212
+ .map((entry) => {
2213
+ if (entry === null) {
2214
+ return null;
2215
+ }
2216
+ return deserializeAws_restJson1Ide(entry, context);
2217
+ });
2218
+ return retVal;
2219
+ };
2220
+ const deserializeAws_restJson1ListSourceRepositoriesItem = (output, context) => {
2221
+ return {
2222
+ createdTime: output.createdTime != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.createdTime)) : undefined,
2223
+ description: (0, smithy_client_1.expectString)(output.description),
2224
+ id: (0, smithy_client_1.expectString)(output.id),
2225
+ lastUpdatedTime: output.lastUpdatedTime != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.lastUpdatedTime)) : undefined,
2226
+ name: (0, smithy_client_1.expectString)(output.name),
2227
+ };
2228
+ };
2229
+ const deserializeAws_restJson1ListSourceRepositoriesItems = (output, context) => {
2230
+ const retVal = (output || [])
2231
+ .filter((e) => e != null)
2232
+ .map((entry) => {
2233
+ if (entry === null) {
2234
+ return null;
2235
+ }
2236
+ return deserializeAws_restJson1ListSourceRepositoriesItem(entry, context);
2237
+ });
2238
+ return retVal;
2239
+ };
2240
+ const deserializeAws_restJson1ListSourceRepositoryBranchesItem = (output, context) => {
2241
+ return {
2242
+ headCommitId: (0, smithy_client_1.expectString)(output.headCommitId),
2243
+ lastUpdatedTime: output.lastUpdatedTime != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.lastUpdatedTime)) : undefined,
2244
+ name: (0, smithy_client_1.expectString)(output.name),
2245
+ ref: (0, smithy_client_1.expectString)(output.ref),
2246
+ };
2247
+ };
2248
+ const deserializeAws_restJson1ListSourceRepositoryBranchesItems = (output, context) => {
2249
+ const retVal = (output || [])
2250
+ .filter((e) => e != null)
2251
+ .map((entry) => {
2252
+ if (entry === null) {
2253
+ return null;
2254
+ }
2255
+ return deserializeAws_restJson1ListSourceRepositoryBranchesItem(entry, context);
2256
+ });
2257
+ return retVal;
2258
+ };
2259
+ const deserializeAws_restJson1PersistentStorage = (output, context) => {
2260
+ return {
2261
+ sizeInGiB: (0, smithy_client_1.expectInt32)(output.sizeInGiB),
2262
+ };
2263
+ };
2264
+ const deserializeAws_restJson1ProjectInformation = (output, context) => {
2265
+ return {
2266
+ name: (0, smithy_client_1.expectString)(output.name),
2267
+ projectId: (0, smithy_client_1.expectString)(output.projectId),
2268
+ };
2269
+ };
2270
+ const deserializeAws_restJson1ProjectSummaries = (output, context) => {
2271
+ const retVal = (output || [])
2272
+ .filter((e) => e != null)
2273
+ .map((entry) => {
2274
+ if (entry === null) {
2275
+ return null;
2276
+ }
2277
+ return deserializeAws_restJson1ProjectSummary(entry, context);
2278
+ });
2279
+ return retVal;
2280
+ };
2281
+ const deserializeAws_restJson1ProjectSummary = (output, context) => {
2282
+ return {
2283
+ description: (0, smithy_client_1.expectString)(output.description),
2284
+ displayName: (0, smithy_client_1.expectString)(output.displayName),
2285
+ name: (0, smithy_client_1.expectString)(output.name),
2286
+ };
2287
+ };
2288
+ const deserializeAws_restJson1SpaceSummaries = (output, context) => {
2289
+ const retVal = (output || [])
2290
+ .filter((e) => e != null)
2291
+ .map((entry) => {
2292
+ if (entry === null) {
2293
+ return null;
2294
+ }
2295
+ return deserializeAws_restJson1SpaceSummary(entry, context);
2296
+ });
2297
+ return retVal;
2298
+ };
2299
+ const deserializeAws_restJson1SpaceSummary = (output, context) => {
2300
+ return {
2301
+ description: (0, smithy_client_1.expectString)(output.description),
2302
+ displayName: (0, smithy_client_1.expectString)(output.displayName),
2303
+ name: (0, smithy_client_1.expectString)(output.name),
2304
+ regionName: (0, smithy_client_1.expectString)(output.regionName),
2305
+ };
2306
+ };
2307
+ const deserializeAws_restJson1UserIdentity = (output, context) => {
2308
+ return {
2309
+ awsAccountId: (0, smithy_client_1.expectString)(output.awsAccountId),
2310
+ principalId: (0, smithy_client_1.expectString)(output.principalId),
2311
+ userName: (0, smithy_client_1.expectString)(output.userName),
2312
+ userType: (0, smithy_client_1.expectString)(output.userType),
2313
+ };
2314
+ };
2315
+ const deserializeMetadata = (output) => ({
2316
+ httpStatusCode: output.statusCode,
2317
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
2318
+ extendedRequestId: output.headers["x-amz-id-2"],
2319
+ cfId: output.headers["x-amz-cf-id"],
2320
+ });
2321
+ const collectBody = (streamBody = new Uint8Array(), context) => {
2322
+ if (streamBody instanceof Uint8Array) {
2323
+ return Promise.resolve(streamBody);
2324
+ }
2325
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2326
+ };
2327
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
2328
+ const isSerializableHeaderValue = (value) => value !== undefined &&
2329
+ value !== null &&
2330
+ value !== "" &&
2331
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2332
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2333
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
2334
+ if (encoded.length) {
2335
+ return JSON.parse(encoded);
2336
+ }
2337
+ return {};
2338
+ });
2339
+ const parseErrorBody = async (errorBody, context) => {
2340
+ const value = await parseBody(errorBody, context);
2341
+ value.message = value.message ?? value.Message;
2342
+ return value;
2343
+ };
2344
+ const loadRestJsonErrorCode = (output, data) => {
2345
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
2346
+ const sanitizeErrorCode = (rawValue) => {
2347
+ let cleanValue = rawValue;
2348
+ if (typeof cleanValue === "number") {
2349
+ cleanValue = cleanValue.toString();
2350
+ }
2351
+ if (cleanValue.indexOf(",") >= 0) {
2352
+ cleanValue = cleanValue.split(",")[0];
2353
+ }
2354
+ if (cleanValue.indexOf(":") >= 0) {
2355
+ cleanValue = cleanValue.split(":")[0];
2356
+ }
2357
+ if (cleanValue.indexOf("#") >= 0) {
2358
+ cleanValue = cleanValue.split("#")[1];
2359
+ }
2360
+ return cleanValue;
2361
+ };
2362
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
2363
+ if (headerKey !== undefined) {
2364
+ return sanitizeErrorCode(output.headers[headerKey]);
2365
+ }
2366
+ if (data.code !== undefined) {
2367
+ return sanitizeErrorCode(data.code);
2368
+ }
2369
+ if (data["__type"] !== undefined) {
2370
+ return sanitizeErrorCode(data["__type"]);
2371
+ }
2372
+ };