@@ -222,6 +222,24 @@ func (r *BrowserPoolRef) UnmarshalJSON(data []byte) error {
222222 return apijson .UnmarshalRoot (data , r )
223223}
224224
225+ // Session usage metrics.
226+ type BrowserUsage struct {
227+ // Time in milliseconds the session was actively running.
228+ UptimeMs int64 `json:"uptime_ms" api:"required"`
229+ // JSON contains metadata for fields, check presence with [respjson.Field.Valid].
230+ JSON struct {
231+ UptimeMs respjson.Field
232+ ExtraFields map [string ]respjson.Field
233+ raw string
234+ } `json:"-"`
235+ }
236+
237+ // Returns the unmodified JSON received from the API
238+ func (r BrowserUsage ) RawJSON () string { return r .JSON .raw }
239+ func (r * BrowserUsage ) UnmarshalJSON (data []byte ) error {
240+ return apijson .UnmarshalRoot (data , r )
241+ }
242+
225243// Browser profile metadata.
226244type Profile struct {
227245 // Unique identifier for the profile
@@ -284,6 +302,8 @@ type BrowserNewResponse struct {
284302 Profile Profile `json:"profile"`
285303 // ID of the proxy associated with this browser session, if any.
286304 ProxyID string `json:"proxy_id"`
305+ // Session usage metrics.
306+ Usage BrowserUsage `json:"usage"`
287307 // Initial browser window size in pixels with optional refresh rate. If omitted,
288308 // image defaults apply (1920x1080@25). Arbitrary viewport dimensions are accepted,
289309 // but the following configurations are known-good and fully tested: 2560x1440@10,
@@ -309,6 +329,7 @@ type BrowserNewResponse struct {
309329 Pool respjson.Field
310330 Profile respjson.Field
311331 ProxyID respjson.Field
332+ Usage respjson.Field
312333 Viewport respjson.Field
313334 ExtraFields map [string ]respjson.Field
314335 raw string
@@ -353,6 +374,8 @@ type BrowserGetResponse struct {
353374 Profile Profile `json:"profile"`
354375 // ID of the proxy associated with this browser session, if any.
355376 ProxyID string `json:"proxy_id"`
377+ // Session usage metrics.
378+ Usage BrowserUsage `json:"usage"`
356379 // Initial browser window size in pixels with optional refresh rate. If omitted,
357380 // image defaults apply (1920x1080@25). Arbitrary viewport dimensions are accepted,
358381 // but the following configurations are known-good and fully tested: 2560x1440@10,
@@ -378,6 +401,7 @@ type BrowserGetResponse struct {
378401 Pool respjson.Field
379402 Profile respjson.Field
380403 ProxyID respjson.Field
404+ Usage respjson.Field
381405 Viewport respjson.Field
382406 ExtraFields map [string ]respjson.Field
383407 raw string
@@ -422,6 +446,8 @@ type BrowserUpdateResponse struct {
422446 Profile Profile `json:"profile"`
423447 // ID of the proxy associated with this browser session, if any.
424448 ProxyID string `json:"proxy_id"`
449+ // Session usage metrics.
450+ Usage BrowserUsage `json:"usage"`
425451 // Initial browser window size in pixels with optional refresh rate. If omitted,
426452 // image defaults apply (1920x1080@25). Arbitrary viewport dimensions are accepted,
427453 // but the following configurations are known-good and fully tested: 2560x1440@10,
@@ -447,6 +473,7 @@ type BrowserUpdateResponse struct {
447473 Pool respjson.Field
448474 Profile respjson.Field
449475 ProxyID respjson.Field
476+ Usage respjson.Field
450477 Viewport respjson.Field
451478 ExtraFields map [string ]respjson.Field
452479 raw string
@@ -491,6 +518,8 @@ type BrowserListResponse struct {
491518 Profile Profile `json:"profile"`
492519 // ID of the proxy associated with this browser session, if any.
493520 ProxyID string `json:"proxy_id"`
521+ // Session usage metrics.
522+ Usage BrowserUsage `json:"usage"`
494523 // Initial browser window size in pixels with optional refresh rate. If omitted,
495524 // image defaults apply (1920x1080@25). Arbitrary viewport dimensions are accepted,
496525 // but the following configurations are known-good and fully tested: 2560x1440@10,
@@ -516,6 +545,7 @@ type BrowserListResponse struct {
516545 Pool respjson.Field
517546 Profile respjson.Field
518547 ProxyID respjson.Field
548+ Usage respjson.Field
519549 Viewport respjson.Field
520550 ExtraFields map [string ]respjson.Field
521551 raw string
0 commit comments