Evo Voice

<back to all web services

AppBuyPhoneNumber

Requires Authentication
The following routes are available for this service:
POST/portal/phone-numbers
import Foundation
import ServiceStack

public class AppBuyPhoneNumber : Codable
{
    public var accountId:String
    public var customerId:String
    public var phoneNumberType:EndpointTypes
    public var phoneNumber:String

    required public init(){}
}

public enum EndpointTypes : String, Codable
{
    case PhoneNumber
    case User
    case FaxNumber
    case EmailAddress
    case Unused_1
    case Unused_2
    case Unused_3
    case Unused_4
    case Unused_5
    case Team
    case Assistant
}

public class EndpointInfo : EntityInfo
{
    /**
    * The account ID this endpoint is associated with
    */
    // @ApiMember(Description="The account ID this endpoint is associated with")
    public var accountId:String

    /**
    * The name of the account this endpoint is associated with
    */
    // @ApiMember(Description="The name of the account this endpoint is associated with")
    public var accountName:String

    /**
    * The ID of the customer this endpoint is associated with
    */
    // @ApiMember(Description="The ID of the customer this endpoint is associated with")
    public var customerId:String

    /**
    * The name of the customer this endpoint is associated with
    */
    // @ApiMember(Description="The name of the customer this endpoint is associated with")
    public var customerName:String

    /**
    * The third party reference ID for the endpoint
    */
    // @ApiMember(Description="The third party reference ID for the endpoint")
    public var referenceId:String

    /**
    * The breadcrumb to the customer for this endpoint
    */
    // @ApiMember(Description="The breadcrumb to the customer for this endpoint")
    public var customerBreadcrumb:[CustomerBreadcrumb]

    /**
    * The display name of the endpoint
    */
    // @ApiMember(Description="The display name of the endpoint")
    public var displayName:String

    /**
    * The type of endpoint
    */
    // @ApiMember(Description="The type of endpoint")
    public var type:EndpointTypes

    /**
    * Extra info for this endpoint (typically to show in grid)
    */
    // @ApiMember(Description="Extra info for this endpoint (typically to show in grid)")
    public var extraInformation:String

    /**
    * The ID of the flow to use for voice
    */
    // @ApiMember(Description="The ID of the flow to use for voice")
    public var flowId:String

    /**
    * The name of the flow to use for voice
    */
    // @ApiMember(Description="The name of the flow to use for voice")
    public var flowName:String

    /**
    * The params for the voice flow
    */
    // @ApiMember(Description="The params for the voice flow")
    public var flowParams:Struct

    /**
    * Whether to use a single flow always or use scheduled flow system
    */
    // @ApiMember(Description="Whether to use a single flow always or use scheduled flow system")
    public var flowSchedule:EndpointFlowSchedules

    /**
    * This endpoint's schedule
    */
    // @ApiMember(Description="This endpoint's schedule")
    public var schedule:Schedule

    /**
    * The list of scheduled flows when using scheduling
    */
    // @ApiMember(Description="The list of scheduled flows when using scheduling")
    public var scheduledFlows:[ScheduledFlow]

    /**
    * Disable SMS
    */
    // @ApiMember(Description="Disable SMS")
    public var disableSms:Bool

    /**
    * Set this to true to prevent Evo Voice from overriding the 10DLC / SMS settings for this number
    */
    // @ApiMember(Description="Set this to true to prevent Evo Voice from overriding the 10DLC / SMS settings for this number")
    public var useExternal10DlcCampaign:Bool

    /**
    * Is this a virtual phone number?
    */
    // @ApiMember(Description="Is this a virtual phone number?")
    public var isVirtualPhoneNumber:Bool

    /**
    * Is caller ID verified for this virtual number?
    */
    // @ApiMember(Description="Is caller ID verified for this virtual number?")
    public var isCallerIdVerified:Bool

    /**
    * The verification code for this number
    */
    // @ApiMember(Description="The verification code for this number")
    public var callerIdVerificationCode:String

    /**
    * The phone number
    */
    // @ApiMember(Description="The phone number")
    public var phoneNumber:String

    /**
    * The Sid of the phone number
    */
    // @ApiMember(Description="The Sid of the phone number")
    public var phoneNumberSid:String

    /**
    * The caller ID Name (CNAM) for the phone number
    */
    // @ApiMember(Description="The caller ID Name (CNAM) for the phone number")
    public var callerIdName:String

    /**
    * The address SID associated with the phone number
    */
    // @ApiMember(Description="The address SID associated with the phone number")
    public var addressSid:String

    /**
    * Do not touch this phone number - for BYOA accounts
    */
    // @ApiMember(Description="Do not touch this phone number - for BYOA accounts")
    public var doNotTouchPhoneNumber:Bool

    /**
    * Is this number enrolled in a 10DLC messaging service campaign
    */
    // @ApiMember(Description="Is this number enrolled in a 10DLC messaging service campaign")
    public var isEnrolledIn10DlcService:Bool

