"""Global participant schemas.""" from pydantic import BaseModel, ConfigDict, Field from contributor.api.schemas.contributors import Contributor, GlobalParticipantKey from contributor.api.schemas.schema_examples import with_example class GlobalParticipant(GlobalParticipantKey): model_config = ConfigDict( title="A global participant linked to a contributor.", json_schema_extra=with_example("global_participant"), ) id: str = Field(description="Global participant identifier.") name: str | None = Field(default=None, description="Display name.") spotify_id: str | None = Field(default=None, description="Spotify artist ID.") apple_music_id: str | None = Field( default=None, description="Apple Music artist ID." ) chartmetric_id: str | None = Field( default=None, description="Chartmetric artist ID." ) image_url: str | None = Field(default=None, description="Image URL.") monthly_listeners: int | None = Field( default=None, description="Number of monthly listeners for the global participant.", ) class GlobalParticipantDataloaderRequest(BaseModel): model_config = ConfigDict( title="Request body for loading multiple global participants by key.", json_schema_extra=with_example("global_participant_dataloader_request"), ) global_participants: list[GlobalParticipantKey] = Field( description="List of global participant keys to load." ) class GlobalParticipantContributors(BaseModel): model_config = ConfigDict( title="Contributors associated with a global participant.", json_schema_extra=with_example("global_participant_contributors"), ) global_participant: GlobalParticipantKey = Field( description="Global participant identifier." ) contributors: list[Contributor] = Field( default=[], description="List of contributors associated with the global participant.", )