Skip to content

Commit 52f818d

Browse files
docs: revise readme docs about nested params (#128)
1 parent d951f03 commit 52f818d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,27 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
8181

8282
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`.
8383

84+
## Nested params
85+
86+
Nested parameters are dictionaries, typed using `TypedDict`, for example:
87+
88+
```python
89+
from arcadepy import Arcade
90+
91+
client = Arcade()
92+
93+
authorization_response = client.auth.authorize(
94+
auth_requirement={
95+
"id": "id",
96+
"oauth2": {"scopes": ["string"]},
97+
"provider_id": "provider_id",
98+
"provider_type": "provider_type",
99+
},
100+
user_id="user_id",
101+
)
102+
print(authorization_response.auth_requirement)
103+
```
104+
84105
## Handling errors
85106

86107
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `arcadepy.APIConnectionError` is raised.

0 commit comments

Comments
 (0)