blaxel 0.1.9rc37__py3-none-any.whl → 0.1.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. blaxel/authentication/__init__.py +11 -2
  2. blaxel/client/api/compute/create_sandbox_preview.py +179 -0
  3. blaxel/client/api/compute/create_sandbox_preview_token.py +192 -0
  4. blaxel/client/api/compute/delete_sandbox_preview.py +167 -0
  5. blaxel/client/api/compute/delete_sandbox_preview_token.py +180 -0
  6. blaxel/client/api/compute/get_sandbox_preview.py +167 -0
  7. blaxel/client/api/compute/list_sandbox_preview_tokens.py +172 -0
  8. blaxel/client/api/compute/list_sandbox_previews.py +159 -0
  9. blaxel/client/api/compute/update_sandbox_preview.py +192 -0
  10. blaxel/client/api/integrations/get_integration.py +64 -7
  11. blaxel/client/api/workspaces/check_workspace_availability.py +165 -0
  12. blaxel/client/models/__init__.py +32 -2
  13. blaxel/client/models/check_workspace_availability_body.py +60 -0
  14. blaxel/client/models/delete_sandbox_preview_token_response_200.py +60 -0
  15. blaxel/client/models/integration.py +197 -0
  16. blaxel/client/models/integration_additional_infos.py +45 -0
  17. blaxel/client/models/integration_endpoint.py +143 -0
  18. blaxel/client/models/integration_endpoint_token.py +79 -0
  19. blaxel/client/models/integration_endpoints.py +61 -0
  20. blaxel/client/models/integration_headers.py +45 -0
  21. blaxel/client/models/integration_organization.py +88 -0
  22. blaxel/client/models/integration_query_params.py +45 -0
  23. blaxel/client/models/metrics.py +9 -0
  24. blaxel/client/models/preview.py +96 -0
  25. blaxel/client/models/preview_metadata.py +133 -0
  26. blaxel/client/models/preview_spec.py +79 -0
  27. blaxel/client/models/preview_token.py +96 -0
  28. blaxel/client/models/preview_token_metadata.py +97 -0
  29. blaxel/client/models/preview_token_spec.py +88 -0
  30. blaxel/common/autoload.py +1 -0
  31. blaxel/common/internal.py +5 -5
  32. blaxel/sandbox/base.py +68 -0
  33. blaxel/sandbox/client/__init__.py +8 -0
  34. blaxel/sandbox/client/api/__init__.py +1 -0
  35. blaxel/sandbox/client/api/filesystem/__init__.py +0 -0
  36. blaxel/sandbox/client/api/filesystem/delete_filesystem_path.py +184 -0
  37. blaxel/sandbox/client/api/filesystem/get_filesystem_path.py +184 -0
  38. blaxel/sandbox/client/api/filesystem/put_filesystem_path.py +189 -0
  39. blaxel/sandbox/client/api/network/__init__.py +0 -0
  40. blaxel/sandbox/client/api/network/delete_network_process_pid_monitor.py +169 -0
  41. blaxel/sandbox/client/api/network/get_network_process_pid_ports.py +169 -0
  42. blaxel/sandbox/client/api/network/post_network_process_pid_monitor.py +195 -0
  43. blaxel/sandbox/client/api/process/__init__.py +0 -0
  44. blaxel/sandbox/client/api/process/delete_process_identifier.py +163 -0
  45. blaxel/sandbox/client/api/process/delete_process_identifier_kill.py +189 -0
  46. blaxel/sandbox/client/api/process/get_process.py +135 -0
  47. blaxel/sandbox/client/api/process/get_process_identifier.py +159 -0
  48. blaxel/sandbox/client/api/process/get_process_identifier_logs.py +188 -0
  49. blaxel/sandbox/client/api/process/get_process_identifier_logs_stream.py +190 -0
  50. blaxel/sandbox/client/api/process/post_process.py +176 -0
  51. blaxel/sandbox/client/client.py +162 -0
  52. blaxel/sandbox/client/errors.py +16 -0
  53. blaxel/sandbox/client/models/__init__.py +41 -0
  54. blaxel/sandbox/client/models/delete_network_process_pid_monitor_response_200.py +45 -0
  55. blaxel/sandbox/client/models/directory.py +112 -0
  56. blaxel/sandbox/client/models/error_response.py +60 -0
  57. blaxel/sandbox/client/models/file.py +105 -0
  58. blaxel/sandbox/client/models/file_request.py +78 -0
  59. blaxel/sandbox/client/models/file_with_content.py +114 -0
  60. blaxel/sandbox/client/models/get_network_process_pid_ports_response_200.py +45 -0
  61. blaxel/sandbox/client/models/get_process_identifier_logs_response_200.py +45 -0
  62. blaxel/sandbox/client/models/get_process_identifier_logs_stream_response_200.py +45 -0
  63. blaxel/sandbox/client/models/port_monitor_request.py +60 -0
  64. blaxel/sandbox/client/models/post_network_process_pid_monitor_response_200.py +45 -0
  65. blaxel/sandbox/client/models/process_kill_request.py +60 -0
  66. blaxel/sandbox/client/models/process_request.py +118 -0
  67. blaxel/sandbox/client/models/process_response.py +123 -0
  68. blaxel/sandbox/client/models/subdirectory.py +60 -0
  69. blaxel/sandbox/client/models/success_response.py +69 -0
  70. blaxel/sandbox/client/py.typed +1 -0
  71. blaxel/sandbox/client/types.py +46 -0
  72. blaxel/sandbox/filesystem.py +104 -0
  73. blaxel/sandbox/process.py +57 -0
  74. blaxel/sandbox/sandbox.py +92 -0
  75. blaxel/tools/__init__.py +1 -1
  76. {blaxel-0.1.9rc37.dist-info → blaxel-0.1.10.dist-info}/METADATA +1 -1
  77. {blaxel-0.1.9rc37.dist-info → blaxel-0.1.10.dist-info}/RECORD +79 -12
  78. blaxel/client/models/sandboxes.py +0 -129
  79. {blaxel-0.1.9rc37.dist-info → blaxel-0.1.10.dist-info}/WHEEL +0 -0
  80. {blaxel-0.1.9rc37.dist-info → blaxel-0.1.10.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,190 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import Client
8
+ from ...models.error_response import ErrorResponse
9
+ from ...models.get_process_identifier_logs_stream_response_200 import (
10
+ GetProcessIdentifierLogsStreamResponse200,
11
+ )
12
+ from ...types import UNSET, Response, Unset
13
+
14
+
15
+ def _get_kwargs(
16
+ identifier: str,
17
+ *,
18
+ stream: Union[Unset, bool] = UNSET,
19
+ ) -> dict[str, Any]:
20
+ params: dict[str, Any] = {}
21
+
22
+ params["stream"] = stream
23
+
24
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
25
+
26
+ _kwargs: dict[str, Any] = {
27
+ "method": "get",
28
+ "url": f"/process/{identifier}/logs/stream",
29
+ "params": params,
30
+ }
31
+
32
+ return _kwargs
33
+
34
+
35
+ def _parse_response(
36
+ *, client: Client, response: httpx.Response
37
+ ) -> Optional[Union[ErrorResponse, GetProcessIdentifierLogsStreamResponse200]]:
38
+ if response.status_code == 200:
39
+ response_200 = GetProcessIdentifierLogsStreamResponse200.from_dict(response.json())
40
+
41
+ return response_200
42
+ if response.status_code == 404:
43
+ response_404 = ErrorResponse.from_dict(response.json())
44
+
45
+ return response_404
46
+ if response.status_code == 500:
47
+ response_500 = ErrorResponse.from_dict(response.json())
48
+
49
+ return response_500
50
+ if client.raise_on_unexpected_status:
51
+ raise errors.UnexpectedStatus(response.status_code, response.content)
52
+ else:
53
+ return None
54
+
55
+
56
+ def _build_response(
57
+ *, client: Client, response: httpx.Response
58
+ ) -> Response[Union[ErrorResponse, GetProcessIdentifierLogsStreamResponse200]]:
59
+ return Response(
60
+ status_code=HTTPStatus(response.status_code),
61
+ content=response.content,
62
+ headers=response.headers,
63
+ parsed=_parse_response(client=client, response=response),
64
+ )
65
+
66
+
67
+ def sync_detailed(
68
+ identifier: str,
69
+ *,
70
+ client: Union[Client],
71
+ stream: Union[Unset, bool] = UNSET,
72
+ ) -> Response[Union[ErrorResponse, GetProcessIdentifierLogsStreamResponse200]]:
73
+ """Get process logs in realtime
74
+
75
+ Get the stdout and stderr output of a process in realtime
76
+
77
+ Args:
78
+ identifier (str):
79
+ stream (Union[Unset, bool]):
80
+
81
+ Raises:
82
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
83
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
84
+
85
+ Returns:
86
+ Response[Union[ErrorResponse, GetProcessIdentifierLogsStreamResponse200]]
87
+ """
88
+
89
+ kwargs = _get_kwargs(
90
+ identifier=identifier,
91
+ stream=stream,
92
+ )
93
+
94
+ response = client.get_httpx_client().request(
95
+ **kwargs,
96
+ )
97
+
98
+ return _build_response(client=client, response=response)
99
+
100
+
101
+ def sync(
102
+ identifier: str,
103
+ *,
104
+ client: Union[Client],
105
+ stream: Union[Unset, bool] = UNSET,
106
+ ) -> Optional[Union[ErrorResponse, GetProcessIdentifierLogsStreamResponse200]]:
107
+ """Get process logs in realtime
108
+
109
+ Get the stdout and stderr output of a process in realtime
110
+
111
+ Args:
112
+ identifier (str):
113
+ stream (Union[Unset, bool]):
114
+
115
+ Raises:
116
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
117
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
118
+
119
+ Returns:
120
+ Union[ErrorResponse, GetProcessIdentifierLogsStreamResponse200]
121
+ """
122
+
123
+ return sync_detailed(
124
+ identifier=identifier,
125
+ client=client,
126
+ stream=stream,
127
+ ).parsed
128
+
129
+
130
+ async def asyncio_detailed(
131
+ identifier: str,
132
+ *,
133
+ client: Union[Client],
134
+ stream: Union[Unset, bool] = UNSET,
135
+ ) -> Response[Union[ErrorResponse, GetProcessIdentifierLogsStreamResponse200]]:
136
+ """Get process logs in realtime
137
+
138
+ Get the stdout and stderr output of a process in realtime
139
+
140
+ Args:
141
+ identifier (str):
142
+ stream (Union[Unset, bool]):
143
+
144
+ Raises:
145
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
146
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
147
+
148
+ Returns:
149
+ Response[Union[ErrorResponse, GetProcessIdentifierLogsStreamResponse200]]
150
+ """
151
+
152
+ kwargs = _get_kwargs(
153
+ identifier=identifier,
154
+ stream=stream,
155
+ )
156
+
157
+ response = await client.get_async_httpx_client().request(**kwargs)
158
+
159
+ return _build_response(client=client, response=response)
160
+
161
+
162
+ async def asyncio(
163
+ identifier: str,
164
+ *,
165
+ client: Union[Client],
166
+ stream: Union[Unset, bool] = UNSET,
167
+ ) -> Optional[Union[ErrorResponse, GetProcessIdentifierLogsStreamResponse200]]:
168
+ """Get process logs in realtime
169
+
170
+ Get the stdout and stderr output of a process in realtime
171
+
172
+ Args:
173
+ identifier (str):
174
+ stream (Union[Unset, bool]):
175
+
176
+ Raises:
177
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
178
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
179
+
180
+ Returns:
181
+ Union[ErrorResponse, GetProcessIdentifierLogsStreamResponse200]
182
+ """
183
+
184
+ return (
185
+ await asyncio_detailed(
186
+ identifier=identifier,
187
+ client=client,
188
+ stream=stream,
189
+ )
190
+ ).parsed
@@ -0,0 +1,176 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import Client
8
+ from ...models.error_response import ErrorResponse
9
+ from ...models.process_request import ProcessRequest
10
+ from ...models.process_response import ProcessResponse
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ *,
16
+ body: ProcessRequest,
17
+ ) -> dict[str, Any]:
18
+ headers: dict[str, Any] = {}
19
+
20
+ _kwargs: dict[str, Any] = {
21
+ "method": "post",
22
+ "url": "/process",
23
+ }
24
+
25
+ if type(body) == dict:
26
+ _body = body
27
+ else:
28
+ _body = body.to_dict()
29
+
30
+ _kwargs["json"] = _body
31
+ headers["Content-Type"] = "application/json"
32
+
33
+ _kwargs["headers"] = headers
34
+ return _kwargs
35
+
36
+
37
+ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[ErrorResponse, ProcessResponse]]:
38
+ if response.status_code == 200:
39
+ response_200 = ProcessResponse.from_dict(response.json())
40
+
41
+ return response_200
42
+ if response.status_code == 400:
43
+ response_400 = ErrorResponse.from_dict(response.json())
44
+
45
+ return response_400
46
+ if response.status_code == 500:
47
+ response_500 = ErrorResponse.from_dict(response.json())
48
+
49
+ return response_500
50
+ if client.raise_on_unexpected_status:
51
+ raise errors.UnexpectedStatus(response.status_code, response.content)
52
+ else:
53
+ return None
54
+
55
+
56
+ def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[ErrorResponse, ProcessResponse]]:
57
+ return Response(
58
+ status_code=HTTPStatus(response.status_code),
59
+ content=response.content,
60
+ headers=response.headers,
61
+ parsed=_parse_response(client=client, response=response),
62
+ )
63
+
64
+
65
+ def sync_detailed(
66
+ *,
67
+ client: Union[Client],
68
+ body: ProcessRequest,
69
+ ) -> Response[Union[ErrorResponse, ProcessResponse]]:
70
+ """Execute a command
71
+
72
+ Execute a command and return process information
73
+
74
+ Args:
75
+ body (ProcessRequest):
76
+
77
+ Raises:
78
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
79
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
80
+
81
+ Returns:
82
+ Response[Union[ErrorResponse, ProcessResponse]]
83
+ """
84
+
85
+ kwargs = _get_kwargs(
86
+ body=body,
87
+ )
88
+
89
+ response = client.get_httpx_client().request(
90
+ **kwargs,
91
+ )
92
+
93
+ return _build_response(client=client, response=response)
94
+
95
+
96
+ def sync(
97
+ *,
98
+ client: Union[Client],
99
+ body: ProcessRequest,
100
+ ) -> Optional[Union[ErrorResponse, ProcessResponse]]:
101
+ """Execute a command
102
+
103
+ Execute a command and return process information
104
+
105
+ Args:
106
+ body (ProcessRequest):
107
+
108
+ Raises:
109
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
110
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
111
+
112
+ Returns:
113
+ Union[ErrorResponse, ProcessResponse]
114
+ """
115
+
116
+ return sync_detailed(
117
+ client=client,
118
+ body=body,
119
+ ).parsed
120
+
121
+
122
+ async def asyncio_detailed(
123
+ *,
124
+ client: Union[Client],
125
+ body: ProcessRequest,
126
+ ) -> Response[Union[ErrorResponse, ProcessResponse]]:
127
+ """Execute a command
128
+
129
+ Execute a command and return process information
130
+
131
+ Args:
132
+ body (ProcessRequest):
133
+
134
+ Raises:
135
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
136
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
137
+
138
+ Returns:
139
+ Response[Union[ErrorResponse, ProcessResponse]]
140
+ """
141
+
142
+ kwargs = _get_kwargs(
143
+ body=body,
144
+ )
145
+
146
+ response = await client.get_async_httpx_client().request(**kwargs)
147
+
148
+ return _build_response(client=client, response=response)
149
+
150
+
151
+ async def asyncio(
152
+ *,
153
+ client: Union[Client],
154
+ body: ProcessRequest,
155
+ ) -> Optional[Union[ErrorResponse, ProcessResponse]]:
156
+ """Execute a command
157
+
158
+ Execute a command and return process information
159
+
160
+ Args:
161
+ body (ProcessRequest):
162
+
163
+ Raises:
164
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
165
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
166
+
167
+ Returns:
168
+ Union[ErrorResponse, ProcessResponse]
169
+ """
170
+
171
+ return (
172
+ await asyncio_detailed(
173
+ client=client,
174
+ body=body,
175
+ )
176
+ ).parsed
@@ -0,0 +1,162 @@
1
+ import ssl
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+ from attrs import define, evolve, field
6
+
7
+
8
+ @define
9
+ class Client:
10
+ """A Client which has been authenticated for use on secured endpoints
11
+
12
+ The following are accepted as keyword arguments and will be used to construct httpx Clients internally:
13
+
14
+ ``base_url``: The base URL for the API, all requests are made to a relative path to this URL
15
+
16
+ ``cookies``: A dictionary of cookies to be sent with every request
17
+
18
+ ``headers``: A dictionary of headers to be sent with every request
19
+
20
+ ``auth``: An implementation of httpx.Auth to use for authentication
21
+
22
+ ``timeout``: The maximum amount of a time a request can take. API functions will raise
23
+ httpx.TimeoutException if this is exceeded.
24
+
25
+ ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production,
26
+ but can be set to False for testing purposes.
27
+
28
+ ``follow_redirects``: Whether or not to follow redirects. Default value is False.
29
+
30
+ ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor.
31
+
32
+
33
+ Attributes:
34
+ raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a
35
+ status code that was not documented in the source OpenAPI document. Can also be provided as a keyword
36
+ argument to the constructor.
37
+ auth: Auth to use for authentication
38
+ """
39
+
40
+ raise_on_unexpected_status: bool = field(default=True, kw_only=True)
41
+ _base_url: str = field(alias="base_url", default="")
42
+ _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies")
43
+ _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers")
44
+ _auth: httpx.Auth = field(default=None, alias="auth")
45
+ _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout")
46
+ _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl")
47
+ _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects")
48
+ _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args")
49
+ _client: Optional[httpx.Client] = field(default=None, init=False)
50
+ _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False)
51
+
52
+ def with_base_url(self, base_url: str) -> "Client":
53
+ """Get a new client matching this one with a new base URL"""
54
+ self._base_url = base_url
55
+ if self._client is not None:
56
+ self._client.base_url = base_url
57
+ if self._async_client is not None:
58
+ self._async_client.base_url = base_url
59
+ return evolve(self, base_url=base_url)
60
+
61
+ def with_headers(self, headers: dict[str, str]) -> "Client":
62
+ """Get a new client matching this one with additional headers"""
63
+ self._headers = headers
64
+ if self._client is not None:
65
+ self._client.headers.update(headers)
66
+ if self._async_client is not None:
67
+ self._async_client.headers.update(headers)
68
+ return evolve(self, headers={**self._headers, **headers})
69
+
70
+ def with_cookies(self, cookies: dict[str, str]) -> "Client":
71
+ """Get a new client matching this one with additional cookies"""
72
+ self._cookies = cookies
73
+ if self._client is not None:
74
+ self._client.cookies.update(cookies)
75
+ if self._async_client is not None:
76
+ self._async_client.cookies.update(cookies)
77
+ return evolve(self, cookies={**self._cookies, **cookies})
78
+
79
+ def with_timeout(self, timeout: httpx.Timeout) -> "Client":
80
+ """Get a new client matching this one with a new timeout (in seconds)"""
81
+ self._timeout = timeout
82
+ if self._client is not None:
83
+ self._client.timeout = timeout
84
+ if self._async_client is not None:
85
+ self._async_client.timeout = timeout
86
+ return evolve(self, timeout=timeout)
87
+
88
+ def with_auth(self, auth: httpx.Auth) -> "Client":
89
+ """Get a new client matching this one with a new provider"""
90
+ self._auth = auth
91
+ if self._client is not None:
92
+ self._client.auth = auth
93
+ if self._async_client is not None:
94
+ self._async_client.auth = auth
95
+ return evolve(self, auth=auth)
96
+
97
+ def set_httpx_client(self, client: httpx.Client) -> "Client":
98
+ """Manually set the underlying httpx.Client
99
+
100
+ **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
101
+ """
102
+ self._client = client
103
+ return self
104
+
105
+ def get_httpx_client(self) -> httpx.Client:
106
+ """Get the underlying httpx.Client, constructing a new one if not previously set"""
107
+ if self._client is None:
108
+ self._client = httpx.Client(
109
+ base_url=self._base_url,
110
+ cookies=self._cookies,
111
+ headers=self._headers,
112
+ timeout=self._timeout,
113
+ verify=self._verify_ssl,
114
+ follow_redirects=self._follow_redirects,
115
+ auth=self._auth,
116
+ **self._httpx_args,
117
+ )
118
+ return self._client
119
+
120
+ def __enter__(self) -> "Client":
121
+ """Enter a context manager for self.client—you cannot enter twice (see httpx docs)"""
122
+ self.get_httpx_client().__enter__()
123
+ return self
124
+
125
+ def __exit__(self, *args: Any, **kwargs: Any) -> None:
126
+ """Exit a context manager for internal httpx.Client (see httpx docs)"""
127
+ self.get_httpx_client().__exit__(*args, **kwargs)
128
+
129
+ def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client":
130
+ """Manually the underlying httpx.AsyncClient
131
+
132
+ **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
133
+ """
134
+ self._async_client = async_client
135
+ return self
136
+
137
+ def get_async_httpx_client(self) -> httpx.AsyncClient:
138
+ """Get the underlying httpx.AsyncClient, constructing a new one if not previously set"""
139
+ if self._async_client is None:
140
+ self._async_client = httpx.AsyncClient(
141
+ base_url=self._base_url,
142
+ cookies=self._cookies,
143
+ headers=self._headers,
144
+ timeout=self._timeout,
145
+ verify=self._verify_ssl,
146
+ follow_redirects=self._follow_redirects,
147
+ auth=self._auth,
148
+ **self._httpx_args,
149
+ )
150
+ return self._async_client
151
+
152
+ async def __aenter__(self) -> "Client":
153
+ """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)"""
154
+ await self.get_async_httpx_client().__aenter__()
155
+ return self
156
+
157
+ async def __aexit__(self, *args: Any, **kwargs: Any) -> None:
158
+ """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)"""
159
+ await self.get_async_httpx_client().__aexit__(*args, **kwargs)
160
+
161
+
162
+ client = Client()
@@ -0,0 +1,16 @@
1
+ """Contains shared errors types that can be raised from API functions"""
2
+
3
+
4
+ class UnexpectedStatus(Exception):
5
+ """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True"""
6
+
7
+ def __init__(self, status_code: int, content: bytes):
8
+ self.status_code = status_code
9
+ self.content = content
10
+
11
+ super().__init__(
12
+ f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}"
13
+ )
14
+
15
+
16
+ __all__ = ["UnexpectedStatus"]
@@ -0,0 +1,41 @@
1
+ """Contains all the data models used in inputs/outputs"""
2
+
3
+ from .delete_network_process_pid_monitor_response_200 import (
4
+ DeleteNetworkProcessPidMonitorResponse200,
5
+ )
6
+ from .directory import Directory
7
+ from .error_response import ErrorResponse
8
+ from .file import File
9
+ from .file_request import FileRequest
10
+ from .file_with_content import FileWithContent
11
+ from .get_network_process_pid_ports_response_200 import GetNetworkProcessPidPortsResponse200
12
+ from .get_process_identifier_logs_response_200 import GetProcessIdentifierLogsResponse200
13
+ from .get_process_identifier_logs_stream_response_200 import (
14
+ GetProcessIdentifierLogsStreamResponse200,
15
+ )
16
+ from .port_monitor_request import PortMonitorRequest
17
+ from .post_network_process_pid_monitor_response_200 import PostNetworkProcessPidMonitorResponse200
18
+ from .process_kill_request import ProcessKillRequest
19
+ from .process_request import ProcessRequest
20
+ from .process_response import ProcessResponse
21
+ from .subdirectory import Subdirectory
22
+ from .success_response import SuccessResponse
23
+
24
+ __all__ = (
25
+ "DeleteNetworkProcessPidMonitorResponse200",
26
+ "Directory",
27
+ "ErrorResponse",
28
+ "File",
29
+ "FileRequest",
30
+ "FileWithContent",
31
+ "GetNetworkProcessPidPortsResponse200",
32
+ "GetProcessIdentifierLogsResponse200",
33
+ "GetProcessIdentifierLogsStreamResponse200",
34
+ "PortMonitorRequest",
35
+ "PostNetworkProcessPidMonitorResponse200",
36
+ "ProcessKillRequest",
37
+ "ProcessRequest",
38
+ "ProcessResponse",
39
+ "Subdirectory",
40
+ "SuccessResponse",
41
+ )
@@ -0,0 +1,45 @@
1
+ from typing import Any, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ T = TypeVar("T", bound="DeleteNetworkProcessPidMonitorResponse200")
7
+
8
+
9
+ @_attrs_define
10
+ class DeleteNetworkProcessPidMonitorResponse200:
11
+ """ """
12
+
13
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
14
+
15
+ def to_dict(self) -> dict[str, Any]:
16
+ field_dict: dict[str, Any] = {}
17
+ field_dict.update(self.additional_properties)
18
+
19
+ return field_dict
20
+
21
+ @classmethod
22
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
23
+ if not src_dict:
24
+ return None
25
+ d = src_dict.copy()
26
+ delete_network_process_pid_monitor_response_200 = cls()
27
+
28
+ delete_network_process_pid_monitor_response_200.additional_properties = d
29
+ return delete_network_process_pid_monitor_response_200
30
+
31
+ @property
32
+ def additional_keys(self) -> list[str]:
33
+ return list(self.additional_properties.keys())
34
+
35
+ def __getitem__(self, key: str) -> Any:
36
+ return self.additional_properties[key]
37
+
38
+ def __setitem__(self, key: str, value: Any) -> None:
39
+ self.additional_properties[key] = value
40
+
41
+ def __delitem__(self, key: str) -> None:
42
+ del self.additional_properties[key]
43
+
44
+ def __contains__(self, key: str) -> bool:
45
+ return key in self.additional_properties