# 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
from .action_module_version_reference import ActionModuleVersionReference


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

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the module.
    """

    code: typing.Optional[str] = pydantic.Field(default=None)
    """
    The source code from the module's draft version.
    """

    dependencies: typing.Optional[typing.List[ActionModuleDependency]] = pydantic.Field(default=None)
    """
    The npm dependencies from the module's draft version.
    """

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

    actions_using_module_total: typing.Optional[int] = pydantic.Field(default=None)
    """
    The number of deployed actions using this module.
    """

    all_changes_published: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether all draft changes have been published as a version.
    """

    latest_version_number: typing.Optional[int] = pydantic.Field(default=None)
    """
    The version number of the latest published version. Omitted if no versions have been published.
    """

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

    updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Timestamp when the module was last updated.
    """

    latest_version: typing.Optional[ActionModuleVersionReference] = None

    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
