# generated by datamodel-codegen:

#   filename:  commerce_media_v1_beta_oas3.yaml

#   timestamp: 2026-04-07T08:09:11+00:00



from __future__ import annotations



from typing import List, Optional



from pydantic import BaseModel, Field





class CreateDocumentFromUrlRequest(BaseModel):

    """

    This type contains the metadata used to create the document ID when creating a document using a URL.

    """



    documentType: Optional[str] = Field(

        None,

        description="The type of the document being created. For example, a <code>USER_GUIDE_OR_MANUAL</code> or a <code>SAFETY_DATA_SHEET</code>. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/commerce/media/types/api:DocumentTypeEnum'>eBay API documentation</a>",

    )

    documentUrl: Optional[str] = Field(

        None,

        description="The URL of the document being created.<br><br>The document referenced by the URL must be a .pdf, .png, .jpg, or .jpeg file, and must be no larger than 10 MB.",

    )

    languages: Optional[List[str]] = Field(

        None, description="This array shows the language(s) used in the document."

    )





class CreateDocumentRequest(BaseModel):

    """

    This type contains the metadata used to create the document ID.

    """



    documentType: Optional[str] = Field(

        None,

        description="The type of the document being uploaded. For example, a <code>USER_GUIDE_OR_MANUAL</code> or a <code>SAFETY_DATA_SHEET</code>. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/commerce/media/types/api:DocumentTypeEnum'>eBay API documentation</a>",

    )

    languages: Optional[List[str]] = Field(

        None, description="This array shows the language(s) used in the document."

    )





class CreateDocumentResponse(BaseModel):

    """

    This type provides information about the created document ID.

    """



    documentId: Optional[str] = Field(

        None,

        description='The unique identifier of the document to be uploaded.<br><br>This value is returned in the response and <b>location</b> header of the <b>createDocument</b> and <b>createDocumentFromUrl</b> methods. This ID can be used with the <b>getDocument</b> and <b>uploadDocument</b> methods, and to add an uploaded document to a listing. See <a href="/api-docs/sell/static/inventory/managing-document-media.html#add-documents" target="_blank">Adding documents to listings</a> for more information. ',

    )

    documentStatus: Optional[str] = Field(

        None,

        description="The status of the document resource.<br><br>For example, the value <code>PENDING_UPLOAD</code> is the initial state when the reference to the document has been created using the <b>createDocument</b> method. When creating a document using the <b>createDocumentFromUrl</b> method, the initial state will be <code>SUBMITTED</code>. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/commerce/media/types/api:DocumentStatusEnum'>eBay API documentation</a>",

    )

    documentType: Optional[str] = Field(

        None,

        description="The type of the document uploaded. For example, <code>USER_GUIDE_OR_MANUAL</code>. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/commerce/media/types/api:DocumentTypeEnum'>eBay API documentation</a>",

    )

    languages: Optional[List[str]] = Field(

        None, description="This array shows the language(s) used in the document."

    )





class CreateImageFromUrlRequest(BaseModel):

    """

    A type that provides the location of the image.

    """



    imageUrl: Optional[str] = Field(

        None,

        description='The image URL of the self-hosted picture to upload to eBay Picture Services (EPS). In addition to the picture requirements in <a href="https://www.ebay.com/help/policies/listing-policies/picture-policy?id=4370" target="_blank">Picture policy</a>, the provided URL must be secured using HTTPS (HTTP is not permitted). For more information, see <a href="/api-docs/sell/static/inventory/managing-image-media.html#image-requirements" target="_blank">Image requirements</a>.',

    )





class CreateVideoRequest(BaseModel):

    """

    The request to create a video, which must contain the video's <b>title</b>, <b>size</b>, and <b>classification</b>. <b>Description</b> is an optional field when creating videos.

    """



    classification: Optional[List[str]] = Field(

        None,

        description="The intended use for this video content. Currently, videos can only be added and associated with eBay listings, so the only supported value is <code>ITEM</code>.",

    )

    description: Optional[str] = Field(

        None, description="The description of the video."

    )

    size: Optional[int] = Field(

        None,

        description="The size, in bytes, of the video content. <br><br><b>Max:</b> 157,286,400 bytes",

    )

    title: Optional[str] = Field(None, description="The title of the video.")





