import Foundation
import ServiceStack
/**
* Saves/Updates a Devices details and registers that device with an appliance.
*/
// @Api(Description="Saves/Updates a Devices details and registers that device with an appliance.")
public class RegisterDevice : Codable
{
/**
* Guid of the Appliance this Device is Registering under.
*/
// @ApiMember(DataType="Guid", Description="Guid of the Appliance this Device is Registering under.", IsRequired=true, Name="ApplianceId", ParameterType="query")
public var applianceId:String
/**
* Guid of the Device. If empty the Device will be inserted, if provided the device will be updated.
*/
// @ApiMember(DataType="Guid", Description="Guid of the Device. If empty the Device will be inserted, if provided the device will be updated.", IsRequired=true, Name="DeviceId", ParameterType="query")
public var deviceId:String
/**
* The Device manufacturers number.
*/
// @ApiMember(DataType="string", Description="The Device manufacturers number.", Name="ManufacturerDeviceNumber", ParameterType="query")
public var manufacturerDeviceNumber:String
/**
* The Device MAC Address.
*/
// @ApiMember(DataType="string", Description="The Device MAC Address.", Name="MacAddress", ParameterType="query")
public var macAddress:String
/**
* The Device Model Name.
*/
// @ApiMember(DataType="string", Description="The Device Model Name.", IsRequired=true, Name="ModelName", ParameterType="query")
public var modelName:String
/**
* The Device Form, e.g Phone | Tablet.
*/
// @ApiMember(DataType="string", Description="The Device Form, e.g Phone | Tablet.", IsRequired=true, Name="FormFactor", ParameterType="query")
public var formFactor:String
/**
* The Device Brand.
*/
// @ApiMember(DataType="string", Description="The Device Brand.", Name="Brand", ParameterType="query")
public var brand:String
/**
* The Device Dimensions (Height x Width x Depth).
*/
// @ApiMember(DataType="string", Description="The Device Dimensions (Height x Width x Depth).", Name="Dimensions", ParameterType="query")
public var dimensions:String
/**
* The Device display resolution width in pixels.
*/
// @ApiMember(DataType="int", Description="The Device display resolution width in pixels.", Name="DisplayResolutionWidthPixels", ParameterType="query")
public var displayResolutionWidthPixels:Int?
/**
* The Device display resolution height in pixels.
*/
// @ApiMember(DataType="int", Description="The Device display resolution height in pixels.", Name="DisplayResolutionHeightPixels", ParameterType="query")
public var displayResolutionHeightPixels:Int?
/**
* The Device display width size in inches.
*/
// @ApiMember(DataType="decimal", Description="The Device display width size in inches.", Name="DisplaySizeWidthInches", ParameterType="query")
public var displaySizeWidthInches:Double?
/**
* The Device display height size in inches.
*/
// @ApiMember(DataType="decimal", Description="The Device display height size in inches.", Name="DisplaySizeHeightInches", ParameterType="query")
public var displaySizeHeightInches:Double?
/**
* The Device operating system.
*/
// @ApiMember(DataType="string", Description="The Device operating system.", Name="OperatingSystem", ParameterType="query")
public var operatingSystem:String
/**
* The Device operating system version.
*/
// @ApiMember(DataType="string", Description="The Device operating system version.", Name="OperatingSystemVersion", ParameterType="query")
public var operatingSystemVersion:String
/**
* The Device IP Address.
*/
// @ApiMember(DataType="string", Description="The Device IP Address.", Name="IpAddress", ParameterType="query")
public var ipAddress:String
/**
* Any Notes about the device.
*/
// @ApiMember(DataType="string", Description="Any Notes about the device.", Name="Notes", ParameterType="query")
public var notes:String
/**
* Total memory size available (in bytes).
*/
// @ApiMember(DataType="string", Description="Total memory size available (in bytes).", Name="TotalMemorySize", ParameterType="query")
public var totalMemorySize:Int?
/**
* The Network provider name.
*/
// @ApiMember(DataType="string", Description="The Network provider name.", Name="CellularProviderName", ParameterType="query")
public var cellularProviderName:String
/**
* The ISO Country Code of the country the device is currently located in.
*/
// @ApiMember(DataType="string", Description="The ISO Country Code of the country the device is currently located in.", Name="ISOCountryCode", ParameterType="query")
public var isoCountryCode:String
/**
* The Mobile Country Code the device is currently located in.
*/
// @ApiMember(DataType="string", Description="The Mobile Country Code the device is currently located in.", Name="MobileCountryCode", ParameterType="query")
public var mobileCountryCode:String
/**
* The Mobile Network Code the device is currently using.
*/
// @ApiMember(DataType="string", Description="The Mobile Network Code the device is currently using.", Name="MobileNetworkCode", ParameterType="query")
public var mobileNetworkCode:String
/**
* The Language Code Identifier that represents the language used on the device.
*/
// @ApiMember(DataType="string", Description="The Language Code Identifier that represents the language used on the device.", Name="LanguageCodeIdentifier", ParameterType="query")
public var languageCodeIdentifier:String
/**
* The name of the Timezone the device was last used in.
*/
// @ApiMember(DataType="string", Description="The name of the Timezone the device was last used in.", Name="LastKnownTimeZone", ParameterType="query")
public var lastKnownTimeZone:String
/**
* The UTC Offset of the Timezone the device was last used in. Formatted as +-##:##
*/
// @ApiMember(DataType="string", Description="The UTC Offset of the Timezone the device was last used in. Formatted as +-##:##", Name="LastKnownTimeZoneOffset", ParameterType="query")
public var lastKnownTimeZoneOffset:String
/**
* The latitude the device was last located at.
*/
// @ApiMember(DataType="double", Description="The latitude the device was last located at.", IsRequired=true, Name="Latitude", ParameterType="query")
public var latitude:Double
/**
* The longitude the device was last located at.
*/
// @ApiMember(DataType="double", Description="The longitude the device was last located at.", IsRequired=true, Name="Longitude", ParameterType="query")
public var longitude:Double
/**
* The current value of InstanceSeed that the device has stored.
*/
// @ApiMember(DataType="int", Description="The current value of InstanceSeed that the device has stored.", IsRequired=true, Name="InstanceSeed", ParameterType="query")
public var instanceSeed:Int
/**
* The current value of InstanceCounterLastValue that the device has stored
*/
// @ApiMember(DataType="int", Description="The current value of InstanceCounterLastValue that the device has stored", IsRequired=true, Name="InstanceCounterLastValue", ParameterType="query")
public var instanceCounterLastValue:Int
required public init(){}
}
public class DeviceModel : Codable
{
/**
* Guid representing the saved Device
*/
// @ApiMember(DataType="Guid", Description="Guid representing the saved Device", Name="DeviceId", ParameterType="query")
public var deviceId:String
/**
* Details of the Type of Device
*/
// @ApiMember(DataType="DeviceTypeModel", Description="Details of the Type of Device", Name="DeviceType", ParameterType="query")
public var deviceType:DeviceTypeModel
/**
* Current saved settings of the Device
*/
// @ApiMember(DataType="DeviceHistoryModel", Description="Current saved settings of the Device", Name="CurrentHistory", ParameterType="query")
public var currentHistory:DeviceHistoryModel
/**
* The Device Model Name.
*/
// @ApiMember(DataType="string", Description="The Device Model Name.", IsRequired=true, Name="ModelName", ParameterType="query")
public var modelName:String
/**
* The Device model number.
*/
// @ApiMember(DataType="string", Description="The Device model number.", Name="ModelNumber", ParameterType="query")
public var modelNumber:String
/**
* The Device serial number.
*/
// @ApiMember(DataType="string", Description="The Device serial number.", Name="SerialNumber", ParameterType="query")
public var serialNumber:String
/**
* The Device manufacturers number.
*/
// @ApiMember(DataType="string", Description="The Device manufacturers number.", Name="ManufacturerDeviceNumber", ParameterType="query")
public var manufacturerDeviceNumber:String
/**
* The Device MAC Address.
*/
// @ApiMember(DataType="string", Description="The Device MAC Address.", Name="MacAddress", ParameterType="query")
public var macAddress:String
/**
* The current value of InstanceSeed that the device has stored. If InstanceCounterLastValue has gone over 99999, this will contain a new seed value for the device.
*/
// @ApiMember(DataType="int", Description="The current value of InstanceSeed that the device has stored. If InstanceCounterLastValue has gone over 99999, this will contain a new seed value for the device.", IsRequired=true, Name="InstanceSeed", ParameterType="query")
public var instanceSeed:Int
/**
* The current value of InstanceCounterLastValue that the device has stored
*/
// @ApiMember(DataType="int", Description="The current value of InstanceCounterLastValue that the device has stored", IsRequired=true, Name="InstanceCounterLastValue", ParameterType="query")
public var instanceCounterLastValue:Int
/**
* ServiceStack ResponseStatus.
*/
// @ApiMember(DataType="ResponseStatus", Description="ServiceStack ResponseStatus.", Name="ResponseStatus", ParameterType="query")
public var responseStatus:ResponseStatus
required public init(){}
}
public class DeviceTypeModel : Codable
{
/**
* Guid representing the saved Device Type
*/
// @ApiMember(DataType="Guid", Description="Guid representing the saved Device Type", Name="DeviceTypeId", ParameterType="query")
public var deviceTypeId:String
/**
* Guid representing the saved Device Class
*/
// @ApiMember(DataType="Guid", Description="Guid representing the saved Device Class", Name="DeviceClassId", ParameterType="query")
public var deviceClassId:String
/**
* The Device Class Name
*/
// @ApiMember(DataType="string", Description="The Device Class Name", Name="DeviceClassName", ParameterType="query")
public var deviceClassName:String
/**
* The Device Brand.
*/
// @ApiMember(DataType="string", Description="The Device Brand.", Name="Brand", ParameterType="query")
public var brand:String
/**
* The Device Model Name.
*/
// @ApiMember(DataType="string", Description="The Device Model Name.", IsRequired=true, Name="ModelName", ParameterType="query")
public var modelName:String
/**
* The Device Form, e.g Phone | Tablet.
*/
// @ApiMember(DataType="string", Description="The Device Form, e.g Phone | Tablet.", Name="FormFactor", ParameterType="query")
public var formFactor:String
/**
* The Device Dimensions (Height x Width x Depth).
*/
// @ApiMember(DataType="string", Description="The Device Dimensions (Height x Width x Depth).", Name="Dimensions", ParameterType="query")
public var dimensions:String
/**
* The Device display resolution width in pixels.
*/
// @ApiMember(DataType="int", Description="The Device display resolution width in pixels.", Name="DisplayResolutionWidthPixels", ParameterType="query")
public var displayResolutionWidthPixels:Int?
/**
* The Device display resolution height in pixels.
*/
// @ApiMember(DataType="int", Description="The Device display resolution height in pixels.", Name="DisplayResolutionHeightPixels", ParameterType="query")
public var displayResolutionHeightPixels:Int?
/**
* The Device display width size in inches.
*/
// @ApiMember(DataType="decimal", Description="The Device display width size in inches.", Name="DisplaySizeWidthInches", ParameterType="query")
public var displaySizeWidthInches:Double?
/**
* The Device display height size in inches.
*/
// @ApiMember(DataType="decimal", Description="The Device display height size in inches.", Name="DisplaySizeHeightInches", ParameterType="query")
public var displaySizeHeightInches:Double?
required public init(){}
}
public class DeviceHistoryModel : Codable
{
/**
* Guid representing the current Device History
*/
// @ApiMember(DataType="Guid", Description="Guid representing the current Device History", Name="DeviceHistoryId", ParameterType="query")
public var deviceHistoryId:String
/**
* Guid representing the current Device History Device Configuration record.
*/
// @ApiMember(DataType="Guid", Description="Guid representing the current Device History Device Configuration record.", Name="PrimaryDeviceHistoryDeviceConfigurationId", ParameterType="query")
public var primaryDeviceHistoryDeviceConfigurationId:String
/**
* The Device name.
*/
// @ApiMember(DataType="string", Description="The Device name.", Name="DeviceName", ParameterType="query")
public var deviceName:String
/**
* The Device operating system.
*/
// @ApiMember(DataType="string", Description="The Device operating system.", Name="OperatingSystem", ParameterType="query")
public var operatingSystem:String
/**
* The Device operating system version.
*/
// @ApiMember(DataType="string", Description="The Device operating system version.", Name="OperatingSystemVersion", ParameterType="query")
public var operatingSystemVersion:String
/**
* The Device IP Address.
*/
// @ApiMember(DataType="string", Description="The Device IP Address.", Name="IpAddress", ParameterType="query")
public var ipAddress:String
/**
* Any Notes about the device.
*/
// @ApiMember(DataType="string", Description="Any Notes about the device.", Name="Notes", ParameterType="query")
public var notes:String
/**
* Total memory size available (in bytes).
*/
// @ApiMember(DataType="string", Description="Total memory size available (in bytes).", Name="TotalMemorySize", ParameterType="query")
public var totalMemorySize:Int?
/**
* The Network provider name.
*/
// @ApiMember(DataType="string", Description="The Network provider name.", Name="CellularProviderName", ParameterType="query")
public var cellularProviderName:String
/**
* The Mobile Country Code the device is currently located in.
*/
// @ApiMember(DataType="string", Description="The Mobile Country Code the device is currently located in.", Name="MobileCountryCode", ParameterType="query")
public var mobileCountryCode:String
/**
* The Mobile Network Code the device is currently using.
*/
// @ApiMember(DataType="string", Description="The Mobile Network Code the device is currently using.", Name="MobileNetworkCode", ParameterType="query")
public var mobileNetworkCode:String
/**
* The Language Code Identifier that represents the language used on the device.
*/
// @ApiMember(DataType="string", Description="The Language Code Identifier that represents the language used on the device.", Name="LanguageCodeIdentifier", ParameterType="query")
public var languageCodeIdentifier:String
/**
* The latitude the device was last located at.
*/
// @ApiMember(DataType="double", Description="The latitude the device was last located at.", Name="Latitude", ParameterType="query")
public var latitude:Double
/**
* The longitude the device was last located at.
*/
// @ApiMember(DataType="double", Description="The longitude the device was last located at.", Name="Longitude", ParameterType="query")
public var longitude:Double
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 /json/reply/RegisterDevice HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: application/json
Content-Type: application/json
Content-Length: length
{"ApplianceId":"00000000-0000-0000-0000-000000000000","DeviceId":"00000000-0000-0000-0000-000000000000","ManufacturerDeviceNumber":"String","MacAddress":"String","ModelName":"String","FormFactor":"String","Brand":"String","Dimensions":"String","DisplayResolutionWidthPixels":0,"DisplayResolutionHeightPixels":0,"DisplaySizeWidthInches":0,"DisplaySizeHeightInches":0,"OperatingSystem":"String","OperatingSystemVersion":"String","IpAddress":"String","Notes":"String","TotalMemorySize":0,"CellularProviderName":"String","ISOCountryCode":"String","MobileCountryCode":"String","MobileNetworkCode":"String","LanguageCodeIdentifier":"String","LastKnownTimeZone":"String","LastKnownTimeZoneOffset":"String","Latitude":0,"Longitude":0,"InstanceSeed":0,"InstanceCounterLastValue":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"DeviceId":"00000000-0000-0000-0000-000000000000","DeviceType":{"DeviceTypeId":"00000000-0000-0000-0000-000000000000","DeviceClassId":"00000000-0000-0000-0000-000000000000","DeviceClassName":"String","Brand":"String","ModelName":"String","FormFactor":"String","Dimensions":"String","DisplayResolutionWidthPixels":0,"DisplayResolutionHeightPixels":0,"DisplaySizeWidthInches":0,"DisplaySizeHeightInches":0},"CurrentHistory":{"DeviceHistoryId":"00000000-0000-0000-0000-000000000000","PrimaryDeviceHistoryDeviceConfigurationId":"00000000-0000-0000-0000-000000000000","DeviceName":"String","OperatingSystem":"String","OperatingSystemVersion":"String","IpAddress":"String","Notes":"String","TotalMemorySize":0,"CellularProviderName":"String","MobileCountryCode":"String","MobileNetworkCode":"String","LanguageCodeIdentifier":"String","Latitude":0,"Longitude":0},"ModelName":"String","ModelNumber":"String","SerialNumber":"String","ManufacturerDeviceNumber":"String","MacAddress":"String","InstanceSeed":0,"InstanceCounterLastValue":0,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}