# 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 BuildPrepareResponse(UniversalBaseModel):
    """
    Response containing a presigned URL for uploading build context.
    """

    bucket: str = pydantic.Field()
    """
    GCS bucket where the context will be stored.
    """

    content_type: str = pydantic.Field()
    """
    Content-Type header that must be used for the upload.
    """

    expires_at: dt.datetime = pydantic.Field()
    """
    When the presigned URL expires.
    """

    image_url: str = pydantic.Field()
    """
    Full Artifact Registry image URL that the build will push.
    """

    instructions: str = pydantic.Field()
    """
    Human instructions for how to upload the context archive.
    """

    method: typing.Optional[str] = pydantic.Field(default=None)
    """
    HTTP method to use for the upload.
    """

    object_key: str = pydantic.Field()
    """
    GCS object key where the context will be stored.
    """

    upload_url: str = pydantic.Field()
    """
    Presigned PUT URL for uploading the build context archive.
    """

    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