class DocumentMetadata(BaseModel):

    """

    This type provides information about the <b>documentId</b>.

    """



    fileName: Optional[str] = Field(

        None,

        description="The name of the file including its extension (for example, <code>drone_user_warranty.pdf</code>).",

    )

    fileSize: Optional[str] = Field(

        None, description="The size, in bytes, of the document content."

    )

    fileType: Optional[str] = Field(

        None,

        description="The type of the file uploaded. Supported file types include the following: <code>pdf</code>, <code>jpeg</code>, <code>jpg</code>, and <code>png</code>.",

    )





class DocumentResponse(BaseModel):

    """

    This type provides information returned about a created document ID, which may or may not have been uploaded.

    """



    documentId: Optional[str] = Field(

        None, description="The unique ID of the document."

    )

    documentMetadata: Optional[DocumentMetadata] = Field(

        None,

        description="This container provides the name, size, and type of the specified file.",

    )

    documentStatus: Optional[str] = Field(

        None,

        description="The status of the document resource.<br><br>Once a document has been uploaded using the <b>uploadDocument</b> method, the <b>documentStatus</b> will be <code>SUBMITTED</code>. The document will then either be accepted or rejected. Only documents with the status of <code>ACCEPTED</code> are available to be added to a listing. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/commerce/media/types/api:DocumentStatusEnum'>eBay API documentation</a>",

    )

    documentType: Optional[str] = Field(

        None,

        description="The type of the document uploaded. For example, <code>USER_GUIDE_OR_MANUAL</code>. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/commerce/media/types/api:DocumentTypeEnum'>eBay API documentation</a>",

    )

    languages: Optional[List[str]] = Field(

        None, description="This array shows the language(s) used in the document."

    )





class ErrorParameter(BaseModel):

    name: Optional[str] = Field(None, description="The object of the error.")

    value: Optional[str] = Field(None, description="The value of the object.")





class Image(BaseModel):

    """

    A type that provides the location of the image.

    """



    imageUrl: Optional[str] = Field(

        None, description="The URL of the image's location."

    )





class ImageResponse(BaseModel):

    """

    A type that provides an image's details including its URL and expiration.

    """



    expirationDate: Optional[str] = Field(

        None,

        description="The date and time when an unused EPS image will expire and be removed from the EPS server, in Coordinated Universal Time (UTC). As long as an EPS image is being used in an active listing, that image will remain on the EPS server and be accessible.",

    )

    imageUrl: Optional[str] = Field(

        None,

        description="The EPS URL to access the uploaded image. This URL will be used in listing calls to add the image to a listing.",

    )

    maxDimensionImageUrl: Optional[str] = Field(

        None,

        description="The EPS URL to access the maximum dimension version of the uploaded image.",

    )





class InputStream(BaseModel):

    """

    The streaming input of the video source. The input source must be an .mp4 file of the type MPEG-4 Part 10 or Advanced Video Coding (MPEG-4 AVC).

    """





class Moderation(BaseModel):

    """

    A container that provides video moderation information when calling the <strong>getVideo</strong> method.<br /><br />This container is returned if the specified video has been blocked by moderators.<br /><br /><span class="tablenote"><span style="color:#478415"><strong>Tip:</strong></span> See <a href="https://www.ebay.com/help/selling/listings/creating-managing-listings/add-video-to-listing?id=5272#section2" target="_blank">Video moderation and restrictions</a> in the eBay Seller Center for details about video moderation.</span>

    """



    rejectReasons: Optional[List[str]] = Field(

        None,

        description="The reason(s) why the specified video was blocked by moderators.",

    )





class Play(BaseModel):

    """

    The two streaming video URLs available for a successfully uploaded video with a status of <code>LIVE</code>. The supported streaming video protocols are DASH (Dynamic Adaptive Streaming over HTTP) and HLS (HTTP Live Streaming).

    """



    playUrl: Optional[str] = Field(None, description="The playable URL for this video.")

    protocol: Optional[str] = Field(

        None,

        description="The protocol for the video playlist. Supported protocols are DASH (Dynamic Adaptive Streaming over HTTP) and HLS (HTTP\xa0Live Streaming). For implementation help, refer to <a href='https://developer.ebay.com/api-docs/commerce/media/types/api:ProtocolEnum'>eBay API documentation</a>",

    )