    /**
    * Whether we look up caller ID or not
    */
    // @ApiMember(Description="Whether we look up caller ID or not")
    public var enableCallerIdLookup:Bool

    /**
    * The email address of the user
    */
    // @ApiMember(Description="The email address of the user")
    public var userEmailAddress:String

    /**
    * The Twilio Region for the SIP endpoint
    */
    // @ApiMember(Description="The Twilio Region for the SIP endpoint")
    public var sipRegion:TwilioSipRegions

    /**
    * The Twilio Sid of the credentials for Sip
    */
    // @ApiMember(Description="The Twilio Sid of the credentials for Sip")
    public var sipCredentialSid:String

    /**
    * The Twilio SIP user name
    */
    // @ApiMember(Description="The Twilio SIP user name")
    public var sipUserName:String

    /**
    * The Twilio SIP password
    */
    // @ApiMember(Description="The Twilio SIP password")
    public var sipPassword:String

    /**
    * The SIP domain
    */
    // @ApiMember(Description="The SIP domain")
    public var sipDomain:String

    /**
    * Is emergency calling enabled on this number?
    */
    // @ApiMember(Description="Is emergency calling enabled on this number?")
    public var enableEmergencyCalling:Bool

    /**
    * The SID of the emergency address for this number
    */
    // @ApiMember(Description="The SID of the emergency address for this number")
    public var emergencyAddressSid:String

    /**
    * The ID of the phone number to use for emergency dialing
    */
    // @ApiMember(Description="The ID of the phone number to use for emergency dialing")
    public var emergencyPhoneNumberId:String

    /**
    * The current agent state of this user endpoint
    */
    // @ApiMember(Description="The current agent state of this user endpoint")
    public var agentState:AgentStates

    /**
    * The current agent state reason of this user endpoint
    */
    // @ApiMember(Description="The current agent state reason of this user endpoint")
    public var agentStateReason:AgentStateReasons

    /**
    * The mode for this user
    */
    // @ApiMember(Description="The mode for this user")
    public var userMode:UserModes

    /**
    * The ID of the file to use for voicemail greeting
    */
    // @ApiMember(Description="The ID of the file to use for voicemail greeting")
    public var voicemailGreetingId:String

    /**
    * The endpoint's data
    */
    // @ApiMember(Description="The endpoint's data")
    public var data:Struct

    /**
    * The email address for email endpoints
    */
    // @ApiMember(Description="The email address for email endpoints")
    public var emailAddress:String

    /**
    * The first name of the user (for user endpoints)
    */
    // @ApiMember(Description="The first name of the user (for user endpoints)")
    public var userFirstName:String

    /**
    * The last name of the user (for user endpoints)
    */
    // @ApiMember(Description="The last name of the user (for user endpoints)")
    public var userLastName:String

    /**
    * The URL of an image for this user's avatar
    */
    // @ApiMember(Description="The URL of an image for this user's avatar")
    public var avatarUrl:String

    /**
    * Does this user have manager role?
    */
    // @ApiMember(Description="Does this user have manager role?")
    public var managerRole:UserManagerRoles

    /**
    * The list of dashboard permissions for when the manager role is custom
    */
    // @ApiMember(Description="The list of dashboard permissions for when the manager role is custom")
    public var dashboardPermissions:[DashboardPermissions]

    /**
    * The type of visibility this user has to their own fields
    */
    // @ApiMember(Description="The type of visibility this user has to their own fields")
    public var myFieldPermissions:UserDataFieldModes

    /**
    * The type of visibility this user has to customer fields
    */
    // @ApiMember(Description="The type of visibility this user has to customer fields")
    public var customerFieldPermissions:UserDataFieldModes

    /**
    * The type of visibility this user has to other user fields
    */
    // @ApiMember(Description="The type of visibility this user has to other user fields")
    public var otherUserFieldPermissions:UserDataFieldModes

    /**
    * The type of visibility this user has to other endpoint fields
    */
    // @ApiMember(Description="The type of visibility this user has to other endpoint fields")
    public var otherEndpointFieldPermissions:UserDataFieldModes

    /**
    * The name of this endpoint (for bots etc.)
    */
    // @ApiMember(Description="The name of this endpoint (for bots etc.)")
    public var name:String

    /**
    * The list of tags for this endpoint
    */
    // @ApiMember(Description="The list of tags for this endpoint")
    public var tags:[Tag]

    /**
    * The list of action URLs
    */
    // @ApiMember(Description="The list of action URLs")
    public var actionUrls:[EndpointActionUrl]

    /**
    * The list of members in this team
    */
    // @ApiMember(Description="The list of members in this team")
    public var teamMemberIds:[String]

    /**
    * Visibility of this user/team in contact lists
    */
    // @ApiMember(Description="Visibility of this user/team in contact lists")
    public var contactListVisibility:CustomerVisibility

    /**
    * The list of contacts personal to this user
    */
    // @ApiMember(Description="The list of contacts personal to this user")
    public var contacts:[EndpointContact]

    /**
    * The documo ID for this number
    */
    // @ApiMember(Description="The documo ID for this number")
    public var documoId:String

    /**
    * Integration data for this endpoint
    */
    // @ApiMember(Description="Integration data for this endpoint")
    public var integrationData:EntityIntegrationData

    /**
    * Settings for third party phone system
    */
    // @ApiMember(Description="Settings for third party phone system")
    public var thirdPartyPhoneSystemSettings:ThirdPartyPhoneSystemSettings

    /**
    * Should this user override the parent customer's app settings
    */
    // @ApiMember(Description="Should this user override the parent customer's app settings")
    public var overrideAppSettings:Bool

    /**
    * App / Portal settings for this user
    */
    // @ApiMember(Description="App / Portal settings for this user")
    public var appSettings:AppSettings

    /**
    * Configuration for the AI assistant
    */
    // @ApiMember(Description="Configuration for the AI assistant")
    public var assistantSettings:AssistantSettings

    /**
    * Configuration for the embed
    */
    // @ApiMember(Description="Configuration for the embed")
    public var embedSettings:EmbedSettings

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case accountId
        case accountName
        case customerId
        case customerName
        case referenceId
        case customerBreadcrumb
        case displayName
        case type
        case extraInformation
        case flowId
        case flowName
        case flowParams
        case flowSchedule
        case schedule
        case scheduledFlows
        case disableSms
        case useExternal10DlcCampaign
        case isVirtualPhoneNumber
        case isCallerIdVerified
        case callerIdVerificationCode
        case phoneNumber
        case phoneNumberSid
        case callerIdName
        case addressSid
        case doNotTouchPhoneNumber
        case isEnrolledIn10DlcService
        case enableCallerIdLookup
        case userEmailAddress
        case sipRegion
        case sipCredentialSid
        case sipUserName
        case sipPassword
        case sipDomain
        case enableEmergencyCalling
        case emergencyAddressSid
        case emergencyPhoneNumberId
        case agentState
        case agentStateReason
        case userMode
        case voicemailGreetingId
        case data
        case emailAddress
        case userFirstName
        case userLastName
        case avatarUrl
        case managerRole
        case dashboardPermissions
        case myFieldPermissions
        case customerFieldPermissions
        case otherUserFieldPermissions
        case otherEndpointFieldPermissions
        case name
        case tags
        case actionUrls
        case teamMemberIds
        case contactListVisibility
        case contacts
        case documoId
        case integrationData
        case thirdPartyPhoneSystemSettings
        case overrideAppSettings
        case appSettings
        case assistantSettings
        case embedSettings
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        accountId = try container.decodeIfPresent(String.self, forKey: .accountId)
        accountName = try container.decodeIfPresent(String.self, forKey: .accountName)
        customerId = try container.decodeIfPresent(String.self, forKey: .customerId)
        customerName = try container.decodeIfPresent(String.self, forKey: .customerName)
        referenceId = try container.decodeIfPresent(String.self, forKey: .referenceId)
        customerBreadcrumb = try container.decodeIfPresent([CustomerBreadcrumb].self, forKey: .customerBreadcrumb) ?? []
        displayName = try container.decodeIfPresent(String.self, forKey: .displayName)
        type = try container.decodeIfPresent(EndpointTypes.self, forKey: .type)
        extraInformation = try container.decodeIfPresent(String.self, forKey: .extraInformation)
        flowId = try container.decodeIfPresent(String.self, forKey: .flowId)
        flowName = try container.decodeIfPresent(String.self, forKey: .flowName)
        flowParams = try container.decodeIfPresent(Struct.self, forKey: .flowParams)
        flowSchedule = try container.decodeIfPresent(EndpointFlowSchedules.self, forKey: .flowSchedule)
        schedule = try container.decodeIfPresent(Schedule.self, forKey: .schedule)
        scheduledFlows = try container.decodeIfPresent([ScheduledFlow].self, forKey: .scheduledFlows) ?? []
        disableSms = try container.decodeIfPresent(Bool.self, forKey: .disableSms)
        useExternal10DlcCampaign = try container.decodeIfPresent(Bool.self, forKey: .useExternal10DlcCampaign)
        isVirtualPhoneNumber = try container.decodeIfPresent(Bool.self, forKey: .isVirtualPhoneNumber)
        isCallerIdVerified = try container.decodeIfPresent(Bool.self, forKey: .isCallerIdVerified)
        callerIdVerificationCode = try container.decodeIfPresent(String.self, forKey: .callerIdVerificationCode)
        phoneNumber = try container.decodeIfPresent(String.self, forKey: .phoneNumber)
        phoneNumberSid = try container.decodeIfPresent(String.self, forKey: .phoneNumberSid)
        callerIdName = try container.decodeIfPresent(String.self, forKey: .callerIdName)
        addressSid = try container.decodeIfPresent(String.self, forKey: .addressSid)
        doNotTouchPhoneNumber = try container.decodeIfPresent(Bool.self, forKey: .doNotTouchPhoneNumber)
        isEnrolledIn10DlcService = try container.decodeIfPresent(Bool.self, forKey: .isEnrolledIn10DlcService)
        enableCallerIdLookup = try container.decodeIfPresent(Bool.self, forKey: .enableCallerIdLookup)
        userEmailAddress = try container.decodeIfPresent(String.self, forKey: .userEmailAddress)
        sipRegion = try container.decodeIfPresent(TwilioSipRegions.self, forKey: .sipRegion)
        sipCredentialSid = try container.decodeIfPresent(String.self, forKey: .sipCredentialSid)
        sipUserName = try container.decodeIfPresent(String.self, forKey: .sipUserName)
        sipPassword = try container.decodeIfPresent(String.self, forKey: .sipPassword)
        sipDomain = try container.decodeIfPresent(String.self, forKey: .sipDomain)
        enableEmergencyCalling = try container.decodeIfPresent(Bool.self, forKey: .enableEmergencyCalling)
        emergencyAddressSid = try container.decodeIfPresent(String.self, forKey: .emergencyAddressSid)
        emergencyPhoneNumberId = try container.decodeIfPresent(String.self, forKey: .emergencyPhoneNumberId)
        agentState = try container.decodeIfPresent(AgentStates.self, forKey: .agentState)
        agentStateReason = try container.decodeIfPresent(AgentStateReasons.self, forKey: .agentStateReason)
        userMode = try container.decodeIfPresent(UserModes.self, forKey: .userMode)
        voicemailGreetingId = try container.decodeIfPresent(String.self, forKey: .voicemailGreetingId)
        data = try container.decodeIfPresent(Struct.self, forKey: .data)
        emailAddress = try container.decodeIfPresent(String.self, forKey: .emailAddress)
        userFirstName = try container.decodeIfPresent(String.self, forKey: .userFirstName)
        userLastName = try container.decodeIfPresent(String.self, forKey: .userLastName)
        avatarUrl = try container.decodeIfPresent(String.self, forKey: .avatarUrl)
        managerRole = try container.decodeIfPresent(UserManagerRoles.self, forKey: .managerRole)
        dashboardPermissions = try container.decodeIfPresent([DashboardPermissions].self, forKey: .dashboardPermissions) ?? []
        myFieldPermissions = try container.decodeIfPresent(UserDataFieldModes.self, forKey: .myFieldPermissions)
        customerFieldPermissions = try container.decodeIfPresent(UserDataFieldModes.self, forKey: .customerFieldPermissions)
        otherUserFieldPermissions = try container.decodeIfPresent(UserDataFieldModes.self, forKey: .otherUserFieldPermissions)
        otherEndpointFieldPermissions = try container.decodeIfPresent(UserDataFieldModes.self, forKey: .otherEndpointFieldPermissions)
        name = try container.decodeIfPresent(String.self, forKey: .name)
        tags = try container.decodeIfPresent([Tag].self, forKey: .tags) ?? []
        actionUrls = try container.decodeIfPresent([EndpointActionUrl].self, forKey: .actionUrls) ?? []
        teamMemberIds = try container.decodeIfPresent([String].self, forKey: .teamMemberIds) ?? []
        contactListVisibility = try container.decodeIfPresent(CustomerVisibility.self, forKey: .contactListVisibility)
        contacts = try container.decodeIfPresent([EndpointContact].self, forKey: .contacts) ?? []
        documoId = try container.decodeIfPresent(String.self, forKey: .documoId)
        integrationData = try container.decodeIfPresent(EntityIntegrationData.self, forKey: .integrationData)
        thirdPartyPhoneSystemSettings = try container.decodeIfPresent(ThirdPartyPhoneSystemSettings.self, forKey: .thirdPartyPhoneSystemSettings)
        overrideAppSettings = try container.decodeIfPresent(Bool.self, forKey: .overrideAppSettings)
        appSettings = try container.decodeIfPresent(AppSettings.self, forKey: .appSettings)
        assistantSettings = try container.decodeIfPresent(AssistantSettings.self, forKey: .assistantSettings)
        embedSettings = try container.decodeIfPresent(EmbedSettings.self, forKey: .embedSettings)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if accountId != nil { try container.encode(accountId, forKey: .accountId) }
        if accountName != nil { try container.encode(accountName, forKey: .accountName) }
        if customerId != nil { try container.encode(customerId, forKey: .customerId) }
        if customerName != nil { try container.encode(customerName, forKey: .customerName) }
        if referenceId != nil { try container.encode(referenceId, forKey: .referenceId) }
        if customerBreadcrumb != nil { try container.encode(customerBreadcrumb, forKey: .customerBreadcrumb) }
        if displayName != nil { try container.encode(displayName, forKey: .displayName) }
        if type != nil { try container.encode(type, forKey: .type) }
        if extraInformation != nil { try container.encode(extraInformation, forKey: .extraInformation) }
        if flowId != nil { try container.encode(flowId, forKey: .flowId) }
        if flowName != nil { try container.encode(flowName, forKey: .flowName) }
        if flowParams != nil { try container.encode(flowParams, forKey: .flowParams) }
        if flowSchedule != nil { try container.encode(flowSchedule, forKey: .flowSchedule) }
        if schedule != nil { try container.encode(schedule, forKey: .schedule) }
        if scheduledFlows != nil { try container.encode(scheduledFlows, forKey: .scheduledFlows) }
        if disableSms != nil { try container.encode(disableSms, forKey: .disableSms) }
        if useExternal10DlcCampaign != nil { try container.encode(useExternal10DlcCampaign, forKey: .useExternal10DlcCampaign) }
        if isVirtualPhoneNumber != nil { try container.encode(isVirtualPhoneNumber, forKey: .isVirtualPhoneNumber) }
        if isCallerIdVerified != nil { try container.encode(isCallerIdVerified, forKey: .isCallerIdVerified) }
        if callerIdVerificationCode != nil { try container.encode(callerIdVerificationCode, forKey: .callerIdVerificationCode) }
        if phoneNumber != nil { try container.encode(phoneNumber, forKey: .phoneNumber) }
        if phoneNumberSid != nil { try container.encode(phoneNumberSid, forKey: .phoneNumberSid) }
        if callerIdName != nil { try container.encode(callerIdName, forKey: .callerIdName) }
        if addressSid != nil { try container.encode(addressSid, forKey: .addressSid) }
        if doNotTouchPhoneNumber != nil { try container.encode(doNotTouchPhoneNumber, forKey: .doNotTouchPhoneNumber) }
        if isEnrolledIn10DlcService != nil { try container.encode(isEnrolledIn10DlcService, forKey: .isEnrolledIn10DlcService) }
        if enableCallerIdLookup != nil { try container.encode(enableCallerIdLookup, forKey: .enableCallerIdLookup) }
        if userEmailAddress != nil { try container.encode(userEmailAddress, forKey: .userEmailAddress) }
        if sipRegion != nil { try container.encode(sipRegion, forKey: .sipRegion) }
        if sipCredentialSid != nil { try container.encode(sipCredentialSid, forKey: .sipCredentialSid) }
        if sipUserName != nil { try container.encode(sipUserName, forKey: .sipUserName) }
        if sipPassword != nil { try container.encode(sipPassword, forKey: .sipPassword) }
        if sipDomain != nil { try container.encode(sipDomain, forKey: .sipDomain) }
        if enableEmergencyCalling != nil { try container.encode(enableEmergencyCalling, forKey: .enableEmergencyCalling) }
        if emergencyAddressSid != nil { try container.encode(emergencyAddressSid, forKey: .emergencyAddressSid) }
        if emergencyPhoneNumberId != nil { try container.encode(emergencyPhoneNumberId, forKey: .emergencyPhoneNumberId) }
        if agentState != nil { try container.encode(agentState, forKey: .agentState) }
        if agentStateReason != nil { try container.encode(agentStateReason, forKey: .agentStateReason) }
        if userMode != nil { try container.encode(userMode, forKey: .userMode) }
        if voicemailGreetingId != nil { try container.encode(voicemailGreetingId, forKey: .voicemailGreetingId) }
        if data != nil { try container.encode(data, forKey: .data) }
        if emailAddress != nil { try container.encode(emailAddress, forKey: .emailAddress) }
        if userFirstName != nil { try container.encode(userFirstName, forKey: .userFirstName) }
        if userLastName != nil { try container.encode(userLastName, forKey: .userLastName) }
        if avatarUrl != nil { try container.encode(avatarUrl, forKey: .avatarUrl) }
        if managerRole != nil { try container.encode(managerRole, forKey: .managerRole) }
        if dashboardPermissions != nil { try container.encode(dashboardPermissions, forKey: .dashboardPermissions) }
        if myFieldPermissions != nil { try container.encode(myFieldPermissions, forKey: .myFieldPermissions) }
        if customerFieldPermissions != nil { try container.encode(customerFieldPermissions, forKey: .customerFieldPermissions) }
        if otherUserFieldPermissions != nil { try container.encode(otherUserFieldPermissions, forKey: .otherUserFieldPermissions) }
        if otherEndpointFieldPermissions != nil { try container.encode(otherEndpointFieldPermissions, forKey: .otherEndpointFieldPermissions) }
        if name != nil { try container.encode(name, forKey: .name) }
        if tags != nil { try container.encode(tags, forKey: .tags) }
        if actionUrls != nil { try container.encode(actionUrls, forKey: .actionUrls) }
        if teamMemberIds != nil { try container.encode(teamMemberIds, forKey: .teamMemberIds) }
        if contactListVisibility != nil { try container.encode(contactListVisibility, forKey: .contactListVisibility) }
        if contacts != nil { try container.encode(contacts, forKey: .contacts) }
        if documoId != nil { try container.encode(documoId, forKey: .documoId) }
        if integrationData != nil { try container.encode(integrationData, forKey: .integrationData) }
        if thirdPartyPhoneSystemSettings != nil { try container.encode(thirdPartyPhoneSystemSettings, forKey: .thirdPartyPhoneSystemSettings) }
        if overrideAppSettings != nil { try container.encode(overrideAppSettings, forKey: .overrideAppSettings) }
        if appSettings != nil { try container.encode(appSettings, forKey: .appSettings) }
        if assistantSettings != nil { try container.encode(assistantSettings, forKey: .assistantSettings) }
        if embedSettings != nil { try container.encode(embedSettings, forKey: .embedSettings) }
    }
}

