/* Options: Date: 2025-05-04 22:54:28 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: PatchIntegration.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack /** * Update a specific integration */ // @Route("/integrations/{integrationId}", "PATCH") // @Api(Description="Update a specific integration") public class PatchIntegration : IReturn, IPatch, Codable { public typealias Return = IntegrationInfo /** * The ID of the integration you want to update */ // @ApiMember(Description="The ID of the integration you want to update") public var integrationId:String? /** * The name for the integration */ // @ApiMember(Description="The name for the integration") public var name:String? /** * The parent customer for this integration */ // @ApiMember(Description="The parent customer for this integration") public var customerId:String? /** * Automatically create new customers / users when sync'ing with CRM? */ // @ApiMember(Description="Automatically create new customers / users when sync'ing with CRM?") public var automaticallyCreateCustomers:Bool? /** * Settings values for this integration */ // @ApiMember(Description="Settings values for this integration") public var settings:Struct? required public init(){} } public class IntegrationInfo : EntityInfo { /** * The ID of the account associated with this integration */ // @ApiMember(Description="The ID of the account associated with this integration") public var accountId:String? /** * The ID of the customer this integration is associated with */ // @ApiMember(Description="The ID of the customer this integration is associated with") public var customerId:String? /** * The name of the customer this integration is associated with */ // @ApiMember(Description="The name of the customer this integration is associated with") public var customerName:String? /** * The date the integration was sync'd last */ // @ApiMember(Description="The date the integration was sync'd last") public var dateLastSync:String? /** * The breadcrumb to the customer for this integration */ // @ApiMember(Description="The breadcrumb to the customer for this integration") public var customerBreadcrumb:[CustomerBreadcrumb]? /** * The name of the integration (e.g. HostedSuite Dallas) */ // @ApiMember(Description="The name of the integration (e.g. HostedSuite Dallas)") public var name:String? /** * Automatically create new customers / users when sync'ing with CRM? */ // @ApiMember(Description="Automatically create new customers / users when sync'ing with CRM?") public var automaticallyCreateCustomers:Bool? /** * The type of integration */ // @ApiMember(Description="The type of integration") public var type:IntegrationTypes? /** * The status of the integration */ // @ApiMember(Description="The status of the integration") public var status:IntegrationStatuses? /** * The status of the integration */ // @ApiMember(Description="The status of the integration") public var statusMessage:String? /** * The settings type for this integration */ // @ApiMember(Description="The settings type for this integration") public var settingsDataType:DataType? /** * The settings for this integration */ // @ApiMember(Description="The settings for this integration") public var settings:Struct? /** * The features supported by this integration */ // @ApiMember(Description="The features supported by this integration") public var features:[IntegrationFeatures]? /** * Is this integration authorized (OAuth)? */ // @ApiMember(Description="Is this integration authorized (OAuth)?") public var isAuthorized:Bool? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case accountId case customerId case customerName case dateLastSync case customerBreadcrumb case name case automaticallyCreateCustomers case type case status case statusMessage case settingsDataType case settings case features case isAuthorized } 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) customerId = try container.decodeIfPresent(String.self, forKey: .customerId) customerName = try container.decodeIfPresent(String.self, forKey: .customerName) dateLastSync = try container.decodeIfPresent(String.self, forKey: .dateLastSync) customerBreadcrumb = try container.decodeIfPresent([CustomerBreadcrumb].self, forKey: .customerBreadcrumb) ?? [] name = try container.decodeIfPresent(String.self, forKey: .name) automaticallyCreateCustomers = try container.decodeIfPresent(Bool.self, forKey: .automaticallyCreateCustomers) type = try container.decodeIfPresent(IntegrationTypes.self, forKey: .type) status = try container.decodeIfPresent(IntegrationStatuses.self, forKey: .status) statusMessage = try container.decodeIfPresent(String.self, forKey: .statusMessage) settingsDataType = try container.decodeIfPresent(DataType.self, forKey: .settingsDataType) settings = try container.decodeIfPresent(Struct.self, forKey: .settings) features = try container.decodeIfPresent([IntegrationFeatures].self, forKey: .features) ?? [] isAuthorized = try container.decodeIfPresent(Bool.self, forKey: .isAuthorized) } 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 customerId != nil { try container.encode(customerId, forKey: .customerId) } if customerName != nil { try container.encode(customerName, forKey: .customerName) } if dateLastSync != nil { try container.encode(dateLastSync, forKey: .dateLastSync) } if customerBreadcrumb != nil { try container.encode(customerBreadcrumb, forKey: .customerBreadcrumb) } if name != nil { try container.encode(name, forKey: .name) } if automaticallyCreateCustomers != nil { try container.encode(automaticallyCreateCustomers, forKey: .automaticallyCreateCustomers) } if type != nil { try container.encode(type, forKey: .type) } if status != nil { try container.encode(status, forKey: .status) } if statusMessage != nil { try container.encode(statusMessage, forKey: .statusMessage) } if settingsDataType != nil { try container.encode(settingsDataType, forKey: .settingsDataType) } if settings != nil { try container.encode(settings, forKey: .settings) } if features != nil { try container.encode(features, forKey: .features) } if isAuthorized != nil { try container.encode(isAuthorized, forKey: .isAuthorized) } } } 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 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 enum IntegrationTypes : String, Codable { case HostedSuite case OfficeRnd case Zoho } 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 enum IntegrationStatuses : String, Codable { case NotConfigured case Error case OK } public class DataType : Codable { public var typeName:String? public var fields:[DataField]? required public init(){} } public enum IntegrationFeatures : String, Codable { case CrmSync case OAuth2 } 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(){} }