@boatdev/sdk 1.9.6 → 1.9.7

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 (37) hide show
  1. package/.openapi-generator/FILES +4 -0
  2. package/dist/apis/BoatApi.d.ts +76 -0
  3. package/dist/apis/BoatApi.js +199 -0
  4. package/dist/esm/apis/BoatApi.d.ts +76 -0
  5. package/dist/esm/apis/BoatApi.js +199 -0
  6. package/dist/esm/models/CredentialAccount.d.ts +50 -0
  7. package/dist/esm/models/CredentialAccount.js +53 -0
  8. package/dist/esm/models/CredentialAccountsResponse.d.ts +64 -0
  9. package/dist/esm/models/CredentialAccountsResponse.js +65 -0
  10. package/dist/esm/models/CredentialProfile.d.ts +9 -0
  11. package/dist/esm/models/CredentialProfile.js +2 -0
  12. package/dist/esm/models/SetCredentialKeyRequest.d.ts +6 -0
  13. package/dist/esm/models/SetCredentialKeyRequest.js +2 -0
  14. package/dist/esm/models/index.d.ts +2 -0
  15. package/dist/esm/models/index.js +2 -0
  16. package/dist/models/CredentialAccount.d.ts +50 -0
  17. package/dist/models/CredentialAccount.js +60 -0
  18. package/dist/models/CredentialAccountsResponse.d.ts +64 -0
  19. package/dist/models/CredentialAccountsResponse.js +72 -0
  20. package/dist/models/CredentialProfile.d.ts +9 -0
  21. package/dist/models/CredentialProfile.js +2 -0
  22. package/dist/models/SetCredentialKeyRequest.d.ts +6 -0
  23. package/dist/models/SetCredentialKeyRequest.js +2 -0
  24. package/dist/models/index.d.ts +2 -0
  25. package/dist/models/index.js +2 -0
  26. package/docs/BoatApi.md +325 -0
  27. package/docs/CredentialAccount.md +39 -0
  28. package/docs/CredentialAccountsResponse.md +42 -0
  29. package/docs/CredentialProfile.md +2 -0
  30. package/docs/SetCredentialKeyRequest.md +2 -0
  31. package/package.json +1 -1
  32. package/src/apis/BoatApi.ts +307 -0
  33. package/src/models/CredentialAccount.ts +92 -0
  34. package/src/models/CredentialAccountsResponse.ts +128 -0
  35. package/src/models/CredentialProfile.ts +15 -0
  36. package/src/models/SetCredentialKeyRequest.ts +8 -0
  37. package/src/models/index.ts +2 -0
@@ -46,6 +46,8 @@ docs/CreateSandboxRequest.md
46
46
  docs/CreateSandboxResponse.md
47
47
  docs/CreateScopedApiKey503Response.md
48
48
  docs/CreateScopedApiKeyRequest.md
49
+ docs/CredentialAccount.md
50
+ docs/CredentialAccountsResponse.md
49
51
  docs/CredentialId.md
50
52
  docs/CredentialProfile.md
51
53
  docs/CredentialProfileDeletedResponse.md
@@ -230,6 +232,8 @@ src/models/CreateSandboxRequest.ts
230
232
  src/models/CreateSandboxResponse.ts
231
233
  src/models/CreateScopedApiKey503Response.ts
232
234
  src/models/CreateScopedApiKeyRequest.ts
235
+ src/models/CredentialAccount.ts
236
+ src/models/CredentialAccountsResponse.ts
233
237
  src/models/CredentialId.ts
234
238
  src/models/CredentialProfile.ts
235
239
  src/models/CredentialProfileDeletedResponse.ts
@@ -33,6 +33,7 @@ import { type CreateSandboxEnvironmentRequest } from '../models/CreateSandboxEnv
33
33
  import { type CreateSandboxRequest } from '../models/CreateSandboxRequest';
34
34
  import { type CreateSandboxResponse } from '../models/CreateSandboxResponse';
35
35
  import { type CreateScopedApiKeyRequest } from '../models/CreateScopedApiKeyRequest';
36
+ import { type CredentialAccountsResponse } from '../models/CredentialAccountsResponse';
36
37
  import { type CredentialId } from '../models/CredentialId';
37
38
  import { type CredentialProfileDeletedResponse } from '../models/CredentialProfileDeletedResponse';
38
39
  import { type CredentialProfileListResponse } from '../models/CredentialProfileListResponse';