public class EntityInfo : Codable
{
    /**
    * The ID of the object
    */
    // @ApiMember(Description="The ID of the object")
    public var id:String

    /**
    * The date the object was created
    */
    // @ApiMember(Description="The date the object was created")
    public var dateCreated:String

    /**
    * The date the object was last modified
    */
    // @ApiMember(Description="The date the object was last modified")
    public var dateLastModified:String

    /**
    * The user that created this object
    */
    // @ApiMember(Description="The user that created this object")
    public var createdBy:String

    /**
    * The user that last modified this object
    */
    // @ApiMember(Description="The user that last modified this object")
    public var lastModifiedBy:String

    required public init(){}
}

public class CustomerBreadcrumb : Codable
{
    public var id:String
    public var name:String

    required public init(){}
}

public class Struct : List<String:Value>
{
    required public init(){ super.init() }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
    }
}

public class Value : Codable
{
    public var boolValue:Bool?
    public var stringValue:String
    public var numberValue:Double?
    public var listValue:[Struct]
    public var structValue:Struct

    required public init(){}
}

public enum EndpointFlowSchedules : String, Codable
{
    case Always
    case Scheduled
    case Simple
}

public class Schedule : Codable
{
    public var timeZoneId:String
    public var inherit:Bool
    public var forceClosed:Bool
    public var rules:[SchedulingRule]
    public var defaultState:String

