Add structured workflow result models for video and document uploads; update client methods and examples
This commit is contained in:
parent
6d54c5900c
commit
00539b4fb2
5 changed files with 98 additions and 26 deletions
|
|
@ -32,7 +32,7 @@ def upload_image_from_url(client: EbayClient, image_url: str) -> None:
|
|||
|
||||
|
||||
def upload_document_and_wait(client: EbayClient, document_path: Path) -> None:
|
||||
accepted = client.media.create_upload_and_wait_document(
|
||||
result = client.media.create_upload_and_wait_document(
|
||||
CreateDocumentRequest(
|
||||
documentType="USER_GUIDE_OR_MANUAL",
|
||||
languages=["en-US"],
|
||||
|
|
@ -42,11 +42,12 @@ def upload_document_and_wait(client: EbayClient, document_path: Path) -> None:
|
|||
content_type="application/pdf",
|
||||
timeout_seconds=60.0,
|
||||
)
|
||||
print("document_final_status:", accepted.documentStatus)
|
||||
print("document_id:", result.document_id)
|
||||
print("document_final_status:", result.document.documentStatus)
|
||||
|
||||
|
||||
def upload_document_and_wait_from_path(client: EbayClient, document_path: Path) -> None:
|
||||
accepted = client.media.create_upload_and_wait_document_from_path(
|
||||
result = client.media.create_upload_and_wait_document_from_path(
|
||||
CreateDocumentRequest(
|
||||
documentType="USER_GUIDE_OR_MANUAL",
|
||||
languages=["en-US"],
|
||||
|
|
@ -54,17 +55,18 @@ def upload_document_and_wait_from_path(client: EbayClient, document_path: Path)
|
|||
document_path,
|
||||
timeout_seconds=60.0,
|
||||
)
|
||||
print("document_final_status:", accepted.documentStatus)
|
||||
print("document_id:", result.document_id)
|
||||
print("document_final_status:", result.document.documentStatus)
|
||||
|
||||
|
||||
def upload_video_and_wait(client: EbayClient, video_path: Path) -> None:
|
||||
live_video = client.media.create_upload_and_wait_video_from_path(
|
||||
result = client.media.create_upload_and_wait_video_from_path(
|
||||
video_path,
|
||||
description="Example upload from the ebay-rest-client workspace.",
|
||||
timeout_seconds=120.0,
|
||||
)
|
||||
print("video_status:", live_video.status)
|
||||
print("video_id:", live_video.videoId)
|
||||
print("video_id:", result.video_id)
|
||||
print("video_status:", result.video.status)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue