@hostafrica/ha-sdk-typescript 1.0.13 → 1.0.14

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 (121) hide show
  1. package/.github/workflows/codeql.yml +3 -3
  2. package/.github/workflows/release.yml +3 -3
  3. package/.github/workflows/semgrep.yml +1 -1
  4. package/dist/apis/SnapshotsApi.d.ts +63 -3
  5. package/dist/apis/SnapshotsApi.js +190 -2
  6. package/dist/apis/VPSManagementApi.d.ts +2 -2
  7. package/dist/apis/VPSManagementApi.js +2 -2
  8. package/dist/esm/apis/SnapshotsApi.d.ts +63 -3
  9. package/dist/esm/apis/SnapshotsApi.js +191 -3
  10. package/dist/esm/apis/VPSManagementApi.d.ts +2 -2
  11. package/dist/esm/apis/VPSManagementApi.js +2 -2
  12. package/dist/esm/models/CreateSnapshotJobRequestContent.d.ts +76 -0
  13. package/dist/esm/models/CreateSnapshotJobRequestContent.js +63 -0
  14. package/dist/esm/models/CreateSnapshotJobResponseContent.d.ts +40 -0
  15. package/dist/esm/models/CreateSnapshotJobResponseContent.js +49 -0
  16. package/dist/esm/models/CreateSnapshotRequestContent.d.ts +7 -1
  17. package/dist/esm/models/CreateSnapshotRequestContent.js +6 -2
  18. package/dist/esm/models/DeleteSnapshotJobRequestContent.d.ts +38 -0
  19. package/dist/esm/models/DeleteSnapshotJobRequestContent.js +47 -0
  20. package/dist/esm/models/DeleteSnapshotJobResponseContent.d.ts +40 -0
  21. package/dist/esm/models/DeleteSnapshotJobResponseContent.js +49 -0
  22. package/dist/esm/models/ListSnapshotJobsRequestContent.d.ts +32 -0
  23. package/dist/esm/models/ListSnapshotJobsRequestContent.js +43 -0
  24. package/dist/esm/models/ListSnapshotJobsResponseContent.d.ts +40 -0
  25. package/dist/esm/models/ListSnapshotJobsResponseContent.js +49 -0
  26. package/dist/esm/models/SnapshotJob.d.ts +88 -0
  27. package/dist/esm/models/SnapshotJob.js +67 -0
  28. package/dist/esm/models/SnapshotJobDeleteResponseData.d.ts +39 -0
  29. package/dist/esm/models/SnapshotJobDeleteResponseData.js +48 -0
  30. package/dist/esm/models/SnapshotJobLimits.d.ts +44 -0
  31. package/dist/esm/models/SnapshotJobLimits.js +51 -0
  32. package/dist/esm/models/SnapshotJobListResponseData.d.ts +52 -0
  33. package/dist/esm/models/SnapshotJobListResponseData.js +55 -0
  34. package/dist/esm/models/SnapshotJobMutationResponseData.d.ts +46 -0
  35. package/dist/esm/models/SnapshotJobMutationResponseData.js +53 -0
  36. package/dist/esm/models/SnapshotJobPeriod.d.ts +25 -0
  37. package/dist/esm/models/SnapshotJobPeriod.js +43 -0
  38. package/dist/esm/models/SnapshotJobUpdateResponseData.d.ts +39 -0
  39. package/dist/esm/models/SnapshotJobUpdateResponseData.js +48 -0
  40. package/dist/esm/models/UpdateSnapshotJobRequestContent.d.ts +82 -0
  41. package/dist/esm/models/UpdateSnapshotJobRequestContent.js +63 -0
  42. package/dist/esm/models/UpdateSnapshotJobResponseContent.d.ts +40 -0
  43. package/dist/esm/models/UpdateSnapshotJobResponseContent.js +49 -0
  44. package/dist/esm/models/index.d.ts +15 -0
  45. package/dist/esm/models/index.js +15 -0
  46. package/dist/esm/retryablePaths.js +1 -0
  47. package/dist/models/CreateSnapshotJobRequestContent.d.ts +76 -0
  48. package/dist/models/CreateSnapshotJobRequestContent.js +70 -0
  49. package/dist/models/CreateSnapshotJobResponseContent.d.ts +40 -0
  50. package/dist/models/CreateSnapshotJobResponseContent.js +56 -0
  51. package/dist/models/CreateSnapshotRequestContent.d.ts +7 -1
  52. package/dist/models/CreateSnapshotRequestContent.js +6 -2
  53. package/dist/models/DeleteSnapshotJobRequestContent.d.ts +38 -0
  54. package/dist/models/DeleteSnapshotJobRequestContent.js +54 -0
  55. package/dist/models/DeleteSnapshotJobResponseContent.d.ts +40 -0
  56. package/dist/models/DeleteSnapshotJobResponseContent.js +56 -0
  57. package/dist/models/ListSnapshotJobsRequestContent.d.ts +32 -0
  58. package/dist/models/ListSnapshotJobsRequestContent.js +50 -0
  59. package/dist/models/ListSnapshotJobsResponseContent.d.ts +40 -0
  60. package/dist/models/ListSnapshotJobsResponseContent.js +56 -0
  61. package/dist/models/SnapshotJob.d.ts +88 -0
  62. package/dist/models/SnapshotJob.js +74 -0
  63. package/dist/models/SnapshotJobDeleteResponseData.d.ts +39 -0
  64. package/dist/models/SnapshotJobDeleteResponseData.js +55 -0
  65. package/dist/models/SnapshotJobLimits.d.ts +44 -0
  66. package/dist/models/SnapshotJobLimits.js +58 -0
  67. package/dist/models/SnapshotJobListResponseData.d.ts +52 -0
  68. package/dist/models/SnapshotJobListResponseData.js +62 -0
  69. package/dist/models/SnapshotJobMutationResponseData.d.ts +46 -0
  70. package/dist/models/SnapshotJobMutationResponseData.js +60 -0
  71. package/dist/models/SnapshotJobPeriod.d.ts +25 -0
  72. package/dist/models/SnapshotJobPeriod.js +51 -0
  73. package/dist/models/SnapshotJobUpdateResponseData.d.ts +39 -0
  74. package/dist/models/SnapshotJobUpdateResponseData.js +55 -0
  75. package/dist/models/UpdateSnapshotJobRequestContent.d.ts +82 -0
  76. package/dist/models/UpdateSnapshotJobRequestContent.js +70 -0
  77. package/dist/models/UpdateSnapshotJobResponseContent.d.ts +40 -0
  78. package/dist/models/UpdateSnapshotJobResponseContent.js +56 -0
  79. package/dist/models/index.d.ts +15 -0
  80. package/dist/models/index.js +15 -0
  81. package/dist/retryablePaths.js +1 -0
  82. package/dist.zip +0 -0
  83. package/docs/CreateSnapshotJobRequestContent.md +48 -0
  84. package/docs/CreateSnapshotJobResponseContent.md +36 -0
  85. package/docs/CreateSnapshotRequestContent.md +4 -2
  86. package/docs/DeleteSnapshotJobRequestContent.md +36 -0
  87. package/docs/DeleteSnapshotJobResponseContent.md +36 -0
  88. package/docs/ListSnapshotJobsRequestContent.md +34 -0
  89. package/docs/ListSnapshotJobsResponseContent.md +36 -0
  90. package/docs/SnapshotJob.md +53 -0
  91. package/docs/SnapshotJobDeleteResponseData.md +37 -0
  92. package/docs/SnapshotJobLimits.md +39 -0
  93. package/docs/SnapshotJobListResponseData.md +41 -0
  94. package/docs/SnapshotJobMutationResponseData.md +39 -0
  95. package/docs/SnapshotJobPeriod.md +33 -0
  96. package/docs/SnapshotJobUpdateResponseData.md +37 -0
  97. package/docs/SnapshotsApi.md +321 -1
  98. package/docs/UpdateSnapshotJobRequestContent.md +50 -0
  99. package/docs/UpdateSnapshotJobResponseContent.md +36 -0
  100. package/docs/VPSManagementApi.md +1 -1
  101. package/package.json +1 -1
  102. package/src/apis/SnapshotsApi.ts +262 -2
  103. package/src/apis/VPSManagementApi.ts +2 -2
  104. package/src/models/CreateSnapshotJobRequestContent.ts +141 -0
  105. package/src/models/CreateSnapshotJobResponseContent.ts +92 -0
  106. package/src/models/CreateSnapshotRequestContent.ts +12 -3
  107. package/src/models/DeleteSnapshotJobRequestContent.ts +75 -0
  108. package/src/models/DeleteSnapshotJobResponseContent.ts +92 -0
  109. package/src/models/ListSnapshotJobsRequestContent.ts +66 -0
  110. package/src/models/ListSnapshotJobsResponseContent.ts +92 -0
  111. package/src/models/SnapshotJob.ts +157 -0
  112. package/src/models/SnapshotJobDeleteResponseData.ts +83 -0
  113. package/src/models/SnapshotJobLimits.ts +84 -0
  114. package/src/models/SnapshotJobListResponseData.ts +107 -0
  115. package/src/models/SnapshotJobMutationResponseData.ts +99 -0
  116. package/src/models/SnapshotJobPeriod.ts +53 -0
  117. package/src/models/SnapshotJobUpdateResponseData.ts +83 -0
  118. package/src/models/UpdateSnapshotJobRequestContent.ts +148 -0
  119. package/src/models/UpdateSnapshotJobResponseContent.ts +92 -0
  120. package/src/models/index.ts +15 -0
  121. package/src/retryablePaths.ts +1 -0
