Requires any of the roles: | bookingsupplier-administrator-write, superadmin, bookingsupplier-administrator-read |
GET | /support/cases/{SupportCaseId}/attachments | Get all support case attachments | Get all support case attachments. |
---|
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 SupportCaseAttachmentQuery : QueryDb2<CaseAttachment, SupportCaseAttachmentResponse>, 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 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(){}
}
public class AccessKeyTypeResponse : Codable
{
public var id:Int
public var keyType:String
public var Description:String
required public init(){}
}
Swift SupportCaseAttachmentQuery DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /support/cases/{SupportCaseId}/attachments HTTP/1.1 Host: api.bokamera.se Accept: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Offset":0,"Total":0,"Results":[{"Id":0,"FileUrl":"String"}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}