Skip to content

Commit 1af5508

Browse files
refactor: deprecate and make Nullable total_count and remaining_count of ListViews (#7533)
1 parent 54bb583 commit 1af5508

19 files changed

Lines changed: 96 additions & 47 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 117
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c8d61a0c8b88fa30666ba021d1239eb0d549902354513c4741e9216bcbfa8e6d.yml
3-
openapi_spec_hash: 433e6fb4ce076012b696f69ae7596c67
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8704a652545c3831c8b7e246ec17f1a626b59911eb5701ddc922ca6cae1c8d57.yml
3+
openapi_spec_hash: e609bc5ed3fdce498bc7d16921bbba5e
44
config_hash: eb28692edd68a6ae95cf92af931c9976

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Methods:
144144
- <code title="post /v1/devboxes/{id}/remove_tunnel">client.devboxes.<a href="./src/resources/devboxes/devboxes.ts">removeTunnel</a>(id, { ...params }) -> unknown</code>
145145
- <code title="post /v1/devboxes/{id}/resume">client.devboxes.<a href="./src/resources/devboxes/devboxes.ts">resume</a>(id) -> DevboxView</code>
146146
- <code title="get /v1/devboxes/{id}/usage">client.devboxes.<a href="./src/resources/devboxes/devboxes.ts">retrieveResourceUsage</a>(id) -> DevboxResourceUsageView</code>
147-
- <code title="post /v1/devboxes/{id}/shutdown">client.devboxes.<a href="./src/resources/devboxes/devboxes.ts">shutdown</a>(id) -> DevboxView</code>
147+
- <code title="post /v1/devboxes/{id}/shutdown">client.devboxes.<a href="./src/resources/devboxes/devboxes.ts">shutdown</a>(id, { ...params }) -> DevboxView</code>
148148
- <code title="post /v1/devboxes/{id}/snapshot_disk">client.devboxes.<a href="./src/resources/devboxes/devboxes.ts">snapshotDisk</a>(id, { ...params }) -> DevboxSnapshotView</code>
149149
- <code title="post /v1/devboxes/{id}/snapshot_disk_async">client.devboxes.<a href="./src/resources/devboxes/devboxes.ts">snapshotDiskAsync</a>(id, { ...params }) -> DevboxSnapshotView</code>
150150
- <code title="post /v1/devboxes/{id}/suspend">client.devboxes.<a href="./src/resources/devboxes/devboxes.ts">suspend</a>(id) -> DevboxView</code>

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ import {
197197
DevboxResourceUsageView,
198198
DevboxSendStdInRequest,
199199
DevboxSendStdInResult,
200+
DevboxShutdownParams,
200201
DevboxSnapshotDiskAsyncParams,
201202
DevboxSnapshotDiskParams,
202203
DevboxSnapshotListView,
@@ -630,6 +631,7 @@ export declare namespace Runloop {
630631
type DevboxListDiskSnapshotsParams as DevboxListDiskSnapshotsParams,
631632
type DevboxReadFileContentsParams as DevboxReadFileContentsParams,
632633
type DevboxRemoveTunnelParams as DevboxRemoveTunnelParams,
634+
type DevboxShutdownParams as DevboxShutdownParams,
633635
type DevboxSnapshotDiskParams as DevboxSnapshotDiskParams,
634636
type DevboxSnapshotDiskAsyncParams as DevboxSnapshotDiskAsyncParams,
635637
type DevboxUploadFileParams as DevboxUploadFileParams,

src/resources/agents.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,16 @@ export interface AgentListView {
7878
has_more: boolean;
7979

8080
/**
81-
* The count of remaining Agents.
81+
* The count of remaining Agents. Deprecated: will be removed in a future breaking
82+
* change.
8283
*/
83-
remaining_count: number;
84+
remaining_count?: number | null;
8485

8586
/**
86-
* The total count of Agents.
87+
* The total count of Agents. Deprecated: will be removed in a future breaking
88+
* change.
8789
*/
88-
total_count: number;
90+
total_count?: number | null;
8991
}
9092

9193
/**

src/resources/benchmark-jobs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,9 @@ export interface BenchmarkJobListView {
308308
*/
309309
jobs: Array<BenchmarkJobView>;
310310

311-
remaining_count: number;
311+
remaining_count?: number | null;
312312

313-
total_count: number;
313+
total_count?: number | null;
314314
}
315315

316316
/**

src/resources/benchmark-runs.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ export class BenchmarkRunViewsBenchmarkRunsCursorIDPage extends BenchmarkRunsCur
8585
export interface BenchmarkRunListView {
8686
has_more: boolean;
8787

88-
remaining_count: number;
89-
9088
/**
9189
* List of BenchmarkRuns matching filter.
9290
*/
9391
runs: Array<BenchmarkRunView>;
9492

95-
total_count: number;
93+
remaining_count?: number | null;
94+
95+
total_count?: number | null;
9696
}
9797

9898
/**

src/resources/benchmarks.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,14 @@ export interface BenchmarkView {
299299
export interface ScenarioDefinitionListView {
300300
has_more: boolean;
301301

302-
remaining_count: number;
303-
304302
/**
305303
* List of Scenarios matching filter.
306304
*/
307305
scenarios: Array<ScenariosAPI.ScenarioView>;
308306

309-
total_count: number;
307+
remaining_count?: number | null;
308+
309+
total_count?: number | null;
310310
}
311311

312312
export interface StartBenchmarkRunParameters {

src/resources/blueprints.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,9 @@ export interface BlueprintListView {
456456

457457
has_more: boolean;
458458

459-
remaining_count: number;
459+
remaining_count?: number | null;
460460

461-
total_count: number;
461+
total_count?: number | null;
462462
}
463463

464464
export interface BlueprintPreviewView {

src/resources/devboxes/devboxes.ts

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,26 @@ export class Devboxes extends APIResource {
450450
/**
451451
* Shutdown a running Devbox. This will permanently stop the Devbox. If you want to
452452
* save the state of the Devbox, you should take a snapshot before shutting down or
453-
* should suspend the Devbox instead of shutting down.
453+
* should suspend the Devbox instead of shutting down. If the Devbox has any
454+
* in-progress snapshots, the shutdown will be rejected with a 409 Conflict unless
455+
* force=true is specified.
454456
*/
455-
shutdown(id: string, options?: Core.RequestOptions): Core.APIPromise<DevboxView> {
456-
return this._client.post(`/v1/devboxes/${id}/shutdown`, options);
457+
shutdown(
458+
id: string,
459+
params?: DevboxShutdownParams,
460+
options?: Core.RequestOptions,
461+
): Core.APIPromise<DevboxView>;
462+
shutdown(id: string, options?: Core.RequestOptions): Core.APIPromise<DevboxView>;
463+
shutdown(
464+
id: string,
465+
params: DevboxShutdownParams | Core.RequestOptions = {},
466+
options?: Core.RequestOptions,
467+
): Core.APIPromise<DevboxView> {
468+
if (isRequestOptions(params)) {
469+
return this.shutdown(id, {}, params);
470+
}
471+
const { force } = params;
472+
return this._client.post(`/v1/devboxes/${id}/shutdown`, { query: { force }, ...options });
457473
}
458474

459475
/**
@@ -674,9 +690,9 @@ export interface DevboxListView {
674690

675691
has_more: boolean;
676692

677-
remaining_count: number;
693+
remaining_count?: number | null;
678694

679-
total_count: number;
695+
total_count?: number | null;
680696
}
681697

682698
export interface DevboxResourceUsageView {
@@ -762,14 +778,14 @@ export interface DevboxSendStdInResult {
762778
export interface DevboxSnapshotListView {
763779
has_more: boolean;
764780

765-
remaining_count: number;
766-
767781
/**
768782
* List of snapshots matching filter.
769783
*/
770784
snapshots: Array<DevboxSnapshotView>;
771785

772-
total_count: number;
786+
remaining_count?: number | null;
787+
788+
total_count?: number | null;
773789
}
774790

775791
/**
@@ -1380,6 +1396,13 @@ export interface DevboxRemoveTunnelParams {
13801396
port: number;
13811397
}
13821398

1399+
export interface DevboxShutdownParams {
1400+
/**
1401+
* If true, force shutdown even if snapshots are in progress. Defaults to false.
1402+
*/
1403+
force?: string;
1404+
}
1405+
13831406
export interface DevboxSnapshotDiskParams {
13841407
/**
13851408
* (Optional) Commit message associated with the snapshot (max 1000 characters)
@@ -1500,6 +1523,7 @@ export declare namespace Devboxes {
15001523
type DevboxListDiskSnapshotsParams as DevboxListDiskSnapshotsParams,
15011524
type DevboxReadFileContentsParams as DevboxReadFileContentsParams,
15021525
type DevboxRemoveTunnelParams as DevboxRemoveTunnelParams,
1526+
type DevboxShutdownParams as DevboxShutdownParams,
15031527
type DevboxSnapshotDiskParams as DevboxSnapshotDiskParams,
15041528
type DevboxSnapshotDiskAsyncParams as DevboxSnapshotDiskAsyncParams,
15051529
type DevboxUploadFileParams as DevboxUploadFileParams,

src/resources/devboxes/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export {
4646
type DevboxListDiskSnapshotsParams,
4747
type DevboxReadFileContentsParams,
4848
type DevboxRemoveTunnelParams,
49+
type DevboxShutdownParams,
4950
type DevboxSnapshotDiskParams,
5051
type DevboxSnapshotDiskAsyncParams,
5152
type DevboxUploadFileParams,

0 commit comments

Comments
 (0)