Skip to content

Types

The models/types subpackage contains enumerations and shared type definitions used across the domain layer and adapters.

Base Types

Foundational type definitions and base enumerations shared across the application.

Classes:

Name Description
BaseType

Base class for creating enumerated types with custom values.

FilterOperationType

Enumeration of filter operations for querying or filtering data.

BaseType

Base class for creating enumerated types with custom values.

This class extends the Enum class to allow custom values for enum members.

Source code in archipy/models/types/base_types.py
class BaseType(Enum):
    """Base class for creating enumerated types with custom values.

    This class extends the `Enum` class to allow custom values for enum members.
    """

    def __new__(cls, *args: object, **_: object) -> Self:
        """Create a new instance of the enum member.

        Args:
            cls: The enum class.
            *args: Arguments passed to the enum member.
            **_: Unused keyword arguments.

        Returns:
            BaseType: A new instance of the enum member with the custom value.
        """
        obj = object.__new__(cls)
        obj._value_ = args[0]
        return obj

FilterOperationType

Enumeration of filter operations for querying or filtering data.

This enum defines the types of operations that can be used in filtering, such as equality checks, comparisons, and string matching.

Attributes:

Name Type Description
EQUAL str

Represents an equality check.

NOT_EQUAL str

Represents a non-equality check.

LESS_THAN str

Represents a less-than comparison.

LESS_THAN_OR_EQUAL str

Represents a less-than-or-equal comparison.

GREATER_THAN str

Represents a greater-than comparison.

GREATER_THAN_OR_EQUAL str

Represents a greater-than-or-equal comparison.

IN_LIST str

Represents a check for membership in a list.

NOT_IN_LIST str

Represents a check for non-membership in a list.

LIKE str

Represents a case-sensitive string pattern match.

ILIKE str

Represents a case-insensitive string pattern match.

STARTS_WITH str

Represents a check if a string starts with a given prefix.

ENDS_WITH str

Represents a check if a string ends with a given suffix.

CONTAINS str

Represents a check if a string contains a given substring.

IS_NULL str

Represents a check if a value is null.

IS_NOT_NULL str

Represents a check if a value is not null.

Source code in archipy/models/types/base_types.py
class FilterOperationType(Enum):
    """Enumeration of filter operations for querying or filtering data.

    This enum defines the types of operations that can be used in filtering,
    such as equality checks, comparisons, and string matching.

    Attributes:
        EQUAL (str): Represents an equality check.
        NOT_EQUAL (str): Represents a non-equality check.
        LESS_THAN (str): Represents a less-than comparison.
        LESS_THAN_OR_EQUAL (str): Represents a less-than-or-equal comparison.
        GREATER_THAN (str): Represents a greater-than comparison.
        GREATER_THAN_OR_EQUAL (str): Represents a greater-than-or-equal comparison.
        IN_LIST (str): Represents a check for membership in a list.
        NOT_IN_LIST (str): Represents a check for non-membership in a list.
        LIKE (str): Represents a case-sensitive string pattern match.
        ILIKE (str): Represents a case-insensitive string pattern match.
        STARTS_WITH (str): Represents a check if a string starts with a given prefix.
        ENDS_WITH (str): Represents a check if a string ends with a given suffix.
        CONTAINS (str): Represents a check if a string contains a given substring.
        IS_NULL (str): Represents a check if a value is null.
        IS_NOT_NULL (str): Represents a check if a value is not null.
    """

    EQUAL = "EQUAL"
    NOT_EQUAL = "NOT_EQUAL"
    LESS_THAN = "LESS_THAN"
    LESS_THAN_OR_EQUAL = "LESS_THAN_OR_EQUAL"
    GREATER_THAN = "GREATER_THAN"
    GREATER_THAN_OR_EQUAL = "GREATER_THAN_OR_EQUAL"
    IN_LIST = "IN_LIST"
    NOT_IN_LIST = "NOT_IN_LIST"
    LIKE = "LIKE"
    ILIKE = "ILIKE"
    STARTS_WITH = "STARTS_WITH"
    ENDS_WITH = "ENDS_WITH"
    CONTAINS = "CONTAINS"
    IS_NULL = "IS_NULL"
    IS_NOT_NULL = "IS_NOT_NULL"

options: show_root_toc_entry: false heading_level: 3

Email Types

Enumeration of email content types and delivery classifications.

Classes:

Name Description
EmailAttachmentType

Enum representing different types of email attachments.

EmailAttachmentDispositionType

Enum representing attachment disposition types.

EmailAttachmentType

Enum representing different types of email attachments.

This enum defines the types of attachments that can be included in an email, such as files, base64-encoded data, URLs, or binary data.

Attributes:

Name Type Description
FILE str

Represents a file attachment.

