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
{{ message }}
Repository navigation
Commit d0bb085
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -121,79 +121,19 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
121
121
122
122
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
123
123
124
-
## Pagination
124
+
## Nested params
125
125
126
-
List methods in the Unlayer API are paginated.
127
-
128
-
This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
126
+
Nested parameters are dictionaries, typed using `TypedDict`, for example:
129
127
130
128
```python
131
129
from unlayer import Unlayer
132
130
133
131
client = Unlayer()
134
132
135
-
all_projects = []
136
-
# Automatically fetches more pages as needed.
137
-
for project in client.project.templates_list(
138
-
project_id="your-project-id",
139
-
limit=10,
140
-
):
141
-
# Do something with project here
142
-
all_projects.append(project)
143
-
print(all_projects)
144
-
```
145
-
146
-
Or, asynchronously:
147
-
148
-
```python
149
-
import asyncio
150
-
from unlayer import AsyncUnlayer
151
-
152
-
client = AsyncUnlayer()
153
-
154
-
155
-
asyncdefmain() -> None:
156
-
all_projects = []
157
-
# Iterate through items across all pages, issuing requests as needed.
158
-
asyncfor project in client.project.templates_list(
159
-
project_id="your-project-id",
160
-
limit=10,
161
-
):
162
-
all_projects.append(project)
163
-
print(all_projects)
164
-
165
-
166
-
asyncio.run(main())
167
-
```
168
-
169
-
Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
project= response.parse() # get the object that `project.current_list()` would have returned
334
-
print(project.data)
275
+
full_to_simple= response.parse() # get the object that `convert.full_to_simple.create()` would have returned
276
+
print(full_to_simple.data)
335
277
```
336
278
337
279
These methods return an [`APIResponse`](https://github.com/stainless-sdks/unlayer-python/tree/main/src/unlayer/_response.py) object.
@@ -345,8 +287,8 @@ The above interface eagerly reads the full response body when you make the reque
345
287
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
346
288
347
289
```python
348
-
with client.project.with_streaming_response.current_list(
349
-
project_id="your-project-id",
290
+
with client.convert.full_to_simple.with_streaming_response.create(
0 commit comments