""" Options: Date: 2025-05-04 22:58:10 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: ListFlows.* #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] @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class Struct(Dict[str,Value]): pass @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class Value: bool_value: Optional[bool] = None string_value: Optional[str] = None number_value: Optional[float] = None list_value: Optional[List[Struct]] = None struct_value: Optional[Struct] = None class UserDataFieldModes(str, Enum): HIDDEN = 'Hidden' READ_ONLY = 'ReadOnly' READ_WRITE = 'ReadWrite' class ValueTypes(str, Enum): NOT_SPECIFIED = 'NotSpecified' STRING = 'String' BOOLEAN = 'Boolean' NUMBER = 'Number' LIST = 'List' STRUCT = 'Struct' TRANSITION = 'Transition' CUSTOM = 'Custom' DATE = 'Date' AUDIO_FILE = 'AudioFile' TIME_ZONE_ID = 'TimeZoneId' PHONE_NUMBER = 'PhoneNumber' USER = 'User' ENDPOINT = 'Endpoint' TIME = 'Time' FILE = 'File' FAX_NUMBER = 'FaxNumber' EMAIL_ACCOUNT = 'EmailAccount' CUSTOMER = 'Customer' FLOW = 'Flow' TEAM = 'Team' FLOW_REFERENCE = 'FlowReference' INTEGRATION = 'Integration' ASSISTANT = 'Assistant' class FlowRoles(str, Enum): UI = 'UI' REFERENCE = 'Reference' PHONE_NUMBER_ROUTING = 'PhoneNumberRouting' USER_DIAL_OUT = 'UserDialOut' FAX_NUMBER_ROUTING = 'FaxNumberRouting' class FlowNodeCategories(str, Enum): GENERAL = 'General' VOICE = 'Voice' LOGIC = 'Logic' DATE_AND_TIME = 'DateAndTime' AUDIO = 'Audio' MESSAGING = 'Messaging' ASSISTANT = 'Assistant' FLOWS = 'Flows' FAX = 'Fax' NETWORK = 'Network' COOKIES = 'Cookies' CALL_CENTER = 'CallCenter' INTELLIGENCE = 'Intelligence' class UIHints(str, Enum): NONE = 'None' LARGE_TEXT = 'LargeText' INLINE_FORM = 'InlineForm' PASSWORD = 'Password' INLINE_STRUCT = 'InlineStruct' class DataFieldUniqueness(str, Enum): NOT_UNIQUE = 'NotUnique' UNIQUE = 'Unique' UNIQUE_TO_CUSTOMER = 'UniqueToCustomer' @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DataField: id: Optional[str] = None name: Optional[str] = None type: Optional[ValueTypes] = None ui_hint: Optional[UIHints] = None ui_tab: Optional[str] = None is_async: bool = False disable_binding: bool = False struct_type: Optional[DataType] = None list_type: Optional[DataType] = None description: Optional[str] = None possible_values: Optional[List[str]] = None is_output: bool = False custom_field_values_url: Optional[str] = None default_value: Optional[Value] = None transition_name_format: Optional[str] = None uniqueness: Optional[DataFieldUniqueness] = None voice_only: bool = False conditional_visibility_field: Optional[str] = None conditional_visibility_value: Optional[str] = None no_eval_template: bool = False user_mode: Optional[UserDataFieldModes] = None any_value_type: bool = False @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DataType: type_name: Optional[str] = None fields: Optional[List[DataField]] = None class FlowChannels(str, Enum): VOICE = 'Voice' CHAT = 'Chat' FAX = 'Fax' @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class FlowNodeSpec: # @ApiMember(Description="The name of this node") name: Optional[str] = None """ The name of this node """ # @ApiMember(Description="A description of this node") description: Optional[str] = None """ A description of this node """ # @ApiMember(Description="Icon class for this node (FontAwesome)") icon_class: Optional[str] = None """ Icon class for this node (FontAwesome) """ # @ApiMember(Description="The type name for this node") type_name: Optional[str] = None """ The type name for this node """ # @ApiMember(Description="The category this node should be grouped under") category: Optional[FlowNodeCategories] = None """ The category this node should be grouped under """ # @ApiMember(Description="The URL where this node is located") url: Optional[str] = None """ The URL where this node is located """ # @ApiMember(Description="The data type for this node") data_type: Optional[DataType] = None """ The data type for this node """ # @ApiMember(Description="URL for documentation for this node") documentation_url: Optional[str] = None """ URL for documentation for this node """ # @ApiMember(Description="The channels that this node is restricted to") restrict_to_channels: Optional[List[FlowChannels]] = None """ The channels that this node is restricted to """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class FlowNodeUI: # @ApiMember(Description="The X position of the node") x: float = 0.0 """ The X position of the node """ # @ApiMember(Description="The Y position of the node") y: float = 0.0 """ The Y position of the node """ # @ApiMember(Description="Notes for this node") notes: Optional[str] = None """ Notes for this node """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class FlowNode: # @ApiMember(Description="The ID of this node. Must be unique within the flow but can be anything") id: Optional[str] = None """ The ID of this node. Must be unique within the flow but can be anything """ # @ApiMember(Description="Is this the starting node for the flow. Only one node can have this set") is_start_node: bool = False """ Is this the starting node for the flow. Only one node can have this set """ # @ApiMember(Description="The name of the node, descriptive to be used as a reminder in the GUI") name: Optional[str] = None """ The name of the node, descriptive to be used as a reminder in the GUI """ # @ApiMember(Description="The specification for the node") spec: Optional[FlowNodeSpec] = None """ The specification for the node """ # @ApiMember(Description="The UI data for the node") ui: Optional[FlowNodeUI] = None """ The UI data for the node """ # @ApiMember(Description="The data for this node. These will be POST'd to the endpoint when it is called.") parameters: Optional[NodeParameterMap] = None """ The data for this node. These will be POST'd to the endpoint when it is called. """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class FlowExit: # @ApiMember(Description="The unique ID for this exit") id: Optional[str] = None """ The unique ID for this exit """ # @ApiMember(Description="The name of this exit") name: Optional[str] = None """ The name of this exit """ # @ApiMember(Description="The UI for the exit") ui: Optional[FlowNodeUI] = None """ The UI for the exit """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class FlowParameter(DataField): is_public: bool = False is_knob: bool = False @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class FlowUI: selected_node: Optional[str] = None canvas_x: float = 0.0 canvas_y: float = 0.0 canvas_zoom: float = 0.0 class TagColors(str, Enum): MAGENTA = 'Magenta' RED = 'Red' VOLCANO = 'Volcano' ORANGE = 'Orange' GOLD = 'Gold' LIME = 'Lime' GREEN = 'Green' CYAN = 'Cyan' BLUE = 'Blue' GEEK_BLUE = 'GeekBlue' PURPLE = 'Purple' @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class Tag: id: Optional[str] = None name: Optional[str] = None color: Optional[TagColors] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class EntityInfo: # @ApiMember(Description="The ID of the object") id: Optional[str] = None """ The ID of the object """ # @ApiMember(Description="The date the object was created") date_created: Optional[str] = None """ The date the object was created """ # @ApiMember(Description="The date the object was last modified") date_last_modified: Optional[str] = None """ The date the object was last modified """ # @ApiMember(Description="The user that created this object") created_by: Optional[str] = None """ The user that created this object """ # @ApiMember(Description="The user that last modified this object") last_modified_by: Optional[str] = None """ The user that last modified this object """ 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 """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomerBreadcrumb: id: Optional[str] = None name: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class FlowInfo(EntityInfo): # @ApiMember(Description="The name of this flow") name: Optional[str] = None """ The name of this flow """ # @ApiMember(Description="The roles that this flow has") roles: Optional[List[FlowRoles]] = None """ The roles that this flow has """ # @ApiMember(Description="What this flow does") description: Optional[str] = None """ What this flow does """ # @ApiMember(Description="Any notes for this flow") notes: Optional[str] = None """ Any notes for this flow """ # @ApiMember(Description="The ID of the account associated with the flow") account_id: Optional[str] = None """ The ID of the account associated with the flow """ # @ApiMember(Description="The name of the account associated with the flow") account_name: Optional[str] = None """ The name of the account associated with the flow """ # @ApiMember(Description="The ID of the customer this flow is associated with") customer_id: Optional[str] = None """ The ID of the customer this flow is associated with """ # @ApiMember(Description="The name of the customer this flow is associated with") customer_name: Optional[str] = None """ The name of the customer this flow is associated with """ # @ApiMember(Description="The breadcrumb to the flow for this endpoint") customer_breadcrumb: Optional[List[CustomerBreadcrumb]] = None """ The breadcrumb to the flow for this endpoint """ # @ApiMember(Description="The nodes in this flow") nodes: Optional[List[FlowNode]] = None """ The nodes in this flow """ # @ApiMember(Description="The flow's parameters") parameters: Optional[List[FlowParameter]] = None """ The flow's parameters """ # @ApiMember(Description="The flow's exits") exits: Optional[List[FlowExit]] = None """ The flow's exits """ # @ApiMember(Description="The UI data for the flow") ui: Optional[FlowUI] = None """ The UI data for the flow """ # @ApiMember(Description="The list of tags for this flow") tags: Optional[List[Tag]] = None """ The list of tags for this flow """ # @ApiMember(Description="The number of nodes in this flow") node_count: int = 0 """ The number of nodes in this flow """ # @Route("/flows", "GET") # @Api(Description="Lists all the flows") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ListFlows(ListRequest[FlowInfo], IReturn[ListResponse[FlowInfo]]): """ Lists all the flows """ # @ApiMember(Description="Filter by accounts") account_ids: Optional[List[str]] = None """ Filter by accounts """ # @ApiMember(Description="The IDs of the customers whose flows you want to retrieve") customer_ids: Optional[List[str]] = None """ The IDs of the customers whose flows you want to retrieve """ # @ApiMember(Description="Filter by name") name_filter: Optional[str] = None """ Filter by name """ # @ApiMember(Description="The list of tag IDs to filter by (must contain all)") tag_ids: Optional[List[str]] = None """ The list of tag IDs to filter by (must contain all) """ # @ApiMember(Description="List flows by specific role") role: Optional[FlowRoles] = None """ List flows by specific role """ # @ApiMember(Description="Exclude nodes") include_nodes: bool = False """ Exclude nodes """ # @ApiMember(Description="Node Type Filter") node_type_filter: Optional[str] = None """ Node Type Filter """