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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .availability_times import AvailabilityTimes
from .backend_access_type import BackendAccessType
from .backend_hardware_provider import BackendHardwareProvider
from .backend_provider import BackendProvider
from .backend_status import BackendStatus
from .backend_technology import BackendTechnology
from .backend_type import BackendType
from .configuration import Configuration
from .cost import Cost
from .documentation import Documentation


class Backend(UniversalBaseModel):
    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Unique identifier of the backend
    """

    internal_id: typing.Optional[str] = None
    provider: typing.Optional[BackendProvider] = None
    hardware_provider: typing.Optional[BackendHardwareProvider] = None
    name: typing.Optional[str] = None
    display_name: typing.Optional[str] = None
    type: typing.Optional[BackendType] = None
    technology: typing.Optional[BackendTechnology] = None
    status: typing.Optional[BackendStatus] = None
    queue_size: typing.Optional[int] = None
    updated_at: typing.Optional[str] = None
    access_type: typing.Optional[BackendAccessType] = None
    documentation: typing.Optional[Documentation] = None
    configuration: typing.Optional[Configuration] = None
    availability: typing.Optional[typing.List[AvailabilityTimes]] = None
    costs: typing.Optional[typing.List[Cost]] = None
    has_calibration: typing.Optional[bool] = None
    free_of_charge: typing.Optional[bool] = None

    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
