/* Options: Date: 2025-05-05 00:54:19 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: ListCustomers.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack /** * Retrieve customers */ // @Route("/customers", "GET") // @Api(Description="Retrieve customers") public class ListCustomers : ListRequest, IReturn { public typealias Return = ListResponse /** * Filter by accounts */ // @ApiMember(Description="Filter by accounts") public var accountIds:[String]? /** * Filter by name */ // @ApiMember(Description="Filter by name") public var nameFilter:String? /** * The IDs of the parent customers you want to filter by */ // @ApiMember(Description="The IDs of the parent customers you want to filter by") public var parentCustomerIds:[String]? /** * If you want a shall parent customer filter (e.g. no deep children) */ // @ApiMember(Description="If you want a shall parent customer filter (e.g. no deep children)") public var shallowParent:Bool? /** * The list of tag IDs to filter by (must contain all) */ // @ApiMember(Description="The list of tag IDs to filter by (must contain all)") public var tagIds:[String]? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case accountIds case nameFilter case parentCustomerIds case shallowParent case tagIds } 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) ?? [] nameFilter = try container.decodeIfPresent(String.self, forKey: .nameFilter) parentCustomerIds = try container.decodeIfPresent([String].self, forKey: .parentCustomerIds) ?? [] shallowParent = try container.decodeIfPresent(Bool.self, forKey: .shallowParent) tagIds = try container.decodeIfPresent([String].self, forKey: .tagIds) ?? [] } 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 nameFilter != nil { try container.encode(nameFilter, forKey: .nameFilter) } if parentCustomerIds != nil { try container.encode(parentCustomerIds, forKey: .parentCustomerIds) } if shallowParent != nil { try container.encode(shallowParent, forKey: .shallowParent) } if tagIds != nil { try container.encode(tagIds, forKey: .tagIds) } } } public class ListResponse : Codable { /** * The items */ // @ApiMember(Description="The items") public var items:[CustomerInfo]? /** * 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 class BillingSettings : Codable { public var base:BillingItem? public var localNumbers:BillingItem? public var tollFreeNumbers:BillingItem? public var inboundVoiceCalls:BillingItem? public var outboundVoiceCalls:BillingItem? public var inboundFaxes:BillingItem? public var outboundFaxes:BillingItem? public var inboundSmsMessages:BillingItem? public var outboundSmsMessages:BillingItem? public var aiInsights:BillingItem? public var aiLiveMinutes:BillingItem? 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 class Struct : List { 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 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 Tag : Codable { public var id:String? public var name:String? public var color:TagColors? required public init(){} } 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 EntityIntegrationData : List { 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 BillingItem : Codable { public var baseCost:Double? public var rawUnitMultiplier:Double? public var unitCost:Double? public var allowance:Int? required public init(){} } 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 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 IntegrationData : Codable { public var thirdPartyId:String? required public init(){} } public class CustomerInfo : EntityInfo { /** * The ID of the account associated with this customer */ // @ApiMember(Description="The ID of the account associated with this customer") public var accountId:String? /** * The parent customer ID for this customer */ // @ApiMember(Description="The parent customer ID for this customer") public var parentCustomerId:String? /** * The breadcrumb to this customer */ // @ApiMember(Description="The breadcrumb to this customer") public var breadcrumb:[CustomerBreadcrumb]? /** * The name of the account associated with this customer */ // @ApiMember(Description="The name of the account associated with this customer") public var accountName:String? /** * Is this customer staging or production? */ // @ApiMember(Description="Is this customer staging or production?") public var isStaging:Bool? /** * The name of the company */ // @ApiMember(Description="The name of the company") public var name:String? /** * The reference ID for this company */ // @ApiMember(Description="The reference ID for this company") public var referenceId:String? /** * This customer's data values */ // @ApiMember(Description="This customer's data values") public var data:Struct? /** * The list of tags for this customer */ // @ApiMember(Description="The list of tags for this customer") public var tags:[Tag]? /** * This customer's schedule */ // @ApiMember(Description="This customer's schedule") public var schedule:Schedule? /** * Integration data for this customer */ // @ApiMember(Description="Integration data for this customer") public var integrationData:EntityIntegrationData? /** * Override this customer's billing settings? Otherwise inherits from parent */ // @ApiMember(Description="Override this customer's billing settings? Otherwise inherits from parent") public var overrideBillingSettings:Bool? /** * Billing settings for this customer */ // @ApiMember(Description="Billing settings for this customer") public var billingSettings:BillingSettings? /** * Should this customer override the parent customer's app settings */ // @ApiMember(Description="Should this customer override the parent customer's app settings") public var overrideAppSettings:Bool? /** * App / Portal settings for this customer */ // @ApiMember(Description="App / Portal settings for this customer") public var appSettings:AppSettings? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case accountId case parentCustomerId case breadcrumb case accountName case isStaging case name case referenceId case data case tags case schedule case integrationData case overrideBillingSettings case billingSettings case overrideAppSettings case appSettings } 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) parentCustomerId = try container.decodeIfPresent(String.self, forKey: .parentCustomerId) breadcrumb = try container.decodeIfPresent([CustomerBreadcrumb].self, forKey: .breadcrumb) ?? [] accountName = try container.decodeIfPresent(String.self, forKey: .accountName) isStaging = try container.decodeIfPresent(Bool.self, forKey: .isStaging) name = try container.decodeIfPresent(String.self, forKey: .name) referenceId = try container.decodeIfPresent(String.self, forKey: .referenceId) data = try container.decodeIfPresent(Struct.self, forKey: .data) tags = try container.decodeIfPresent([Tag].self, forKey: .tags) ?? [] schedule = try container.decodeIfPresent(Schedule.self, forKey: .schedule) integrationData = try container.decodeIfPresent(EntityIntegrationData.self, forKey: .integrationData) overrideBillingSettings = try container.decodeIfPresent(Bool.self, forKey: .overrideBillingSettings) billingSettings = try container.decodeIfPresent(BillingSettings.self, forKey: .billingSettings) overrideAppSettings = try container.decodeIfPresent(Bool.self, forKey: .overrideAppSettings) appSettings = try container.decodeIfPresent(AppSettings.self, forKey: .appSettings) } 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 parentCustomerId != nil { try container.encode(parentCustomerId, forKey: .parentCustomerId) } if breadcrumb != nil { try container.encode(breadcrumb, forKey: .breadcrumb) } if accountName != nil { try container.encode(accountName, forKey: .accountName) } if isStaging != nil { try container.encode(isStaging, forKey: .isStaging) } if name != nil { try container.encode(name, forKey: .name) } if referenceId != nil { try container.encode(referenceId, forKey: .referenceId) } if data != nil { try container.encode(data, forKey: .data) } if tags != nil { try container.encode(tags, forKey: .tags) } if schedule != nil { try container.encode(schedule, forKey: .schedule) } if integrationData != nil { try container.encode(integrationData, forKey: .integrationData) } if overrideBillingSettings != nil { try container.encode(overrideBillingSettings, forKey: .overrideBillingSettings) } if billingSettings != nil { try container.encode(billingSettings, forKey: .billingSettings) } if overrideAppSettings != nil { try container.encode(overrideAppSettings, forKey: .overrideAppSettings) } if appSettings != nil { try container.encode(appSettings, forKey: .appSettings) } } } 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(){} }