@@ -0,0 +1,50 @@
1
+
2
+ # UpdateSnapshotJobRequestContent
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `serviceId` | string
10
+ `jobId` | string
11
+ `name` | string
12
+ `description` | string
13
+ `vmstate` | boolean
14
+ `period` | [SnapshotJobPeriod](SnapshotJobPeriod.md)
15
+ `runEvery` | number
16
+ `days` | [Array<DayOfWeek>](DayOfWeek.md)
17
+ `startTime` | string
18
+
19
+ ## Example
20
+
21
+ ```typescript
22
+ import type { UpdateSnapshotJobRequestContent } from '@hostafrica/ha-sdk-typescript'
23
+
24
+ // TODO: Update the object below with actual values
25
+ const example = {
26
+ "serviceId": null,
27
+ "jobId": null,
28
+ "name": null,
29
+ "description": null,
30
+ "vmstate": null,
31
+ "period": null,
32
+ "runEvery": null,
33
+ "days": null,
34
+ "startTime": null,
35
+ } satisfies UpdateSnapshotJobRequestContent
36
+
37
+ console.log(example)
38
+
39
+ // Convert the instance to a JSON string
40
+ const exampleJSON: string = JSON.stringify(example)
41
+ console.log(exampleJSON)
42
+
43
+ // Parse the JSON string back to an object
44
+ const exampleParsed = JSON.parse(exampleJSON) as UpdateSnapshotJobRequestContent
45
+ console.log(exampleParsed)
46
+ ```
47
+
48
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
49
+
50
+
@@ -0,0 +1,36 @@
1
+
2
+ # UpdateSnapshotJobResponseContent
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `status` | [OperationStatus](OperationStatus.md)
10
+ `data` | [SnapshotJobUpdateResponseData](SnapshotJobUpdateResponseData.md)
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { UpdateSnapshotJobResponseContent } from '@hostafrica/ha-sdk-typescript'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "status": null,
20
+ "data": null,
21
+ } satisfies UpdateSnapshotJobResponseContent
22
+
23
+ console.log(example)
24
+
25
+ // Convert the instance to a JSON string
26
+ const exampleJSON: string = JSON.stringify(example)
27
+ console.log(exampleJSON)
28
+
29
+ // Parse the JSON string back to an object
30
+ const exampleParsed = JSON.parse(exampleJSON) as UpdateSnapshotJobResponseContent
31
+ console.log(exampleParsed)
32
+ ```
33
+
34
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
35
+
36
+
@@ -257,7 +257,7 @@ example().catch(console.error);
257
257
 
258
258
 
259
259
 
260
- [Under development] Retrieves the list of available OS images for VPS reinstallation
260
+ Retrieves the list of available OS images for VPS reinstallation
261
261
 
262
262
  ### Example
263
263
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostafrica/ha-sdk-typescript",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "HostAfrica API TypeScript SDK",
5
5
  "author": "HostAfrica",
6
6
  "repository": {
@@ -16,12 +16,18 @@
16
16
  import * as runtime from '../runtime.js';
17
17
  import type {
18
18
  BadRequestErrorResponseContent,
19
+ CreateSnapshotJobRequestContent,
20
+ CreateSnapshotJobResponseContent,
19
21
  CreateSnapshotRequestContent,
20
22
  CreateSnapshotResponseContent,
23
+ DeleteSnapshotJobRequestContent,
24
+ DeleteSnapshotJobResponseContent,
21
25
  DeleteSnapshotRequestContent,
22
26
  DeleteSnapshotResponseContent,
23
27
  ForbiddenErrorResponseContent,
24
28
  InternalServiceErrorResponseContent,
29
+ ListSnapshotJobsRequestContent,
30
+ ListSnapshotJobsResponseContent,
25
31
  ListSnapshotsRequestContent,
26
32
  ListSnapshotsResponseContent,
27
33
  ResourceNotFoundErrorResponseContent,
@@ -30,6 +36,8 @@ import type {
30
36
  ServiceUnavailableErrorResponseContent,
31
37
  TooManyRequestsErrorResponseContent,
32
38
  UnauthorizedErrorResponseContent,
39
+ UpdateSnapshotJobRequestContent,
40
+ UpdateSnapshotJobResponseContent,
33
41
  UpdateSnapshotRequestContent,
34
42
  UpdateSnapshotResponseContent,
35
43
  ValidationErrorResponseContent,
@@ -37,10 +45,18 @@ import type {
37
45
  import {
38
46
  BadRequestErrorResponseContentFromJSON,
39
47
  BadRequestErrorResponseContentToJSON,
48
+ CreateSnapshotJobRequestContentFromJSON,
49
+ CreateSnapshotJobRequestContentToJSON,
50
+ CreateSnapshotJobResponseContentFromJSON,
51
+ CreateSnapshotJobResponseContentToJSON,
40
52
  CreateSnapshotRequestContentFromJSON,
41
53
  CreateSnapshotRequestContentToJSON,
42
54
  CreateSnapshotResponseContentFromJSON,
43
55
  CreateSnapshotResponseContentToJSON,
56
+ DeleteSnapshotJobRequestContentFromJSON,
57
+ DeleteSnapshotJobRequestContentToJSON,
58
+ DeleteSnapshotJobResponseContentFromJSON,
59
+ DeleteSnapshotJobResponseContentToJSON,
44
60
  DeleteSnapshotRequestContentFromJSON,
45
61
  DeleteSnapshotRequestContentToJSON,
46
62
  DeleteSnapshotResponseContentFromJSON,
@@ -49,6 +65,10 @@ import {
49
65
  ForbiddenErrorResponseContentToJSON,
50
66
  InternalServiceErrorResponseContentFromJSON,
51
67
  InternalServiceErrorResponseContentToJSON,
68
+ ListSnapshotJobsRequestContentFromJSON,
69
+ ListSnapshotJobsRequestContentToJSON,
70
+ ListSnapshotJobsResponseContentFromJSON,
71
+ ListSnapshotJobsResponseContentToJSON,
52
72
  ListSnapshotsRequestContentFromJSON,
53
73
  ListSnapshotsRequestContentToJSON,
54
74
  ListSnapshotsResponseContentFromJSON,
@@ -65,6 +85,10 @@ import {
65
85
  TooManyRequestsErrorResponseContentToJSON,
66
86
  UnauthorizedErrorResponseContentFromJSON,
67
87
  UnauthorizedErrorResponseContentToJSON,
88
+ UpdateSnapshotJobRequestContentFromJSON,
89
+ UpdateSnapshotJobRequestContentToJSON,
90
+ UpdateSnapshotJobResponseContentFromJSON,
91
+ UpdateSnapshotJobResponseContentToJSON,
68
92
  UpdateSnapshotRequestContentFromJSON,
69
93
  UpdateSnapshotRequestContentToJSON,
70
94
  UpdateSnapshotResponseContentFromJSON,
@@ -77,10 +101,22 @@ export interface CreateSnapshotRequest {
77
101
  createSnapshotRequestContent: CreateSnapshotRequestContent;
78
102
  }
79
103
 
104
+ export interface CreateSnapshotJobRequest {
105
+ createSnapshotJobRequestContent: CreateSnapshotJobRequestContent;
106
+ }
107
+
80
108
  export interface DeleteSnapshotRequest {
81
109
  deleteSnapshotRequestContent: DeleteSnapshotRequestContent;
82
110
  }
83
111
 
112
+ export interface DeleteSnapshotJobRequest {
113
+ deleteSnapshotJobRequestContent: DeleteSnapshotJobRequestContent;
114
+ }
115
+
116
+ export interface ListSnapshotJobsRequest {
117
+ listSnapshotJobsRequestContent: ListSnapshotJobsRequestContent;
118
+ }
119
+
84
120
  export interface ListSnapshotsRequest {
85
121
  listSnapshotsRequestContent: ListSnapshotsRequestContent;
86
122
  }
@@ -93,6 +129,10 @@ export interface UpdateSnapshotRequest {
93
129
  updateSnapshotRequestContent: UpdateSnapshotRequestContent;
94
130
  }
95
131
 
132
+ export interface UpdateSnapshotJobRequest {
133
+ updateSnapshotJobRequestContent: UpdateSnapshotJobRequestContent;
134
+ }
135
+
96
136
  /**
97
137
  *
98
138
  */
@@ -153,6 +193,61 @@ export class SnapshotsApi extends runtime.BaseAPI {
153
193
  return await response.value();
154
194
  }
155
195
 
196
+ /**
197
+ * Creates request options for createSnapshotJob without sending the request
198
+ */
199
+ async createSnapshotJobRequestOpts(requestParameters: CreateSnapshotJobRequest): Promise<runtime.RequestOpts> {
200
+ if (requestParameters['createSnapshotJobRequestContent'] == null) {
201
+ throw new runtime.RequiredError(
202
+ 'createSnapshotJobRequestContent',
203
+ 'Required parameter "createSnapshotJobRequestContent" was null or undefined when calling createSnapshotJob().'
204
+ );
205
+ }
206
+
207
+ const queryParameters: any = {};
208
+
209
+ const headerParameters: runtime.HTTPHeaders = {};
210
+
211
+ headerParameters['Content-Type'] = 'application/json';
212
+
213
+ if (this.configuration && this.configuration.accessToken) {
214
+ const token = this.configuration.accessToken;
215
+ const tokenString = await token("BearerAuth", []);
216
+
217
+ if (tokenString) {
218
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
219
+ }
220
+ }
221
+
222
+ let urlPath = `/vps/create-snapshot-job`;
223
+
224
+ return {
225
+ path: urlPath,
226
+ method: 'POST',
227
+ headers: headerParameters,
228
+ query: queryParameters,
229
+ body: CreateSnapshotJobRequestContentToJSON(requestParameters['createSnapshotJobRequestContent']),
230
+ };
231
+ }
232
+
233
+ /**
234
+ * [Under development] Creates a new snapshot job for a VPS service. Use period=\'hourly\' with run_every, or period=\'daily\' with days and start_time.
235
+ */
236
+ async createSnapshotJobRaw(requestParameters: CreateSnapshotJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateSnapshotJobResponseContent>> {
237
+ const requestOptions = await this.createSnapshotJobRequestOpts(requestParameters);
238
+ const response = await this.request(requestOptions, initOverrides);
239
+
240
+ return new runtime.JSONApiResponse(response, (jsonValue) => CreateSnapshotJobResponseContentFromJSON(jsonValue));
241
+ }
242
+
243
+ /**
244
+ * [Under development] Creates a new snapshot job for a VPS service. Use period=\'hourly\' with run_every, or period=\'daily\' with days and start_time.
245
+ */
246
+ async createSnapshotJob(requestParameters: CreateSnapshotJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateSnapshotJobResponseContent> {
247
+ const response = await this.createSnapshotJobRaw(requestParameters, initOverrides);
248
+ return await response.value();
249
+ }
250
+
156
251
  /**
157
252
  * Creates request options for deleteSnapshot without sending the request
158
253
  */
@@ -208,6 +303,116 @@ export class SnapshotsApi extends runtime.BaseAPI {
208
303
  return await response.value();
209
304
  }
210
305
 
306
+ /**
307
+ * Creates request options for deleteSnapshotJob without sending the request
308
+ */
309
+ async deleteSnapshotJobRequestOpts(requestParameters: DeleteSnapshotJobRequest): Promise<runtime.RequestOpts> {
310
+ if (requestParameters['deleteSnapshotJobRequestContent'] == null) {
311
+ throw new runtime.RequiredError(
312
+ 'deleteSnapshotJobRequestContent',
313
+ 'Required parameter "deleteSnapshotJobRequestContent" was null or undefined when calling deleteSnapshotJob().'
314
+ );
315
+ }
316
+
317
+ const queryParameters: any = {};
318
+
319
+ const headerParameters: runtime.HTTPHeaders = {};
320
+
321
+ headerParameters['Content-Type'] = 'application/json';
322
+
323
+ if (this.configuration && this.configuration.accessToken) {
324
+ const token = this.configuration.accessToken;
325
+ const tokenString = await token("BearerAuth", []);
326
+
327
+ if (tokenString) {
328
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
329
+ }
330
+ }
331
+
332
+ let urlPath = `/vps/delete-snapshot-job`;
333
+
334
+ return {
335
+ path: urlPath,
336
+ method: 'POST',
337
+ headers: headerParameters,
338
+ query: queryParameters,
339
+ body: DeleteSnapshotJobRequestContentToJSON(requestParameters['deleteSnapshotJobRequestContent']),
340
+ };
341
+ }
342
+
343
+ /**
344
+ * [Under development]Deletes a snapshot job from a VPS service
345
+ */
346
+ async deleteSnapshotJobRaw(requestParameters: DeleteSnapshotJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DeleteSnapshotJobResponseContent>> {
347
+ const requestOptions = await this.deleteSnapshotJobRequestOpts(requestParameters);
348
+ const response = await this.request(requestOptions, initOverrides);
349
+
350
+ return new runtime.JSONApiResponse(response, (jsonValue) => DeleteSnapshotJobResponseContentFromJSON(jsonValue));
351
+ }
352
+
353
+ /**
354
+ * [Under development]Deletes a snapshot job from a VPS service
355
+ */
356
+ async deleteSnapshotJob(requestParameters: DeleteSnapshotJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DeleteSnapshotJobResponseContent> {
357
+ const response = await this.deleteSnapshotJobRaw(requestParameters, initOverrides);
358
+ return await response.value();
359
+ }
360
+
361
+ /**
362
+ * Creates request options for listSnapshotJobs without sending the request
363
+ */
364
+ async listSnapshotJobsRequestOpts(requestParameters: ListSnapshotJobsRequest): Promise<runtime.RequestOpts> {
365
+ if (requestParameters['listSnapshotJobsRequestContent'] == null) {
366
+ throw new runtime.RequiredError(
367
+ 'listSnapshotJobsRequestContent',
368
+ 'Required parameter "listSnapshotJobsRequestContent" was null or undefined when calling listSnapshotJobs().'
369
+ );
370
+ }
371
+
372
+ const queryParameters: any = {};
373
+
374
+ const headerParameters: runtime.HTTPHeaders = {};
375
+
376
+ headerParameters['Content-Type'] = 'application/json';
377
+
378
+ if (this.configuration && this.configuration.accessToken) {
379
+ const token = this.configuration.accessToken;
380
+ const tokenString = await token("BearerAuth", []);
381
+
382
+ if (tokenString) {
383
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
384
+ }
385
+ }
386
+
387
+ let urlPath = `/vps/list-snapshot-jobs`;
388
+
389
+ return {
390
+ path: urlPath,
391
+ method: 'POST',
392
+ headers: headerParameters,
393
+ query: queryParameters,
394
+ body: ListSnapshotJobsRequestContentToJSON(requestParameters['listSnapshotJobsRequestContent']),
395
+ };
396
+ }
397
+
398
+ /**
399
+ * [Under development]Retrieves the list of snapshot jobs for a VPS service
400
+ */
401
+ async listSnapshotJobsRaw(requestParameters: ListSnapshotJobsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListSnapshotJobsResponseContent>> {
402
+ const requestOptions = await this.listSnapshotJobsRequestOpts(requestParameters);
403
+ const response = await this.request(requestOptions, initOverrides);
404
+
405
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListSnapshotJobsResponseContentFromJSON(jsonValue));
406
+ }
407
+
408
+ /**
409
+ * [Under development]Retrieves the list of snapshot jobs for a VPS service
410
+ */
411
+ async listSnapshotJobs(requestParameters: ListSnapshotJobsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListSnapshotJobsResponseContent> {
412
+ const response = await this.listSnapshotJobsRaw(requestParameters, initOverrides);
413
+ return await response.value();
414
+ }
415
+
211
416
  /**
212
417
  * Creates request options for listSnapshots without sending the request
213
418
  */
@@ -301,7 +506,7 @@ export class SnapshotsApi extends runtime.BaseAPI {
301
506
  }
302
507
 
303
508
  /**
304
- * [Under development] Rolls back a VPS to a previous snapshot state
509
+ * Rolls back a VPS to a previous snapshot state
305
510
  */
306
511
  async rollbackSnapshotRaw(requestParameters: RollbackSnapshotRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RollbackSnapshotResponseContent>> {
307
512
  const requestOptions = await this.rollbackSnapshotRequestOpts(requestParameters);
@@ -311,7 +516,7 @@ export class SnapshotsApi extends runtime.BaseAPI {
311
516
  }
312
517
 
313
518
  /**
314
- * [Under development] Rolls back a VPS to a previous snapshot state
519
+ * Rolls back a VPS to a previous snapshot state
315
520
  */
316
521
  async rollbackSnapshot(requestParameters: RollbackSnapshotRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RollbackSnapshotResponseContent> {
317
522
  const response = await this.rollbackSnapshotRaw(requestParameters, initOverrides);
@@ -373,4 +578,59 @@ export class SnapshotsApi extends runtime.BaseAPI {
373
578
  return await response.value();
374
579
  }
375
580
 
581
+ /**
582
+ * Creates request options for updateSnapshotJob without sending the request
583
+ */
584
+ async updateSnapshotJobRequestOpts(requestParameters: UpdateSnapshotJobRequest): Promise<runtime.RequestOpts> {
585
+ if (requestParameters['updateSnapshotJobRequestContent'] == null) {
586
+ throw new runtime.RequiredError(
587
+ 'updateSnapshotJobRequestContent',
588
+ 'Required parameter "updateSnapshotJobRequestContent" was null or undefined when calling updateSnapshotJob().'
589
+ );
590
+ }
591
+
592
+ const queryParameters: any = {};
593
+
594
+ const headerParameters: runtime.HTTPHeaders = {};
595
+
596
+ headerParameters['Content-Type'] = 'application/json';
597
+
598
+ if (this.configuration && this.configuration.accessToken) {
599
+ const token = this.configuration.accessToken;
600
+ const tokenString = await token("BearerAuth", []);
601
+
602
+ if (tokenString) {
603
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
604
+ }
605
+ }
606
+
607
+ let urlPath = `/vps/update-snapshot-job`;
608
+
609
+ return {
610
+ path: urlPath,
611
+ method: 'POST',
612
+ headers: headerParameters,
613
+ query: queryParameters,
614
+ body: UpdateSnapshotJobRequestContentToJSON(requestParameters['updateSnapshotJobRequestContent']),
615
+ };
616
+ }
617
+
618
+ /**
619
+ * [Under development] Updates an existing snapshot job. Only provide fields you want to change.
620
+ */
621
+ async updateSnapshotJobRaw(requestParameters: UpdateSnapshotJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UpdateSnapshotJobResponseContent>> {
622
+ const requestOptions = await this.updateSnapshotJobRequestOpts(requestParameters);
623
+ const response = await this.request(requestOptions, initOverrides);
624
+
625
+ return new runtime.JSONApiResponse(response, (jsonValue) => UpdateSnapshotJobResponseContentFromJSON(jsonValue));
626
+ }
627
+
628
+ /**
629
+ * [Under development] Updates an existing snapshot job. Only provide fields you want to change.
630
+ */
631
+ async updateSnapshotJob(requestParameters: UpdateSnapshotJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UpdateSnapshotJobResponseContent> {
632
+ const response = await this.updateSnapshotJobRaw(requestParameters, initOverrides);
633
+ return await response.value();
634
+ }
635
+
376
636
  }
@@ -327,7 +327,7 @@ export class VPSManagementApi extends runtime.BaseAPI {
327
327
  }
328
328
 
329
329
  /**
330
- * [Under development] Retrieves the list of available OS images for VPS reinstallation
330
+ * Retrieves the list of available OS images for VPS reinstallation
331
331
  */
332
332
  async listReinstallOsRaw(requestParameters: ListReinstallOsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListReinstallOsResponseContent>> {
333
333
  const requestOptions = await this.listReinstallOsRequestOpts(requestParameters);
@@ -337,7 +337,7 @@ export class VPSManagementApi extends runtime.BaseAPI {
337
337
  }
338
338
 
339
339
  /**
340
- * [Under development] Retrieves the list of available OS images for VPS reinstallation
340
+ * Retrieves the list of available OS images for VPS reinstallation
341
341
  */
342
342
  async listReinstallOs(requestParameters: ListReinstallOsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListReinstallOsResponseContent> {
343
343
  const response = await this.listReinstallOsRaw(requestParameters, initOverrides);
@@ -0,0 +1,141 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * HostAfricaApi
5
+ * HostAfrica API
6
+ *
7
+ * The version of the OpenAPI document: 2026-01-01
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime.js';
16
+ import type { DayOfWeek } from './DayOfWeek.js';
17
+ import {
18
+ DayOfWeekFromJSON,
19
+ DayOfWeekFromJSONTyped,
20
+ DayOfWeekToJSON,
21
+ DayOfWeekToJSONTyped,
22
+ } from './DayOfWeek.js';
23
+ import type { SnapshotJobPeriod } from './SnapshotJobPeriod.js';
24
+ import {
25
+ SnapshotJobPeriodFromJSON,
26
+ SnapshotJobPeriodFromJSONTyped,
27
+ SnapshotJobPeriodToJSON,
28
+ SnapshotJobPeriodToJSONTyped,
29
+ } from './SnapshotJobPeriod.js';
30
+
31
+ /**
32
+ *
33
+ * @export
34
+ * @interface CreateSnapshotJobRequestContent
35
+ */
36
+ export interface CreateSnapshotJobRequestContent {
37
+ /**
38
+ * Service ID - must be sent as a string
39
+ * @type {string}
40
+ * @memberof CreateSnapshotJobRequestContent
41
+ */
42
+ serviceId: string;
43
+ /**
44
+ * Name for the snapshot job (e.g. 'auto_hourly')
45
+ * @type {string}
46
+ * @memberof CreateSnapshotJobRequestContent
47
+ */
48
+ name: string;
49
+ /**
50
+ * Description for the snapshot job
51
+ * @type {string}
52
+ * @memberof CreateSnapshotJobRequestContent
53
+ */
54
+ description?: string;
55
+ /**
56
+ * Whether to include VM state in the snapshot
57
+ * @type {boolean}
58
+ * @memberof CreateSnapshotJobRequestContent
59
+ */
60
+ vmstate?: boolean;
61
+ /**
62
+ *
63
+ * @type {SnapshotJobPeriod}
64
+ * @memberof CreateSnapshotJobRequestContent
65
+ */
66
+ period: SnapshotJobPeriod;
67
+ /**
68
+ * For hourly jobs: run every N hours (e.g. 6 = every 6 hours)
69
+ * @type {number}
70
+ * @memberof CreateSnapshotJobRequestContent
71
+ */
72
+ runEvery?: number;
73
+ /**
74
+ * For daily jobs: days of week when the job should run
75
+ * @type {Array<DayOfWeek>}
76
+ * @memberof CreateSnapshotJobRequestContent
77
+ */
78
+ days?: Array<DayOfWeek>;
79
+ /**
80
+ * For daily jobs: start time in HH:MM format (e.g. '02:30')
81
+ * @type {string}
82
+ * @memberof CreateSnapshotJobRequestContent
83
+ */
84
+ startTime?: string;
85
+ }
86
+
87
+
88
+
89
+ /**
90
+ * Check if a given object implements the CreateSnapshotJobRequestContent interface.
91
+ */
92
+ export function instanceOfCreateSnapshotJobRequestContent(value: object): value is CreateSnapshotJobRequestContent {
93
+ if (!('serviceId' in value) || value['serviceId'] === undefined) return false;
94
+ if (!('name' in value) || value['name'] === undefined) return false;
95
+ if (!('period' in value) || value['period'] === undefined) return false;
96
+ return true;
97
+ }
98
+
99
+ export function CreateSnapshotJobRequestContentFromJSON(json: any): CreateSnapshotJobRequestContent {
100
+ return CreateSnapshotJobRequestContentFromJSONTyped(json, false);
101
+ }
102
+
103
+ export function CreateSnapshotJobRequestContentFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateSnapshotJobRequestContent {
104
+ if (json == null) {
105
+ return json;
106
+ }
107
+ return {
108
+
109
+ 'serviceId': json['service_id'],
110
+ 'name': json['name'],
111
+ 'description': json['description'] == null ? undefined : json['description'],
112
+ 'vmstate': json['vmstate'] == null ? undefined : json['vmstate'],
113
+ 'period': SnapshotJobPeriodFromJSON(json['period']),
114
+ 'runEvery': json['run_every'] == null ? undefined : json['run_every'],
115
+ 'days': json['days'] == null ? undefined : ((json['days'] as Array<any>).map(DayOfWeekFromJSON)),
116
+ 'startTime': json['start_time'] == null ? undefined : json['start_time'],
117
+ };
118
+ }
119
+
120
+ export function CreateSnapshotJobRequestContentToJSON(json: any): CreateSnapshotJobRequestContent {
121
+ return CreateSnapshotJobRequestContentToJSONTyped(json, false);
122
+ }
123
+
124
+ export function CreateSnapshotJobRequestContentToJSONTyped(value?: CreateSnapshotJobRequestContent | null, ignoreDiscriminator: boolean = false): any {
125
+ if (value == null) {
126
+ return value;
127
+ }
128
+
129
+ return {
130
+
131
+ 'service_id': value['serviceId'],
132
+ 'name': value['name'],
133
+ 'description': value['description'],
134
+ 'vmstate': value['vmstate'],
135
+ 'period': SnapshotJobPeriodToJSON(value['period']),
136
+ 'run_every': value['runEvery'],
137
+ 'days': value['days'] == null ? undefined : ((value['days'] as Array<any>).map(DayOfWeekToJSON)),
138
+ 'start_time': value['startTime'],
139
+ };
140
+ }
141
+