"""Project schemas.""" from pydantic import BaseModel, ConfigDict, Field from contributor.api.schemas.contributors import Contributor, ContributorKey from contributor.api.schemas.schema_examples import with_example class ProjectKey(BaseModel): model_config = ConfigDict(title="Key identifying a project.") project_id: int = Field(description="The project's internal ID.") class ProjectDataloaderRequest(BaseModel): model_config = ConfigDict( title="Request body for loading multiple projects by key.", json_schema_extra=with_example("project_dataloader_request"), ) projects: list[ProjectKey] = Field(description="List of project keys to load.") class ProjectsResponse(BaseModel): model_config = ConfigDict( title="Projects for a contributor.", json_schema_extra=with_example("projects_response"), ) contributor: ContributorKey = Field(description="Contributor for the projects.") projects: list[ProjectKey] = Field(default=[], description="List of projects.") class ProjectContributors(BaseModel): model_config = ConfigDict( title="Contributors associated with a project.", json_schema_extra=with_example("project_contributors"), ) project: ProjectKey = Field(description="The project identifier.") contributors: list[Contributor] = Field( default=[], description="List of contributors associated with the project." )