| All Verbs | /query/tournees |
|---|
import Foundation
import ServiceStack
public class query_tournees : SecuredQueryDb<tournees>
{
public var id:String
public var inter_livraisons:[inter_livraisons] = []
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case id
case inter_livraisons
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(String.self, forKey: .id)
inter_livraisons = try container.decodeIfPresent([inter_livraisons].self, forKey: .inter_livraisons) ?? []
}
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) }
if inter_livraisons.count > 0 { try container.encode(inter_livraisons, forKey: .inter_livraisons) }
}
}
public class SecuredQueryDb<T : Codable> : QueryDb<T>
{
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 tournees : Codable
{
public var id_operateur:String
public var id_tournee:String
public var libelle:String
required public init(){}
}
public class inter_livraisons : Codable
{
public var id_operateur:String
public var id_tournee:String
public var date:String
public var latitude:Double
public var longitude:Double
public var id_client_termine:String
public var satisfaction:Int
public var id_client_suivant:String
public var signature:String
required public init(){}
}
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.
POST /query/tournees HTTP/1.1
Host: freemotion-staging.milliet.paris
Accept: application/json
Content-Type: application/json
Content-Length: length
{"id":"String","inter_livraisons":[{"id_operateur":"String","id_tournee":"String","date":"String","latitude":0,"longitude":0,"id_client_termine":"String","satisfaction":0,"id_client_suivant":"String","signature":"String"}],"skip":0,"take":0,"orderBy":"String","orderByDesc":"String","include":"String","fields":"String","meta":{"String":"String"}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"offset":0,"total":0,"results":[{"id_operateur":"String","id_tournee":"String","libelle":"String"}],"meta":{"String":"String"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}