@@ -17,13 +17,14 @@ export class Computer extends APIResource {
1717 *
1818 * @example
1919 * ```ts
20- * await client.browsers.computer.batch('id', {
21- * actions: [{ type: 'click_mouse' }],
22- * });
20+ * await client.browsers.computer.batch(
21+ * 'htzv5orfit78e1m2biiifpbv',
22+ * { actions: [{ type: 'click_mouse' }] },
23+ * );
2324 * ```
2425 */
25- batch ( id : string , body : ComputerBatchParams , options ?: RequestOptions ) : APIPromise < void > {
26- return this . _client . post ( path `/browsers/${ id } /computer/batch` , {
26+ batch ( idOrName : string , body : ComputerBatchParams , options ?: RequestOptions ) : APIPromise < void > {
27+ return this . _client . post ( path `/browsers/${ idOrName } /computer/batch` , {
2728 body,
2829 ...options ,
2930 headers : buildHeaders ( [ { Accept : '*/*' } , options ?. headers ] ) ,
@@ -36,18 +37,20 @@ export class Computer extends APIResource {
3637 * @example
3738 * ```ts
3839 * const response =
39- * await client.browsers.computer.captureScreenshot('id');
40+ * await client.browsers.computer.captureScreenshot(
41+ * 'htzv5orfit78e1m2biiifpbv',
42+ * );
4043 *
4144 * const content = await response.blob();
4245 * console.log(content);
4346 * ```
4447 */
4548 captureScreenshot (
46- id : string ,
49+ idOrName : string ,
4750 body : ComputerCaptureScreenshotParams | null | undefined = { } ,
4851 options ?: RequestOptions ,
4952 ) : APIPromise < Response > {
50- return this . _client . post ( path `/browsers/${ id } /computer/screenshot` , {
53+ return this . _client . post ( path `/browsers/${ idOrName } /computer/screenshot` , {
5154 body,
5255 ...options ,
5356 headers : buildHeaders ( [ { Accept : 'image/png' } , options ?. headers ] ) ,
@@ -60,14 +63,14 @@ export class Computer extends APIResource {
6063 *
6164 * @example
6265 * ```ts
63- * await client.browsers.computer.clickMouse('id', {
64- * x: 0 ,
65- * y: 0,
66- * } );
66+ * await client.browsers.computer.clickMouse(
67+ * 'htzv5orfit78e1m2biiifpbv' ,
68+ * { x: 0, y: 0 } ,
69+ * );
6770 * ```
6871 */
69- clickMouse ( id : string , body : ComputerClickMouseParams , options ?: RequestOptions ) : APIPromise < void > {
70- return this . _client . post ( path `/browsers/${ id } /computer/click_mouse` , {
72+ clickMouse ( idOrName : string , body : ComputerClickMouseParams , options ?: RequestOptions ) : APIPromise < void > {
73+ return this . _client . post ( path `/browsers/${ idOrName } /computer/click_mouse` , {
7174 body,
7275 ...options ,
7376 headers : buildHeaders ( [ { Accept : '*/*' } , options ?. headers ] ) ,
@@ -79,16 +82,19 @@ export class Computer extends APIResource {
7982 *
8083 * @example
8184 * ```ts
82- * await client.browsers.computer.dragMouse('id', {
83- * path: [
84- * [0, 0],
85- * [0, 0],
86- * ],
87- * });
85+ * await client.browsers.computer.dragMouse(
86+ * 'htzv5orfit78e1m2biiifpbv',
87+ * {
88+ * path: [
89+ * [0, 0],
90+ * [0, 0],
91+ * ],
92+ * },
93+ * );
8894 * ```
8995 */
90- dragMouse ( id : string , body : ComputerDragMouseParams , options ?: RequestOptions ) : APIPromise < void > {
91- return this . _client . post ( path `/browsers/${ id } /computer/drag_mouse` , {
96+ dragMouse ( idOrName : string , body : ComputerDragMouseParams , options ?: RequestOptions ) : APIPromise < void > {
97+ return this . _client . post ( path `/browsers/${ idOrName } /computer/drag_mouse` , {
9298 body,
9399 ...options ,
94100 headers : buildHeaders ( [ { Accept : '*/*' } , options ?. headers ] ) ,
@@ -101,26 +107,28 @@ export class Computer extends APIResource {
101107 * @example
102108 * ```ts
103109 * const response =
104- * await client.browsers.computer.getMousePosition('id');
110+ * await client.browsers.computer.getMousePosition(
111+ * 'htzv5orfit78e1m2biiifpbv',
112+ * );
105113 * ```
106114 */
107- getMousePosition ( id : string , options ?: RequestOptions ) : APIPromise < ComputerGetMousePositionResponse > {
108- return this . _client . post ( path `/browsers/${ id } /computer/get_mouse_position` , options ) ;
115+ getMousePosition ( idOrName : string , options ?: RequestOptions ) : APIPromise < ComputerGetMousePositionResponse > {
116+ return this . _client . post ( path `/browsers/${ idOrName } /computer/get_mouse_position` , options ) ;
109117 }
110118
111119 /**
112120 * Move the mouse cursor to the specified coordinates on the browser instance
113121 *
114122 * @example
115123 * ```ts
116- * await client.browsers.computer.moveMouse('id', {
117- * x: 0 ,
118- * y: 0,
119- * } );
124+ * await client.browsers.computer.moveMouse(
125+ * 'htzv5orfit78e1m2biiifpbv' ,
126+ * { x: 0, y: 0 } ,
127+ * );
120128 * ```
121129 */
122- moveMouse ( id : string , body : ComputerMoveMouseParams , options ?: RequestOptions ) : APIPromise < void > {
123- return this . _client . post ( path `/browsers/${ id } /computer/move_mouse` , {
130+ moveMouse ( idOrName : string , body : ComputerMoveMouseParams , options ?: RequestOptions ) : APIPromise < void > {
131+ return this . _client . post ( path `/browsers/${ idOrName } /computer/move_mouse` , {
124132 body,
125133 ...options ,
126134 headers : buildHeaders ( [ { Accept : '*/*' } , options ?. headers ] ) ,
@@ -132,13 +140,14 @@ export class Computer extends APIResource {
132140 *
133141 * @example
134142 * ```ts
135- * await client.browsers.computer.pressKey('id', {
136- * keys: ['string'],
137- * });
143+ * await client.browsers.computer.pressKey(
144+ * 'htzv5orfit78e1m2biiifpbv',
145+ * { keys: ['string'] },
146+ * );
138147 * ```
139148 */
140- pressKey ( id : string , body : ComputerPressKeyParams , options ?: RequestOptions ) : APIPromise < void > {
141- return this . _client . post ( path `/browsers/${ id } /computer/press_key` , {
149+ pressKey ( idOrName : string , body : ComputerPressKeyParams , options ?: RequestOptions ) : APIPromise < void > {
150+ return this . _client . post ( path `/browsers/${ idOrName } /computer/press_key` , {
142151 body,
143152 ...options ,
144153 headers : buildHeaders ( [ { Accept : '*/*' } , options ?. headers ] ) ,
@@ -151,23 +160,28 @@ export class Computer extends APIResource {
151160 * @example
152161 * ```ts
153162 * const response =
154- * await client.browsers.computer.readClipboard('id');
163+ * await client.browsers.computer.readClipboard(
164+ * 'htzv5orfit78e1m2biiifpbv',
165+ * );
155166 * ```
156167 */
157- readClipboard ( id : string , options ?: RequestOptions ) : APIPromise < ComputerReadClipboardResponse > {
158- return this . _client . post ( path `/browsers/${ id } /computer/clipboard/read` , options ) ;
168+ readClipboard ( idOrName : string , options ?: RequestOptions ) : APIPromise < ComputerReadClipboardResponse > {
169+ return this . _client . post ( path `/browsers/${ idOrName } /computer/clipboard/read` , options ) ;
159170 }
160171
161172 /**
162173 * Scroll the mouse wheel at a position on the host computer
163174 *
164175 * @example
165176 * ```ts
166- * await client.browsers.computer.scroll('id', { x: 0, y: 0 });
177+ * await client.browsers.computer.scroll(
178+ * 'htzv5orfit78e1m2biiifpbv',
179+ * { x: 0, y: 0 },
180+ * );
167181 * ```
168182 */
169- scroll ( id : string , body : ComputerScrollParams , options ?: RequestOptions ) : APIPromise < void > {
170- return this . _client . post ( path `/browsers/${ id } /computer/scroll` , {
183+ scroll ( idOrName : string , body : ComputerScrollParams , options ?: RequestOptions ) : APIPromise < void > {
184+ return this . _client . post ( path `/browsers/${ idOrName } /computer/scroll` , {
171185 body,
172186 ...options ,
173187 headers : buildHeaders ( [ { Accept : '*/*' } , options ?. headers ] ) ,
@@ -180,31 +194,33 @@ export class Computer extends APIResource {
180194 * @example
181195 * ```ts
182196 * const response =
183- * await client.browsers.computer.setCursorVisibility('id', {
184- * hidden: true,
185- * });
197+ * await client.browsers.computer.setCursorVisibility(
198+ * 'htzv5orfit78e1m2biiifpbv',
199+ * { hidden: true },
200+ * );
186201 * ```
187202 */
188203 setCursorVisibility (
189- id : string ,
204+ idOrName : string ,
190205 body : ComputerSetCursorVisibilityParams ,
191206 options ?: RequestOptions ,
192207 ) : APIPromise < ComputerSetCursorVisibilityResponse > {
193- return this . _client . post ( path `/browsers/${ id } /computer/cursor` , { body, ...options } ) ;
208+ return this . _client . post ( path `/browsers/${ idOrName } /computer/cursor` , { body, ...options } ) ;
194209 }
195210
196211 /**
197212 * Type text on the browser instance
198213 *
199214 * @example
200215 * ```ts
201- * await client.browsers.computer.typeText('id', {
202- * text: 'text',
203- * });
216+ * await client.browsers.computer.typeText(
217+ * 'htzv5orfit78e1m2biiifpbv',
218+ * { text: 'text' },
219+ * );
204220 * ```
205221 */
206- typeText ( id : string , body : ComputerTypeTextParams , options ?: RequestOptions ) : APIPromise < void > {
207- return this . _client . post ( path `/browsers/${ id } /computer/type` , {
222+ typeText ( idOrName : string , body : ComputerTypeTextParams , options ?: RequestOptions ) : APIPromise < void > {
223+ return this . _client . post ( path `/browsers/${ idOrName } /computer/type` , {
208224 body,
209225 ...options ,
210226 headers : buildHeaders ( [ { Accept : '*/*' } , options ?. headers ] ) ,
@@ -216,13 +232,18 @@ export class Computer extends APIResource {
216232 *
217233 * @example
218234 * ```ts
219- * await client.browsers.computer.writeClipboard('id', {
220- * text: 'text',
221- * });
235+ * await client.browsers.computer.writeClipboard(
236+ * 'htzv5orfit78e1m2biiifpbv',
237+ * { text: 'text' },
238+ * );
222239 * ```
223240 */
224- writeClipboard ( id : string , body : ComputerWriteClipboardParams , options ?: RequestOptions ) : APIPromise < void > {
225- return this . _client . post ( path `/browsers/${ id } /computer/clipboard/write` , {
241+ writeClipboard (
242+ idOrName : string ,
243+ body : ComputerWriteClipboardParams ,
244+ options ?: RequestOptions ,
245+ ) : APIPromise < void > {
246+ return this . _client . post ( path `/browsers/${ idOrName } /computer/clipboard/write` , {
226247 body,
227248 ...options ,
228249 headers : buildHeaders ( [ { Accept : '*/*' } , options ?. headers ] ) ,
0 commit comments