    required public init(){}
}

public class SchedulingRule : Codable
{
    public var id:String
    public var name:String
    public var priority:Int
    public var state:String
    public var source:String
    public var condition:String
    public var simpleRuleType:SimpleSchedulingRuleTypes
    public var customerState:String
    public var flowId:String
    public var flowParams:Struct
    public var isAllDay:Bool
    public var startDate:String
    public var startTime:String
    public var endTime:String
    public var bySetPosition:[Int]
    public var byMonth:[Int]
    public var byWeekNo:[Int]
    public var byYearDay:[Int]
    public var byMonthDay:[Int]
    public var byDay:[ScheduleDay]
    public var byHour:[Int]
    public var byMinute:[Int]
    public var interval:Int
    public var count:Int
    public var untilDate:String
    public var frequency:SchedulingRuleFrequency

    required public init(){}
}

public enum SimpleSchedulingRuleTypes : String, Codable
{
    case Always
    case CustomerState
    case Time
}

public class ScheduleDay : Codable
{
    public var offset:Int
    public var dayOfWeek:DayOfWeek

    required public init(){}
}

public enum SchedulingRuleFrequency : String, Codable
{
    case None
    case Secondly
    case Minutely
    case Hourly
    case Daily
    case Weekly
    case Monthly
    case Yearly
}

