From 1e46ca037fb195efd2809c7921816b59f6d09ed4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 9 Mar 2025 21:38:35 +0000 Subject: [PATCH] docs: revise readme docs about nested params --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 23c1bfc..36d42ad 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,24 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ 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`. +## Nested params + +Nested parameters are dictionaries, typed using `TypedDict`, for example: + +```python +from prelude_python_sdk import Prelude + +client = Prelude() + +verification = client.verification.create( + target={ + "type": "phone_number", + "value": "+30123456789", + }, +) +print(verification.target) +``` + ## Handling errors When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `prelude_python_sdk.APIConnectionError` is raised.