| POST | /cmd/locations/devices/add |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
public static class AddLocationDevice
{
public String id = null;
public Device device = null;
public String getId() { return id; }
public AddLocationDevice setId(String value) { this.id = value; return this; }
public Device getDevice() { return device; }
public AddLocationDevice setDevice(Device value) { this.device = value; return this; }
}
public static class Device
{
public String id = null;
public String name = null;
public Boolean isActive = null;
public DeviceProfile profile = null;
public RecordDictionary<String, String> integrationsData = null;
public String getId() { return id; }
public Device setId(String value) { this.id = value; return this; }
public String getName() { return name; }
public Device setName(String value) { this.name = value; return this; }
public Boolean getIsActive() { return isActive; }
public Device setIsActive(Boolean value) { this.isActive = value; return this; }
public DeviceProfile getProfile() { return profile; }
public Device setProfile(DeviceProfile value) { this.profile = value; return this; }
public RecordDictionary<String, String> getIntegrationsData() { return integrationsData; }
public Device setIntegrationsData(RecordDictionary<String, String> value) { this.integrationsData = value; return this; }
}
public static class DeviceProfile
{
public DeviceUsageMode usageMode = null;
public DeviceUserInterface userInterface = null;
public Ref wallet = null;
public DeviceManagement managedBy = null;
public DeviceUsageMode getUsageMode() { return usageMode; }
public DeviceProfile setUsageMode(DeviceUsageMode value) { this.usageMode = value; return this; }
public DeviceUserInterface getUserInterface() { return userInterface; }
public DeviceProfile setUserInterface(DeviceUserInterface value) { this.userInterface = value; return this; }
public Ref getWallet() { return wallet; }
public DeviceProfile setWallet(Ref value) { this.wallet = value; return this; }
public DeviceManagement getManagedBy() { return managedBy; }
public DeviceProfile setManagedBy(DeviceManagement value) { this.managedBy = value; return this; }
}
public static enum DeviceUsageMode
{
@SerializedName("0") ClerkServiced(0),
@SerializedName("1") Personal(1),
@SerializedName("2") SelfService(2),
@SerializedName("-1") Unknown(-1);
private final int value;
DeviceUsageMode(final int intValue) { value = intValue; }
public int getValue() { return value; }
}
public static enum DeviceUserInterface
{
@SerializedName("0") Tablet(0),
@SerializedName("1") Kiosk(1),
@SerializedName("2") Default(2),
@SerializedName("-1") Unknown(-1);
private final int value;
DeviceUserInterface(final int intValue) { value = intValue; }
public int getValue() { return value; }
}
public static class Ref
{
public String id = null;
public String val = null;
public String getId() { return id; }
public Ref setId(String value) { this.id = value; return this; }
public String getVal() { return val; }
public Ref setVal(String value) { this.val = value; return this; }
}
public static enum DeviceManagement
{
@SerializedName("1") Partner(1),
@SerializedName("2") Platform(2);
private final int value;
DeviceManagement(final int intValue) { value = intValue; }
public int getValue() { return value; }
}
public static class RecordDictionary<TKey, TVal> extends HashMap<TKey,TVal>
{
}
}
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 /cmd/locations/devices/add HTTP/1.1
Host: api.bettor.webhop.biz
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
id: String,
device:
{
id: String,
name: String,
isActive: False,
profile:
{
usageMode: 0,
userInterface: 0,
wallet:
{
id: String,
val: String
},
managedBy: 0
},
integrationsData:
{
String: String
}
}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}