PUT | /user/{supplieruserid}/contract/{contractid}/contractversion/{contractversionid}/accept |
---|
import Foundation
import ServiceStack
public class EditContractVersionIsAccepted : ContractVersionBase, IPut
{
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 ContractVersionBase : ContractBase
{
public var contractVersionId:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case contractVersionId
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
contractVersionId = try container.decodeIfPresent(Int.self, forKey: .contractVersionId)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if contractVersionId != nil { try container.encode(contractVersionId, forKey: .contractVersionId) }
}
}
public class ContractBase : Codable
{
public var supplierUserId:Int
public var contractId:Int
required public init(){}
}
public class ModifyEntityResponse : ResponseBase
{
public var id:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
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 id != nil { try container.encode(id, forKey: .id) }
}
}
public class ResponseBase : Codable
{
public var responseStatus:ResponseStatus
required public init(){}
}
Swift EditContractVersionIsAccepted DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /user/{supplieruserid}/contract/{contractid}/contractversion/{contractversionid}/accept HTTP/1.1
Host: szallitoiportal-be.veolia.hu
Accept: application/json
Content-Type: application/json
Content-Length: length
{"ContractVersionId":0,"SupplierUserId":0,"ContractId":0}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"Id":0,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}