/* Options: Date: 2025-05-05 01:02:13 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: ListMessages.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/messages", "GET") public class ListMessages : ListRequest, IReturn { public typealias Return = ListResponse /** * The IDs of the account whose messages you want to retrieve */ // @ApiMember(Description="The IDs of the account whose messages you want to retrieve") public var accountIds:[String]? /** * The IDs of the customers whose messages you want to retrieve */ // @ApiMember(Description="The IDs of the customers whose messages you want to retrieve") public var customerIds:[String]? /** * The IDs of the endpoints whose messages you want to retrieve */ // @ApiMember(Description="The IDs of the endpoints whose messages you want to retrieve") public var endpointIds:[String]? /** * The ID of the conversations whose messages you want to retrieve */ // @ApiMember(Description="The ID of the conversations whose messages you want to retrieve") public var conversationIds:[String]? /** * The date after which messages should be retrieved */ // @ApiMember(Description="The date after which messages should be retrieved") public var afterDate:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case accountIds case customerIds case endpointIds case conversationIds case afterDate } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) accountIds = try container.decodeIfPresent([String].self, forKey: .accountIds) ?? [] customerIds = try container.decodeIfPresent([String].self, forKey: .customerIds) ?? [] endpointIds = try container.decodeIfPresent([String].self, forKey: .endpointIds) ?? [] conversationIds = try container.decodeIfPresent([String].self, forKey: .conversationIds) ?? [] afterDate = try container.decodeIfPresent(String.self, forKey: .afterDate) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if accountIds != nil { try container.encode(accountIds, forKey: .accountIds) } if customerIds != nil { try container.encode(customerIds, forKey: .customerIds) } if endpointIds != nil { try container.encode(endpointIds, forKey: .endpointIds) } if conversationIds != nil { try container.encode(conversationIds, forKey: .conversationIds) } if afterDate != nil { try container.encode(afterDate, forKey: .afterDate) } } } public class ListResponse : Codable { /** * The items */ // @ApiMember(Description="The items") public var items:[MessageInfo]? /** * The total number of items */ // @ApiMember(Description="The total number of items") public var totalCount:Int? /** * The total number of pages */ // @ApiMember(Description="The total number of pages") public var totalPages:Int? /** * Are there more pages of items? Used with simplified paging */ // @ApiMember(Description="Are there more pages of items? Used with simplified paging") public var hasMorePages:Bool? required public init(){} } public enum SortOrders : String, Codable { case Ascend case Descend } public class ListRequest : IGet, Codable { /** * The page of data to retrieve */ // @ApiMember(Description="The page of data to retrieve") public var page:Int? /** * If you want all objects to be returned. This should be used with care */ // @ApiMember(Description="If you want all objects to be returned. This should be used with care") public var all:Bool? /** * The number per page to retrieve */ // @ApiMember(Description="The number per page to retrieve") public var countPerPage:Int? /** * Specific IDs */ // @ApiMember(Description="Specific IDs") public var specificIds:[String]? /** * Specify a sort field */ // @ApiMember(Description="Specify a sort field") public var sortField:String? /** * Specify a sort order */ // @ApiMember(Description="Specify a sort order") public var sortOrder:SortOrders? /** * Disables total / page counts - improves performance. Returns only data. If there is no more data, Items will be empty array */ // @ApiMember(Description="Disables total / page counts - improves performance. Returns only data. If there is no more data, Items will be empty array") public var simplifiedPaging:Bool? required public init(){} } public enum MessageDirections : String, Codable { case Incoming case Outgoing } 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(){} }