Skip to content

Commit aeabbe3

Browse files
feat: Say how many certificates the refresh PR body leaves out
Stainless-Generated-From: 7d10b47e929bab046694b4510dc16193a39f7555
1 parent 7100c82 commit aeabbe3

14 files changed

Lines changed: 508 additions & 7 deletions

‎.stats.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 178
1+
configured_endpoints: 179

‎api.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,18 @@ Methods:
228228
- <code title="get /browsers/{id_or_name}/telemetry/events">client.browsers.telemetry.<a href="./src/kernel/resources/browsers/telemetry.py">events</a>(id_or_name, \*\*<a href="src/kernel/types/browsers/telemetry_events_params.py">params</a>) -> <a href="./src/kernel/types/browsers/telemetry_events_response.py">SyncOffsetPagination[TelemetryEventsResponse]</a></code>
229229
- <code title="get /browsers/{id_or_name}/telemetry/stream">client.browsers.telemetry.<a href="./src/kernel/resources/browsers/telemetry.py">stream</a>(id_or_name, \*\*<a href="src/kernel/types/browsers/telemetry_stream_params.py">params</a>) -> <a href="./src/kernel/types/browsers/telemetry_stream_response.py">TelemetryStreamResponse</a></code>
230230

231+
## LiveView
232+
233+
Types:
234+
235+
```python
236+
from kernel.types.browsers import BrowserLiveView, BrowserLiveViewRequest, BrowserLiveViewScope
237+
```
238+
239+
Methods:
240+
241+
- <code title="post /browsers/{id_or_name}/live_view">client.browsers.live_view.<a href="./src/kernel/resources/browsers/live_view.py">create</a>(id_or_name, \*\*<a href="src/kernel/types/browsers/live_view_create_params.py">params</a>) -> <a href="./src/kernel/types/browsers/browser_live_view.py">BrowserLiveView</a></code>
242+
231243
## Replays
232244

233245
Types:

