# 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 .spark_build import SparkBuild
from .spark_image_build_build_source import SparkImageBuildBuildSource


class SparkImageBuild(UniversalBaseModel):
    """
    Describes that we are building a new image based on the spec
    """

    type: typing.Literal["spark-image-build"] = pydantic.Field(default="spark-image-build")
    """
    +value=spark-image-build
    """

    docker_registry: typing.Optional[str] = pydantic.Field(default=None)
    """
    FQN of the container registry. If you can't find your registry here,
    add it through the [Integrations](/integrations?tab=docker-registry) page
    """

    build_source: SparkImageBuildBuildSource = pydantic.Field()
    """
    Fetch source code
    """

    build_spec: SparkBuild

    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
