# 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
from .action_module_dependency import ActionModuleDependency
from .action_module_secret import ActionModuleSecret


class ActionModuleVersionReference(UniversalBaseModel):
    """
    The latest published version as a reference object. Omitted if no versions have been published.
    """

    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The unique ID of the version.
    """

    version_number: typing.Optional[int] = pydantic.Field(default=None)
    """
    The version number.
    """

    code: typing.Optional[str] = pydantic.Field(default=None)
    """
    The source code from this version.
    """

    dependencies: typing.Optional[typing.List[ActionModuleDependency]] = pydantic.Field(default=None)
    """
    The npm dependencies from this version.
    """

    secrets: typing.Optional[typing.List[ActionModuleSecret]] = pydantic.Field(default=None)
    """
    The secrets from this version (names and timestamps only, values never returned).
    """

    created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Timestamp when the version was created.
    """

    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
