/* Options: Date: 2024-12-29 02:35:11 SwiftVersion: 5.0 Version: 8.22 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://data.regent-college.edu //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: CRMDonationNotesRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/DynamicsCRM/Donations/Notes", "POST") public class CRMDonationNotesRequest : IReturn, Codable { public typealias Return = [CRMDonationNoteResponse] public var guids:[String] = [] required public init(){} } public class CRMNoteResponse : Codable { public var subject:String public var text:String public var owner_first_name:String public var owner_last_name:String public var file_base64:String public var filename:String public var filesize:Int public var mimetype:String public var added_date:Date? required public init(){} } public class CRMDonationNoteResponse : CRMNoteResponse { public var first_name:String public var last_name:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case first_name case last_name } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) first_name = try container.decodeIfPresent(String.self, forKey: .first_name) last_name = try container.decodeIfPresent(String.self, forKey: .last_name) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if first_name != nil { try container.encode(first_name, forKey: .first_name) } if last_name != nil { try container.encode(last_name, forKey: .last_name) } } }