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

from ..core.pydantic_utilities import UniversalBaseModel
import pydantic
from .tool_service_kind_dto import ToolServiceKindDto
import typing
from .tool import Tool
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class Service(UniversalBaseModel):
    """
    Details about an integrated service and its available tools.

    Services can be either SDK-based for advanced features or OpenAPI-based
    for simpler integrations. The tools list is only included when retrieving
    a specific service, not in list operations.
    """

    name: str = pydantic.Field()
    """
    Name of the service
    """

    kind: ToolServiceKindDto
    url: str = pydantic.Field()
    """
    Base URL where the service is hosted
    """

    tools: typing.Optional[typing.List[Tool]] = pydantic.Field(default=None)
    """
    List of tools provided by this service. Only included when retrieving a specific service.
    """

    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
