BokaMera.API.Host

<back to all web services

SupportCaseCommentQuery

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin, bookingsupplier-administrator-read
The following routes are available for this service:
GET/support/cases/{SupportCaseId}/commentsGet all support case commentsGet all support case comments.
import Foundation
import ServiceStack

// @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 SupportCaseCommentQuery : QueryDb2<CaseComment, SupportCaseCommentsResponse>, ICompany
{
    /**
    * 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 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(){}
}

public class AccessKeyTypeResponse : Codable
{
    public var id:Int
    public var keyType:String
    public var Description:String

    required public init(){}
}


Swift SupportCaseCommentQuery DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /support/cases/{SupportCaseId}/comments HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Offset":0,"Total":0,"Results":[{"SupportCaseId":0,"Id":0,"Comment":"String","CreatedBy":"String"}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}