@daytonaio/sdk 0.7.1

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 (215) hide show
  1. package/LICENCE +43 -0
  2. package/README.md +181 -0
  3. package/dist/Daytona.d.ts +106 -0
  4. package/dist/Daytona.js +141 -0
  5. package/dist/FileSystem.d.ts +97 -0
  6. package/dist/FileSystem.js +126 -0
  7. package/dist/Git.d.ts +67 -0
  8. package/dist/Git.js +109 -0
  9. package/dist/LspServer.d.ts +68 -0
  10. package/dist/LspServer.js +93 -0
  11. package/dist/Process.d.ts +54 -0
  12. package/dist/Process.js +84 -0
  13. package/dist/Workspace.d.ts +53 -0
  14. package/dist/Workspace.js +51 -0
  15. package/dist/client/apis/ApiKeyApi.d.ts +54 -0
  16. package/dist/client/apis/ApiKeyApi.js +135 -0
  17. package/dist/client/apis/BuildApi.d.ts +95 -0
  18. package/dist/client/apis/BuildApi.js +228 -0
  19. package/dist/client/apis/ContainerRegistryApi.d.ts +68 -0
  20. package/dist/client/apis/ContainerRegistryApi.js +163 -0
  21. package/dist/client/apis/DefaultApi.d.ts +31 -0
  22. package/dist/client/apis/DefaultApi.js +72 -0
  23. package/dist/client/apis/GitProviderApi.d.ts +197 -0
  24. package/dist/client/apis/GitProviderApi.js +477 -0
  25. package/dist/client/apis/PrebuildApi.d.ts +97 -0
  26. package/dist/client/apis/PrebuildApi.js +241 -0
  27. package/dist/client/apis/ProfileApi.d.ts +51 -0
  28. package/dist/client/apis/ProfileApi.js +128 -0
  29. package/dist/client/apis/ProjectConfigApi.d.ts +94 -0
  30. package/dist/client/apis/ProjectConfigApi.js +220 -0
  31. package/dist/client/apis/ProviderApi.d.ts +71 -0
  32. package/dist/client/apis/ProviderApi.js +160 -0
  33. package/dist/client/apis/SampleApi.d.ts +28 -0
  34. package/dist/client/apis/SampleApi.js +73 -0
  35. package/dist/client/apis/ServerApi.d.ts +61 -0
  36. package/dist/client/apis/ServerApi.js +156 -0
  37. package/dist/client/apis/TargetApi.d.ts +67 -0
  38. package/dist/client/apis/TargetApi.js +159 -0
  39. package/dist/client/apis/WorkspaceApi.d.ts +141 -0
  40. package/dist/client/apis/WorkspaceApi.js +330 -0
  41. package/dist/client/apis/WorkspaceToolboxApi.d.ts +464 -0
  42. package/dist/client/apis/WorkspaceToolboxApi.js +1248 -0
  43. package/dist/client/apis/index.d.ts +14 -0
  44. package/dist/client/apis/index.js +32 -0
  45. package/dist/client/index.d.ts +3 -0
  46. package/dist/client/index.js +21 -0
  47. package/dist/client/models/ApiKey.d.ts +45 -0
  48. package/dist/client/models/ApiKey.js +60 -0
  49. package/dist/client/models/ApikeyApiKeyType.d.ts +26 -0
  50. package/dist/client/models/ApikeyApiKeyType.js +52 -0
  51. package/dist/client/models/Build.d.ts +98 -0
  52. package/dist/client/models/Build.js +91 -0
  53. package/dist/client/models/BuildBuildState.d.ts +31 -0
  54. package/dist/client/models/BuildBuildState.js +57 -0
  55. package/dist/client/models/BuildConfig.d.ts +40 -0
  56. package/dist/client/models/BuildConfig.js +57 -0
  57. package/dist/client/models/CachedBuild.d.ts +38 -0
  58. package/dist/client/models/CachedBuild.js +55 -0
  59. package/dist/client/models/CloneTarget.d.ts +25 -0
  60. package/dist/client/models/CloneTarget.js +51 -0
  61. package/dist/client/models/CompletionContext.d.ts +38 -0
  62. package/dist/client/models/CompletionContext.js +53 -0
  63. package/dist/client/models/CompletionItem.d.ts +68 -0
  64. package/dist/client/models/CompletionItem.js +63 -0
  65. package/dist/client/models/CompletionList.d.ts +39 -0
  66. package/dist/client/models/CompletionList.js +56 -0
  67. package/dist/client/models/ContainerConfig.d.ts +38 -0
  68. package/dist/client/models/ContainerConfig.js +55 -0
  69. package/dist/client/models/ContainerRegistry.d.ts +44 -0
  70. package/dist/client/models/ContainerRegistry.js +59 -0
  71. package/dist/client/models/CreateBuildDTO.d.ts +52 -0
  72. package/dist/client/models/CreateBuildDTO.js +62 -0
  73. package/dist/client/models/CreatePrebuildDTO.d.ts +56 -0
  74. package/dist/client/models/CreatePrebuildDTO.js +59 -0
  75. package/dist/client/models/CreateProjectConfigDTO.d.ts +71 -0
  76. package/dist/client/models/CreateProjectConfigDTO.js +72 -0
  77. package/dist/client/models/CreateProjectDTO.d.ts +72 -0
  78. package/dist/client/models/CreateProjectDTO.js +73 -0
  79. package/dist/client/models/CreateProjectSourceDTO.d.ts +33 -0
  80. package/dist/client/models/CreateProjectSourceDTO.js +52 -0
  81. package/dist/client/models/CreateProviderTargetDTO.d.ts +45 -0
  82. package/dist/client/models/CreateProviderTargetDTO.js +60 -0
  83. package/dist/client/models/CreateWorkspaceDTO.d.ts +51 -0
  84. package/dist/client/models/CreateWorkspaceDTO.js +64 -0
  85. package/dist/client/models/DevcontainerConfig.d.ts +32 -0
  86. package/dist/client/models/DevcontainerConfig.js +51 -0
  87. package/dist/client/models/ExecuteRequest.d.ts +38 -0
  88. package/dist/client/models/ExecuteRequest.js +53 -0
  89. package/dist/client/models/ExecuteResponse.d.ts +38 -0
  90. package/dist/client/models/ExecuteResponse.js +55 -0
  91. package/dist/client/models/FRPSConfig.d.ts +44 -0
  92. package/dist/client/models/FRPSConfig.js +59 -0
  93. package/dist/client/models/FileInfo.d.ts +74 -0
  94. package/dist/client/models/FileInfo.js +79 -0
  95. package/dist/client/models/FileStatus.d.ts +51 -0
  96. package/dist/client/models/FileStatus.js +64 -0
  97. package/dist/client/models/GetRepositoryContext.d.ts +80 -0
  98. package/dist/client/models/GetRepositoryContext.js +67 -0
  99. package/dist/client/models/GitAddRequest.d.ts +38 -0
  100. package/dist/client/models/GitAddRequest.js +55 -0
  101. package/dist/client/models/GitBranch.d.ts +38 -0
  102. package/dist/client/models/GitBranch.js +55 -0
  103. package/dist/client/models/GitBranchRequest.d.ts +38 -0
  104. package/dist/client/models/GitBranchRequest.js +55 -0
  105. package/dist/client/models/GitCloneRequest.d.ts +62 -0
  106. package/dist/client/models/GitCloneRequest.js +63 -0
  107. package/dist/client/models/GitCommitInfo.d.ts +56 -0
  108. package/dist/client/models/GitCommitInfo.js +67 -0
  109. package/dist/client/models/GitCommitRequest.d.ts +50 -0
  110. package/dist/client/models/GitCommitRequest.js +63 -0
  111. package/dist/client/models/GitCommitResponse.d.ts +32 -0
  112. package/dist/client/models/GitCommitResponse.js +51 -0
  113. package/dist/client/models/GitNamespace.d.ts +38 -0
  114. package/dist/client/models/GitNamespace.js +55 -0
  115. package/dist/client/models/GitProvider.d.ts +75 -0
  116. package/dist/client/models/GitProvider.js +76 -0
  117. package/dist/client/models/GitPullRequest.d.ts +68 -0
  118. package/dist/client/models/GitPullRequest.js +75 -0
  119. package/dist/client/models/GitRepoRequest.d.ts +44 -0
  120. package/dist/client/models/GitRepoRequest.js +55 -0
  121. package/dist/client/models/GitRepository.d.ts +87 -0
  122. package/dist/client/models/GitRepository.js +84 -0
  123. package/dist/client/models/GitStatus.d.ts +57 -0
  124. package/dist/client/models/GitStatus.js +62 -0
  125. package/dist/client/models/GitUser.d.ts +50 -0
  126. package/dist/client/models/GitUser.js +63 -0
  127. package/dist/client/models/InstallProviderRequest.d.ts +40 -0
  128. package/dist/client/models/InstallProviderRequest.js +55 -0
  129. package/dist/client/models/ListBranchResponse.d.ts +32 -0
  130. package/dist/client/models/ListBranchResponse.js +51 -0
  131. package/dist/client/models/LogFileConfig.d.ts +62 -0
  132. package/dist/client/models/LogFileConfig.js +67 -0
  133. package/dist/client/models/LspCompletionParams.d.ts +58 -0
  134. package/dist/client/models/LspCompletionParams.js +69 -0
  135. package/dist/client/models/LspDocumentRequest.d.ts +44 -0
  136. package/dist/client/models/LspDocumentRequest.js +59 -0
  137. package/dist/client/models/LspLocation.d.ts +39 -0
  138. package/dist/client/models/LspLocation.js +56 -0
  139. package/dist/client/models/LspPosition.d.ts +38 -0
  140. package/dist/client/models/LspPosition.js +55 -0
  141. package/dist/client/models/LspRange.d.ts +39 -0
  142. package/dist/client/models/LspRange.js +56 -0
  143. package/dist/client/models/LspServerRequest.d.ts +38 -0
  144. package/dist/client/models/LspServerRequest.js +55 -0
  145. package/dist/client/models/LspSymbol.d.ts +45 -0
  146. package/dist/client/models/LspSymbol.js +60 -0
  147. package/dist/client/models/Match.d.ts +44 -0
  148. package/dist/client/models/Match.js +59 -0
  149. package/dist/client/models/NetworkKey.d.ts +32 -0
  150. package/dist/client/models/NetworkKey.js +51 -0
  151. package/dist/client/models/Position.d.ts +38 -0
  152. package/dist/client/models/Position.js +55 -0
  153. package/dist/client/models/PrebuildConfig.d.ts +56 -0
  154. package/dist/client/models/PrebuildConfig.js +67 -0
  155. package/dist/client/models/PrebuildDTO.d.ts +62 -0
  156. package/dist/client/models/PrebuildDTO.js +68 -0
  157. package/dist/client/models/ProfileData.d.ts +34 -0
  158. package/dist/client/models/ProfileData.js +51 -0
  159. package/dist/client/models/Project.d.ts +91 -0
  160. package/dist/client/models/Project.js +88 -0
  161. package/dist/client/models/ProjectConfig.d.ts +84 -0
  162. package/dist/client/models/ProjectConfig.js +87 -0
  163. package/dist/client/models/ProjectDirResponse.d.ts +32 -0
  164. package/dist/client/models/ProjectDirResponse.js +49 -0
  165. package/dist/client/models/ProjectInfo.d.ts +56 -0
  166. package/dist/client/models/ProjectInfo.js +65 -0
  167. package/dist/client/models/ProjectState.d.ts +45 -0
  168. package/dist/client/models/ProjectState.js +60 -0
  169. package/dist/client/models/Provider.d.ts +44 -0
  170. package/dist/client/models/Provider.js +57 -0
  171. package/dist/client/models/ProviderProviderInfo.d.ts +44 -0
  172. package/dist/client/models/ProviderProviderInfo.js +57 -0
  173. package/dist/client/models/ProviderProviderTargetProperty.d.ts +72 -0
  174. package/dist/client/models/ProviderProviderTargetProperty.js +64 -0
  175. package/dist/client/models/ProviderProviderTargetPropertyType.d.ts +29 -0
  176. package/dist/client/models/ProviderProviderTargetPropertyType.js +55 -0
  177. package/dist/client/models/ProviderTarget.d.ts +51 -0
  178. package/dist/client/models/ProviderTarget.js +64 -0
  179. package/dist/client/models/ReplaceRequest.d.ts +44 -0
  180. package/dist/client/models/ReplaceRequest.js +59 -0
  181. package/dist/client/models/ReplaceResult.d.ts +44 -0
  182. package/dist/client/models/ReplaceResult.js +53 -0
  183. package/dist/client/models/RepositoryUrl.d.ts +32 -0
  184. package/dist/client/models/RepositoryUrl.js +51 -0
  185. package/dist/client/models/Sample.d.ts +44 -0
  186. package/dist/client/models/Sample.js +59 -0
  187. package/dist/client/models/SearchFilesResponse.d.ts +32 -0
  188. package/dist/client/models/SearchFilesResponse.js +51 -0
  189. package/dist/client/models/ServerConfig.d.ts +130 -0
  190. package/dist/client/models/ServerConfig.js +119 -0
  191. package/dist/client/models/SetGitProviderConfig.d.ts +75 -0
  192. package/dist/client/models/SetGitProviderConfig.js +70 -0
  193. package/dist/client/models/SetProjectState.d.ts +39 -0
  194. package/dist/client/models/SetProjectState.js +56 -0
  195. package/dist/client/models/SigningMethod.d.ts +25 -0
  196. package/dist/client/models/SigningMethod.js +51 -0
  197. package/dist/client/models/Status.d.ts +31 -0
  198. package/dist/client/models/Status.js +57 -0
  199. package/dist/client/models/Workspace.d.ts +51 -0
  200. package/dist/client/models/Workspace.js +64 -0
  201. package/dist/client/models/WorkspaceDTO.d.ts +58 -0
  202. package/dist/client/models/WorkspaceDTO.js +67 -0
  203. package/dist/client/models/WorkspaceInfo.d.ts +45 -0
  204. package/dist/client/models/WorkspaceInfo.js +58 -0
  205. package/dist/client/models/index.d.ts +79 -0
  206. package/dist/client/models/index.js +97 -0
  207. package/dist/client/runtime.d.ts +182 -0
  208. package/dist/client/runtime.js +340 -0
  209. package/dist/code-toolbox/WorkspacePythonCodeToolbox.d.ts +5 -0
  210. package/dist/code-toolbox/WorkspacePythonCodeToolbox.js +13 -0
  211. package/dist/code-toolbox/WorkspaceTsCodeToolbox.d.ts +5 -0
  212. package/dist/code-toolbox/WorkspaceTsCodeToolbox.js +13 -0
  213. package/dist/index.d.ts +8 -0
  214. package/dist/index.js +13 -0
  215. package/package.json +42 -0
