Add media upload convenience methods and example workflows for images, documents, and videos

This commit is contained in:
claudi 2026-04-07 10:29:42 +02:00
parent ee539e8189
commit 937cd86c8b
4 changed files with 325 additions and 2 deletions

View file

@ -16,6 +16,16 @@ The Media wrapper includes workflow helpers on top of the raw endpoints:
- `extract_resource_id()` to pull a media resource ID from a `Location` header
- `wait_for_video()` to poll until a video reaches `LIVE` or a terminal failure state
- `wait_for_document()` to poll until a document reaches `ACCEPTED` or a terminal failure state
- `create_upload_and_wait_video()` to stage, upload, and poll a video in one call
- `create_upload_and_wait_document()` to stage, upload, and poll a document in one call
- `create_document_from_url_and_wait()` to create a document from a URL and poll until it is accepted
A concrete workflow example is available in `examples/media_workflows.py` for:
- uploading an image from a file
- creating an image from a URL
- staging, uploading, and polling a document
- staging, uploading, and polling a video
## Generate Low-Level Clients