|
97 | 97 | from ...types.devbox_resource_usage_view import DevboxResourceUsageView |
98 | 98 | from ...types.devbox_execution_detail_view import DevboxExecutionDetailView |
99 | 99 | from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse |
| 100 | +from ...types.devbox_watch_evictions_response import DevboxWatchEvictionsResponse |
100 | 101 | from ...types.shared_params.launch_parameters import LaunchParameters |
101 | 102 | from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView |
102 | 103 | from ...types.shared_params.code_mount_parameters import CodeMountParameters |
@@ -1742,6 +1743,31 @@ def wait_for_command( |
1742 | 1743 | cast_to=DevboxAsyncExecutionDetailView, |
1743 | 1744 | ) |
1744 | 1745 |
|
| 1746 | + def watch_evictions( |
| 1747 | + self, |
| 1748 | + *, |
| 1749 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 1750 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 1751 | + extra_headers: Headers | None = None, |
| 1752 | + extra_query: Query | None = None, |
| 1753 | + extra_body: Body | None = None, |
| 1754 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 1755 | + ) -> DevboxWatchEvictionsResponse: |
| 1756 | + """ |
| 1757 | + Subscribe, via server-sent events, to pending infrastructure evictions for every |
| 1758 | + Devbox in the account. On connect the stream emits one event per Devbox that |
| 1759 | + currently has a pending eviction, then one event as each further eviction is |
| 1760 | + scheduled. Best-effort and advisory: a Devbox stays running until its deadline, |
| 1761 | + and delivery is not guaranteed. |
| 1762 | + """ |
| 1763 | + return self._get( |
| 1764 | + "/v1/devboxes/watch_evictions", |
| 1765 | + options=make_request_options( |
| 1766 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 1767 | + ), |
| 1768 | + cast_to=DevboxWatchEvictionsResponse, |
| 1769 | + ) |
| 1770 | + |
1745 | 1771 | def write_file_contents( |
1746 | 1772 | self, |
1747 | 1773 | id: str, |
@@ -3417,6 +3443,31 @@ async def wait_for_command( |
3417 | 3443 | cast_to=DevboxAsyncExecutionDetailView, |
3418 | 3444 | ) |
3419 | 3445 |
|
| 3446 | + async def watch_evictions( |
| 3447 | + self, |
| 3448 | + *, |
| 3449 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 3450 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 3451 | + extra_headers: Headers | None = None, |
| 3452 | + extra_query: Query | None = None, |
| 3453 | + extra_body: Body | None = None, |
| 3454 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 3455 | + ) -> DevboxWatchEvictionsResponse: |
| 3456 | + """ |
| 3457 | + Subscribe, via server-sent events, to pending infrastructure evictions for every |
| 3458 | + Devbox in the account. On connect the stream emits one event per Devbox that |
| 3459 | + currently has a pending eviction, then one event as each further eviction is |
| 3460 | + scheduled. Best-effort and advisory: a Devbox stays running until its deadline, |
| 3461 | + and delivery is not guaranteed. |
| 3462 | + """ |
| 3463 | + return await self._get( |
| 3464 | + "/v1/devboxes/watch_evictions", |
| 3465 | + options=make_request_options( |
| 3466 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 3467 | + ), |
| 3468 | + cast_to=DevboxWatchEvictionsResponse, |
| 3469 | + ) |
| 3470 | + |
3420 | 3471 | async def write_file_contents( |
3421 | 3472 | self, |
3422 | 3473 | id: str, |
@@ -3555,6 +3606,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: |
3555 | 3606 | self.wait_for_command = to_raw_response_wrapper( |
3556 | 3607 | devboxes.wait_for_command, |
3557 | 3608 | ) |
| 3609 | + self.watch_evictions = to_raw_response_wrapper( |
| 3610 | + devboxes.watch_evictions, |
| 3611 | + ) |
3558 | 3612 | self.write_file_contents = to_raw_response_wrapper( |
3559 | 3613 | devboxes.write_file_contents, |
3560 | 3614 | ) |
@@ -3651,6 +3705,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: |
3651 | 3705 | self.wait_for_command = async_to_raw_response_wrapper( |
3652 | 3706 | devboxes.wait_for_command, |
3653 | 3707 | ) |
| 3708 | + self.watch_evictions = async_to_raw_response_wrapper( |
| 3709 | + devboxes.watch_evictions, |
| 3710 | + ) |
3654 | 3711 | self.write_file_contents = async_to_raw_response_wrapper( |
3655 | 3712 | devboxes.write_file_contents, |
3656 | 3713 | ) |
@@ -3747,6 +3804,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: |
3747 | 3804 | self.wait_for_command = to_streamed_response_wrapper( |
3748 | 3805 | devboxes.wait_for_command, |
3749 | 3806 | ) |
| 3807 | + self.watch_evictions = to_streamed_response_wrapper( |
| 3808 | + devboxes.watch_evictions, |
| 3809 | + ) |
3750 | 3810 | self.write_file_contents = to_streamed_response_wrapper( |
3751 | 3811 | devboxes.write_file_contents, |
3752 | 3812 | ) |
@@ -3843,6 +3903,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: |
3843 | 3903 | self.wait_for_command = async_to_streamed_response_wrapper( |
3844 | 3904 | devboxes.wait_for_command, |
3845 | 3905 | ) |
| 3906 | + self.watch_evictions = async_to_streamed_response_wrapper( |
| 3907 | + devboxes.watch_evictions, |
| 3908 | + ) |
3846 | 3909 | self.write_file_contents = async_to_streamed_response_wrapper( |
3847 | 3910 | devboxes.write_file_contents, |
3848 | 3911 | ) |
|
0 commit comments