chaturbate_poller.models

Pydantic models for the Chaturbate Events API.

Classes

BaseModelWithEnums

Base model with custom configuration for all models.

MediaType

Enumeration for the media type.

Gender

Enumeration for the user's gender.

Subgender

Enumeration for the user's subgender.

Media

Model for media objects.

Message

Model for chat messages.

Tip

Model for tips.

User

Model for user information.

EventData

Model for event data.

Event

Model for an event.

EventsAPIResponse

Model for the API response.

Module Contents

class chaturbate_poller.models.BaseModelWithEnums(/, **data: Any)[source]

Bases: pydantic.BaseModel

Base model with custom configuration for all models.

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class chaturbate_poller.models.MediaType[source]

Bases: str, enum.Enum

Enumeration for the media type.

PHOTOS = 'photos'

The media type for photos.

Type:

str

VIDEOS = 'videos'

The media type for videos.

Type:

str

class chaturbate_poller.models.Gender[source]

Bases: str, enum.Enum

Enumeration for the user’s gender.

MALE = 'm'

The gender for male users.

Type:

str

FEMALE = 'f'

The gender for female users.

Type:

str

TRANS = 't'

The gender for transgender users.

Type:

str

COUPLE = 'c'

The gender for couples.

Type:

str

class chaturbate_poller.models.Subgender[source]

Bases: str, enum.Enum

Enumeration for the user’s subgender.

NONE = ''

The subgender for users with no subgender.

Type:

str

TF = 'tf'

The subgender for transfeminine users.

Type:

str

TM = 'tm'

The subgender for transmasculine users.

Type:

str

TN = 'tn'

The subgender for transneutral users.

Type:

str

class chaturbate_poller.models.Media(/, **data: Any)[source]

Bases: BaseModelWithEnums

Model for media objects.

id: int = None

The media ID.

Type:

int

type: MediaType = None

The media type.

Type:

MediaType

name: str = None

The media name.

Type:

str

tokens: int = None

The media tokens.

Type:

int

class chaturbate_poller.models.Message(/, **data: Any)[source]

Bases: BaseModelWithEnums

Model for chat messages.

color: str = None

The message color.

Type:

str

bg_color: str | None = None

The message background color.

Type:

str | None

message: str = None

The message content.

Type:

str

font: str = None

The font used in the message.

Type:

str

from_user: str | None = None

The sender of the message.

Type:

str | None

to_user: str | None = None

The recipient of the message.

Type:

str | None

class chaturbate_poller.models.Tip(/, **data: Any)[source]

Bases: BaseModelWithEnums

Model for tips.

tokens: int = None

The number of tokens in the tip.

Type:

int

is_anon: bool = None

Whether the tip is anonymous.

Type:

bool

message: str = None

A message accompanying the tip.

Type:

str

classmethod ensure_positive_tokens(v: int) int[source]

Ensure the number of tokens is positive.

class chaturbate_poller.models.User(/, **data: Any)[source]

Bases: BaseModelWithEnums

Model for user information.

username: str = None

The username.

Type:

str

in_fanclub: bool = None

Whether the user is in the fanclub.

Type:

bool

has_tokens: bool = None

Whether the user has tokens.

Type:

bool

is_mod: bool = None

Whether the user is a moderator.

Type:

bool

recent_tips: str = None

The user’s recent tips.

Type:

str

gender: Gender = None

The user’s gender.

Type:

Gender

subgender: Subgender = None

The user’s subgender.

Type:

Subgender

class chaturbate_poller.models.EventData(/, **data: Any)[source]

Bases: BaseModelWithEnums

Model for event data.

broadcaster: str | None = None

The broadcaster.

Type:

str | None

user: User | None = None

The user.

Type:

User | None

media: Media | None = None

The media associated with the event.

Type:

Media | None

tip: Tip | None = None

The tip data.

Type:

Tip | None

message: Message | None = None

The message.

Type:

Message | None

subject: str | None = None

The subject of the event.

Type:

str | None

class chaturbate_poller.models.Event(/, **data: Any)[source]

Bases: BaseModelWithEnums

Model for an event.

method: str = None

The event method.

Type:

str

object: EventData = None

The event data.

Type:

EventData

id: str = None

The unique identifier for the event.

Type:

str

class chaturbate_poller.models.EventsAPIResponse(/, **data: Any)[source]

Bases: BaseModelWithEnums

Model for the API response.

events: list[Event] = None

A list of events.

Type:

list[Event]

next_url: str = None

The URL for the next page of results.

Type:

str

classmethod validate_next_url(v: str) str[source]

Validate that the next_url is a valid URL.