BASE64 str

Represents a base64-encoded attachment.

URL str

Represents an attachment referenced by a URL.

BINARY str

Represents raw binary data as an attachment.

Source code in archipy/models/types/email_types.py
class EmailAttachmentType(StrEnum):
    """Enum representing different types of email attachments.

    This enum defines the types of attachments that can be included in an email,
    such as files, base64-encoded data, URLs, or binary data.

    Attributes:
        FILE (str): Represents a file attachment.
        BASE64 (str): Represents a base64-encoded attachment.
        URL (str): Represents an attachment referenced by a URL.
        BINARY (str): Represents raw binary data as an attachment.
    """

    FILE = "file"
    BASE64 = "base64"
    URL = "url"
    BINARY = "binary"

EmailAttachmentDispositionType

Enum representing attachment disposition types.

This enum defines how an email attachment should be displayed or handled, such as being treated as a downloadable attachment or displayed inline.

Attributes:

Name Type Description
ATTACHMENT str

Represents an attachment that should be downloaded.

INLINE str

Represents an attachment that should be displayed inline.

Source code in archipy/models/types/email_types.py
class EmailAttachmentDispositionType(StrEnum):
    """Enum representing attachment disposition types.

    This enum defines how an email attachment should be displayed or handled,
    such as being treated as a downloadable attachment or displayed inline.

    Attributes:
        ATTACHMENT (str): Represents an attachment that should be downloaded.
        INLINE (str): Represents an attachment that should be displayed inline.
    """

    ATTACHMENT = "ATTACHMENT"
    INLINE = "INLINE"

options: show_root_toc_entry: false heading_level: 3

Language Type

Enumeration of supported language codes for internationalisation.

Classes:

Name Description
LanguageType

Enum representing supported languages for error messages.

LanguageType

Enum representing supported languages for error messages.

This enum defines the languages that are supported for generating or displaying error messages. Each language is represented by its ISO 639-1 code.

Attributes:

Name Type Description
FA str

Represents the Persian language (ISO 639-1 code: 'fa').

EN str

Represents the English language (ISO 639-1 code: 'en').

Source code in archipy/models/types/language_type.py
class LanguageType(StrEnum):
    """Enum representing supported languages for error messages.

    This enum defines the languages that are supported for generating or displaying
    error messages. Each language is represented by its ISO 639-1 code.

    Attributes:
        FA (str): Represents the Persian language (ISO 639-1 code: 'fa').
        EN (str): Represents the English language (ISO 639-1 code: 'en').
    """

    FA = "FA"  # Persian
    EN = "EN"  # English

options: show_root_toc_entry: false heading_level: 3

Sort Order Type

Enumeration of sort order directions (ascending, descending).

Classes:

Name Description
SortOrderType

Enumeration of sorting order types.

SortOrderType

Enumeration of sorting order types.

This enum defines the types of sorting orders that can be applied to data, such as ascending or descending.

Attributes:

Name Type Description
ASCENDING str

Represents sorting in ascending order.

DESCENDING str

Represents sorting in descending order.

Source code in archipy/models/types/sort_order_type.py
class SortOrderType(Enum):
    """Enumeration of sorting order types.

    This enum defines the types of sorting orders that can be applied to data,
    such as ascending or descending.

    Attributes:
        ASCENDING (str): Represents sorting in ascending order.
        DESCENDING (str): Represents sorting in descending order.
    """

    ASCENDING = "ASCENDING"
    DESCENDING = "DESCENDING"

options: show_root_toc_entry: false heading_level: 3

Time Interval Unit Type

Enumeration of time interval units (seconds, minutes, hours, days) used in scheduling and rate limiting.

Classes:

Name Description
TimeIntervalUnitType

Enum representing units of time for intervals.

TimeIntervalUnitType

Enum representing units of time for intervals.

This enum defines standard time units used to specify intervals or durations in time-based operations, such as scheduling, timeouts, or pagination. Each value represents a unit of time, from seconds to years, and inherits from str to allow seamless integration with string-based APIs or databases.

Source code in archipy/models/types/time_interval_unit_type.py
class TimeIntervalUnitType(StrEnum):
    """Enum representing units of time for intervals.

    This enum defines standard time units used to specify intervals or durations in
    time-based operations, such as scheduling, timeouts, or pagination. Each value
    represents a unit of time, from seconds to years, and inherits from `str` to allow
    seamless integration with string-based APIs or databases.
    """

    SECONDS = "SECONDS"
    MINUTES = "MINUTES"
    HOURS = "HOURS"
    DAYS = "DAYS"
    WEEKS = "WEEKS"
    MONTHS = "MONTHS"
    YEAR = "YEAR"

options: show_root_toc_entry: false heading_level: 3