public class ScheduledFlow : Codable
{
    public var stateName:String
    public var flowId:String
    public var flowParams:Struct

    required public init(){}
}

public enum TwilioSipRegions : String, Codable
{
    case NorthAmericaVirginia
    case NorthAmericaOregon
    case EuropeIreland
    case EuropeFrankfurt
    case AsiaPacificSingapore
    case AsiaPacificTokyo
    case AsiaPacificSydney
    case SouthAmericaSanPaolo
}

public enum AgentStates : String, Codable
{
    case Unknown
    case Ready
    case NotReady
    case LoggedOut
    case WrapUp
    case Outgoing
    case Other
}

public enum AgentStateReasons : String, Codable
{
    case Unknown
    case SetByUser
    case MissedCall
    case SetBySystem
}

public enum UserModes : String, Codable
{
    case SoftPhone
    case Sip
    case Flow
    case DataOnly
    case ThirdParty
}

public enum UserManagerRoles : String, Codable
{
    case None
    case Manager
    case VoicemailAndCallHistory
    case Custom
}

public enum DashboardPermissions : String, Codable
{
    case ViewFiles
    case ViewNotifications
    case ViewSessions
    case ViewEndpoints
    case ViewReports
    case ViewCustomers
    case ViewFlows
}

public enum UserDataFieldModes : String, Codable
{
    case Hidden
    case ReadOnly
    case ReadWrite
}

public class Tag : Codable
{
    public var id:String
    public var name:String
    public var color:TagColors

    required public init(){}
}

public enum TagColors : String, Codable
{
    case Magenta
    case Red
    case Volcano
    case Orange
    case Gold
    case Lime
    case Green
    case Cyan
    case Blue
    case GeekBlue
    case Purple
}

public class EndpointActionUrl : Codable
{
    public var id:String
    public var url:String
    public var method:ActionUrlHttpMethods

