|
34 | 34 | computer_move_mouse_params, |
35 | 35 | computer_click_mouse_params, |
36 | 36 | computer_capture_screenshot_params, |
| 37 | + computer_set_cursor_visibility_params, |
37 | 38 | ) |
| 39 | +from ...types.browsers.computer_set_cursor_visibility_response import ComputerSetCursorVisibilityResponse |
38 | 40 |
|
39 | 41 | __all__ = ["ComputerResource", "AsyncComputerResource"] |
40 | 42 |
|
@@ -390,6 +392,45 @@ def scroll( |
390 | 392 | cast_to=NoneType, |
391 | 393 | ) |
392 | 394 |
|
| 395 | + def set_cursor_visibility( |
| 396 | + self, |
| 397 | + id: str, |
| 398 | + *, |
| 399 | + hidden: bool, |
| 400 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 401 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 402 | + extra_headers: Headers | None = None, |
| 403 | + extra_query: Query | None = None, |
| 404 | + extra_body: Body | None = None, |
| 405 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 406 | + ) -> ComputerSetCursorVisibilityResponse: |
| 407 | + """ |
| 408 | + Set cursor visibility |
| 409 | +
|
| 410 | + Args: |
| 411 | + hidden: Whether the cursor should be hidden or visible |
| 412 | +
|
| 413 | + extra_headers: Send extra headers |
| 414 | +
|
| 415 | + extra_query: Add additional query parameters to the request |
| 416 | +
|
| 417 | + extra_body: Add additional JSON properties to the request |
| 418 | +
|
| 419 | + timeout: Override the client-level default timeout for this request, in seconds |
| 420 | + """ |
| 421 | + if not id: |
| 422 | + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
| 423 | + return self._post( |
| 424 | + f"/browsers/{id}/computer/cursor", |
| 425 | + body=maybe_transform( |
| 426 | + {"hidden": hidden}, computer_set_cursor_visibility_params.ComputerSetCursorVisibilityParams |
| 427 | + ), |
| 428 | + options=make_request_options( |
| 429 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 430 | + ), |
| 431 | + cast_to=ComputerSetCursorVisibilityResponse, |
| 432 | + ) |
| 433 | + |
393 | 434 | def type_text( |
394 | 435 | self, |
395 | 436 | id: str, |
@@ -789,6 +830,45 @@ async def scroll( |
789 | 830 | cast_to=NoneType, |
790 | 831 | ) |
791 | 832 |
|
| 833 | + async def set_cursor_visibility( |
| 834 | + self, |
| 835 | + id: str, |
| 836 | + *, |
| 837 | + hidden: bool, |
| 838 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 839 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 840 | + extra_headers: Headers | None = None, |
| 841 | + extra_query: Query | None = None, |
| 842 | + extra_body: Body | None = None, |
| 843 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 844 | + ) -> ComputerSetCursorVisibilityResponse: |
| 845 | + """ |
| 846 | + Set cursor visibility |
| 847 | +
|
| 848 | + Args: |
| 849 | + hidden: Whether the cursor should be hidden or visible |
| 850 | +
|
| 851 | + extra_headers: Send extra headers |
| 852 | +
|
| 853 | + extra_query: Add additional query parameters to the request |
| 854 | +
|
| 855 | + extra_body: Add additional JSON properties to the request |
| 856 | +
|
| 857 | + timeout: Override the client-level default timeout for this request, in seconds |
| 858 | + """ |
| 859 | + if not id: |
| 860 | + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
| 861 | + return await self._post( |
| 862 | + f"/browsers/{id}/computer/cursor", |
| 863 | + body=await async_maybe_transform( |
| 864 | + {"hidden": hidden}, computer_set_cursor_visibility_params.ComputerSetCursorVisibilityParams |
| 865 | + ), |
| 866 | + options=make_request_options( |
| 867 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 868 | + ), |
| 869 | + cast_to=ComputerSetCursorVisibilityResponse, |
| 870 | + ) |
| 871 | + |
792 | 872 | async def type_text( |
793 | 873 | self, |
794 | 874 | id: str, |
@@ -860,6 +940,9 @@ def __init__(self, computer: ComputerResource) -> None: |
860 | 940 | self.scroll = to_raw_response_wrapper( |
861 | 941 | computer.scroll, |
862 | 942 | ) |
| 943 | + self.set_cursor_visibility = to_raw_response_wrapper( |
| 944 | + computer.set_cursor_visibility, |
| 945 | + ) |
863 | 946 | self.type_text = to_raw_response_wrapper( |
864 | 947 | computer.type_text, |
865 | 948 | ) |
@@ -888,6 +971,9 @@ def __init__(self, computer: AsyncComputerResource) -> None: |
888 | 971 | self.scroll = async_to_raw_response_wrapper( |
889 | 972 | computer.scroll, |
890 | 973 | ) |
| 974 | + self.set_cursor_visibility = async_to_raw_response_wrapper( |
| 975 | + computer.set_cursor_visibility, |
| 976 | + ) |
891 | 977 | self.type_text = async_to_raw_response_wrapper( |
892 | 978 | computer.type_text, |
893 | 979 | ) |
@@ -916,6 +1002,9 @@ def __init__(self, computer: ComputerResource) -> None: |
916 | 1002 | self.scroll = to_streamed_response_wrapper( |
917 | 1003 | computer.scroll, |
918 | 1004 | ) |
| 1005 | + self.set_cursor_visibility = to_streamed_response_wrapper( |
| 1006 | + computer.set_cursor_visibility, |
| 1007 | + ) |
919 | 1008 | self.type_text = to_streamed_response_wrapper( |
920 | 1009 | computer.type_text, |
921 | 1010 | ) |
@@ -944,6 +1033,9 @@ def __init__(self, computer: AsyncComputerResource) -> None: |
944 | 1033 | self.scroll = async_to_streamed_response_wrapper( |
945 | 1034 | computer.scroll, |
946 | 1035 | ) |
| 1036 | + self.set_cursor_visibility = async_to_streamed_response_wrapper( |
| 1037 | + computer.set_cursor_visibility, |
| 1038 | + ) |
947 | 1039 | self.type_text = async_to_streamed_response_wrapper( |
948 | 1040 | computer.type_text, |
949 | 1041 | ) |
0 commit comments