Skip to content

Commit 6c7b47f

Browse files
feat(api): add browser timeouts
1 parent e4ca558 commit 6c7b47f

2 files changed

Lines changed: 18 additions & 8 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 31
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-6f4aab5f0db80d6ce30ef40274eee347cce0a9465e7f1e5077f8f4a085251ddf.yml
3-
openapi_spec_hash: 8e83254243d1620b80a0dc8aa212ee0d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-b55c3e0424fa7733487139488b9fff00ad8949ff02ee3160ee36b9334e84b134.yml
3+
openapi_spec_hash: 17f36677e3dc0a3aeb419654c8d5cae3
44
config_hash: f67e4b33b2fb30c1405ee2fff8096320

browser.go

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"fmt"
1010
"net/http"
1111
"net/url"
12+
"time"
1213

1314
"github.com/onkernel/kernel-go-sdk/internal/apijson"
1415
"github.com/onkernel/kernel-go-sdk/internal/apiquery"
@@ -138,11 +139,13 @@ func (r *BrowserPersistenceParam) UnmarshalJSON(data []byte) error {
138139
type BrowserNewResponse struct {
139140
// Websocket URL for Chrome DevTools Protocol connections to the browser session
140141
CdpWsURL string `json:"cdp_ws_url,required"`
141-
// Indicates whether the browser session is headless.
142+
// When the browser session was created.
143+
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
144+
// Whether the browser session is running in headless mode.
142145
Headless bool `json:"headless,required"`
143146
// Unique identifier for the browser session
144147
SessionID string `json:"session_id,required"`
145-
// Indicates whether the browser session is stealth.
148+
// Whether the browser session is running in stealth mode.
146149
Stealth bool `json:"stealth,required"`
147150
// The number of seconds of inactivity before the browser session is terminated.
148151
TimeoutSeconds int64 `json:"timeout_seconds,required"`
@@ -154,6 +157,7 @@ type BrowserNewResponse struct {
154157
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
155158
JSON struct {
156159
CdpWsURL respjson.Field
160+
CreatedAt respjson.Field
157161
Headless respjson.Field
158162
SessionID respjson.Field
159163
Stealth respjson.Field
@@ -174,11 +178,13 @@ func (r *BrowserNewResponse) UnmarshalJSON(data []byte) error {
174178
type BrowserGetResponse struct {
175179
// Websocket URL for Chrome DevTools Protocol connections to the browser session
176180
CdpWsURL string `json:"cdp_ws_url,required"`
177-
// Indicates whether the browser session is headless.
181+
// When the browser session was created.
182+
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
183+
// Whether the browser session is running in headless mode.
178184
Headless bool `json:"headless,required"`
179185
// Unique identifier for the browser session
180186
SessionID string `json:"session_id,required"`
181-
// Indicates whether the browser session is stealth.
187+
// Whether the browser session is running in stealth mode.
182188
Stealth bool `json:"stealth,required"`
183189
// The number of seconds of inactivity before the browser session is terminated.
184190
TimeoutSeconds int64 `json:"timeout_seconds,required"`
@@ -190,6 +196,7 @@ type BrowserGetResponse struct {
190196
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
191197
JSON struct {
192198
CdpWsURL respjson.Field
199+
CreatedAt respjson.Field
193200
Headless respjson.Field
194201
SessionID respjson.Field
195202
Stealth respjson.Field
@@ -210,11 +217,13 @@ func (r *BrowserGetResponse) UnmarshalJSON(data []byte) error {
210217
type BrowserListResponse struct {
211218
// Websocket URL for Chrome DevTools Protocol connections to the browser session
212219
CdpWsURL string `json:"cdp_ws_url,required"`
213-
// Indicates whether the browser session is headless.
220+
// When the browser session was created.
221+
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
222+
// Whether the browser session is running in headless mode.
214223
Headless bool `json:"headless,required"`
215224
// Unique identifier for the browser session
216225
SessionID string `json:"session_id,required"`
217-
// Indicates whether the browser session is stealth.
226+
// Whether the browser session is running in stealth mode.
218227
Stealth bool `json:"stealth,required"`
219228
// The number of seconds of inactivity before the browser session is terminated.
220229
TimeoutSeconds int64 `json:"timeout_seconds,required"`
@@ -226,6 +235,7 @@ type BrowserListResponse struct {
226235
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
227236
JSON struct {
228237
CdpWsURL respjson.Field
238+
CreatedAt respjson.Field
229239
Headless respjson.Field
230240
SessionID respjson.Field
231241
Stealth respjson.Field

0 commit comments

Comments
 (0)