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.

archipy.models.types.base_types.BaseType

Bases: Enum

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

archipy.models.types.base_types.FilterOperationType

Bases: 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:

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"

archipy.models.types.base_types.FilterOperationType.EQUAL class-attribute instance-attribute

EQUAL = 'EQUAL'

archipy.models.types.base_types.FilterOperationType.NOT_EQUAL class-attribute instance-attribute

NOT_EQUAL = 'NOT_EQUAL'

archipy.models.types.base_types.FilterOperationType.LESS_THAN class-attribute instance-attribute

LESS_THAN = 'LESS_THAN'

archipy.models.types.base_types.FilterOperationType.LESS_THAN_OR_EQUAL class-attribute instance-attribute

LESS_THAN_OR_EQUAL = 'LESS_THAN_OR_EQUAL'

archipy.models.types.base_types.FilterOperationType.GREATER_THAN class-attribute instance-attribute

GREATER_THAN = 'GREATER_THAN'

archipy.models.types.base_types.FilterOperationType.GREATER_THAN_OR_EQUAL class-attribute instance-attribute

GREATER_THAN_OR_EQUAL = 'GREATER_THAN_OR_EQUAL'

archipy.models.types.base_types.FilterOperationType.IN_LIST class-attribute instance-attribute

IN_LIST = 'IN_LIST'

archipy.models.types.base_types.FilterOperationType.NOT_IN_LIST class-attribute instance-attribute

NOT_IN_LIST = 'NOT_IN_LIST'

archipy.models.types.base_types.FilterOperationType.LIKE class-attribute instance-attribute

LIKE = 'LIKE'

archipy.models.types.base_types.FilterOperationType.ILIKE class-attribute instance-attribute

ILIKE = 'ILIKE'

archipy.models.types.base_types.FilterOperationType.STARTS_WITH class-attribute instance-attribute

STARTS_WITH = 'STARTS_WITH'

archipy.models.types.base_types.FilterOperationType.ENDS_WITH class-attribute instance-attribute

ENDS_WITH = 'ENDS_WITH'

archipy.models.types.base_types.FilterOperationType.CONTAINS class-attribute instance-attribute

CONTAINS = 'CONTAINS'

archipy.models.types.base_types.FilterOperationType.IS_NULL class-attribute instance-attribute

IS_NULL = 'IS_NULL'

archipy.models.types.base_types.FilterOperationType.IS_NOT_NULL class-attribute instance-attribute

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.

archipy.models.types.email_types.EmailAttachmentType

Bases: 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:

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"

archipy.models.types.email_types.EmailAttachmentType.FILE class-attribute instance-attribute

FILE = 'file'

archipy.models.types.email_types.EmailAttachmentType.BASE64 class-attribute instance-attribute

BASE64 = 'base64'

archipy.models.types.email_types.EmailAttachmentType.URL class-attribute instance-attribute

URL = 'url'

archipy.models.types.email_types.EmailAttachmentType.BINARY class-attribute instance-attribute

BINARY = 'binary'

archipy.models.types.email_types.EmailAttachmentDispositionType

Bases: 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:

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"

archipy.models.types.email_types.EmailAttachmentDispositionType.ATTACHMENT class-attribute instance-attribute

ATTACHMENT = 'ATTACHMENT'

archipy.models.types.email_types.EmailAttachmentDispositionType.INLINE class-attribute instance-attribute

INLINE = 'INLINE'

options: show_root_toc_entry: false heading_level: 3

Language Type

Enumeration of supported language codes for internationalisation.

archipy.models.types.language_type.LanguageType

Bases: 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:

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

archipy.models.types.language_type.LanguageType.FA class-attribute instance-attribute

FA = 'FA'

archipy.models.types.language_type.LanguageType.EN class-attribute instance-attribute

EN = 'EN'

options: show_root_toc_entry: false heading_level: 3

Sort Order Type

Enumeration of sort order directions (ascending, descending).

archipy.models.types.sort_order_type.SortOrderType

Bases: 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:

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"

archipy.models.types.sort_order_type.SortOrderType.ASCENDING class-attribute instance-attribute

ASCENDING = 'ASCENDING'

archipy.models.types.sort_order_type.SortOrderType.DESCENDING class-attribute instance-attribute

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.

archipy.models.types.time_interval_unit_type.TimeIntervalUnitType

Bases: 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.

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"

archipy.models.types.time_interval_unit_type.TimeIntervalUnitType.SECONDS class-attribute instance-attribute

SECONDS = 'SECONDS'

archipy.models.types.time_interval_unit_type.TimeIntervalUnitType.MINUTES class-attribute instance-attribute

MINUTES = 'MINUTES'

archipy.models.types.time_interval_unit_type.TimeIntervalUnitType.HOURS class-attribute instance-attribute

HOURS = 'HOURS'

archipy.models.types.time_interval_unit_type.TimeIntervalUnitType.DAYS class-attribute instance-attribute

DAYS = 'DAYS'

archipy.models.types.time_interval_unit_type.TimeIntervalUnitType.WEEKS class-attribute instance-attribute

WEEKS = 'WEEKS'

archipy.models.types.time_interval_unit_type.TimeIntervalUnitType.MONTHS class-attribute instance-attribute

MONTHS = 'MONTHS'

archipy.models.types.time_interval_unit_type.TimeIntervalUnitType.YEAR class-attribute instance-attribute

YEAR = 'YEAR'

options: show_root_toc_entry: false heading_level: 3