| All Verbs | /qry/configurations/devices |
|---|
import Foundation
import ServiceStack
public class GetDeviceConfiguration : Codable
{
public var id:String
required public init(){}
}
public class DeviceConfiguration : Codable
{
public var id:String
public var name:String
public var isActive:Bool
public var productInstances:RecordList<ProductInstanceRef>
public var timeZone:Ref
public var currency:Ref
public var language:Ref
public var location:LocationRef
public var organization:OrganizationRef
required public init(){}
}
public class RecordList<T : Codable> : List<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 ProductInstanceRef : Codable
{
public var id:String
public var name:String
public var title:String
public var product:ProductReference
required public init(){}
}
public class ProductReference : Codable
{
public var id:String
public var value:String
public var category:String
public var productProvider:Ref
required public init(){}
}
public class Ref : Codable
{
public var id:String
public var val:String
required public init(){}
}
public class LocationRef : Codable
{
public var id:String
public var name:String
public var group:Ref
public var region:Ref
public var address:Address
public var integrationsData:RecordDictionary<String, String>
required public init(){}
}
public class Address : Codable
{
public var street:String
public var city:String
public var state:String
public var postalCode:String
public var country:Ref
public var gps:GPSCoordinates
public var data:RecordDictionary<String, String>
required public init(){}
}
public class GPSCoordinates : Codable
{
public var lat:Double
public var lng:Double
required public init(){}
}
public class RecordDictionary<TKey : Codable, TVal : Codable> : List<TKey:TVal>
{
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 OrganizationRef : Codable
{
public var id:String
public var name:String
public var address:Address
public var integrationsData:RecordDictionary<String, String>
required public init(){}
}
Swift GetDeviceConfiguration DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /qry/configurations/devices HTTP/1.1
Host: api.beto2.webhop.biz
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
id: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
id: String,
name: String,
isActive: False,
productInstances:
[
{
id: String,
name: String,
title: String,
product:
{
id: String,
value: String,
category: String,
productProvider:
{
id: String,
val: String
}
}
}
],
timeZone:
{
id: String,
val: String
},
currency:
{
id: String,
val: String
},
language:
{
id: String,
val: String
},
location:
{
id: String,
name: String,
group:
{
id: String,
val: String
},
region:
{
id: String,
val: String
},
address:
{
street: String,
city: String,
state: String,
postalCode: String,
country:
{
id: String,
val: String
},
gps:
{
lat: 0,
lng: 0
},
data:
{
String: String
}
},
integrationsData:
{
String: String
}
},
organization:
{
id: String,
name: String,
address:
{
street: String,
city: String,
state: String,
postalCode: String,
country:
{
id: String,
val: String
},
gps:
{
lat: 0,
lng: 0
},
data:
{
String: String
}
},
integrationsData:
{
String: String
}
}
}