/* Options: Date: 2024-06-29 12:07:29 SwiftVersion: 5.0 Version: 8.23 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://testapi.bokamera.se //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: SuperAdminSupportCaseCommentQuery.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/superadmin/support/cases/{SupportCaseId}/comments", "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 SuperAdminSupportCaseCommentQuery : 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 CaseComment : BaseModel { // @Required() public var companyId:String? // @Required() public var supportCaseId:Int? public var id:Int // @Required() public var comment:String? // @Required() public var deleted:Bool? // @Required() public var createdBy:String? // @Required() public var created:Date? public var modifiedDate:Date? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case companyId case supportCaseId case id case comment case deleted case createdBy case created 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) supportCaseId = try container.decodeIfPresent(Int.self, forKey: .supportCaseId) id = try container.decodeIfPresent(Int.self, forKey: .id) comment = try container.decodeIfPresent(String.self, forKey: .comment) deleted = try container.decodeIfPresent(Bool.self, forKey: .deleted) createdBy = try container.decodeIfPresent(String.self, forKey: .createdBy) created = try container.decodeIfPresent(Date.self, forKey: .created) 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 supportCaseId != nil { try container.encode(supportCaseId, forKey: .supportCaseId) } if id != nil { try container.encode(id, forKey: .id) } if comment != nil { try container.encode(comment, forKey: .comment) } if deleted != nil { try container.encode(deleted, forKey: .deleted) } if createdBy != nil { try container.encode(createdBy, forKey: .createdBy) } if created != nil { try container.encode(created, forKey: .created) } if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) } } } public class BaseModel : Codable { required public init(){} } public class SupportCaseCommentsResponse : Codable { /** * The case id */ // @ApiMember(Description="The case id") public var supportCaseId:Int /** * The comments id */ // @ApiMember(Description="The comments id") public var id:Int /** * The case comment */ // @ApiMember(Description="The case comment") public var comment:String /** * The case comment created by */ // @ApiMember(Description="The case comment created by") public var createdBy:String /** * The case comment created date */ // @ApiMember(Description="The case comment created date") public var created:Date required public init(){} }