‎src/kernel/resources/browsers/__init__.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@
5656
ComputerResourceWithStreamingResponse,
5757
AsyncComputerResourceWithStreamingResponse,
5858
)
59+
from .live_view import (
60+
LiveViewResource,
61+
AsyncLiveViewResource,
62+
LiveViewResourceWithRawResponse,
63+
AsyncLiveViewResourceWithRawResponse,
64+
LiveViewResourceWithStreamingResponse,
65+
AsyncLiveViewResourceWithStreamingResponse,
66+
)
5967
from .telemetry import (
6068
TelemetryResource,
6169
AsyncTelemetryResource,
@@ -80,6 +88,12 @@
8088
"AsyncTelemetryResourceWithRawResponse",
8189
"TelemetryResourceWithStreamingResponse",
8290
"AsyncTelemetryResourceWithStreamingResponse",
91+
"LiveViewResource",
92+
"AsyncLiveViewResource",
93+
"LiveViewResourceWithRawResponse",
94+
"AsyncLiveViewResourceWithRawResponse",
95+
"LiveViewResourceWithStreamingResponse",
96+
"AsyncLiveViewResourceWithStreamingResponse",
8397
"ReplaysResource",
8498
"AsyncReplaysResource",
8599
"ReplaysResourceWithRawResponse",

‎src/kernel/resources/browsers/browsers.py‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@
6464
AsyncComputerResourceWithStreamingResponse,
6565
)
6666
from ..._compat import cached_property
67+
from .live_view import (
68+
LiveViewResource,
69+
AsyncLiveViewResource,
70+
LiveViewResourceWithRawResponse,
71+
AsyncLiveViewResourceWithRawResponse,
72+
LiveViewResourceWithStreamingResponse,
73+
AsyncLiveViewResourceWithStreamingResponse,
74+
)
6775
from .telemetry import (
6876
TelemetryResource,
6977
AsyncTelemetryResource,
@@ -135,6 +143,11 @@ def telemetry(self) -> TelemetryResource:
135143
"""
136144
return TelemetryResource(self._client)
137145

146+
@cached_property
147+
def live_view(self) -> LiveViewResource:
148+
"""Create and manage browser sessions."""
149+
return LiveViewResource(self._client)
150+
138151
@cached_property
139152
def replays(self) -> ReplaysResource:
140153
"""Record and manage browser session video replays."""
@@ -1000,6 +1013,11 @@ def telemetry(self) -> AsyncTelemetryResource:
10001013
"""
10011014
return AsyncTelemetryResource(self._client)
10021015

1016+
@cached_property
1017+
def live_view(self) -> AsyncLiveViewResource:
1018+
"""Create and manage browser sessions."""
1019+
return AsyncLiveViewResource(self._client)
1020+
10031021
@cached_property
10041022
def replays(self) -> AsyncReplaysResource:
10051023
"""Record and manage browser session video replays."""
@@ -1896,6 +1914,11 @@ def telemetry(self) -> TelemetryResourceWithRawResponse:
18961914
"""
18971915
return TelemetryResourceWithRawResponse(self._browsers.telemetry)
18981916

1917+
@cached_property
1918+
def live_view(self) -> LiveViewResourceWithRawResponse:
1919+
"""Create and manage browser sessions."""
1920+
return LiveViewResourceWithRawResponse(self._browsers.live_view)
1921+
18991922
@cached_property
19001923
def replays(self) -> ReplaysResourceWithRawResponse:
19011924
"""Record and manage browser session video replays."""
@@ -1973,6 +1996,11 @@ def telemetry(self) -> AsyncTelemetryResourceWithRawResponse:
19731996
"""
19741997
return AsyncTelemetryResourceWithRawResponse(self._browsers.telemetry)
19751998

1999+
@cached_property
2000+
def live_view(self) -> AsyncLiveViewResourceWithRawResponse:
2001+
"""Create and manage browser sessions."""
2002+
return AsyncLiveViewResourceWithRawResponse(self._browsers.live_view)
2003+
19762004
@cached_property
19772005
def replays(self) -> AsyncReplaysResourceWithRawResponse:
19782006
"""Record and manage browser session video replays."""
@@ -2050,6 +2078,11 @@ def telemetry(self) -> TelemetryResourceWithStreamingResponse:
20502078
"""
20512079
return TelemetryResourceWithStreamingResponse(self._browsers.telemetry)
20522080

2081+
@cached_property
2082+
def live_view(self) -> LiveViewResourceWithStreamingResponse:
2083+
"""Create and manage browser sessions."""
2084+
return LiveViewResourceWithStreamingResponse(self._browsers.live_view)
2085+
20532086
@cached_property
20542087
def replays(self) -> ReplaysResourceWithStreamingResponse:
20552088
"""Record and manage browser session video replays."""
@@ -2127,6 +2160,11 @@ def telemetry(self) -> AsyncTelemetryResourceWithStreamingResponse:
21272160
"""
21282161
return AsyncTelemetryResourceWithStreamingResponse(self._browsers.telemetry)
21292162

2163+
@cached_property
2164+
def live_view(self) -> AsyncLiveViewResourceWithStreamingResponse:
2165+
"""Create and manage browser sessions."""
2166+
return AsyncLiveViewResourceWithStreamingResponse(self._browsers.live_view)
2167+
21302168
@cached_property
21312169
def replays(self) -> AsyncReplaysResourceWithStreamingResponse:
21322170
"""Record and manage browser session video replays."""
Lines changed: 226 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
import httpx
6+
7+
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
8+
from ..._utils import path_template, maybe_transform, async_maybe_transform
9+
from ..._compat import cached_property
10+
from ..._resource import SyncAPIResource, AsyncAPIResource
11+
from ..._response import (
12+
to_raw_response_wrapper,
13+
to_streamed_response_wrapper,
14+
async_to_raw_response_wrapper,
15+
async_to_streamed_response_wrapper,
16+
)
17+
from ..._base_client import make_request_options
18+
from ...types.browsers import BrowserLiveViewScope, live_view_create_params
19+
from ...types.browsers.browser_live_view import BrowserLiveView
20+
from ...types.browsers.browser_live_view_scope import BrowserLiveViewScope
21+
22+
__all__ = ["LiveViewResource", "AsyncLiveViewResource"]
23+
24+
25+
class LiveViewResource(SyncAPIResource):
26+
"""Create and manage browser sessions."""
27+
28+
@cached_property
29+
def with_raw_response(self) -> LiveViewResourceWithRawResponse:
30+
"""
31+
This property can be used as a prefix for any HTTP method call to return
32+
the raw response object instead of the parsed content.
33+
34+
For more information, see https://www.github.com/kernel/kernel-python-sdk#accessing-raw-response-data-eg-headers
35+
"""
36+
return LiveViewResourceWithRawResponse(self)
37+
38+
@cached_property
39+
def with_streaming_response(self) -> LiveViewResourceWithStreamingResponse:
40+
"""
41+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
42+
43+
For more information, see https://www.github.com/kernel/kernel-python-sdk#with_streaming_response
44+
"""
45+
return LiveViewResourceWithStreamingResponse(self)
46+
47+
def create(
48+
self,
49+
id_or_name: str,
50+
*,
51+
scope: BrowserLiveViewScope | Omit = omit,
52+
ttl_seconds: int | Omit = omit,
53+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
54+
# The extra values given here take precedence over values defined on the client or passed to this method.
55+
extra_headers: Headers | None = None,
56+
extra_query: Query | None = None,
57+
extra_body: Body | None = None,
58+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
59+
idempotency_key: str | None = None,
60+
) -> BrowserLiveView:
61+
"""
62+
Creates a live view URL for a headful browser that grants either read-only or
63+
control access. The URL works only for the live view: it cannot connect to CDP,
64+
WebDriver, or any other browser endpoint. A read-only URL shows the browser but
65+
cannot send input, regardless of query parameters. The URL stays valid until the
66+
browser is deleted, or until `ttl_seconds` elapse when set. For a browser
67+
acquired from a pool, it stops working when the browser is released. Nothing is
68+
stored, so a URL cannot be revoked before then.
69+
70+
Args:
71+
scope: `read` shows the browser without accepting input. `control` also lets the viewer
72+
drive the browser through the live view.
73+
74+
ttl_seconds: Seconds until the URL expires. Omit to keep it valid until the browser is
75+
deleted.
76+
77+
extra_headers: Send extra headers
78+
79+
extra_query: Add additional query parameters to the request
80+
81+
extra_body: Add additional JSON properties to the request
82+
83+
timeout: Override the client-level default timeout for this request, in seconds
84+
85+
idempotency_key: Specify a custom idempotency key for this request
86+
"""
87+
if not id_or_name:
88+
raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}")
89+
return self._post(
90+
path_template("/browsers/{id_or_name}/live_view", id_or_name=id_or_name),
91+
body=maybe_transform(
92+
{
93+
"scope": scope,
94+
"ttl_seconds": ttl_seconds,
95+
},
96+
live_view_create_params.LiveViewCreateParams,
97+
),
98+
options=make_request_options(
99+
extra_headers=extra_headers,
100+
extra_query=extra_query,
101+
extra_body=extra_body,
102+
timeout=timeout,
103+
idempotency_key=idempotency_key,
104+
),
105+
cast_to=BrowserLiveView,
106+
)
107+
108+
109+
class AsyncLiveViewResource(AsyncAPIResource):
110+
"""Create and manage browser sessions."""
111+
112+
@cached_property
113+
def with_raw_response(self) -> AsyncLiveViewResourceWithRawResponse:
114+
"""
115+
This property can be used as a prefix for any HTTP method call to return
116+
the raw response object instead of the parsed content.
117+
118+
For more information, see https://www.github.com/kernel/kernel-python-sdk#accessing-raw-response-data-eg-headers
119+
"""
120+
return AsyncLiveViewResourceWithRawResponse(self)
121+
122+
@cached_property
123+
def with_streaming_response(self) -> AsyncLiveViewResourceWithStreamingResponse:
124+
"""
125+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
126+
127+
For more information, see https://www.github.com/kernel/kernel-python-sdk#with_streaming_response
128+
"""
129+
return AsyncLiveViewResourceWithStreamingResponse(self)
130+
131+
async def create(
132+
self,
133+
id_or_name: str,
134+
*,
135+
scope: BrowserLiveViewScope | Omit = omit,
136+
ttl_seconds: int | Omit = omit,
137+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
138+
# The extra values given here take precedence over values defined on the client or passed to this method.
139+
extra_headers: Headers | None = None,
140+
extra_query: Query | None = None,
141+
extra_body: Body | None = None,
142+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
143+
idempotency_key: str | None = None,
144+
) -> BrowserLiveView:
145+
"""
146+
Creates a live view URL for a headful browser that grants either read-only or
147+
control access. The URL works only for the live view: it cannot connect to CDP,
148+
WebDriver, or any other browser endpoint. A read-only URL shows the browser but
149+
cannot send input, regardless of query parameters. The URL stays valid until the
150+
browser is deleted, or until `ttl_seconds` elapse when set. For a browser
151+
acquired from a pool, it stops working when the browser is released. Nothing is
152+
stored, so a URL cannot be revoked before then.
153+
154+
Args:
155+
scope: `read` shows the browser without accepting input. `control` also lets the viewer
156+
drive the browser through the live view.
157+
158+
ttl_seconds: Seconds until the URL expires. Omit to keep it valid until the browser is
159+
deleted.
160+
161+
extra_headers: Send extra headers
162+
163+
extra_query: Add additional query parameters to the request
164+
165+
extra_body: Add additional JSON properties to the request
166+
167+
timeout: Override the client-level default timeout for this request, in seconds
168+
169+
idempotency_key: Specify a custom idempotency key for this request
170+
"""
171+
if not id_or_name:
172+
raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}")
173+
return await self._post(
174+
path_template("/browsers/{id_or_name}/live_view", id_or_name=id_or_name),
175+
body=await async_maybe_transform(
176+
{
177+
"scope": scope,
178+
"ttl_seconds": ttl_seconds,
179+
},
180+
live_view_create_params.LiveViewCreateParams,
181+
),
182+
options=make_request_options(
183+
extra_headers=extra_headers,
184+
extra_query=extra_query,
185+
extra_body=extra_body,
186+
timeout=timeout,
187+
idempotency_key=idempotency_key,
188+
),
189+
cast_to=BrowserLiveView,
190+
)
191+
192+
193+
class LiveViewResourceWithRawResponse:
194+
def __init__(self, live_view: LiveViewResource) -> None:
195+
self._live_view = live_view
196+
197+
self.create = to_raw_response_wrapper(
198+
live_view.create,
199+
)
200+
201+
202+
class AsyncLiveViewResourceWithRawResponse:
203+
def __init__(self, live_view: AsyncLiveViewResource) -> None:
204+
self._live_view = live_view
205+
206+
self.create = async_to_raw_response_wrapper(
207+
live_view.create,
208+
)
209+
210+
211+
class LiveViewResourceWithStreamingResponse:
212+
def __init__(self, live_view: LiveViewResource) -> None:
213+
self._live_view = live_view
214+
215+
self.create = to_streamed_response_wrapper(
216+
live_view.create,
217+
)
218+
219+
220+
class AsyncLiveViewResourceWithStreamingResponse:
221+
def __init__(self, live_view: AsyncLiveViewResource) -> None:
222+
self._live_view = live_view
223+
224+
self.create = async_to_streamed_response_wrapper(
225+
live_view.create,
226+
)

‎src/kernel/resources/vaults/items.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,9 @@ def perform_operation(
12211221
return 403 without both permissions.
12221222
12231223
Args:
1224+
timeout_seconds: How long to keep checking on the schedule. The call still waits for its first
1225+
scheduled check, at most 20 seconds, when that comes later.
1226+
12241227
extra_headers: Send extra headers
12251228
12261229
extra_query: Add additional query parameters to the request
@@ -3312,6 +3315,9 @@ async def perform_operation(
33123315
return 403 without both permissions.
33133316
33143317
Args:
3318+
timeout_seconds: How long to keep checking on the schedule. The call still waits for its first
3319+
scheduled check, at most 20 seconds, when that comes later.
3320+
33153321
extra_headers: Send extra headers
33163322
33173323
extra_query: Add additional query parameters to the request

0 commit comments

Comments
 (0)