/* Options: Date: 2024-11-21 11:47:43 SwiftVersion: 5.0 Version: 8.23 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://api.bokamera.se //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: SuperAdminSupportCaseAttachmentQuery.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/superadmin/support/cases/{SupportCaseId}/attachments", "GET") // @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401) // @ApiResponse(Description="You have too low privilegies to call this service", StatusCode=403) // @ValidateRequest(Validator="IsAuthenticated") public class SuperAdminSupportCaseAttachmentQuery : QueryDb2, IReturn, ICompany { public typealias Return = QueryResponse /** * Enter the company id, if blank company id and you are an admin, your company id will be used. */ // @ApiMember(Description="Enter the company id, if blank company id and you are an admin, your company id will be used.", IsRequired=true) public var companyId:String? /** * The support case id */ // @ApiMember(Description="The support case id", IsRequired=true, ParameterType="path") public var supportCaseId:Int required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case companyId case supportCaseId } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) companyId = try container.decodeIfPresent(String.self, forKey: .companyId) supportCaseId = try container.decodeIfPresent(Int.self, forKey: .supportCaseId) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if companyId != nil { try container.encode(companyId, forKey: .companyId) } if supportCaseId != nil { try container.encode(supportCaseId, forKey: .supportCaseId) } } } public protocol ICompany { var companyId:String? { get set } } public class CaseAttachment : BaseModel { // @Required() public var companyId:String? public var id:Int // @Required() public var fileUrl:String? public var modifiedDate:Date? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case companyId case id case fileUrl case modifiedDate } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) companyId = try container.decodeIfPresent(String.self, forKey: .companyId) id = try container.decodeIfPresent(Int.self, forKey: .id) fileUrl = try container.decodeIfPresent(String.self, forKey: .fileUrl) modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if companyId != nil { try container.encode(companyId, forKey: .companyId) } if id != nil { try container.encode(id, forKey: .id) } if fileUrl != nil { try container.encode(fileUrl, forKey: .fileUrl) } if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) } } } public class BaseModel : Codable { required public init(){} } public class SupportCaseAttachmentResponse : Codable { /** * The attachment id */ // @ApiMember(Description="The attachment id") public var id:Int /** * The attachment file url */ // @ApiMember(Description="The attachment file url") public var fileUrl:String required public init(){} }