""" Options: Date: 2025-05-04 23:02:18 Version: 8.71 Tip: To override a DTO option, remove "#" prefix before updating BaseUrl: https://team.evovoice.io #GlobalNamespace: #AddServiceStackTypes: True #AddResponseStatus: False #AddImplicitVersion: #AddDescriptionAsComments: True IncludeTypes: ListMessages.* #ExcludeTypes: #DefaultImports: datetime,decimal,marshmallow.fields:*,servicestack:*,typing:*,dataclasses:dataclass/field,dataclasses_json:dataclass_json/LetterCase/Undefined/config,enum:Enum/IntEnum #DataClass: #DataClassJson: """ import datetime import decimal from marshmallow.fields import * from servicestack import * from typing import * from dataclasses import dataclass, field from dataclasses_json import dataclass_json, LetterCase, Undefined, config from enum import Enum, IntEnum class SortOrders(str, Enum): ASCEND = 'Ascend' DESCEND = 'Descend' T = TypeVar('T') @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ListRequest(Generic[T], IReturn[ListResponse[T]], IGet): # @ApiMember(Description="The page of data to retrieve") page: int = 0 """ The page of data to retrieve """ # @ApiMember(Description="If you want all objects to be returned. This should be used with care") all: bool = False """ If you want all objects to be returned. This should be used with care """ # @ApiMember(Description="The number per page to retrieve") count_per_page: int = 0 """ The number per page to retrieve """ # @ApiMember(Description="Specific IDs") specific_ids: Optional[List[str]] = None """ Specific IDs """ # @ApiMember(Description="Specify a sort field") sort_field: Optional[str] = None """ Specify a sort field """ # @ApiMember(Description="Specify a sort order") sort_order: Optional[SortOrders] = None """ Specify a sort order """ # @ApiMember(Description="Disables total / page counts - improves performance. Returns only data. If there is no more data, Items will be empty array") simplified_paging: bool = False """ Disables total / page counts - improves performance. Returns only data. If there is no more data, Items will be empty array """ @staticmethod def response_type(): return ListResponse[T] T = TypeVar('T') @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ListResponse(Generic[T]): # @ApiMember(Description="The items") items: Optional[List[T]] = None """ The items """ # @ApiMember(Description="The total number of items") total_count: int = 0 """ The total number of items """ # @ApiMember(Description="The total number of pages") total_pages: int = 0 """ The total number of pages """ # @ApiMember(Description="Are there more pages of items? Used with simplified paging") has_more_pages: bool = False """ Are there more pages of items? Used with simplified paging """ class MessageDirections(str, Enum): INCOMING = 'Incoming' OUTGOING = 'Outgoing' @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class MessageInfo: id: Optional[str] = None account_id: Optional[str] = None customer_id: Optional[str] = None endpoint_id: Optional[str] = None endpoint_display_name: Optional[str] = None date: Optional[str] = None direction: Optional[MessageDirections] = None other_address: Optional[str] = None sender: Optional[str] = None text: Optional[str] = None is_unread: bool = False # @Route("/messages", "GET") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ListMessages(ListRequest[MessageInfo], IReturn[ListResponse[MessageInfo]]): # @ApiMember(Description="The IDs of the account whose messages you want to retrieve") account_ids: Optional[List[str]] = None """ The IDs of the account whose messages you want to retrieve """ # @ApiMember(Description="The IDs of the customers whose messages you want to retrieve") customer_ids: Optional[List[str]] = None """ The IDs of the customers whose messages you want to retrieve """ # @ApiMember(Description="The IDs of the endpoints whose messages you want to retrieve") endpoint_ids: Optional[List[str]] = None """ The IDs of the endpoints whose messages you want to retrieve """ # @ApiMember(Description="The ID of the conversations whose messages you want to retrieve") conversation_ids: Optional[List[str]] = None """ The ID of the conversations whose messages you want to retrieve """ # @ApiMember(Description="The date after which messages should be retrieved") after_date: Optional[str] = None """ The date after which messages should be retrieved """