"""Script model."""
from typing import Annotated
from pydantic import Field
from .base import EntityKeyBaseModel, MultiEntityBaseModel
[docs]
class Script(MultiEntityBaseModel):
"""An SDP Script."""
[docs]
class Key(EntityKeyBaseModel):
"""An SDP Script primary key."""
kind: Annotated[str, Field(pattern=r"^(realtime)|(batch)$")]
"""The kind of this script (realtime or batch)."""
name: Annotated[str, Field(pattern=r"^[a-zA-Z0-9_-]+$")]
"""The name of this script."""
version: Annotated[str, Field(pattern=r"^[a-zA-Z0-9_\.-]+$")]
"""The version of this script."""
key: Annotated[Key, Field(exclude=True)]
image: Annotated[str, Field(pattern=r"^[a-zA-Z0-9_:\./-]+$")]
"""The OCI image used to launch this script."""