    required public init(){}
}

public enum ActionUrlHttpMethods : String, Codable
{
    case GET
    case POST
}

public enum CustomerVisibility : String, Codable
{
    case None
    case CurrentCustomer
    case CurrentAndChildCustomers
}

public class EndpointContact : Codable
{
    public var id:String
    public var displayName:String
    public var address:String

    required public init(){}
}

public class EntityIntegrationData : List<String:IntegrationData>
{
    required public init(){ super.init() }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
    }
}

public class IntegrationData : Codable
{
    public var thirdPartyId:String

    required public init(){}
}

public class ThirdPartyPhoneSystemSettings : Codable
{
    public var type:ThirdPartyPhoneSystemTypes
    public var sipSettings:ThirdPartySipSettings
    public var demoSettings:ThirdPartyDemoSettings

    required public init(){}
}

public enum ThirdPartyPhoneSystemTypes : String, Codable
{
    case Demo
    case Sip
}

public class ThirdPartySipSettings : Codable
{
    public var accounts:[ThirdPartySipAccountSettings]

    required public init(){}
}

public class ThirdPartySipAccountSettings : Codable
{
    public var number:String
    public var agent:String
    public var authName:String
    public var userName:String
    public var displayName:String
    public var password:String
    public var userDomain:String
    public var registrationExpires:Int
    public var transportType:TransportTypes
    public var localIP:String
    public var localPort:Int
    public var sipServer:String
    public var sipServerPort:Int
    public var outboundServer:String
    public var outboundServerPort:Int
    public var stunServer:String
    public var stunPort:Int
    public var audioPlaybackDeviceName:String
    public var audioRecordingDeviceName:String
    public var audioCodecs:[AudioCodecTypes]
    public var dtmfMethod:DtmfMethods

    required public init(){}
}

public enum TransportTypes : String, Codable
{
    case UDP
    case TLS
    case TCP
    case PERS
}

public enum AudioCodecTypes : Int, Codable
{
    case PCMU = 0
    case GSM = 3
    case PCMA = 8
    case G722 = 9
    case G729 = 18
    case ILBC = 97
    case AMR = 98
    case AMRWB = 99
    case SPEEX = 100
    case DTMF = 101
    case SPEEXWB = 102
    case ISACWB = 103
    case ISACSWB = 104
    case OPUS = 105
    case G7221 = 121
    case NONE = -1
}

public enum DtmfMethods : String, Codable
{
    case RFC2833
    case INFO
}

public class ThirdPartyDemoSettings : Codable
{
    public var `extension`:String

    required public init(){}
}

public class AppSettings : Codable
{
    public var enablePhoneNumberManagement:Bool
    public var enableDeviceManagement:Bool
    public var enableDialer:Bool
    public var enableCallHistory:Bool
    public var enableAssistants:Bool
    public var showFileNameInMessageCenter:Bool
    public var chakraTheme:String
    public var customCss:String
    public var pageTitle:String
    public var stringMappings:String
    public var logoutUrl:String
    public var portMyNumberUrl:String

    required public init(){}
}

public class AssistantSettings : Codable
{
    public var companyName:String
    public var greeting:String
    public var companyInformation:String
    public var customPrompt:String
    public var voice:String
    public var voiceStyle:String
    public var tuning:AssistantTunings
    public var words:[AssistantWord]
    public var links:[AssistantLink]
    public var contacts:[AssistantContact]
    public var integrations:[AssistantIntegration]

    required public init(){}
}

public enum AssistantTunings : String, Codable
{
    case Accuracy
    case Speed
}

public class AssistantWord : Codable
{
    public var word:String
    public var pronounced:String

    required public init(){}
}

public class AssistantLink : Codable
{
    public var url:String
    public var Description:String

    required public init(){}
}

public class AssistantContact : Codable
{
    public var name:String
    public var phoneNumber:String
    public var transferType:AssistantTransferTypes
    public var about:String
    public var emailAddress:String
    public var takeMessageFields:[AssistantTakeMessageField]

    required public init(){}
}

public enum AssistantTransferTypes : String, Codable
{
    case Blind
    case Supervised
    case MessagesOnly
}

public class AssistantTakeMessageField : Codable
{
    public var name:String
    public var Description:String
    public var required:Bool

    required public init(){}
}

public class AssistantIntegration : Codable
{
    public var uri:String
    public var httpMethod:String
    public var authToken:String

    required public init(){}
}

public class EmbedSettings : Codable
{
    public var enabled:Bool
    public var allowedHosts:String

    required public init(){}
}


