Add media content type inference and path-based upload methods for images and documents

This commit is contained in:
claudi 2026-04-07 10:34:43 +02:00
parent 937cd86c8b
commit 6d54c5900c
4 changed files with 202 additions and 16 deletions

View file

@ -14,11 +14,15 @@ Currently wired API domains include Notification, Inventory, Fulfillment, Accoun
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
- `guess_media_content_type()` to infer a content type from a file name when possible
- `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_video_from_path()` to do the same directly from a local file path
- `create_upload_and_wait_document()` to stage, upload, and poll a document in one call
- `create_upload_and_wait_document_from_path()` to do the same directly from a local file path
- `create_document_from_url_and_wait()` to create a document from a URL and poll until it is accepted
- `create_image_from_path()` and `upload_document_from_path()` for path-based local file uploads
A concrete workflow example is available in `examples/media_workflows.py` for: