/* Options: Date: 2025-05-04 23:24:52 SwiftVersion: 6.0 Version: 8.71 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://team.evovoice.io //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True //MakePropertiesOptional: True IncludeTypes: AppGetHomeInformation.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/portal/home", "GET") public class AppGetHomeInformation : IReturn, Codable { public typealias Return = AppHomeInformation public var accountId:String? public var customerId:String? public var fromDate:String? required public init(){} } public class AppHomeInformation : Codable { public var isHostedSuiteCustomer:Bool? public var conversations:[ConversationInfo]? public var calls:[SessionInfo]? public var callMetrics:[AppHomeCallMetric]? public var voicemail:[FileInfo]? public var forms:[HostedSuiteCompletedForm]? required public init(){} } public class HostedSuiteCompletedForm : Codable { public var id:String? public var name:String? public var dateCreated:String? public var dateCompleted:String? public var formId:String? public var formName:String? public var clientId:String? public var clientName:String? public var contactId:String? public var contactName:String? public var contactsIds:[String]? public var contactsNames:[String]? public var emailSubject:String? public var callerNumber:String? public var fields:[HostedSuiteCompletedFormField]? required public init(){} } public class ConversationInfo : Codable { public var id:String? public var endpointId:String? public var otherAddress:String? public var mostRecentMessage:MessageInfo? required public init(){} } public class AppHomeCallMetric : Codable { public var metricKey:String? public var total:Double? public var average:Double? required public init(){} } public class HostedSuiteCompletedFormField : Codable { public var name:String? public var values:[String]? required public init(){} } public class FileInfo : EntityInfo { /** * The type of file this is */ // @ApiMember(Description="The type of file this is") public var type:FileTypes? /** * The account ID this file is associated with */ // @ApiMember(Description="The account ID this file is associated with") public var accountId:String? /** * The name of the account this file is associated with */ // @ApiMember(Description="The name of the account this file is associated with") public var accountName:String? /** * The ID of the customer this file is associated with */ // @ApiMember(Description="The ID of the customer this file is associated with") public var customerId:String? /** * The name of the customer this file is associated with */ // @ApiMember(Description="The name of the customer this file is associated with") public var customerName:String? /** * The breadcrumb to the customer for this file */ // @ApiMember(Description="The breadcrumb to the customer for this file") public var customerBreadcrumb:[CustomerBreadcrumb]? /** * The ID of the user this file is assocaited with */ // @ApiMember(Description="The ID of the user this file is assocaited with") public var userId:String? /** * The name of the user this file is associated with */ // @ApiMember(Description="The name of the user this file is associated with") public var userName:String? /** * The original file name for the file */ // @ApiMember(Description="The original file name for the file") public var fileName:String? /** * The URI of the file */ // @ApiMember(Description="The URI of the file") public var uri:String? /** * The Content type of the file */ // @ApiMember(Description="The Content type of the file") public var contentType:String? /** * The size of the file */ // @ApiMember(Description="The size of the file") public var contentLength:Int? /** * The Twilio ID of the recording */ // @ApiMember(Description="The Twilio ID of the recording") public var recordingSid:String? /** * The duration of the recording in seconds */ // @ApiMember(Description="The duration of the recording in seconds") public var recordingDuration:Int? /** * Who is the recording from? */ // @ApiMember(Description="Who is the recording from?") public var recordingFrom:String? /** * Transcription (if available) */ // @ApiMember(Description="Transcription (if available)") public var transcription:String? /** * From Address (e.g. caller ID) for incoming calls */ // @ApiMember(Description="From Address (e.g. caller ID) for incoming calls") public var fromAddress:String? /** * To Address (e.g. dialed number) for outgoing calls */ // @ApiMember(Description="To Address (e.g. dialed number) for outgoing calls") public var toAddress:String? /** * The AI transcription for this call */ // @ApiMember(Description="The AI transcription for this call") public var aiTranscription:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case type case accountId case accountName case customerId case customerName case customerBreadcrumb case userId case userName case fileName case uri case contentType case contentLength case recordingSid case recordingDuration case recordingFrom case transcription case fromAddress case toAddress case aiTranscription } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) type = try container.decodeIfPresent(FileTypes.self, forKey: .type) 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) customerBreadcrumb = try container.decodeIfPresent([CustomerBreadcrumb].self, forKey: .customerBreadcrumb) ?? [] userId = try container.decodeIfPresent(String.self, forKey: .userId) userName = try container.decodeIfPresent(String.self, forKey: .userName) fileName = try container.decodeIfPresent(String.self, forKey: .fileName) uri = try container.decodeIfPresent(String.self, forKey: .uri) contentType = try container.decodeIfPresent(String.self, forKey: .contentType) contentLength = try container.decodeIfPresent(Int.self, forKey: .contentLength) recordingSid = try container.decodeIfPresent(String.self, forKey: .recordingSid) recordingDuration = try container.decodeIfPresent(Int.self, forKey: .recordingDuration) recordingFrom = try container.decodeIfPresent(String.self, forKey: .recordingFrom) transcription = try container.decodeIfPresent(String.self, forKey: .transcription) fromAddress = try container.decodeIfPresent(String.self, forKey: .fromAddress) toAddress = try container.decodeIfPresent(String.self, forKey: .toAddress) aiTranscription = try container.decodeIfPresent(String.self, forKey: .aiTranscription) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if type != nil { try container.encode(type, forKey: .type) } 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 customerBreadcrumb != nil { try container.encode(customerBreadcrumb, forKey: .customerBreadcrumb) } if userId != nil { try container.encode(userId, forKey: .userId) } if userName != nil { try container.encode(userName, forKey: .userName) } if fileName != nil { try container.encode(fileName, forKey: .fileName) } if uri != nil { try container.encode(uri, forKey: .uri) } if contentType != nil { try container.encode(contentType, forKey: .contentType) } if contentLength != nil { try container.encode(contentLength, forKey: .contentLength) } if recordingSid != nil { try container.encode(recordingSid, forKey: .recordingSid) } if recordingDuration != nil { try container.encode(recordingDuration, forKey: .recordingDuration) } if recordingFrom != nil { try container.encode(recordingFrom, forKey: .recordingFrom) } if transcription != nil { try container.encode(transcription, forKey: .transcription) } if fromAddress != nil { try container.encode(fromAddress, forKey: .fromAddress) } if toAddress != nil { try container.encode(toAddress, forKey: .toAddress) } if aiTranscription != nil { try container.encode(aiTranscription, forKey: .aiTranscription) } } } public class SessionInfo : EntityInfo { /** * The state of the session */ // @ApiMember(Description="The state of the session") public var dialState:SessionDialState? /** * The call state of the session */ // @ApiMember(Description="The call state of the session") public var callState:SessionCallState? /** * The queue state of the session */ // @ApiMember(Description="The queue state of the session") public var queueState:SessionQueueStates? /** * The ID of the account associated with the flow */ // @ApiMember(Description="The ID of the account associated with the flow") public var accountId:String? /** * The name of the account associated with the session */ // @ApiMember(Description="The name of the account associated with the session") public var accountName:String? /** * The ID of the customer this session is associated with */ // @ApiMember(Description="The ID of the customer this session is associated with") public var customerId:String? /** * The customer breadcrumb this session is associated with */ // @ApiMember(Description="The customer breadcrumb this session is associated with") public var customerBreadcrumb:[CustomerBreadcrumb]? /** * The name of the customer this session is associated with */ // @ApiMember(Description="The name of the customer this session is associated with") public var customerName:String? /** * The ID of the endpoint associated with this session */ // @ApiMember(Description="The ID of the endpoint associated with this session") public var endpointId:String? /** * The name of the endpoint associated with this session */ // @ApiMember(Description="The name of the endpoint associated with this session") public var endpointName:String? /** * The date the call completed */ // @ApiMember(Description="The date the call completed") public var dateCompleted:String? /** * The destination of the session (e.g. what was entered into the Dial box) */ // @ApiMember(Description="The destination of the session (e.g. what was entered into the Dial box)") public var destination:String? /** * The to address if any */ // @ApiMember(Description="The to address if any") public var toAddress:String? /** * The from address if any */ // @ApiMember(Description="The from address if any") public var fromAddress:String? /** * The from name if any */ // @ApiMember(Description="The from name if any") public var fromName:String? /** * Answered by name (if any) */ // @ApiMember(Description="Answered by name (if any)") public var answeredByName:String? /** * The ID of the queue member assigned to this call */ // @ApiMember(Description="The ID of the queue member assigned to this call") public var queueMemberId:String? /** * The flow channel */ // @ApiMember(Description="The flow channel") public var channel:FlowChannels? /** * Has the session ended */ // @ApiMember(Description="Has the session ended") public var ended:Bool? /** * The outcome of the call */ // @ApiMember(Description="The outcome of the call") public var outcome:String? /** * The twilio Call SID of this session */ // @ApiMember(Description="The twilio Call SID of this session") public var callSid:String? /** * Any console data for this session */ // @ApiMember(Description="Any console data for this session") public var consoleData:String? /** * The name of the hold queue for this call */ // @ApiMember(Description="The name of the hold queue for this call") public var holdQueueName:String? /** * The user ID who put this call on hold */ // @ApiMember(Description="The user ID who put this call on hold") public var heldByUserId:String? /** * The reason for the hold */ // @ApiMember(Description="The reason for the hold") public var holdReason:SessionHoldReasons? /** * The SID of the conference if in a conference call */ // @ApiMember(Description="The SID of the conference if in a conference call") public var conferenceSid:String? /** * The display name for this session */ // @ApiMember(Description="The display name for this session") public var displayName:String? /** * The log entries for this session */ // @ApiMember(Description="The log entries for this session") public var log:[SessionLogInfo]? /** * The members of this session */ // @ApiMember(Description="The members of this session") public var members:[SessionMemberInfo]? /** * The callback number (typically used for SIP to User calls) */ // @ApiMember(Description="The callback number (typically used for SIP to User calls)") public var callbackNumber:String? /** * The ID of the endpoint that answered */ // @ApiMember(Description="The ID of the endpoint that answered") public var answeredById:String? /** * Is this session incoming or outgoing? */ // @ApiMember(Description="Is this session incoming or outgoing?") public var direction:SessionDirections? /** * The phone number that this session is coming from (used with SMS chats) */ // @ApiMember(Description="The phone number that this session is coming from (used with SMS chats)") public var fromPhoneNumber:String? /** * The Call SID of the most recently added conference participant */ // @ApiMember(Description="The Call SID of the most recently added conference participant") public var mostRecentParticipantCallSid:String? /** * Was this session missed? */ // @ApiMember(Description="Was this session missed?") public var wasMissed:Bool? /** * The ring queue that the call is currently in */ // @ApiMember(Description="The ring queue that the call is currently in") public var ringQueueId:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case dialState case callState case queueState case accountId case accountName case customerId case customerBreadcrumb case customerName case endpointId case endpointName case dateCompleted case destination case toAddress case fromAddress case fromName case answeredByName case queueMemberId case channel case ended case outcome case callSid case consoleData case holdQueueName case heldByUserId case holdReason case conferenceSid case displayName case log case members case callbackNumber case answeredById case direction case fromPhoneNumber case mostRecentParticipantCallSid case wasMissed case ringQueueId } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) dialState = try container.decodeIfPresent(SessionDialState.self, forKey: .dialState) callState = try container.decodeIfPresent(SessionCallState.self, forKey: .callState) queueState = try container.decodeIfPresent(SessionQueueStates.self, forKey: .queueState) accountId = try container.decodeIfPresent(String.self, forKey: .accountId) accountName = try container.decodeIfPresent(String.self, forKey: .accountName) customerId = try container.decodeIfPresent(String.self, forKey: .customerId) customerBreadcrumb = try container.decodeIfPresent([CustomerBreadcrumb].self, forKey: .customerBreadcrumb) ?? [] customerName = try container.decodeIfPresent(String.self, forKey: .customerName) endpointId = try container.decodeIfPresent(String.self, forKey: .endpointId) endpointName = try container.decodeIfPresent(String.self, forKey: .endpointName) dateCompleted = try container.decodeIfPresent(String.self, forKey: .dateCompleted) destination = try container.decodeIfPresent(String.self, forKey: .destination) toAddress = try container.decodeIfPresent(String.self, forKey: .toAddress) fromAddress = try container.decodeIfPresent(String.self, forKey: .fromAddress) fromName = try container.decodeIfPresent(String.self, forKey: .fromName) answeredByName = try container.decodeIfPresent(String.self, forKey: .answeredByName) queueMemberId = try container.decodeIfPresent(String.self, forKey: .queueMemberId) channel = try container.decodeIfPresent(FlowChannels.self, forKey: .channel) ended = try container.decodeIfPresent(Bool.self, forKey: .ended) outcome = try container.decodeIfPresent(String.self, forKey: .outcome) callSid = try container.decodeIfPresent(String.self, forKey: .callSid) consoleData = try container.decodeIfPresent(String.self, forKey: .consoleData) holdQueueName = try container.decodeIfPresent(String.self, forKey: .holdQueueName) heldByUserId = try container.decodeIfPresent(String.self, forKey: .heldByUserId) holdReason = try container.decodeIfPresent(SessionHoldReasons.self, forKey: .holdReason) conferenceSid = try container.decodeIfPresent(String.self, forKey: .conferenceSid) displayName = try container.decodeIfPresent(String.self, forKey: .displayName) log = try container.decodeIfPresent([SessionLogInfo].self, forKey: .log) ?? [] members = try container.decodeIfPresent([SessionMemberInfo].self, forKey: .members) ?? [] callbackNumber = try container.decodeIfPresent(String.self, forKey: .callbackNumber) answeredById = try container.decodeIfPresent(String.self, forKey: .answeredById) direction = try container.decodeIfPresent(SessionDirections.self, forKey: .direction) fromPhoneNumber = try container.decodeIfPresent(String.self, forKey: .fromPhoneNumber) mostRecentParticipantCallSid = try container.decodeIfPresent(String.self, forKey: .mostRecentParticipantCallSid) wasMissed = try container.decodeIfPresent(Bool.self, forKey: .wasMissed) ringQueueId = try container.decodeIfPresent(String.self, forKey: .ringQueueId) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if dialState != nil { try container.encode(dialState, forKey: .dialState) } if callState != nil { try container.encode(callState, forKey: .callState) } if queueState != nil { try container.encode(queueState, forKey: .queueState) } 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 customerBreadcrumb != nil { try container.encode(customerBreadcrumb, forKey: .customerBreadcrumb) } if customerName != nil { try container.encode(customerName, forKey: .customerName) } if endpointId != nil { try container.encode(endpointId, forKey: .endpointId) } if endpointName != nil { try container.encode(endpointName, forKey: .endpointName) } if dateCompleted != nil { try container.encode(dateCompleted, forKey: .dateCompleted) } if destination != nil { try container.encode(destination, forKey: .destination) } if toAddress != nil { try container.encode(toAddress, forKey: .toAddress) } if fromAddress != nil { try container.encode(fromAddress, forKey: .fromAddress) } if fromName != nil { try container.encode(fromName, forKey: .fromName) } if answeredByName != nil { try container.encode(answeredByName, forKey: .answeredByName) } if queueMemberId != nil { try container.encode(queueMemberId, forKey: .queueMemberId) } if channel != nil { try container.encode(channel, forKey: .channel) } if ended != nil { try container.encode(ended, forKey: .ended) } if outcome != nil { try container.encode(outcome, forKey: .outcome) } if callSid != nil { try container.encode(callSid, forKey: .callSid) } if consoleData != nil { try container.encode(consoleData, forKey: .consoleData) } if holdQueueName != nil { try container.encode(holdQueueName, forKey: .holdQueueName) } if heldByUserId != nil { try container.encode(heldByUserId, forKey: .heldByUserId) } if holdReason != nil { try container.encode(holdReason, forKey: .holdReason) } if conferenceSid != nil { try container.encode(conferenceSid, forKey: .conferenceSid) } if displayName != nil { try container.encode(displayName, forKey: .displayName) } if log != nil { try container.encode(log, forKey: .log) } if members != nil { try container.encode(members, forKey: .members) } if callbackNumber != nil { try container.encode(callbackNumber, forKey: .callbackNumber) } if answeredById != nil { try container.encode(answeredById, forKey: .answeredById) } if direction != nil { try container.encode(direction, forKey: .direction) } if fromPhoneNumber != nil { try container.encode(fromPhoneNumber, forKey: .fromPhoneNumber) } if mostRecentParticipantCallSid != nil { try container.encode(mostRecentParticipantCallSid, forKey: .mostRecentParticipantCallSid) } if wasMissed != nil { try container.encode(wasMissed, forKey: .wasMissed) } if ringQueueId != nil { try container.encode(ringQueueId, forKey: .ringQueueId) } } } public class MessageInfo : Codable { public var id:String? public var accountId:String? public var customerId:String? public var endpointId:String? public var endpointDisplayName:String? public var date:String? public var direction:MessageDirections? public var otherAddress:String? public var sender:String? public var text:String? public var isUnread:Bool? required public init(){} }