Module TikTok.ValidationModels.Playlist

Defines data models for handling playlist-related API requests and responses in the TikTok API.

Classes

class InfoRequestModel (**data: Any)

Model for the playlist info request.

Attributes

playlist_id : int
The unique ID of the playlist.
cursor : int | None
The index to start retrieving video results from.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class InfoRequestModel(BaseRequestModel):
    """
    Model for the playlist info request.

    Attributes:
        playlist_id (int): The unique ID of the playlist.
        cursor (int | None): The index to start retrieving video results from.
    """

    playlist_id: int = Field(description="The unique ID of the playlist.")
    cursor: int | None = Field(
        default=None,
        description="Retrieve video results starting from the specified index",
    )

Ancestors

Class variables

var cursor : int | None
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var playlist_id : int

Inherited members

class InfoResponseModel (**data: Any)

Model for the complete API response for playlist information.

Attributes

data : ResponseDataModel
Playlist data.
error : ResponseErrorModel
Error information, if any.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class InfoResponseModel(BaseModel):
    """
    Model for the complete API response for playlist information.

    Attributes:
        data (ResponseDataModel): Playlist data.
        error (ResponseErrorModel): Error information, if any.
    """

    data: ResponseDataModel
    error: ResponseErrorModel

Ancestors

  • pydantic.main.BaseModel

Class variables

var dataResponseDataModel
var errorResponseErrorModel
var model_computed_fields
var model_config
var model_fields
class ResponseDataModel (**data: Any)

Model for playlist data in the API response.

Attributes

playlist_id : int
The unique ID of the playlist.
playlist_item_total : int
The total number of items in the playlist.
playlist_last_updated : int
Timestamp of when the playlist was last updated.
playlist_name : str
The name of the playlist.
playlist_video_ids : list[int]
A list of all video IDs in the playlist.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class ResponseDataModel(BaseRequestModel):
    """
    Model for playlist data in the API response.

    Attributes:
        playlist_id (int): The unique ID of the playlist.
        playlist_item_total (int): The total number of items in the playlist.
        playlist_last_updated (int): Timestamp of when the playlist was last updated.
        playlist_name (str): The name of the playlist.
        playlist_video_ids (list[int]): A list of all video IDs in the playlist.
    """

    playlist_id: int = Field(description="The unique ID of the playlist")
    playlist_item_total: int = Field(
        description="Provides the total number of items in a playlist"
    )
    playlist_last_updated: int = Field(
        description="Provides info on when the playlist was last updated"
    )
    playlist_name: str = Field(description="The name of the playlist")
    playlist_video_ids: list[int] = Field(
        description="Provides a list of all video IDs in a playlist."
    )

Ancestors

Class variables

var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var playlist_id : int
var playlist_item_total : int
var playlist_last_updated : int
var playlist_name : str
var playlist_video_ids : list[int]

Inherited members