class Video(BaseModel):

    """

    A response field that retrieves all the metadata for the video, including its <b>title</b>, <b>classification</b>, <b>size</b>, <b>description</b>, <b>status</b>, <b>status message</b> (if any), and <b>expiration date</b>.

    """



    classification: Optional[List[str]] = Field(

        None,

        description="The intended use for this video content. Currently, videos can only be added and associated with eBay listings, so the only supported value is <code>ITEM</code>.",

    )

    description: Optional[str] = Field(

        None,

        description='The description of the video. The video description is an optional field that can be set using the <a href=" /api-docs/commerce/media/resources/video/methods/createVideo" target="_blank">createVideo</a> method.',

    )

    expirationDate: Optional[str] = Field(

        None,

        description="The date and time when an unused video will expire and be removed from the eBay Video Services server, in Coordinated Universal Time (UTC).<br><br>As long as a video is being used in an active listing, that video will remain on the server and be accessible. If a video is not being used on an active listing, its expiration date is automatically set to 30 days after the video's initial upload.",

    )

    moderation: Optional[Moderation] = Field(

        None,

        description='The video moderation information that is returned if a video is blocked by moderators.<br /><br /><span class="tablenote"><span style="color:#478415"><strong>Tip:</strong></span> See <a href="https://www.ebay.com/help/selling/listings/creating-managing-listings/add-video-to-listing?id=5272#section2" target="_blank">Video moderation and restrictions</a> in the eBay Seller Center for details about video moderation.</span><br /><br />If the video status is <code>BLOCKED</code>, ensure that the video complies with eBay\'s video formatting and content guidelines. Afterwards, begin the video creation and upload procedure anew using the <strong>createVideo</strong> and <strong>uploadVideo</strong> methods.',

    )

    playLists: Optional[List[Play]] = Field(

        None,

        description="The playlist created for the uploaded video, which provides the streaming video URLs to play the video. The supported streaming video protocols are DASH (Dynamic Adaptive Streaming over HTTP) and HLS (HTTP\xa0Live Streaming). The playlist will only be generated if a video is successfully uploaded with a status of <code>LIVE</code>.",

    )

    size: Optional[int] = Field(

        None, description="The size, in bytes, of the video content."

    )

    status: Optional[str] = Field(

        None,

        description="The status of the current video resource. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/commerce/media/types/api:VideoStatusEnum'>eBay API documentation</a>",

    )

    statusMessage: Optional[str] = Field(

        None,

        description="The <b>statusMessage</b> field contains additional information on the status. For example, information on why processing might have failed or if the video was blocked.",

    )

    thumbnail: Optional[Image] = Field(

        None,

        description="The URL of the thumbnail image of the video. The thumbnail image's URL must be an eBayPictureURL (EPS URL).",

    )

    title: Optional[str] = Field(None, description="The title of the video.")

    videoId: Optional[str] = Field(None, description="The unique ID of the video.")





class Error(BaseModel):

    """

    This type defines the fields that can be returned in an error.

    """



    category: Optional[str] = Field(None, description="Identifies the type of erro.")

    domain: Optional[str] = Field(

        None,

        description="Name for the primary system where the error occurred. This is relevant for application errors.",

    )

    errorId: Optional[int] = Field(

        None, description="A unique number to identify the error."

    )

    inputRefIds: Optional[List[str]] = Field(

        None,

        description="An array of request elements most closely associated to the error.",

    )

    longMessage: Optional[str] = Field(

        None, description="A more detailed explanation of the error."

    )

    message: Optional[str] = Field(

        None,

        description="Information on how to correct the problem, in the end user's terms and language where applicable.",

    )

    outputRefIds: Optional[List[str]] = Field(

        None,

        description="An array of request elements most closely associated to the error.",

    )

    parameters: Optional[List[ErrorParameter]] = Field(

        None,

        description="An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned.",

    )

    subdomain: Optional[str] = Field(

        None,

        description="Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc.",

    )

