Using types
Nested request parameters are TypedDicts. Responses are Pydantic models which also provide helper methods for things like:- Serializing back into JSON,
model.to_json() - Converting to a dictionary,
model.to_dict()
python.analysis.typeCheckingMode to basic.
Nested params
Nested parameters are dictionaries, typed usingTypedDict, for example:
File uploads
Request parameters that correspond to file uploads can be passed asbytes, or a PathLike instance or a tuple of (filename, contents, media type).
PathLike instance, the file contents will be read asynchronously automatically.
Pagination
List methods in the Telnyx API are paginated. This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:.has_next_page(), .next_page_info(), or .get_next_page() methods for more granular control working with pages: