You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
83
83
84
84
```python
85
85
import os
86
86
import asyncio
87
-
fromdroidrun_cloudimport DefaultAioHttpClient
88
-
fromdroidrun_cloudimport AsyncMobilerun
87
+
frommobilerunimport DefaultAioHttpClient
88
+
frommobilerunimport AsyncMobilerun
89
89
90
90
91
91
asyncdefmain() -> None:
@@ -111,27 +111,27 @@ Typed requests and responses provide autocomplete and documentation within your
111
111
112
112
## Handling errors
113
113
114
-
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `droidrun_cloud.APIConnectionError` is raised.
114
+
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `mobilerun.APIConnectionError` is raised.
115
115
116
116
When the API returns a non-success status code (that is, 4xx or 5xx
117
-
response), a subclass of `droidrun_cloud.APIStatusError` is raised, containing `status_code` and `response` properties.
117
+
response), a subclass of `mobilerun.APIStatusError` is raised, containing `status_code` and `response` properties.
118
118
119
-
All errors inherit from `droidrun_cloud.APIError`.
119
+
All errors inherit from `mobilerun.APIError`.
120
120
121
121
```python
122
-
importdroidrun_cloud
123
-
fromdroidrun_cloudimport Mobilerun
122
+
importmobilerun
123
+
frommobilerunimport Mobilerun
124
124
125
125
client = Mobilerun()
126
126
127
127
try:
128
128
client.tasks.list()
129
-
exceptdroidrun_cloud.APIConnectionError as e:
129
+
exceptmobilerun.APIConnectionError as e:
130
130
print("The server could not be reached")
131
131
print(e.__cause__) # an underlying Exception, likely raised within httpx.
132
-
exceptdroidrun_cloud.RateLimitError as e:
132
+
exceptmobilerun.RateLimitError as e:
133
133
print("A 429 status code was received; we should back off a bit.")
134
-
exceptdroidrun_cloud.APIStatusError as e:
134
+
exceptmobilerun.APIStatusError as e:
135
135
print("Another non-200-range status code was received")
136
136
print(e.status_code)
137
137
print(e.response)
@@ -159,7 +159,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
159
159
You can use the `max_retries` option to configure or disable retry settings:
160
160
161
161
```python
162
-
fromdroidrun_cloudimport Mobilerun
162
+
frommobilerunimport Mobilerun
163
163
164
164
# Configure the default for all requests:
165
165
client = Mobilerun(
@@ -177,7 +177,7 @@ By default requests time out after 1 minute. You can configure this with a `time
177
177
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
178
178
179
179
```python
180
-
fromdroidrun_cloudimport Mobilerun
180
+
frommobilerunimport Mobilerun
181
181
182
182
# Configure the default for all requests:
183
183
client = Mobilerun(
@@ -229,7 +229,7 @@ if response.my_field is None:
229
229
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
230
230
231
231
```py
232
-
fromdroidrun_cloudimport Mobilerun
232
+
frommobilerunimport Mobilerun
233
233
234
234
client = Mobilerun()
235
235
response = client.tasks.with_raw_response.list()
@@ -239,9 +239,9 @@ task = response.parse() # get the object that `tasks.list()` would have returne
239
239
print(task.items)
240
240
```
241
241
242
-
These methods return an [`APIResponse`](https://github.com/droidrun/mobilerun-sdk-python/tree/main/src/droidrun_cloud/_response.py) object.
242
+
These methods return an [`APIResponse`](https://github.com/droidrun/mobilerun-sdk-python/tree/main/src/mobilerun/_response.py) object.
243
243
244
-
The async client returns an [`AsyncAPIResponse`](https://github.com/droidrun/mobilerun-sdk-python/tree/main/src/droidrun_cloud/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
244
+
The async client returns an [`AsyncAPIResponse`](https://github.com/droidrun/mobilerun-sdk-python/tree/main/src/mobilerun/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
245
245
246
246
#### `.with_streaming_response`
247
247
@@ -303,7 +303,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
327
327
328
328
```py
329
-
fromdroidrun_cloudimport Mobilerun
329
+
frommobilerunimport Mobilerun
330
330
331
331
with Mobilerun() as client:
332
332
# make requests here
@@ -354,8 +354,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
354
354
You can determine the version that is being used at runtime with:
0 commit comments