@@ -114,6 +115,11 @@ import { type WebhookListResponse } from '../models/WebhookListResponse';
114
115
  import { type WebhookResponse } from '../models/WebhookResponse';
115
116
  import { type WebhookSecretResponse } from '../models/WebhookSecretResponse';
116
117
  import { type WebhookUpdateRequest } from '../models/WebhookUpdateRequest';
118
+ export interface AddCredentialAccountRequest {
119
+ profile: string;
120
+ credential: CredentialId;
121
+ setCredentialKeyRequest: SetCredentialKeyRequest;
122
+ }
117
123
  export interface AddEnvironmentRepoOperationRequest {
118
124
  environmentId: string;
119
125
  addEnvironmentRepoRequest: AddEnvironmentRepoRequest;
@@ -191,6 +197,11 @@ export interface CreateUploadUrlRequest {
191
197
  export interface CreateWebhookRequest {
192
198
  webhookCreateRequest: WebhookCreateRequest;
193
199
  }
200
+ export interface DeleteCredentialAccountRequest {
201
+ profile: string;
202
+ credential: CredentialId;
203
+ account: string;
204
+ }
194
205
  export interface DeleteCredentialProfileRequest {
195
206
  profile: string;
196
207
  }
@@ -321,6 +332,10 @@ export interface LimitsRequest {
321
332
  xBoatOrg?: string;
322
333
  teamId?: string;
323
334
  }
335
+ export interface ListCredentialAccountsRequest {
336
+ profile: string;
337
+ credential: CredentialId;
338
+ }
324
339
  export interface ListSandboxSnapshotsRequest {
325
340
  sandboxId: string;
326
341
  limit?: number;
@@ -444,6 +459,11 @@ export interface StopCommandRequest {
444
459
  sandboxId: string;
445
460
  processId: number;
446
461
  }
462
+ export interface SwitchCredentialAccountRequest {
463
+ profile: string;
464
+ credential: CredentialId;
465
+ account: string;
466
+ }
447
467
  export interface UpdateRequest {
448
468
  sandboxId: string;
449
469
  updateSandboxRequest: UpdateSandboxRequest;
@@ -490,6 +510,20 @@ export interface WriteFileRequest {
490
510
  *
491
511
  */
492
512
  export declare class BoatApi extends runtime.BaseAPI {
513
+ /**
514
+ * Creates request options for addCredentialAccount without sending the request
515
+ */
516
+ addCredentialAccountRequestOpts(input: AddCredentialAccountRequest | runtime.FlatBody<AddCredentialAccountRequest, 'setCredentialKeyRequest'>): Promise<runtime.RequestOpts>;
517
+ /**
518
+ * Adds an API key as another account of the credential, ready to switch to. The first key of a credential becomes the one in use. A sign-in returns `400 not_an_api_key`; add another sign-in with \"Add another account\" on the dashboard. Needs an API key with `account.admin`.
519
+ * Add another API key to a credential
520
+ */
521
+ addCredentialAccountRaw(requestParameters: AddCredentialAccountRequest | runtime.FlatBody<AddCredentialAccountRequest, 'setCredentialKeyRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CredentialAccountsResponse>>;
522
+ /**
523
+ * Adds an API key as another account of the credential, ready to switch to. The first key of a credential becomes the one in use. A sign-in returns `400 not_an_api_key`; add another sign-in with \"Add another account\" on the dashboard. Needs an API key with `account.admin`.
524
+ * Add another API key to a credential
525
+ */
526
+ addCredentialAccount(requestParameters: AddCredentialAccountRequest | runtime.FlatBody<AddCredentialAccountRequest, 'setCredentialKeyRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CredentialAccountsResponse>;
493
527
  /**
494
528
  * Creates request options for addEnvironmentRepo without sending the request
495
529
  */
@@ -742,6 +776,20 @@ export declare class BoatApi extends runtime.BaseAPI {
742
776
  * Create webhook
743
777
  */
744
778
  createWebhook(requestParameters: CreateWebhookRequest | runtime.FlatBody<CreateWebhookRequest, 'webhookCreateRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookSecretResponse>;
779
+ /**
780
+ * Creates request options for deleteCredentialAccount without sending the request
781
+ */
782
+ deleteCredentialAccountRequestOpts(requestParameters: DeleteCredentialAccountRequest): Promise<runtime.RequestOpts>;
783
+ /**
784
+ * Deletes an account. For the account in use, the credential switches to another account first, or is removed when it was the last one. Needs an API key with `account.admin`.
785
+ * Forget an account of a credential
786
+ */
787
+ deleteCredentialAccountRaw(requestParameters: DeleteCredentialAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CredentialAccountsResponse>>;
788
+ /**
789
+ * Deletes an account. For the account in use, the credential switches to another account first, or is removed when it was the last one. Needs an API key with `account.admin`.
790
+ * Forget an account of a credential
791
+ */
792
+ deleteCredentialAccount(requestParameters: DeleteCredentialAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CredentialAccountsResponse>;
745
793
  /**
746
794
  * Creates request options for deleteCredentialProfile without sending the request
747
795
  */
@@ -1228,6 +1276,20 @@ export declare class BoatApi extends runtime.BaseAPI {
1228
1276
  * Get Boat limits
1229
1277
  */
1230
1278
  limits(requestParameters?: LimitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LimitsResponse>;
1279
+ /**
1280
+ * Creates request options for listCredentialAccounts without sending the request
1281
+ */
1282
+ listCredentialAccountsRequestOpts(requestParameters: ListCredentialAccountsRequest): Promise<runtime.RequestOpts>;
1283
+ /**
1284
+ * Every account of one credential (several ChatGPT sign-ins, several OpenAI keys), in the order they were added, the one in use marked. Labels only, never a secret. Needs an API key with `account.admin`.
1285
+ * List the accounts of a credential
1286
+ */
1287
+ listCredentialAccountsRaw(requestParameters: ListCredentialAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CredentialAccountsResponse>>;
1288
+ /**
1289
+ * Every account of one credential (several ChatGPT sign-ins, several OpenAI keys), in the order they were added, the one in use marked. Labels only, never a secret. Needs an API key with `account.admin`.
1290
+ * List the accounts of a credential
1291
+ */
1292
+ listCredentialAccounts(requestParameters: ListCredentialAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CredentialAccountsResponse>;
1231
1293
  /**
1232
1294
  * Creates request options for listCredentialProfiles without sending the request
1233
1295
  */
@@ -1716,6 +1778,20 @@ export declare class BoatApi extends runtime.BaseAPI {
1716
1778
  * Stop a detached command
1717
1779
  */
1718
1780
  stopCommand(requestParameters: StopCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CommandStopResponse>;
1781
+ /**
1782
+ * Creates request options for switchCredentialAccount without sending the request
1783
+ */
1784
+ switchCredentialAccountRequestOpts(requestParameters: SwitchCredentialAccountRequest): Promise<runtime.RequestOpts>;
1785
+ /**
1786
+ * Makes this account the one in use; the previous one stays as another account. Switching to the account already in use changes nothing. Every sandbox that uses the profile gets it at once, running ones included, with no restart. Use it when one account runs out of credits. Needs an API key with `account.admin`.
1787
+ * Switch a credential to another account
1788
+ */
1789
+ switchCredentialAccountRaw(requestParameters: SwitchCredentialAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CredentialAccountsResponse>>;
1790
+ /**
1791
+ * Makes this account the one in use; the previous one stays as another account. Switching to the account already in use changes nothing. Every sandbox that uses the profile gets it at once, running ones included, with no restart. Use it when one account runs out of credits. Needs an API key with `account.admin`.
1792
+ * Switch a credential to another account
1793
+ */
1794
+ switchCredentialAccount(requestParameters: SwitchCredentialAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CredentialAccountsResponse>;
1719
1795
  /**
1720
1796
  * Creates request options for update without sending the request
1721
1797
  */
@@ -71,6 +71,7 @@ const CreateSandboxEnvironmentRequest_1 = require("../models/CreateSandboxEnviro
71
71
  const CreateSandboxRequest_1 = require("../models/CreateSandboxRequest");
72
72
  const CreateSandboxResponse_1 = require("../models/CreateSandboxResponse");
73
73
  const CreateScopedApiKeyRequest_1 = require("../models/CreateScopedApiKeyRequest");
74
+ const CredentialAccountsResponse_1 = require("../models/CredentialAccountsResponse");
74
75
  const CredentialProfileDeletedResponse_1 = require("../models/CredentialProfileDeletedResponse");
75
76
  const CredentialProfileListResponse_1 = require("../models/CredentialProfileListResponse");
76
77
  const CredentialProfileResponse_1 = require("../models/CredentialProfileResponse");
@@ -155,6 +156,58 @@ const WebhookUpdateRequest_1 = require("../models/WebhookUpdateRequest");
155
156
  *
156
157
  */
157
158
  class BoatApi extends runtime.BaseAPI {
159
+ /**
160
+ * Creates request options for addCredentialAccount without sending the request
161
+ */
162
+ async addCredentialAccountRequestOpts(input) {
163
+ const requestParameters = runtime.unflattenBody(input, 'setCredentialKeyRequest', ['profile', 'credential'], []);
164
+ if (requestParameters['profile'] == null) {
165
+ throw new runtime.RequiredError('profile', 'Required parameter "profile" was null or undefined when calling addCredentialAccount().');
166
+ }
167
+ if (requestParameters['credential'] == null) {
168
+ throw new runtime.RequiredError('credential', 'Required parameter "credential" was null or undefined when calling addCredentialAccount().');
169
+ }
170
+ if (requestParameters['setCredentialKeyRequest'] == null) {
171
+ throw new runtime.RequiredError('setCredentialKeyRequest', 'Required parameter "setCredentialKeyRequest" was null or undefined when calling addCredentialAccount().');
172
+ }
173
+ const queryParameters = {};
174
+ const headerParameters = {};
175
+ headerParameters['Content-Type'] = 'application/json';
176
+ if (this.configuration && this.configuration.accessToken) {
177
+ const token = this.configuration.accessToken;
178
+ const tokenString = await token("BoatBearerAuth", []);
179
+ if (tokenString) {
180
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
181
+ }
182
+ }
183
+ let urlPath = `/credential-profiles/{profile}/accounts/{credential}`;
184
+ urlPath = urlPath.replace('{profile}', encodeURIComponent(String(requestParameters['profile'])));
185
+ urlPath = urlPath.replace('{credential}', encodeURIComponent(String(requestParameters['credential'])));
186
+ return {
187
+ path: urlPath,
188
+ method: 'POST',
189
+ headers: headerParameters,
190
+ query: queryParameters,
191
+ body: (0, SetCredentialKeyRequest_1.SetCredentialKeyRequestToJSON)(requestParameters['setCredentialKeyRequest']),
192
+ };
193
+ }
194
+ /**
195
+ * Adds an API key as another account of the credential, ready to switch to. The first key of a credential becomes the one in use. A sign-in returns `400 not_an_api_key`; add another sign-in with \"Add another account\" on the dashboard. Needs an API key with `account.admin`.
196
+ * Add another API key to a credential
197
+ */
198
+ async addCredentialAccountRaw(requestParameters, initOverrides) {
199
+ const requestOptions = await this.addCredentialAccountRequestOpts(requestParameters);
200
+ const response = await this.request(requestOptions, initOverrides);
201
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, CredentialAccountsResponse_1.CredentialAccountsResponseFromJSON)(jsonValue));
202
+ }
203
+ /**
204
+ * Adds an API key as another account of the credential, ready to switch to. The first key of a credential becomes the one in use. A sign-in returns `400 not_an_api_key`; add another sign-in with \"Add another account\" on the dashboard. Needs an API key with `account.admin`.
205
+ * Add another API key to a credential
206
+ */
207
+ async addCredentialAccount(requestParameters, initOverrides) {
208
+ const response = await this.addCredentialAccountRaw(requestParameters, initOverrides);
209
+ return await response.value();
210
+ }
158
211
  /**
159
212
  * Creates request options for addEnvironmentRepo without sending the request
160
213
  */
@@ -1010,6 +1063,56 @@ class BoatApi extends runtime.BaseAPI {
1010
1063
  const response = await this.createWebhookRaw(requestParameters, initOverrides);
1011
1064
  return await response.value();
1012
1065
  }
1066
+ /**
1067
+ * Creates request options for deleteCredentialAccount without sending the request
1068
+ */
1069
+ async deleteCredentialAccountRequestOpts(requestParameters) {
1070
+ if (requestParameters['profile'] == null) {
1071
+ throw new runtime.RequiredError('profile', 'Required parameter "profile" was null or undefined when calling deleteCredentialAccount().');
1072
+ }
1073
+ if (requestParameters['credential'] == null) {
1074
+ throw new runtime.RequiredError('credential', 'Required parameter "credential" was null or undefined when calling deleteCredentialAccount().');
1075
+ }
1076
+ if (requestParameters['account'] == null) {
1077
+ throw new runtime.RequiredError('account', 'Required parameter "account" was null or undefined when calling deleteCredentialAccount().');
1078
+ }
1079
+ const queryParameters = {};
1080
+ const headerParameters = {};
1081
+ if (this.configuration && this.configuration.accessToken) {
1082
+ const token = this.configuration.accessToken;
1083
+ const tokenString = await token("BoatBearerAuth", []);
1084
+ if (tokenString) {
1085
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1086
+ }
1087
+ }
1088
+ let urlPath = `/credential-profiles/{profile}/accounts/{credential}/{account}`;
1089
+ urlPath = urlPath.replace('{profile}', encodeURIComponent(String(requestParameters['profile'])));
1090
+ urlPath = urlPath.replace('{credential}', encodeURIComponent(String(requestParameters['credential'])));
1091
+ urlPath = urlPath.replace('{account}', encodeURIComponent(String(requestParameters['account'])));
1092
+ return {
1093
+ path: urlPath,
1094
+ method: 'DELETE',
1095
+ headers: headerParameters,
1096
+ query: queryParameters,
1097
+ };
1098
+ }
1099
+ /**
1100
+ * Deletes an account. For the account in use, the credential switches to another account first, or is removed when it was the last one. Needs an API key with `account.admin`.
1101
+ * Forget an account of a credential
1102
+ */
1103
+ async deleteCredentialAccountRaw(requestParameters, initOverrides) {
1104
+ const requestOptions = await this.deleteCredentialAccountRequestOpts(requestParameters);
1105
+ const response = await this.request(requestOptions, initOverrides);
1106
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, CredentialAccountsResponse_1.CredentialAccountsResponseFromJSON)(jsonValue));
1107
+ }
1108
+ /**
1109
+ * Deletes an account. For the account in use, the credential switches to another account first, or is removed when it was the last one. Needs an API key with `account.admin`.
1110
+ * Forget an account of a credential
1111
+ */
1112
+ async deleteCredentialAccount(requestParameters, initOverrides) {
1113
+ const response = await this.deleteCredentialAccountRaw(requestParameters, initOverrides);
1114
+ return await response.value();
1115
+ }
1013
1116
  /**
1014
1117
  * Creates request options for deleteCredentialProfile without sending the request
1015
1118
  */
@@ -2583,6 +2686,52 @@ class BoatApi extends runtime.BaseAPI {
2583
2686
  const response = await this.limitsRaw(requestParameters, initOverrides);
2584
2687
  return await response.value();
2585
2688
  }
2689
+ /**
2690
+ * Creates request options for listCredentialAccounts without sending the request
2691
+ */
2692
+ async listCredentialAccountsRequestOpts(requestParameters) {
2693
+ if (requestParameters['profile'] == null) {
2694
+ throw new runtime.RequiredError('profile', 'Required parameter "profile" was null or undefined when calling listCredentialAccounts().');
2695
+ }
2696
+ if (requestParameters['credential'] == null) {
2697
+ throw new runtime.RequiredError('credential', 'Required parameter "credential" was null or undefined when calling listCredentialAccounts().');
2698
+ }
2699
+ const queryParameters = {};
2700
+ const headerParameters = {};
2701
+ if (this.configuration && this.configuration.accessToken) {
2702
+ const token = this.configuration.accessToken;
2703
+ const tokenString = await token("BoatBearerAuth", []);
2704
+ if (tokenString) {
2705
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
2706
+ }
2707
+ }
2708
+ let urlPath = `/credential-profiles/{profile}/accounts/{credential}`;
2709
+ urlPath = urlPath.replace('{profile}', encodeURIComponent(String(requestParameters['profile'])));
2710
+ urlPath = urlPath.replace('{credential}', encodeURIComponent(String(requestParameters['credential'])));
2711
+ return {
2712
+ path: urlPath,
2713
+ method: 'GET',
2714
+ headers: headerParameters,
2715
+ query: queryParameters,
2716
+ };
2717
+ }
2718
+ /**
2719
+ * Every account of one credential (several ChatGPT sign-ins, several OpenAI keys), in the order they were added, the one in use marked. Labels only, never a secret. Needs an API key with `account.admin`.
2720
+ * List the accounts of a credential
2721
+ */
2722
+ async listCredentialAccountsRaw(requestParameters, initOverrides) {
2723
+ const requestOptions = await this.listCredentialAccountsRequestOpts(requestParameters);
2724
+ const response = await this.request(requestOptions, initOverrides);
2725
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, CredentialAccountsResponse_1.CredentialAccountsResponseFromJSON)(jsonValue));
2726
+ }
2727
+ /**
2728
+ * Every account of one credential (several ChatGPT sign-ins, several OpenAI keys), in the order they were added, the one in use marked. Labels only, never a secret. Needs an API key with `account.admin`.
2729
+ * List the accounts of a credential
2730
+ */
2731
+ async listCredentialAccounts(requestParameters, initOverrides) {
2732
+ const response = await this.listCredentialAccountsRaw(requestParameters, initOverrides);
2733
+ return await response.value();
2734
+ }
2586
2735
  /**
2587
2736
  * Creates request options for listCredentialProfiles without sending the request
2588
2737
  */
@@ -4173,6 +4322,56 @@ class BoatApi extends runtime.BaseAPI {
4173
4322
  const response = await this.stopCommandRaw(requestParameters, initOverrides);
4174
4323
  return await response.value();
4175
4324
  }
4325
+ /**
4326
+ * Creates request options for switchCredentialAccount without sending the request
4327
+ */
4328
+ async switchCredentialAccountRequestOpts(requestParameters) {
4329
+ if (requestParameters['profile'] == null) {
4330
+ throw new runtime.RequiredError('profile', 'Required parameter "profile" was null or undefined when calling switchCredentialAccount().');
4331
+ }
4332
+ if (requestParameters['credential'] == null) {
4333
+ throw new runtime.RequiredError('credential', 'Required parameter "credential" was null or undefined when calling switchCredentialAccount().');
4334
+ }
4335
+ if (requestParameters['account'] == null) {
4336
+ throw new runtime.RequiredError('account', 'Required parameter "account" was null or undefined when calling switchCredentialAccount().');
4337
+ }
4338
+ const queryParameters = {};
4339
+ const headerParameters = {};
4340
+ if (this.configuration && this.configuration.accessToken) {
4341
+ const token = this.configuration.accessToken;
4342
+ const tokenString = await token("BoatBearerAuth", []);
4343
+ if (tokenString) {
4344
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
4345
+ }
4346
+ }
4347
+ let urlPath = `/credential-profiles/{profile}/accounts/{credential}/{account}/active`;
4348
+ urlPath = urlPath.replace('{profile}', encodeURIComponent(String(requestParameters['profile'])));
4349
+ urlPath = urlPath.replace('{credential}', encodeURIComponent(String(requestParameters['credential'])));
4350
+ urlPath = urlPath.replace('{account}', encodeURIComponent(String(requestParameters['account'])));
4351
+ return {
4352
+ path: urlPath,
4353
+ method: 'PUT',
4354
+ headers: headerParameters,
4355
+ query: queryParameters,
4356
+ };
4357
+ }
4358
+ /**
4359
+ * Makes this account the one in use; the previous one stays as another account. Switching to the account already in use changes nothing. Every sandbox that uses the profile gets it at once, running ones included, with no restart. Use it when one account runs out of credits. Needs an API key with `account.admin`.
4360
+ * Switch a credential to another account
4361
+ */
4362
+ async switchCredentialAccountRaw(requestParameters, initOverrides) {
4363
+ const requestOptions = await this.switchCredentialAccountRequestOpts(requestParameters);
4364
+ const response = await this.request(requestOptions, initOverrides);
4365
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, CredentialAccountsResponse_1.CredentialAccountsResponseFromJSON)(jsonValue));
4366
+ }
4367
+ /**
4368
+ * Makes this account the one in use; the previous one stays as another account. Switching to the account already in use changes nothing. Every sandbox that uses the profile gets it at once, running ones included, with no restart. Use it when one account runs out of credits. Needs an API key with `account.admin`.
4369
+ * Switch a credential to another account
4370
+ */
4371
+ async switchCredentialAccount(requestParameters, initOverrides) {
4372
+ const response = await this.switchCredentialAccountRaw(requestParameters, initOverrides);
4373
+ return await response.value();
4374
+ }
4176
4375
  /**
4177
4376
  * Creates request options for update without sending the request
4178
4377
  */
@@ -33,6 +33,7 @@ import { type CreateSandboxEnvironmentRequest } from '../models/CreateSandboxEnv
33
33
  import { type CreateSandboxRequest } from '../models/CreateSandboxRequest';
34
34
  import { type CreateSandboxResponse } from '../models/CreateSandboxResponse';
35
35
  import { type CreateScopedApiKeyRequest } from '../models/CreateScopedApiKeyRequest';
36
+ import { type CredentialAccountsResponse } from '../models/CredentialAccountsResponse';
36
37
  import { type CredentialId } from '../models/CredentialId';
37
38
  import { type CredentialProfileDeletedResponse } from '../models/CredentialProfileDeletedResponse';
38
39
  import { type CredentialProfileListResponse } from '../models/CredentialProfileListResponse';
@@ -114,6 +115,11 @@ import { type WebhookListResponse } from '../models/WebhookListResponse';
114
115
  import { type WebhookResponse } from '../models/WebhookResponse';
115
116
  import { type WebhookSecretResponse } from '../models/WebhookSecretResponse';
116
117
  import { type WebhookUpdateRequest } from '../models/WebhookUpdateRequest';
118
+ export interface AddCredentialAccountRequest {
119
+ profile: string;
120
+ credential: CredentialId;
121
+ setCredentialKeyRequest: SetCredentialKeyRequest;
122
+ }
117
123
  export interface AddEnvironmentRepoOperationRequest {
118
124
  environmentId: string;
119
125
  addEnvironmentRepoRequest: AddEnvironmentRepoRequest;
@@ -191,6 +197,11 @@ export interface CreateUploadUrlRequest {
191
197
  export interface CreateWebhookRequest {
192
198
  webhookCreateRequest: WebhookCreateRequest;
193
199
  }
200
+ export interface DeleteCredentialAccountRequest {
201
+ profile: string;
202
+ credential: CredentialId;
203
+ account: string;
204
+ }
194
205
  export interface DeleteCredentialProfileRequest {
195
206
  profile: string;
196
207
  }
@@ -321,6 +332,10 @@ export interface LimitsRequest {
321
332
  xBoatOrg?: string;
322
333
  teamId?: string;
323
334
  }
335
+ export interface ListCredentialAccountsRequest {
336
+ profile: string;
337
+ credential: CredentialId;
338
+ }
324
339
  export interface ListSandboxSnapshotsRequest {
325
340
  sandboxId: string;
326
341
  limit?: number;
@@ -444,6 +459,11 @@ export interface StopCommandRequest {
444
459
  sandboxId: string;
445
460
  processId: number;
446
461
  }
462
+ export interface SwitchCredentialAccountRequest {
463
+ profile: string;
464
+ credential: CredentialId;
465
+ account: string;
466
+ }
447
467
  export interface UpdateRequest {
448
468
  sandboxId: string;
449
469
  updateSandboxRequest: UpdateSandboxRequest;
@@ -490,6 +510,20 @@ export interface WriteFileRequest {
490
510
  *
491
511
  */
492
512
  export declare class BoatApi extends runtime.BaseAPI {
513
+ /**
514
+ * Creates request options for addCredentialAccount without sending the request
515
+ */
516
+ addCredentialAccountRequestOpts(input: AddCredentialAccountRequest | runtime.FlatBody<AddCredentialAccountRequest, 'setCredentialKeyRequest'>): Promise<runtime.RequestOpts>;
517
+ /**
518
+ * Adds an API key as another account of the credential, ready to switch to. The first key of a credential becomes the one in use. A sign-in returns `400 not_an_api_key`; add another sign-in with \"Add another account\" on the dashboard. Needs an API key with `account.admin`.
519
+ * Add another API key to a credential
520
+ */
521
+ addCredentialAccountRaw(requestParameters: AddCredentialAccountRequest | runtime.FlatBody<AddCredentialAccountRequest, 'setCredentialKeyRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CredentialAccountsResponse>>;
522
+ /**
523
+ * Adds an API key as another account of the credential, ready to switch to. The first key of a credential becomes the one in use. A sign-in returns `400 not_an_api_key`; add another sign-in with \"Add another account\" on the dashboard. Needs an API key with `account.admin`.
524
+ * Add another API key to a credential
525
+ */
526
+ addCredentialAccount(requestParameters: AddCredentialAccountRequest | runtime.FlatBody<AddCredentialAccountRequest, 'setCredentialKeyRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CredentialAccountsResponse>;
493
527
  /**
494
528
  * Creates request options for addEnvironmentRepo without sending the request
495
529
  */
@@ -742,6 +776,20 @@ export declare class BoatApi extends runtime.BaseAPI {
742
776
  * Create webhook
743
777
  */
744
778
  createWebhook(requestParameters: CreateWebhookRequest | runtime.FlatBody<CreateWebhookRequest, 'webhookCreateRequest'>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookSecretResponse>;
779
+ /**
780
+ * Creates request options for deleteCredentialAccount without sending the request
781
+ */
782
+ deleteCredentialAccountRequestOpts(requestParameters: DeleteCredentialAccountRequest): Promise<runtime.RequestOpts>;
783
+ /**
784
+ * Deletes an account. For the account in use, the credential switches to another account first, or is removed when it was the last one. Needs an API key with `account.admin`.
785
+ * Forget an account of a credential
786
+ */
787
+ deleteCredentialAccountRaw(requestParameters: DeleteCredentialAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CredentialAccountsResponse>>;
788
+ /**
789
+ * Deletes an account. For the account in use, the credential switches to another account first, or is removed when it was the last one. Needs an API key with `account.admin`.
790
+ * Forget an account of a credential
791
+ */
792
+ deleteCredentialAccount(requestParameters: DeleteCredentialAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CredentialAccountsResponse>;
745
793
  /**
746
794
  * Creates request options for deleteCredentialProfile without sending the request
747
795
  */
@@ -1228,6 +1276,20 @@ export declare class BoatApi extends runtime.BaseAPI {
1228
1276
  * Get Boat limits
1229
1277
  */
1230
1278
  limits(requestParameters?: LimitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LimitsResponse>;
1279
+ /**
1280
+ * Creates request options for listCredentialAccounts without sending the request
1281
+ */
1282
+ listCredentialAccountsRequestOpts(requestParameters: ListCredentialAccountsRequest): Promise<runtime.RequestOpts>;
1283
+ /**
1284
+ * Every account of one credential (several ChatGPT sign-ins, several OpenAI keys), in the order they were added, the one in use marked. Labels only, never a secret. Needs an API key with `account.admin`.
1285
+ * List the accounts of a credential
1286
+ */
1287
+ listCredentialAccountsRaw(requestParameters: ListCredentialAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CredentialAccountsResponse>>;
1288
+ /**
1289
+ * Every account of one credential (several ChatGPT sign-ins, several OpenAI keys), in the order they were added, the one in use marked. Labels only, never a secret. Needs an API key with `account.admin`.
1290
+ * List the accounts of a credential
1291
+ */
1292
+ listCredentialAccounts(requestParameters: ListCredentialAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CredentialAccountsResponse>;
1231
1293
  /**
1232
1294
  * Creates request options for listCredentialProfiles without sending the request
1233
1295
  */
@@ -1716,6 +1778,20 @@ export declare class BoatApi extends runtime.BaseAPI {
1716
1778
  * Stop a detached command
1717
1779
  */
1718
1780
  stopCommand(requestParameters: StopCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CommandStopResponse>;
1781
+ /**
1782
+ * Creates request options for switchCredentialAccount without sending the request
1783
+ */
1784
+ switchCredentialAccountRequestOpts(requestParameters: SwitchCredentialAccountRequest): Promise<runtime.RequestOpts>;
1785
+ /**
1786
+ * Makes this account the one in use; the previous one stays as another account. Switching to the account already in use changes nothing. Every sandbox that uses the profile gets it at once, running ones included, with no restart. Use it when one account runs out of credits. Needs an API key with `account.admin`.
1787
+ * Switch a credential to another account
1788
+ */
1789
+ switchCredentialAccountRaw(requestParameters: SwitchCredentialAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CredentialAccountsResponse>>;
1790
+ /**
1791
+ * Makes this account the one in use; the previous one stays as another account. Switching to the account already in use changes nothing. Every sandbox that uses the profile gets it at once, running ones included, with no restart. Use it when one account runs out of credits. Needs an API key with `account.admin`.
1792
+ * Switch a credential to another account
1793
+ */
1794
+ switchCredentialAccount(requestParameters: SwitchCredentialAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CredentialAccountsResponse>;
1719
1795
  /**
1720
1796
  * Creates request options for update without sending the request
1721
1797
  */