@@ -0,0 +1,330 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Daytona Server API
6
+ * Daytona Server API
7
+ *
8
+ * The version of the OpenAPI document: v0.0.0-dev
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }) : (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ o[k2] = m[k];
25
+ }));
26
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
27
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
28
+ }) : function(o, v) {
29
+ o["default"] = v;
30
+ });
31
+ var __importStar = (this && this.__importStar) || function (mod) {
32
+ if (mod && mod.__esModule) return mod;
33
+ var result = {};
34
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
35
+ __setModuleDefault(result, mod);
36
+ return result;
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.WorkspaceApi = void 0;
40
+ const runtime = __importStar(require("../runtime"));
41
+ const index_1 = require("../models/index");
42
+ /**
43
+ *
44
+ */
45
+ class WorkspaceApi extends runtime.BaseAPI {
46
+ /**
47
+ * Create a workspace
48
+ * Create a workspace
49
+ */
50
+ async createWorkspaceRaw(requestParameters, initOverrides) {
51
+ if (requestParameters['workspace'] == null) {
52
+ throw new runtime.RequiredError('workspace', 'Required parameter "workspace" was null or undefined when calling createWorkspace().');
53
+ }
54
+ const queryParameters = {};
55
+ const headerParameters = {};
56
+ headerParameters['Content-Type'] = 'application/json';
57
+ if (this.configuration && this.configuration.apiKey) {
58
+ headerParameters['Authorization'] = await this.configuration.apiKey('Authorization'); // Bearer authentication
59
+ }
60
+ const response = await this.request({
61
+ path: `/workspace`,
62
+ method: 'POST',
63
+ headers: headerParameters,
64
+ query: queryParameters,
65
+ body: (0, index_1.CreateWorkspaceDTOToJSON)(requestParameters['workspace']),
66
+ }, initOverrides);
67
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WorkspaceFromJSON)(jsonValue));
68
+ }
69
+ /**
70
+ * Create a workspace
71
+ * Create a workspace
72
+ */
73
+ async createWorkspace(requestParameters, initOverrides) {
74
+ const response = await this.createWorkspaceRaw(requestParameters, initOverrides);
75
+ return await response.value();
76
+ }
77
+ /**
78
+ * Get workspace info
79
+ * Get workspace info
80
+ */
81
+ async getWorkspaceRaw(requestParameters, initOverrides) {
82
+ if (requestParameters['workspaceId'] == null) {
83
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling getWorkspace().');
84
+ }
85
+ const queryParameters = {};
86
+ if (requestParameters['verbose'] != null) {
87
+ queryParameters['verbose'] = requestParameters['verbose'];
88
+ }
89
+ const headerParameters = {};
90
+ if (this.configuration && this.configuration.apiKey) {
91
+ headerParameters['Authorization'] = await this.configuration.apiKey('Authorization'); // Bearer authentication
92
+ }
93
+ const response = await this.request({
94
+ path: `/workspace/{workspaceId}`.replace(`{${'workspaceId'}}`, encodeURIComponent(String(requestParameters['workspaceId']))),
95
+ method: 'GET',
96
+ headers: headerParameters,
97
+ query: queryParameters,
98
+ }, initOverrides);
99
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WorkspaceDTOFromJSON)(jsonValue));
100
+ }
101
+ /**
102
+ * Get workspace info
103
+ * Get workspace info
104
+ */
105
+ async getWorkspace(requestParameters, initOverrides) {
106
+ const response = await this.getWorkspaceRaw(requestParameters, initOverrides);
107
+ return await response.value();
108
+ }
109
+ /**
110
+ * List workspaces
111
+ * List workspaces
112
+ */
113
+ async listWorkspacesRaw(requestParameters, initOverrides) {
114
+ const queryParameters = {};
115
+ if (requestParameters['verbose'] != null) {
116
+ queryParameters['verbose'] = requestParameters['verbose'];
117
+ }
118
+ const headerParameters = {};
119
+ if (this.configuration && this.configuration.apiKey) {
120
+ headerParameters['Authorization'] = await this.configuration.apiKey('Authorization'); // Bearer authentication
121
+ }
122
+ const response = await this.request({
123
+ path: `/workspace`,
124
+ method: 'GET',
125
+ headers: headerParameters,
126
+ query: queryParameters,
127
+ }, initOverrides);
128
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.WorkspaceDTOFromJSON));
129
+ }
130
+ /**
131
+ * List workspaces
132
+ * List workspaces
133
+ */
134
+ async listWorkspaces(requestParameters = {}, initOverrides) {
135
+ const response = await this.listWorkspacesRaw(requestParameters, initOverrides);
136
+ return await response.value();
137
+ }
138
+ /**
139
+ * Remove workspace
140
+ * Remove workspace
141
+ */
142
+ async removeWorkspaceRaw(requestParameters, initOverrides) {
143
+ if (requestParameters['workspaceId'] == null) {
144
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling removeWorkspace().');
145
+ }
146
+ const queryParameters = {};
147
+ if (requestParameters['force'] != null) {
148
+ queryParameters['force'] = requestParameters['force'];
149
+ }
150
+ const headerParameters = {};
151
+ if (this.configuration && this.configuration.apiKey) {
152
+ headerParameters['Authorization'] = await this.configuration.apiKey('Authorization'); // Bearer authentication
153
+ }
154
+ const response = await this.request({
155
+ path: `/workspace/{workspaceId}`.replace(`{${'workspaceId'}}`, encodeURIComponent(String(requestParameters['workspaceId']))),
156
+ method: 'DELETE',
157
+ headers: headerParameters,
158
+ query: queryParameters,
159
+ }, initOverrides);
160
+ return new runtime.VoidApiResponse(response);
161
+ }
162
+ /**
163
+ * Remove workspace
164
+ * Remove workspace
165
+ */
166
+ async removeWorkspace(requestParameters, initOverrides) {
167
+ await this.removeWorkspaceRaw(requestParameters, initOverrides);
168
+ }
169
+ /**
170
+ * Set project state
171
+ * Set project state
172
+ */
173
+ async setProjectStateRaw(requestParameters, initOverrides) {
174
+ if (requestParameters['workspaceId'] == null) {
175
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling setProjectState().');
176
+ }
177
+ if (requestParameters['projectId'] == null) {
178
+ throw new runtime.RequiredError('projectId', 'Required parameter "projectId" was null or undefined when calling setProjectState().');
179
+ }
180
+ if (requestParameters['setState'] == null) {
181
+ throw new runtime.RequiredError('setState', 'Required parameter "setState" was null or undefined when calling setProjectState().');
182
+ }
183
+ const queryParameters = {};
184
+ const headerParameters = {};
185
+ headerParameters['Content-Type'] = 'application/json';
186
+ if (this.configuration && this.configuration.apiKey) {
187
+ headerParameters['Authorization'] = await this.configuration.apiKey('Authorization'); // Bearer authentication
188
+ }
189
+ const response = await this.request({
190
+ path: `/workspace/{workspaceId}/{projectId}/state`
191
+ .replace(`{${'workspaceId'}}`, encodeURIComponent(String(requestParameters['workspaceId'])))
192
+ .replace(`{${'projectId'}}`, encodeURIComponent(String(requestParameters['projectId']))),
193
+ method: 'POST',
194
+ headers: headerParameters,
195
+ query: queryParameters,
196
+ body: (0, index_1.SetProjectStateToJSON)(requestParameters['setState']),
197
+ }, initOverrides);
198
+ return new runtime.VoidApiResponse(response);
199
+ }
200
+ /**
201
+ * Set project state
202
+ * Set project state
203
+ */
204
+ async setProjectState(requestParameters, initOverrides) {
205
+ await this.setProjectStateRaw(requestParameters, initOverrides);
206
+ }
207
+ /**
208
+ * Start project
209
+ * Start project
210
+ */
211
+ async startProjectRaw(requestParameters, initOverrides) {
212
+ if (requestParameters['workspaceId'] == null) {
213
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling startProject().');
214
+ }
215
+ if (requestParameters['projectId'] == null) {
216
+ throw new runtime.RequiredError('projectId', 'Required parameter "projectId" was null or undefined when calling startProject().');
217
+ }
218
+ const queryParameters = {};
219
+ const headerParameters = {};
220
+ if (this.configuration && this.configuration.apiKey) {
221
+ headerParameters['Authorization'] = await this.configuration.apiKey('Authorization'); // Bearer authentication
222
+ }
223
+ const response = await this.request({
224
+ path: `/workspace/{workspaceId}/{projectId}/start`
225
+ .replace(`{${'workspaceId'}}`, encodeURIComponent(String(requestParameters['workspaceId'])))
226
+ .replace(`{${'projectId'}}`, encodeURIComponent(String(requestParameters['projectId']))),
227
+ method: 'POST',
228
+ headers: headerParameters,
229
+ query: queryParameters,
230
+ }, initOverrides);
231
+ return new runtime.VoidApiResponse(response);
232
+ }
233
+ /**
234
+ * Start project
235
+ * Start project
236
+ */
237
+ async startProject(requestParameters, initOverrides) {
238
+ await this.startProjectRaw(requestParameters, initOverrides);
239
+ }
240
+ /**
241
+ * Start workspace
242
+ * Start workspace
243
+ */
244
+ async startWorkspaceRaw(requestParameters, initOverrides) {
245
+ if (requestParameters['workspaceId'] == null) {
246
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling startWorkspace().');
247
+ }
248
+ const queryParameters = {};
249
+ const headerParameters = {};
250
+ if (this.configuration && this.configuration.apiKey) {
251
+ headerParameters['Authorization'] = await this.configuration.apiKey('Authorization'); // Bearer authentication
252
+ }
253
+ const response = await this.request({
254
+ path: `/workspace/{workspaceId}/start`.replace(`{${'workspaceId'}}`, encodeURIComponent(String(requestParameters['workspaceId']))),
255
+ method: 'POST',
256
+ headers: headerParameters,
257
+ query: queryParameters,
258
+ }, initOverrides);
259
+ return new runtime.VoidApiResponse(response);
260
+ }
261
+ /**
262
+ * Start workspace
263
+ * Start workspace
264
+ */
265
+ async startWorkspace(requestParameters, initOverrides) {
266
+ await this.startWorkspaceRaw(requestParameters, initOverrides);
267
+ }
268
+ /**
269
+ * Stop project
270
+ * Stop project
271
+ */
272
+ async stopProjectRaw(requestParameters, initOverrides) {
273
+ if (requestParameters['workspaceId'] == null) {
274
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling stopProject().');
275
+ }
276
+ if (requestParameters['projectId'] == null) {
277
+ throw new runtime.RequiredError('projectId', 'Required parameter "projectId" was null or undefined when calling stopProject().');
278
+ }
279
+ const queryParameters = {};
280
+ const headerParameters = {};
281
+ if (this.configuration && this.configuration.apiKey) {
282
+ headerParameters['Authorization'] = await this.configuration.apiKey('Authorization'); // Bearer authentication
283
+ }
284
+ const response = await this.request({
285
+ path: `/workspace/{workspaceId}/{projectId}/stop`
286
+ .replace(`{${'workspaceId'}}`, encodeURIComponent(String(requestParameters['workspaceId'])))
287
+ .replace(`{${'projectId'}}`, encodeURIComponent(String(requestParameters['projectId']))),
288
+ method: 'POST',
289
+ headers: headerParameters,
290
+ query: queryParameters,
291
+ }, initOverrides);
292
+ return new runtime.VoidApiResponse(response);
293
+ }
294
+ /**
295
+ * Stop project
296
+ * Stop project
297
+ */
298
+ async stopProject(requestParameters, initOverrides) {
299
+ await this.stopProjectRaw(requestParameters, initOverrides);
300
+ }
301
+ /**
302
+ * Stop workspace
303
+ * Stop workspace
304
+ */
305
+ async stopWorkspaceRaw(requestParameters, initOverrides) {
306
+ if (requestParameters['workspaceId'] == null) {
307
+ throw new runtime.RequiredError('workspaceId', 'Required parameter "workspaceId" was null or undefined when calling stopWorkspace().');
308
+ }
309
+ const queryParameters = {};
310
+ const headerParameters = {};
311
+ if (this.configuration && this.configuration.apiKey) {
312
+ headerParameters['Authorization'] = await this.configuration.apiKey('Authorization'); // Bearer authentication
313
+ }
314
+ const response = await this.request({
315
+ path: `/workspace/{workspaceId}/stop`.replace(`{${'workspaceId'}}`, encodeURIComponent(String(requestParameters['workspaceId']))),
316
+ method: 'POST',
317
+ headers: headerParameters,
318
+ query: queryParameters,
319
+ }, initOverrides);
320
+ return new runtime.VoidApiResponse(response);
321
+ }
322
+ /**
323
+ * Stop workspace
324
+ * Stop workspace
325
+ */
326
+ async stopWorkspace(requestParameters, initOverrides) {
327
+ await this.stopWorkspaceRaw(requestParameters, initOverrides);
328
+ }
329
+ }
330
+ exports.WorkspaceApi = WorkspaceApi;