""" Options: Date: 2024-05-19 16:01:45 Version: 6.40 Tip: To override a DTO option, remove "#" prefix before updating BaseUrl: https://evovoice.io #GlobalNamespace: #AddServiceStackTypes: True #AddResponseStatus: False #AddImplicitVersion: #AddDescriptionAsComments: True IncludeTypes: BuyPhoneNumber.* #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 ActionUrlHttpMethods(str, Enum): GET = 'GET' POST = 'POST' @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 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class AppSettings: enable_phone_number_management: bool = False enable_device_management: bool = False enable_dialer: bool = False enable_call_history: bool = False show_file_name_in_message_center: bool = False chakra_theme: Optional[str] = None custom_css: Optional[str] = None page_title: Optional[str] = None string_mappings: Optional[str] = None logout_url: Optional[str] = None port_my_number_url: Optional[str] = None class UserModes(str, Enum): SOFT_PHONE = 'SoftPhone' SIP = 'Sip' FLOW = 'Flow' DATA_ONLY = 'DataOnly' THIRD_PARTY = 'ThirdParty' class EndpointFlowSchedules(str, Enum): ALWAYS = 'Always' SCHEDULED = 'Scheduled' SIMPLE = 'Simple' @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ScheduledFlow: state_name: Optional[str] = None flow_id: Optional[str] = None flow_params: Optional[Struct] = None class TwilioSipRegions(str, Enum): NORTH_AMERICA_VIRGINIA = 'NorthAmericaVirginia' NORTH_AMERICA_OREGON = 'NorthAmericaOregon' EUROPE_IRELAND = 'EuropeIreland' EUROPE_FRANKFURT = 'EuropeFrankfurt' ASIA_PACIFIC_SINGAPORE = 'AsiaPacificSingapore' ASIA_PACIFIC_TOKYO = 'AsiaPacificTokyo' ASIA_PACIFIC_SYDNEY = 'AsiaPacificSydney' SOUTH_AMERICA_SAN_PAOLO = 'SouthAmericaSanPaolo' class UserManagerRoles(str, Enum): NONE = 'None' MANAGER = 'Manager' VOICEMAIL_AND_CALL_HISTORY = 'VoicemailAndCallHistory' CUSTOM = 'Custom' class DashboardPermissions(str, Enum): VIEW_FILES = 'ViewFiles' VIEW_NOTIFICATIONS = 'ViewNotifications' VIEW_SESSIONS = 'ViewSessions' VIEW_ENDPOINTS = 'ViewEndpoints' VIEW_REPORTS = 'ViewReports' VIEW_CUSTOMERS = 'ViewCustomers' VIEW_FLOWS = 'ViewFlows' class UserDataFieldModes(str, Enum): HIDDEN = 'Hidden' READ_ONLY = 'ReadOnly' READ_WRITE = 'ReadWrite' class CustomerVisibility(str, Enum): NONE = 'None' CURRENT_CUSTOMER = 'CurrentCustomer' CURRENT_AND_CHILD_CUSTOMERS = 'CurrentAndChildCustomers' @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class EndpointActionUrl: id: Optional[str] = None url: Optional[str] = None method: Optional[ActionUrlHttpMethods] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class EndpointContact: id: Optional[str] = None display_name: Optional[str] = None address: Optional[str] = None class ThirdPartyPhoneSystemTypes(str, Enum): DEMO = 'Demo' SIP = 'Sip' class TransportTypes(str, Enum): UDP = 'UDP' TLS = 'TLS' TCP = 'TCP' PERS = 'PERS' class AudioCodecTypes(IntEnum): PCMU = 0 GSM = 3 PCMA = 8 G722 = 9 G729 = 18 ILBC = 97 AMR = 98 AMRWB = 99 SPEEX = 100 DTMF = 101 SPEEXWB = 102 ISACWB = 103 ISACSWB = 104 OPUS = 105 G7221 = 121 NONE = -1 class DtmfMethods(str, Enum): RF_C2833 = 'RFC2833' INFO = 'INFO' @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ThirdPartySipAccountSettings: number: Optional[str] = None agent: Optional[str] = None auth_name: Optional[str] = None user_name: Optional[str] = None display_name: Optional[str] = None password: Optional[str] = None user_domain: Optional[str] = None registration_expires: int = 0 transport_type: Optional[TransportTypes] = None local_i_p: Optional[str] = None local_port: int = 0 sip_server: Optional[str] = None sip_server_port: int = 0 outbound_server: Optional[str] = None outbound_server_port: int = 0 stun_server: Optional[str] = None stun_port: int = 0 audio_playback_device_name: Optional[str] = None audio_recording_device_name: Optional[str] = None audio_codecs: Optional[List[AudioCodecTypes]] = None dtmf_method: Optional[DtmfMethods] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ThirdPartySipSettings: accounts: Optional[List[ThirdPartySipAccountSettings]] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ThirdPartyDemoSettings: extension: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ThirdPartyPhoneSystemSettings: type: Optional[ThirdPartyPhoneSystemTypes] = None sip_settings: Optional[ThirdPartySipSettings] = None demo_settings: Optional[ThirdPartyDemoSettings] = None class EndpointTypes(str, Enum): PHONE_NUMBER = 'PhoneNumber' USER = 'User' FAX_NUMBER = 'FaxNumber' EMAIL_ADDRESS = 'EmailAddress' UNUSED_1 = 'Unused_1' UNUSED_2 = 'Unused_2' UNUSED_3 = 'Unused_3' UNUSED_4 = 'Unused_4' UNUSED_5 = 'Unused_5' TEAM = 'Team' class AgentStates(str, Enum): UNKNOWN = 'Unknown' READY = 'Ready' NOT_READY = 'NotReady' LOGGED_OUT = 'LoggedOut' WRAP_UP = 'WrapUp' OUTGOING = 'Outgoing' OTHER = 'Other' 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 """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomerBreadcrumb: id: Optional[str] = None name: Optional[str] = None class AgentStateReasons(str, Enum): UNKNOWN = 'Unknown' SET_BY_USER = 'SetByUser' MISSED_CALL = 'MissedCall' SET_BY_SYSTEM = 'SetBySystem' @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class IntegrationData: third_party_id: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class EntityIntegrationData(Dict[str,IntegrationData]): pass @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class Schedule: time_zone_id: Optional[str] = None inherit: bool = False force_closed: bool = False rules: Optional[List[SchedulingRule]] = None default_state: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class EndpointInfo(EntityInfo): # @ApiMember(Description="The account ID this endpoint is associated with") account_id: Optional[str] = None """ The account ID this endpoint is associated with """ # @ApiMember(Description="The name of the account this endpoint is associated with") account_name: Optional[str] = None """ The name of the account this endpoint is associated with """ # @ApiMember(Description="The ID of the customer this endpoint is associated with") customer_id: Optional[str] = None """ The ID of the customer this endpoint is associated with """ # @ApiMember(Description="The name of the customer this endpoint is associated with") customer_name: Optional[str] = None """ The name of the customer this endpoint is associated with """ # @ApiMember(Description="The third party reference ID for the endpoint") reference_id: Optional[str] = None """ The third party reference ID for the endpoint """ # @ApiMember(Description="The breadcrumb to the customer for this endpoint") customer_breadcrumb: Optional[List[CustomerBreadcrumb]] = None """ The breadcrumb to the customer for this endpoint """ # @ApiMember(Description="The display name of the endpoint") display_name: Optional[str] = None """ The display name of the endpoint """ # @ApiMember(Description="The type of endpoint") type: Optional[EndpointTypes] = None """ The type of endpoint """ # @ApiMember(Description="Extra info for this endpoint (typically to show in grid)") extra_information: Optional[str] = None """ Extra info for this endpoint (typically to show in grid) """ # @ApiMember(Description="The ID of the flow to use for voice") flow_id: Optional[str] = None """ The ID of the flow to use for voice """ # @ApiMember(Description="The name of the flow to use for voice") flow_name: Optional[str] = None """ The name of the flow to use for voice """ # @ApiMember(Description="The params for the voice flow") flow_params: Optional[Struct] = None """ The params for the voice flow """ # @ApiMember(Description="Whether to use a single flow always or use scheduled flow system") flow_schedule: Optional[EndpointFlowSchedules] = None """ Whether to use a single flow always or use scheduled flow system """ # @ApiMember(Description="This endpoint's schedule") schedule: Optional[Schedule] = None """ This endpoint's schedule """ # @ApiMember(Description="The list of scheduled flows when using scheduling") scheduled_flows: Optional[List[ScheduledFlow]] = None """ The list of scheduled flows when using scheduling """ # @ApiMember(Description="Disable SMS") disable_sms: bool = False """ Disable SMS """ # @ApiMember(Description="Set this to true to prevent Evo Voice from overriding the 10DLC / SMS settings for this number") use_external10_dlc_campaign: bool = False """ Set this to true to prevent Evo Voice from overriding the 10DLC / SMS settings for this number """ # @ApiMember(Description="Is this a virtual phone number?") is_virtual_phone_number: bool = False """ Is this a virtual phone number? """ # @ApiMember(Description="Is caller ID verified for this virtual number?") is_caller_id_verified: bool = False """ Is caller ID verified for this virtual number? """ # @ApiMember(Description="The verification code for this number") caller_id_verification_code: Optional[str] = None """ The verification code for this number """ # @ApiMember(Description="The phone number") phone_number: Optional[str] = None """ The phone number """ # @ApiMember(Description="The Sid of the phone number") phone_number_sid: Optional[str] = None """ The Sid of the phone number """ # @ApiMember(Description="The caller ID Name (CNAM) for the phone number") caller_id_name: Optional[str] = None """ The caller ID Name (CNAM) for the phone number """ # @ApiMember(Description="The address SID associated with the phone number") address_sid: Optional[str] = None """ The address SID associated with the phone number """ # @ApiMember(Description="Do not touch this phone number - for BYOA accounts") do_not_touch_phone_number: bool = False """ Do not touch this phone number - for BYOA accounts """ # @ApiMember(Description="Is this number enrolled in a 10DLC messaging service campaign") is_enrolled_in10_dlc_service: bool = False """ Is this number enrolled in a 10DLC messaging service campaign """ # @ApiMember(Description="Whether we look up caller ID or not") enable_caller_id_lookup: bool = False """ Whether we look up caller ID or not """ # @ApiMember(Description="The email address of the user") user_email_address: Optional[str] = None """ The email address of the user """ # @ApiMember(Description="The Twilio Region for the SIP endpoint") sip_region: Optional[TwilioSipRegions] = None """ The Twilio Region for the SIP endpoint """ # @ApiMember(Description="The Twilio Sid of the credentials for Sip") sip_credential_sid: Optional[str] = None """ The Twilio Sid of the credentials for Sip """ # @ApiMember(Description="The Twilio SIP user name") sip_user_name: Optional[str] = None """ The Twilio SIP user name """ # @ApiMember(Description="The Twilio SIP password") sip_password: Optional[str] = None """ The Twilio SIP password """ # @ApiMember(Description="The SIP domain") sip_domain: Optional[str] = None """ The SIP domain """ # @ApiMember(Description="Is emergency calling enabled on this number?") enable_emergency_calling: bool = False """ Is emergency calling enabled on this number? """ # @ApiMember(Description="The SID of the emergency address for this number") emergency_address_sid: Optional[str] = None """ The SID of the emergency address for this number """ # @ApiMember(Description="The ID of the phone number to use for emergency dialing") emergency_phone_number_id: Optional[str] = None """ The ID of the phone number to use for emergency dialing """ # @ApiMember(Description="The current agent state of this user endpoint") agent_state: Optional[AgentStates] = None """ The current agent state of this user endpoint """ # @ApiMember(Description="The current agent state reason of this user endpoint") agent_state_reason: Optional[AgentStateReasons] = None """ The current agent state reason of this user endpoint """ # @ApiMember(Description="The mode for this user") user_mode: Optional[UserModes] = None """ The mode for this user """ # @ApiMember(Description="The ID of the file to use for voicemail greeting") voicemail_greeting_id: Optional[str] = None """ The ID of the file to use for voicemail greeting """ # @ApiMember(Description="The endpoint's data") data: Optional[Struct] = None """ The endpoint's data """ # @ApiMember(Description="The email address for email endpoints") email_address: Optional[str] = None """ The email address for email endpoints """ # @ApiMember(Description="The first name of the user (for user endpoints)") user_first_name: Optional[str] = None """ The first name of the user (for user endpoints) """ # @ApiMember(Description="The last name of the user (for user endpoints)") user_last_name: Optional[str] = None """ The last name of the user (for user endpoints) """ # @ApiMember(Description="The URL of an image for this user's avatar") avatar_url: Optional[str] = None """ The URL of an image for this user's avatar """ # @ApiMember(Description="Does this user have manager role?") manager_role: Optional[UserManagerRoles] = None """ Does this user have manager role? """ # @ApiMember(Description="The list of dashboard permissions for when the manager role is custom") dashboard_permissions: Optional[List[DashboardPermissions]] = None """ The list of dashboard permissions for when the manager role is custom """ # @ApiMember(Description="The type of visibility this user has to their own fields") my_field_permissions: Optional[UserDataFieldModes] = None """ The type of visibility this user has to their own fields """ # @ApiMember(Description="The type of visibility this user has to customer fields") customer_field_permissions: Optional[UserDataFieldModes] = None """ The type of visibility this user has to customer fields """ # @ApiMember(Description="The type of visibility this user has to other user fields") other_user_field_permissions: Optional[UserDataFieldModes] = None """ The type of visibility this user has to other user fields """ # @ApiMember(Description="The type of visibility this user has to other endpoint fields") other_endpoint_field_permissions: Optional[UserDataFieldModes] = None """ The type of visibility this user has to other endpoint fields """ # @ApiMember(Description="The name of this endpoint (for bots etc.)") name: Optional[str] = None """ The name of this endpoint (for bots etc.) """ # @ApiMember(Description="The list of tags for this endpoint") tags: Optional[List[Tag]] = None """ The list of tags for this endpoint """ # @ApiMember(Description="The list of action URLs") action_urls: Optional[List[EndpointActionUrl]] = None """ The list of action URLs """ # @ApiMember(Description="The list of members in this team") team_member_ids: Optional[List[str]] = None """ The list of members in this team """ # @ApiMember(Description="Visibility of this user/team in contact lists") contact_list_visibility: Optional[CustomerVisibility] = None """ Visibility of this user/team in contact lists """ # @ApiMember(Description="The list of contacts personal to this user") contacts: Optional[List[EndpointContact]] = None """ The list of contacts personal to this user """ # @ApiMember(Description="The documo ID for this number") documo_id: Optional[str] = None """ The documo ID for this number """ # @ApiMember(Description="Integration data for this endpoint") integration_data: Optional[EntityIntegrationData] = None """ Integration data for this endpoint """ # @ApiMember(Description="Settings for third party phone system") third_party_phone_system_settings: Optional[ThirdPartyPhoneSystemSettings] = None """ Settings for third party phone system """ # @ApiMember(Description="Should this user override the parent customer's app settings") override_app_settings: bool = False """ Should this user override the parent customer's app settings """ # @ApiMember(Description="App / Portal settings for this user") app_settings: Optional[AppSettings] = None """ App / Portal settings for this user """ # @Route("/endpoints/phone-numbers", "POST") # @Api(Description="Buys the specified phone number") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class BuyPhoneNumber(IReturn[EndpointInfo], IPost): """ Buys the specified phone number """ # @ApiMember(Description="The ID of the account to associate the number with") account_id: Optional[str] = None """ The ID of the account to associate the number with """ # @ApiMember(Description="The ID of the customer to associate this number with") customer_id: Optional[str] = None """ The ID of the customer to associate this number with """ # @ApiMember(Description="The number to buy/create") number: Optional[str] = None """ The number to buy/create """ # @ApiMember(Description="Is this number virtual? If so we will not buy but just create an entry") is_virtual_phone_number: bool = False """ Is this number virtual? If so we will not buy but just create an entry """ # @ApiMember(Description="Is this a fax number?") is_fax_number: bool = False """ Is this a fax number? """ # @ApiMember(Description="The address SID to associate with the phone number") address_sid: Optional[str] = None """ The address SID to associate with the phone number """ # @ApiMember(Description="The list of tags to associate with the new endpoint") tag_ids: Optional[List[str]] = None """ The list of tags to associate with the new endpoint """ # @ApiMember(Description="Data values for this endpoint") data: Optional[Struct] = None """ Data values for this endpoint """ # @ApiMember(Description="Specify the flow to use") flow_id: Optional[str] = None """ Specify the flow to use """ # @ApiMember(Description="The flow params") flow_params: Optional[Struct] = None """ The flow params """