-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbrowsers.ts
More file actions
85 lines (74 loc) · 2.01 KB
/
Copy pathbrowsers.ts
File metadata and controls
85 lines (74 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import { APIPromise } from '../core/api-promise';
import { RequestOptions } from '../internal/request-options';
import { path } from '../internal/utils/path';
export class Browsers extends APIResource {
/**
* Create Browser Session
*
* @example
* ```ts
* const browser = await client.browsers.create({
* invocation_id: 'ckqwer3o20000jb9s7abcdef',
* });
* ```
*/
create(body: BrowserCreateParams, options?: RequestOptions): APIPromise<BrowserCreateResponse> {
return this._client.post('/browsers', { body, ...options });
}
/**
* Get Browser Session by ID
*
* @example
* ```ts
* const browser = await client.browsers.retrieve(
* 'e5bf36fe-9247-4e2b-8b5a-2f594cc1c073',
* );
* ```
*/
retrieve(id: string, options?: RequestOptions): APIPromise<BrowserRetrieveResponse> {
return this._client.get(path`/browsers/${id}`, options);
}
}
export interface BrowserCreateResponse {
/**
* Remote URL for live viewing the browser session
*/
browser_live_view_url: string;
/**
* Websocket URL for Chrome DevTools Protocol connections to the browser session
*/
cdp_ws_url: string;
/**
* Unique identifier for the browser session
*/
session_id: string;
}
export interface BrowserRetrieveResponse {
/**
* Remote URL for live viewing the browser session
*/
browser_live_view_url: string;
/**
* Websocket URL for Chrome DevTools Protocol connections to the browser session
*/
cdp_ws_url: string;
/**
* Unique identifier for the browser session
*/
session_id: string;
}
export interface BrowserCreateParams {
/**
* action invocation ID
*/
invocation_id: string;
}
export declare namespace Browsers {
export {
type BrowserCreateResponse as BrowserCreateResponse,
type BrowserRetrieveResponse as BrowserRetrieveResponse,
type BrowserCreateParams as BrowserCreateParams,
};
}