Swift AppBuyPhoneNumber DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /portal/phone-numbers HTTP/1.1 
Host: team.evovoice.io 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	accountId: String,
	customerId: String,
	phoneNumberType: PhoneNumber,
	phoneNumber: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	accountId: String,
	accountName: String,
	customerId: String,
	customerName: String,
	referenceId: String,
	customerBreadcrumb: 
	[
		{
			id: String,
			name: String
		}
	],
	displayName: String,
	type: PhoneNumber,
	extraInformation: String,
	flowId: String,
	flowName: String,
	flowSchedule: Always,
	schedule: 
	{
		timeZoneId: String,
		inherit: False,
		forceClosed: False,
		rules: 
		[
			{
				id: String,
				name: String,
				priority: 0,
				state: String,
				source: String,
				condition: String,
				simpleRuleType: Always,
				customerState: String,
				flowId: String,
				isAllDay: False,
				startDate: String,
				startTime: String,
				endTime: String,
				bySetPosition: 
				[
					0
				],
				byMonth: 
				[
					0
				],
				byWeekNo: 
				[
					0
				],
				byYearDay: 
				[
					0
				],
				byMonthDay: 
				[
					0
				],
				byDay: 
				[
					{
						offset: 0,
						dayOfWeek: Sunday
					}
				],
				byHour: 
				[
					0
				],
				byMinute: 
				[
					0
				],
				interval: 0,
				count: 0,
				untilDate: String,
				frequency: None
			}
		],
		defaultState: String
	},
	scheduledFlows: 
	[
		{
			stateName: String,
			flowId: String
		}
	],
	disableSms: False,
	useExternal10DlcCampaign: False,
	isVirtualPhoneNumber: False,
	isCallerIdVerified: False,
	callerIdVerificationCode: String,
	phoneNumber: String,
	phoneNumberSid: String,
	callerIdName: String,
	addressSid: String,
	doNotTouchPhoneNumber: False,
	isEnrolledIn10DlcService: False,
	enableCallerIdLookup: False,
	userEmailAddress: String,
	sipRegion: NorthAmericaVirginia,
	sipCredentialSid: String,
	sipUserName: String,
	sipPassword: String,
	sipDomain: String,
	enableEmergencyCalling: False,
	emergencyAddressSid: String,
	emergencyPhoneNumberId: String,
	agentState: Unknown,
	agentStateReason: Unknown,
	userMode: SoftPhone,
	voicemailGreetingId: String,
	emailAddress: String,
	userFirstName: String,
	userLastName: String,
	avatarUrl: String,
	managerRole: None,
	dashboardPermissions: 
	[
		ViewFiles
	],
	myFieldPermissions: Hidden,
	customerFieldPermissions: Hidden,
	otherUserFieldPermissions: Hidden,
	otherEndpointFieldPermissions: Hidden,
	name: String,
	tags: 
	[
		{
			id: String,
			name: String,
			color: Magenta
		}
	],
	actionUrls: 
	[
		{
			id: String,
			url: String,
			method: GET
		}
	],
	teamMemberIds: 
	[
		String
	],
	contactListVisibility: None,
	contacts: 
	[
		{
			id: String,
			displayName: String,
			address: String
		}
	],
	documoId: String,
	integrationData: 
	{
		String: 
		{
			thirdPartyId: String
		}
	},
	thirdPartyPhoneSystemSettings: 
	{
		type: Demo,
		sipSettings: 
		{
			accounts: 
			[
				{
					number: String,
					agent: String,
					authName: String,
					userName: String,
					displayName: String,
					password: String,
					userDomain: String,
					registrationExpires: 0,
					transportType: UDP,
					localIP: String,
					localPort: 0,
					sipServer: String,
					sipServerPort: 0,
					outboundServer: String,
					outboundServerPort: 0,
					stunServer: String,
					stunPort: 0,
					audioPlaybackDeviceName: String,
					audioRecordingDeviceName: String,
					audioCodecs: 
					[
						PCMU
					],
					dtmfMethod: RFC2833
				}
			]
		},
		demoSettings: 
		{
			extension: String
		}
	},
	overrideAppSettings: False,
	appSettings: 
	{
		enablePhoneNumberManagement: False,
		enableDeviceManagement: False,
		enableDialer: False,
		enableCallHistory: False,
		enableAssistants: False,
		showFileNameInMessageCenter: False,
		chakraTheme: String,
		customCss: String,
		pageTitle: String,
		stringMappings: String,
		logoutUrl: String,
		portMyNumberUrl: String
	},
	assistantSettings: 
	{
		companyName: String,
		greeting: String,
		companyInformation: String,
		customPrompt: String,
		voice: String,
		voiceStyle: String,
		tuning: Accuracy,
		words: 
		[
			{
				word: String,
				pronounced: String
			}
		],
		links: 
		[
			{
				url: String,
				description: String
			}
		],
		contacts: 
		[
			{
				name: String,
				phoneNumber: String,
				transferType: Blind,
				about: String,
				emailAddress: String,
				takeMessageFields: 
				[
					{
						name: String,
						description: String,
						required: False
					}
				]
			}
		],
		integrations: 
		[
			{
				uri: String,
				httpMethod: String,
				authToken: String
			}
		]
	},
	embedSettings: 
	{
		enabled: False,
		allowedHosts: String
	},
	id: String,
	dateCreated: String,
	dateLastModified: String,
	createdBy: String,
	lastModifiedBy: String
}