# 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 RegistryAuthResponse(UniversalBaseModel):
    """
    Response containing short-lived registry credentials for pushing agent images.
    """

    expires_at: dt.datetime = pydantic.Field()
    """
    Token expiration timestamp (typically ~1 hour from issuance)
    """

    registry_url: str = pydantic.Field()
    """
    Docker registry host URL (e.g., us-east4-docker.pkg.dev)
    """

    repository: str = pydantic.Field()
    """
    Repository path within the registry (e.g., project-id/agents)
    """

    token: str = pydantic.Field()
    """
    Short-lived OAuth2 access token for docker login
    """

    username: typing.Optional[str] = pydantic.Field(default=None)
    """
    Username for docker login (always 'oauth2accesstoken' for GCP)
    """

    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
