# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .organization_member_contributed_to_projects_item import OrganizationMemberContributedToProjectsItem
from .organization_member_created_projects_item import OrganizationMemberCreatedProjectsItem


class OrganizationMember(UncheckedBaseModel):
    """
    A serializer mixin that takes an additional `fields` argument that controls
    which fields should be displayed.
    """

    annotations_count: typing.Optional[int] = None
    contributed_projects_count: typing.Optional[int] = None
    contributed_to_projects: typing.Optional[typing.List[OrganizationMemberContributedToProjectsItem]] = None
    created_at: typing.Optional[dt.datetime] = None
    created_projects: typing.Optional[typing.List[OrganizationMemberCreatedProjectsItem]] = None
    organization: int = pydantic.Field()
    """
    Organization ID
    """

    user: int = pydantic.Field()
    """
    User ID
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
