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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from .base_workbench_input import BaseWorkbenchInput
from .workbench_image import WorkbenchImage


class SshServer(BaseWorkbenchInput):
    """
    Describes the configuration for the ssh server
    """

    type: typing.Literal["ssh-server"] = pydantic.Field(default="ssh-server")
    """
    +value=ssh-server
    """

    image: WorkbenchImage
    ssh_public_key: str = pydantic.Field()
    """
    Add Your SSH Public Key, this will be used to authenticate you to the SSH Server.  \\
    You can find it using `cat ~/.ssh/id_rsa.pub` in Mac/Linux or `type $home\\.ssh\\id_rsa.pub` in Windows Powershell.  \\
    You can also generate a new SSH key pair using `ssh-keygen -t rsa` in your local terminal. (same for both Mac/Linux and Windows Powershell)
    """

    cull_timeout: typing.Optional[int] = pydantic.Field(default=None)
    """
    Stop the SSH Server instance after this much time in minutes of inactivity. The instance is considered active if there is at least one active SSH connection (a client connected to the SSH server), or if a background job is running using tmux or screen, or if the pod has restarted.
    """

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

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