/* Options: Date: 2025-05-04 23:19:09 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: ExportPackage.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack /** * Export the specified flows into a package */ // @Route("/packages", "GET") // @Api(Description="Export the specified flows into a package") public class ExportPackage : IReturn, Codable { public typealias Return = PackageInfo /** * The ID of the account */ // @ApiMember(Description="The ID of the account") public var accountId:String? /** * The IDs of the flows to export */ // @ApiMember(Description="The IDs of the flows to export") public var flowIds:[String]? /** * Include all custom fields */ // @ApiMember(Description="Include all custom fields") public var includeAllCustomFields:Bool? required public init(){} } public class PackageInfo : Codable { public var flows:[FlowInfo]? public var customerFields:[CustomerDataField]? public var endpointFields:[EndpointDataField]? public var systemFields:[SystemSettingsField]? 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 enum UserDataFieldModes : String, Codable { case Hidden case ReadOnly case ReadWrite } 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 enum ValueTypes : String, Codable { case NotSpecified case String case Boolean case Number case List case Struct case Transition case Custom case Date case AudioFile case TimeZoneId case PhoneNumber case User case Endpoint case Time case File case FaxNumber case EmailAccount case Customer case Flow case Team case FlowReference case Integration case Assistant } public class SystemSettingsField : DataField { public var value:Value? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case value } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) value = try container.decodeIfPresent(Value.self, forKey: .value) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if value != nil { try container.encode(value, forKey: .value) } } } public class CustomerDataField : DataField { public var showInSearch:Bool? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case showInSearch } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) showInSearch = try container.decodeIfPresent(Bool.self, forKey: .showInSearch) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if showInSearch != nil { try container.encode(showInSearch, forKey: .showInSearch) } } } public class EndpointDataField : DataField { public var showInSearch:Bool? public var showInLists:Bool? public var endpointType:EndpointTypes? public var isCallerId:Bool? public var isKnob:Bool? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case showInSearch case showInLists case endpointType case isCallerId case isKnob } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) showInSearch = try container.decodeIfPresent(Bool.self, forKey: .showInSearch) showInLists = try container.decodeIfPresent(Bool.self, forKey: .showInLists) endpointType = try container.decodeIfPresent(EndpointTypes.self, forKey: .endpointType) isCallerId = try container.decodeIfPresent(Bool.self, forKey: .isCallerId) isKnob = try container.decodeIfPresent(Bool.self, forKey: .isKnob) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if showInSearch != nil { try container.encode(showInSearch, forKey: .showInSearch) } if showInLists != nil { try container.encode(showInLists, forKey: .showInLists) } if endpointType != nil { try container.encode(endpointType, forKey: .endpointType) } if isCallerId != nil { try container.encode(isCallerId, forKey: .isCallerId) } if isKnob != nil { try container.encode(isKnob, forKey: .isKnob) } } } public class DataType : Codable { public var typeName:String? public var fields:[DataField]? 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 UIHints : String, Codable { case None case LargeText case InlineForm case Password case InlineStruct } public enum DataFieldUniqueness : String, Codable { case NotUnique case Unique case UniqueToCustomer } public class DataField : Codable { public var id:String? public var name:String? public var type:ValueTypes? public var uiHint:UIHints? public var uiTab:String? public var isAsync:Bool? public var disableBinding:Bool? public var structType:DataType? public var listType:DataType? public var Description:String? public var possibleValues:[String]? public var isOutput:Bool? public var customFieldValuesUrl:String? public var defaultValue:Value? public var transitionNameFormat:String? public var uniqueness:DataFieldUniqueness? public var voiceOnly:Bool? public var conditionalVisibilityField:String? public var conditionalVisibilityValue:String? public var noEvalTemplate:Bool? public var userMode:UserDataFieldModes? public var anyValueType:Bool? required public init(){} } public class FlowInfo : EntityInfo { /** * The name of this flow */ // @ApiMember(Description="The name of this flow") public var name:String? /** * The roles that this flow has */ // @ApiMember(Description="The roles that this flow has") public var roles:[FlowRoles]? /** * What this flow does */ // @ApiMember(Description="What this flow does") public var Description:String? /** * Any notes for this flow */ // @ApiMember(Description="Any notes for this flow") public var notes:String? /** * 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 flow */ // @ApiMember(Description="The name of the account associated with the flow") public var accountName:String? /** * The ID of the customer this flow is associated with */ // @ApiMember(Description="The ID of the customer this flow is associated with") public var customerId:String? /** * The name of the customer this flow is associated with */ // @ApiMember(Description="The name of the customer this flow is associated with") public var customerName:String? /** * The breadcrumb to the flow for this endpoint */ // @ApiMember(Description="The breadcrumb to the flow for this endpoint") public var customerBreadcrumb:[CustomerBreadcrumb]? /** * The nodes in this flow */ // @ApiMember(Description="The nodes in this flow") public var nodes:[FlowNode]? /** * The flow's parameters */ // @ApiMember(Description="The flow's parameters") public var parameters:[FlowParameter]? /** * The flow's exits */ // @ApiMember(Description="The flow's exits") public var exits:[FlowExit]? /** * The UI data for the flow */ // @ApiMember(Description="The UI data for the flow") public var ui:FlowUI? /** * The list of tags for this flow */ // @ApiMember(Description="The list of tags for this flow") public var tags:[Tag]? /** * The number of nodes in this flow */ // @ApiMember(Description="The number of nodes in this flow") public var nodeCount:Int? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case name case roles case Description case notes case accountId case accountName case customerId case customerName case customerBreadcrumb case nodes case parameters case exits case ui case tags case nodeCount } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) name = try container.decodeIfPresent(String.self, forKey: .name) roles = try container.decodeIfPresent([FlowRoles].self, forKey: .roles) ?? [] Description = try container.decodeIfPresent(String.self, forKey: .Description) notes = try container.decodeIfPresent(String.self, forKey: .notes) 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) ?? [] nodes = try container.decodeIfPresent([FlowNode].self, forKey: .nodes) ?? [] parameters = try container.decodeIfPresent([FlowParameter].self, forKey: .parameters) ?? [] exits = try container.decodeIfPresent([FlowExit].self, forKey: .exits) ?? [] ui = try container.decodeIfPresent(FlowUI.self, forKey: .ui) tags = try container.decodeIfPresent([Tag].self, forKey: .tags) ?? [] nodeCount = try container.decodeIfPresent(Int.self, forKey: .nodeCount) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if name != nil { try container.encode(name, forKey: .name) } if roles != nil { try container.encode(roles, forKey: .roles) } if Description != nil { try container.encode(Description, forKey: .Description) } if notes != nil { try container.encode(notes, forKey: .notes) } 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 nodes != nil { try container.encode(nodes, forKey: .nodes) } if parameters != nil { try container.encode(parameters, forKey: .parameters) } if exits != nil { try container.encode(exits, forKey: .exits) } if ui != nil { try container.encode(ui, forKey: .ui) } if tags != nil { try container.encode(tags, forKey: .tags) } if nodeCount != nil { try container.encode(nodeCount, forKey: .nodeCount) } } }