@boatdev/sdk 1.0.1 → 1.1.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.
@@ -65,6 +65,7 @@ const CreateSandboxResponse_1 = require("../models/CreateSandboxResponse");
65
65
  const CreateScopedApiKeyRequest_1 = require("../models/CreateScopedApiKeyRequest");
66
66
  const DataRetentionPolicyResponse_1 = require("../models/DataRetentionPolicyResponse");
67
67
  const DataRetentionUpdateRequest_1 = require("../models/DataRetentionUpdateRequest");
68
+ const DeletionOperationListResponse_1 = require("../models/DeletionOperationListResponse");
68
69
  const DeletionOperationResponse_1 = require("../models/DeletionOperationResponse");
69
70
  const DesktopRequest_1 = require("../models/DesktopRequest");
70
71
  const DesktopResponse_1 = require("../models/DesktopResponse");
@@ -127,7 +128,8 @@ class BoatApi extends runtime.BaseAPI {
127
128
  /**
128
129
  * Creates request options for addEnvironmentRepo without sending the request
129
130
  */
130
- async addEnvironmentRepoRequestOpts(requestParameters) {
131
+ async addEnvironmentRepoRequestOpts(input) {
132
+ const requestParameters = runtime.unflattenBody(input, 'addEnvironmentRepoRequest', ['environmentId'], []);
131
133
  if (requestParameters['environmentId'] == null) {
132
134
  throw new runtime.RequiredError('environmentId', 'Required parameter "environmentId" was null or undefined when calling addEnvironmentRepo().');
133
135
  }
@@ -300,7 +302,8 @@ class BoatApi extends runtime.BaseAPI {
300
302
  /**
301
303
  * Creates request options for command without sending the request
302
304
  */
303
- async commandRequestOpts(requestParameters) {
305
+ async commandRequestOpts(input) {
306
+ const requestParameters = runtime.unflattenBody(input, 'commandRequest', ['sandboxId'], []);
304
307
  if (requestParameters['sandboxId'] == null) {
305
308
  throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling command().');
306
309
  }
@@ -436,7 +439,8 @@ class BoatApi extends runtime.BaseAPI {
436
439
  /**
437
440
  * Creates request options for create without sending the request
438
441
  */
439
- async createRequestOpts(requestParameters) {
442
+ async createRequestOpts(input) {
443
+ const requestParameters = runtime.unflattenBody(input, 'createSandboxRequest', ['idempotencyKey', 'org', 'xBoatOrg'], ['org']);
440
444
  const queryParameters = {};
441
445
  if (requestParameters['org'] != null) {
442
446
  queryParameters['org'] = requestParameters['org'];
@@ -485,7 +489,8 @@ class BoatApi extends runtime.BaseAPI {
485
489
  /**
486
490
  * Creates request options for createEnvironment without sending the request
487
491
  */
488
- async createEnvironmentRequestOpts(requestParameters) {
492
+ async createEnvironmentRequestOpts(input) {
493
+ const requestParameters = runtime.unflattenBody(input, 'createSandboxEnvironmentRequest', [], []);
489
494
  if (requestParameters['createSandboxEnvironmentRequest'] == null) {
490
495
  throw new runtime.RequiredError('createSandboxEnvironmentRequest', 'Required parameter "createSandboxEnvironmentRequest" was null or undefined when calling createEnvironment().');
491
496
  }
@@ -528,7 +533,8 @@ class BoatApi extends runtime.BaseAPI {
528
533
  /**
529
534
  * Creates request options for createScopedApiKey without sending the request
530
535
  */
531
- async createScopedApiKeyRequestOpts(requestParameters) {
536
+ async createScopedApiKeyRequestOpts(input) {
537
+ const requestParameters = runtime.unflattenBody(input, 'createScopedApiKeyRequest', [], []);
532
538
  if (requestParameters['createScopedApiKeyRequest'] == null) {
533
539
  throw new runtime.RequiredError('createScopedApiKeyRequest', 'Required parameter "createScopedApiKeyRequest" was null or undefined when calling createScopedApiKey().');
534
540
  }
@@ -571,7 +577,8 @@ class BoatApi extends runtime.BaseAPI {
571
577
  /**
572
578
  * Creates request options for createWebhook without sending the request
573
579
  */
574
- async createWebhookRequestOpts(requestParameters) {
580
+ async createWebhookRequestOpts(input) {
581
+ const requestParameters = runtime.unflattenBody(input, 'webhookCreateRequest', [], []);
575
582
  if (requestParameters['webhookCreateRequest'] == null) {
576
583
  throw new runtime.RequiredError('webhookCreateRequest', 'Required parameter "webhookCreateRequest" was null or undefined when calling createWebhook().');
577
584
  }
@@ -883,6 +890,54 @@ class BoatApi extends runtime.BaseAPI {
883
890
  const response = await this.deleteSandboxRaw(requestParameters, initOverrides);
884
891
  return await response.value();
885
892
  }
893
+ /**
894
+ * Creates request options for deleteSandboxSnapshots without sending the request
895
+ */
896
+ async deleteSandboxSnapshotsRequestOpts(requestParameters) {
897
+ if (requestParameters['sandboxId'] == null) {
898
+ throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling deleteSandboxSnapshots().');
899
+ }
900
+ if (requestParameters['xAsciiConfirmDelete'] == null) {
901
+ throw new runtime.RequiredError('xAsciiConfirmDelete', 'Required parameter "xAsciiConfirmDelete" was null or undefined when calling deleteSandboxSnapshots().');
902
+ }
903
+ const queryParameters = {};
904
+ const headerParameters = {};
905
+ if (requestParameters['xAsciiConfirmDelete'] != null) {
906
+ headerParameters['X-Ascii-Confirm-Delete'] = String(requestParameters['xAsciiConfirmDelete']);
907
+ }
908
+ if (this.configuration && this.configuration.accessToken) {
909
+ const token = this.configuration.accessToken;
910
+ const tokenString = await token("BoatBearerAuth", []);
911
+ if (tokenString) {
912
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
913
+ }
914
+ }
915
+ let urlPath = `/sandboxes/{sandboxId}/snapshots`;
916
+ urlPath = urlPath.replace('{sandboxId}', encodeURIComponent(String(requestParameters['sandboxId'])));
917
+ return {
918
+ path: urlPath,
919
+ method: 'DELETE',
920
+ headers: headerParameters,
921
+ query: queryParameters,
922
+ };
923
+ }
924
+ /**
925
+ * Accept irreversible deletion of every unpinned snapshot of this sandbox. The sandbox itself and its named snapshots stay. Snapshots disappear from lists, restores and forks immediately; their stored data is purged in the background. Set `X-Ascii-Confirm-Delete` to the sandbox id.
926
+ * Permanently delete all snapshots of a sandbox
927
+ */
928
+ async deleteSandboxSnapshotsRaw(requestParameters, initOverrides) {
929
+ const requestOptions = await this.deleteSandboxSnapshotsRequestOpts(requestParameters);
930
+ const response = await this.request(requestOptions, initOverrides);
931
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, DeletionOperationListResponse_1.DeletionOperationListResponseFromJSON)(jsonValue));
932
+ }
933
+ /**
934
+ * Accept irreversible deletion of every unpinned snapshot of this sandbox. The sandbox itself and its named snapshots stay. Snapshots disappear from lists, restores and forks immediately; their stored data is purged in the background. Set `X-Ascii-Confirm-Delete` to the sandbox id.
935
+ * Permanently delete all snapshots of a sandbox
936
+ */
937
+ async deleteSandboxSnapshots(requestParameters, initOverrides) {
938
+ const response = await this.deleteSandboxSnapshotsRaw(requestParameters, initOverrides);
939
+ return await response.value();
940
+ }
886
941
  /**
887
942
  * Creates request options for deleteSnapshot without sending the request
888
943
  */
@@ -915,7 +970,7 @@ class BoatApi extends runtime.BaseAPI {
915
970
  };
916
971
  }
917
972
  /**
918
- * Accept irreversible background deletion of an unpinned snapshot owned by the authenticated account. Snapshots required by another incremental snapshot or active restore return `409`. Poll the returned operation until `completed`.
973
+ * Accept irreversible deletion of an unpinned snapshot owned by the authenticated account. Any such snapshot is accepted: it disappears from lists, restores and forks immediately, and its stored data is purged in the background once nothing still reads it (see the operation\'s `stage`). `409` only means `X-Ascii-Confirm-Delete` is missing or wrong.
919
974
  * Permanently delete snapshot data
920
975
  */
921
976
  async deleteSnapshotRaw(requestParameters, initOverrides) {
@@ -924,7 +979,7 @@ class BoatApi extends runtime.BaseAPI {
924
979
  return new runtime.JSONApiResponse(response, (jsonValue) => (0, DeletionOperationResponse_1.DeletionOperationResponseFromJSON)(jsonValue));
925
980
  }
926
981
  /**
927
- * Accept irreversible background deletion of an unpinned snapshot owned by the authenticated account. Snapshots required by another incremental snapshot or active restore return `409`. Poll the returned operation until `completed`.
982
+ * Accept irreversible deletion of an unpinned snapshot owned by the authenticated account. Any such snapshot is accepted: it disappears from lists, restores and forks immediately, and its stored data is purged in the background once nothing still reads it (see the operation\'s `stage`). `409` only means `X-Ascii-Confirm-Delete` is missing or wrong.
928
983
  * Permanently delete snapshot data
929
984
  */
930
985
  async deleteSnapshot(requestParameters, initOverrides) {
@@ -976,7 +1031,8 @@ class BoatApi extends runtime.BaseAPI {
976
1031
  /**
977
1032
  * Creates request options for desktop without sending the request
978
1033
  */
979
- async desktopRequestOpts(requestParameters) {
1034
+ async desktopRequestOpts(input) {
1035
+ const requestParameters = runtime.unflattenBody(input, 'desktopRequest', ['sandboxId', 'vnc', 'theme'], []);
980
1036
  if (requestParameters['sandboxId'] == null) {
981
1037
  throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling desktop().');
982
1038
  }
@@ -1121,7 +1177,8 @@ class BoatApi extends runtime.BaseAPI {
1121
1177
  /**
1122
1178
  * Creates request options for fork without sending the request
1123
1179
  */
1124
- async forkRequestOpts(requestParameters) {
1180
+ async forkRequestOpts(input) {
1181
+ const requestParameters = runtime.unflattenBody(input, 'forkRequest', ['sandboxId', 'idempotencyKey'], []);
1125
1182
  if (requestParameters['sandboxId'] == null) {
1126
1183
  throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling fork().');
1127
1184
  }
@@ -1543,7 +1600,8 @@ class BoatApi extends runtime.BaseAPI {
1543
1600
  /**
1544
1601
  * Creates request options for hostPort without sending the request
1545
1602
  */
1546
- async hostPortRequestOpts(requestParameters) {
1603
+ async hostPortRequestOpts(input) {
1604
+ const requestParameters = runtime.unflattenBody(input, 'hostPortRequest', ['sandboxId'], []);
1547
1605
  if (requestParameters['sandboxId'] == null) {
1548
1606
  throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling hostPort().');
1549
1607
  }
@@ -1932,7 +1990,8 @@ class BoatApi extends runtime.BaseAPI {
1932
1990
  /**
1933
1991
  * Creates request options for prompt without sending the request
1934
1992
  */
1935
- async promptRequestOpts(requestParameters) {
1993
+ async promptRequestOpts(input) {
1994
+ const requestParameters = runtime.unflattenBody(input, 'promptRequest', ['sandboxId'], []);
1936
1995
  if (requestParameters['sandboxId'] == null) {
1937
1996
  throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling prompt().');
1938
1997
  }
@@ -2130,7 +2189,8 @@ class BoatApi extends runtime.BaseAPI {
2130
2189
  /**
2131
2190
  * Creates request options for resume without sending the request
2132
2191
  */
2133
- async resumeRequestOpts(requestParameters) {
2192
+ async resumeRequestOpts(input) {
2193
+ const requestParameters = runtime.unflattenBody(input, 'resumeRequest', ['sandboxId'], []);
2134
2194
  if (requestParameters['sandboxId'] == null) {
2135
2195
  throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling resume().');
2136
2196
  }
@@ -2346,7 +2406,8 @@ class BoatApi extends runtime.BaseAPI {
2346
2406
  /**
2347
2407
  * Creates request options for saveNamedSnapshot without sending the request
2348
2408
  */
2349
- async saveNamedSnapshotRequestOpts(requestParameters) {
2409
+ async saveNamedSnapshotRequestOpts(input) {
2410
+ const requestParameters = runtime.unflattenBody(input, 'namedSnapshotSaveRequest', [], []);
2350
2411
  if (requestParameters['namedSnapshotSaveRequest'] == null) {
2351
2412
  throw new runtime.RequiredError('namedSnapshotSaveRequest', 'Required parameter "namedSnapshotSaveRequest" was null or undefined when calling saveNamedSnapshot().');
2352
2413
  }
@@ -2427,7 +2488,8 @@ class BoatApi extends runtime.BaseAPI {
2427
2488
  /**
2428
2489
  * Creates request options for selectRepo without sending the request
2429
2490
  */
2430
- async selectRepoRequestOpts(requestParameters) {
2491
+ async selectRepoRequestOpts(input) {
2492
+ const requestParameters = runtime.unflattenBody(input, 'repoSelectionRequest', [], []);
2431
2493
  if (requestParameters['repoSelectionRequest'] == null) {
2432
2494
  throw new runtime.RequiredError('repoSelectionRequest', 'Required parameter "repoSelectionRequest" was null or undefined when calling selectRepo().');
2433
2495
  }
@@ -2470,7 +2532,8 @@ class BoatApi extends runtime.BaseAPI {
2470
2532
  /**
2471
2533
  * Creates request options for setActiveOrganization without sending the request
2472
2534
  */
2473
- async setActiveOrganizationRequestOpts(requestParameters) {
2535
+ async setActiveOrganizationRequestOpts(input) {
2536
+ const requestParameters = runtime.unflattenBody(input, 'activeOrgUpdateRequest', [], []);
2474
2537
  if (requestParameters['activeOrgUpdateRequest'] == null) {
2475
2538
  throw new runtime.RequiredError('activeOrgUpdateRequest', 'Required parameter "activeOrgUpdateRequest" was null or undefined when calling setActiveOrganization().');
2476
2539
  }
@@ -2513,7 +2576,8 @@ class BoatApi extends runtime.BaseAPI {
2513
2576
  /**
2514
2577
  * Creates request options for setEnvironmentSecretFile without sending the request
2515
2578
  */
2516
- async setEnvironmentSecretFileRequestOpts(requestParameters) {
2579
+ async setEnvironmentSecretFileRequestOpts(input) {
2580
+ const requestParameters = runtime.unflattenBody(input, 'setEnvironmentSecretFileRequest', ['environmentId'], []);
2517
2581
  if (requestParameters['environmentId'] == null) {
2518
2582
  throw new runtime.RequiredError('environmentId', 'Required parameter "environmentId" was null or undefined when calling setEnvironmentSecretFile().');
2519
2583
  }
@@ -2560,7 +2624,8 @@ class BoatApi extends runtime.BaseAPI {
2560
2624
  /**
2561
2625
  * Creates request options for setEnvironmentVar without sending the request
2562
2626
  */
2563
- async setEnvironmentVarRequestOpts(requestParameters) {
2627
+ async setEnvironmentVarRequestOpts(input) {
2628
+ const requestParameters = runtime.unflattenBody(input, 'setEnvironmentVarRequest', ['environmentId', 'key'], []);
2564
2629
  if (requestParameters['environmentId'] == null) {
2565
2630
  throw new runtime.RequiredError('environmentId', 'Required parameter "environmentId" was null or undefined when calling setEnvironmentVar().');
2566
2631
  }
@@ -2611,7 +2676,8 @@ class BoatApi extends runtime.BaseAPI {
2611
2676
  /**
2612
2677
  * Creates request options for sshKey without sending the request
2613
2678
  */
2614
- async sshKeyRequestOpts(requestParameters) {
2679
+ async sshKeyRequestOpts(input) {
2680
+ const requestParameters = runtime.unflattenBody(input, 'sshKeyRequest', ['sandboxId'], []);
2615
2681
  if (requestParameters['sandboxId'] == null) {
2616
2682
  throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling sshKey().');
2617
2683
  }
@@ -2658,7 +2724,8 @@ class BoatApi extends runtime.BaseAPI {
2658
2724
  /**
2659
2725
  * Creates request options for steer without sending the request
2660
2726
  */
2661
- async steerRequestOpts(requestParameters) {
2727
+ async steerRequestOpts(input) {
2728
+ const requestParameters = runtime.unflattenBody(input, 'steerRequest', ['sandboxId', 'conversation'], ['conversation']);
2662
2729
  if (requestParameters['sandboxId'] == null) {
2663
2730
  throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling steer().');
2664
2731
  }
@@ -2708,7 +2775,8 @@ class BoatApi extends runtime.BaseAPI {
2708
2775
  /**
2709
2776
  * Creates request options for stop without sending the request
2710
2777
  */
2711
- async stopRequestOpts(requestParameters) {
2778
+ async stopRequestOpts(input) {
2779
+ const requestParameters = runtime.unflattenBody(input, 'stopRequest', ['sandboxId'], []);
2712
2780
  if (requestParameters['sandboxId'] == null) {
2713
2781
  throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling stop().');
2714
2782
  }
@@ -2752,7 +2820,8 @@ class BoatApi extends runtime.BaseAPI {
2752
2820
  /**
2753
2821
  * Creates request options for update without sending the request
2754
2822
  */
2755
- async updateRequestOpts(requestParameters) {
2823
+ async updateRequestOpts(input) {
2824
+ const requestParameters = runtime.unflattenBody(input, 'updateSandboxRequest', ['sandboxId'], []);
2756
2825
  if (requestParameters['sandboxId'] == null) {
2757
2826
  throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling update().');
2758
2827
  }
@@ -2797,7 +2866,8 @@ class BoatApi extends runtime.BaseAPI {
2797
2866
  /**
2798
2867
  * Creates request options for updateDataRetention without sending the request
2799
2868
  */
2800
- async updateDataRetentionRequestOpts(requestParameters) {
2869
+ async updateDataRetentionRequestOpts(input) {
2870
+ const requestParameters = runtime.unflattenBody(input, 'dataRetentionUpdateRequest', [], []);
2801
2871
  if (requestParameters['dataRetentionUpdateRequest'] == null) {
2802
2872
  throw new runtime.RequiredError('dataRetentionUpdateRequest', 'Required parameter "dataRetentionUpdateRequest" was null or undefined when calling updateDataRetention().');
2803
2873
  }
@@ -2840,7 +2910,8 @@ class BoatApi extends runtime.BaseAPI {
2840
2910
  /**
2841
2911
  * Creates request options for updateEnvironment without sending the request
2842
2912
  */
2843
- async updateEnvironmentRequestOpts(requestParameters) {
2913
+ async updateEnvironmentRequestOpts(input) {
2914
+ const requestParameters = runtime.unflattenBody(input, 'updateSandboxEnvironmentRequest', ['environmentId'], []);
2844
2915
  if (requestParameters['environmentId'] == null) {
2845
2916
  throw new runtime.RequiredError('environmentId', 'Required parameter "environmentId" was null or undefined when calling updateEnvironment().');
2846
2917
  }
@@ -2887,7 +2958,8 @@ class BoatApi extends runtime.BaseAPI {
2887
2958
  /**
2888
2959
  * Creates request options for updateSecrets without sending the request
2889
2960
  */
2890
- async updateSecretsRequestOpts(requestParameters) {
2961
+ async updateSecretsRequestOpts(input) {
2962
+ const requestParameters = runtime.unflattenBody(input, 'secretsUpdateRequest', [], []);
2891
2963
  if (requestParameters['secretsUpdateRequest'] == null) {
2892
2964
  throw new runtime.RequiredError('secretsUpdateRequest', 'Required parameter "secretsUpdateRequest" was null or undefined when calling updateSecrets().');
2893
2965
  }
@@ -2928,7 +3000,8 @@ class BoatApi extends runtime.BaseAPI {
2928
3000
  /**
2929
3001
  * Creates request options for updateWebhook without sending the request
2930
3002
  */
2931
- async updateWebhookRequestOpts(requestParameters) {
3003
+ async updateWebhookRequestOpts(input) {
3004
+ const requestParameters = runtime.unflattenBody(input, 'webhookUpdateRequest', ['webhookId'], []);
2932
3005
  if (requestParameters['webhookId'] == null) {
2933
3006
  throw new runtime.RequiredError('webhookId', 'Required parameter "webhookId" was null or undefined when calling updateWebhook().');
2934
3007
  }
@@ -2975,7 +3048,8 @@ class BoatApi extends runtime.BaseAPI {
2975
3048
  /**
2976
3049
  * Creates request options for upgradeEnvironment without sending the request
2977
3050
  */
2978
- async upgradeEnvironmentRequestOpts(requestParameters) {
3051
+ async upgradeEnvironmentRequestOpts(input) {
3052
+ const requestParameters = runtime.unflattenBody(input, 'upgradeSandboxEnvironmentRequest', ['environmentId'], []);
2979
3053
  if (requestParameters['environmentId'] == null) {
2980
3054
  throw new runtime.RequiredError('environmentId', 'Required parameter "environmentId" was null or undefined when calling upgradeEnvironment().');
2981
3055
  }
@@ -3067,7 +3141,8 @@ class BoatApi extends runtime.BaseAPI {
3067
3141
  /**
3068
3142
  * Creates request options for writeFile without sending the request
3069
3143
  */
3070
- async writeFileRequestOpts(requestParameters) {
3144
+ async writeFileRequestOpts(input) {
3145
+ const requestParameters = runtime.unflattenBody(input, 'fileWriteRequest', ['sandboxId'], []);
3071
3146
  if (requestParameters['sandboxId'] == null) {
3072
3147
  throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling writeFile().');
3073
3148
  }