| Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
| GET | /company/invoice/article | Get company invoice article | Get company invoice article. |
|---|
import Foundation
import ServiceStack
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
public class GetCompanyInvoiceArticle : QueryDb2<InvoiceArticle, CompanyInvoiceArticleQueryResponse>
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class InvoiceArticle : BaseModel
{
// @Required()
public var name:String?
public var licenseTypeId:Int?
public var licenseProductTypeId:Int
public var modifiedDate:Date?
// @Required()
public var id:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case licenseTypeId
case licenseProductTypeId
case modifiedDate
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
name = try container.decodeIfPresent(String.self, forKey: .name)
licenseTypeId = try container.decodeIfPresent(Int.self, forKey: .licenseTypeId)
licenseProductTypeId = try container.decodeIfPresent(Int.self, forKey: .licenseProductTypeId)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if name != nil { try container.encode(name, forKey: .name) }
if licenseTypeId != nil { try container.encode(licenseTypeId, forKey: .licenseTypeId) }
if licenseProductTypeId != nil { try container.encode(licenseProductTypeId, forKey: .licenseProductTypeId) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class BaseModel : Codable
{
required public init(){}
}
public class CompanyInvoiceArticleQueryResponse : Codable
{
public var name:String
public var licenseTypeId:Int?
public var licenseProductTypeId:Int
public var id:Int
required public init(){}
}
public class AccessKeyTypeResponse : Codable
{
public var id:Int
public var keyType:String
public var Description:String
required public init(){}
}
Swift GetCompanyInvoiceArticle 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 /company/invoice/article 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":[{"Name":"String","LicenseTypeId":0,"LicenseProductTypeId":0,"Id":0}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}