# 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, UniversalBaseModel


class ServiceAccountResponse(UniversalBaseModel):
    """
    Response schema for a service account.
    """

    id: str = pydantic.Field()
    """
    Service account ID (svc_ prefix)
    """

    organization_id: str = pydantic.Field()
    """
    Organization ID
    """

    name: str = pydantic.Field()
    """
    Display name
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    Description
    """

    account_type: str = pydantic.Field()
    """
    Account type: 'assistant' or 'bot'
    """

    assistant_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Linked assistant ID
    """

    capabilities: typing.List[str] = pydantic.Field()
    """
    Assigned capabilities
    """

    is_active: bool = pydantic.Field()
    """
    Whether the account is active
    """

    api_key_count: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of API keys
    """

    created_by: str = pydantic.Field()
    """
    User who created the account
    """

    created_at: dt.datetime = pydantic.Field()
    """
    Creation timestamp
    """

    updated_at: dt.datetime = pydantic.Field()
    """
    Last update timestamp
    """

    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
