import Foundation
import ServiceStack
/**
* Logs details of an event(crash,error,unexpected result) and the device status at the time of the event.
*/
// @Api(Description="Logs details of an event(crash,error,unexpected result) and the device status at the time of the event.")
public class LogDeviceStatus : Codable
{
/**
* Guid of the Appliance this Device is logging an event status for.
*/
// @ApiMember(DataType="Guid", Description="Guid of the Appliance this Device is logging an event status for.", IsRequired=true, Name="ApplianceId", ParameterType="query")
public var applianceId:String
/**
* Guid representing the saved Device
*/
// @ApiMember(DataType="Guid", Description="Guid representing the saved Device", IsRequired=true, Name="DeviceId", ParameterType="query")
public var deviceId: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
/**
* Name of the event we're logging.
*/
// @ApiMember(DataType="string", Description="Name of the event we're logging.", Name="EventName", ParameterType="query")
public var eventName:String
/**
* Details of the event up to (255 char).
*/
// @ApiMember(DataType="string", Description="Details of the event up to (255 char).", Name="EventDetail1", ParameterType="query")
public var eventDetail1:String
/**
* Details of the event up to (255 char).
*/
// @ApiMember(DataType="string", Description="Details of the event up to (255 char).", Name="EventDetail2", ParameterType="query")
public var eventDetail2:String
/**
* Details of the event up to (255 char).
*/
// @ApiMember(DataType="string", Description="Details of the event up to (255 char).", Name="EventDetail3", ParameterType="query")
public var eventDetail3:String
/**
* Details of the event up to (255 char).
*/
// @ApiMember(DataType="string", Description="Details of the event up to (255 char).", Name="EventDetail4", ParameterType="query")
public var eventDetail4:String
/**
* Details of the event up to (255 char).
*/
// @ApiMember(DataType="string", Description="Details of the event up to (255 char).", Name="EventDetail5", ParameterType="query")
public var eventDetail5:String
/**
* Details of the event up to (255 char).
*/
// @ApiMember(DataType="string", Description="Details of the event up to (255 char).", Name="Orientation", ParameterType="query")
public var orientation:String
/**
* The device internet connection status.
*/
// @ApiMember(DataType="string", Description="The device internet connection status.", Name="InternetConnectionStatus", ParameterType="query")
public var internetConnectionStatus:String
/**
* Unlimited text field for logging details of the event.
*/
// @ApiMember(DataType="string", Description="Unlimited text field for logging details of the event.", Name="Log", ParameterType="query")
public var log:String
/**
* Date and Time of the event.
*/
// @ApiMember(DataType="DateTime", Description="Date and Time of the event.", Name="Event", ParameterType="query")
public var event:Date
/**
* True if the device is in portrait mode.
*/
// @ApiMember(DataType="bool", Description="True if the device is in portrait mode.", Name="IsInPortrait", ParameterType="query")
public var isInPortrait:Bool
/**
* True if the device is in landscape mode.
*/
// @ApiMember(DataType="bool", Description="True if the device is in landscape mode.", Name="IsInLandscape", ParameterType="query")
public var isInLandscape:Bool
/**
* True if cellular data is enabled.
*/
// @ApiMember(DataType="bool", Description="True if cellular data is enabled.", Name="CellularDataEnabled", ParameterType="query")
public var cellularDataEnabled:Bool
/**
* True if data roaming is enabled.
*/
// @ApiMember(DataType="bool", Description="True if data roaming is enabled.", Name="DataRoamingEnabled", ParameterType="query")
public var dataRoamingEnabled:Bool
/**
* True if the network is available.
*/
// @ApiMember(DataType="bool", Description="True if the network is available.", Name="IsNetworkAvailable", ParameterType="query")
public var isNetworkAvailable:Bool
/**
* True if the device can send an sms.
*/
// @ApiMember(DataType="bool", Description="True if the device can send an sms.", Name="CanSendSMS", ParameterType="query")
public var canSendSMS:Bool
/**
* True if the battery is charging.
*/
// @ApiMember(DataType="bool", Description="True if the battery is charging.", Name="BatteryCharging", ParameterType="query")
public var batteryCharging:Bool
/**
* The amount of battery life left as a percentage.
*/
// @ApiMember(DataType="int", Description="The amount of battery life left as a percentage.", Name="BatteryLevel", ParameterType="query")
public var batteryLevel:Int
/**
* The Guid of a saved Media Object.
*/
// @ApiMember(DataType="Guid", Description="The Guid of a saved Media Object.", Name="MediaFileId1", ParameterType="query")
public var mediaFileId1:String
/**
* The Guid of a saved Media Object.
*/
// @ApiMember(DataType="Guid", Description="The Guid of a saved Media Object.", Name="MediaFileId2", ParameterType="query")
public var mediaFileId2:String
required public init(){}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /xml/reply/LogDeviceStatus HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<LogDeviceStatus xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
<ApplianceId>00000000-0000-0000-0000-000000000000</ApplianceId>
<BatteryCharging>false</BatteryCharging>
<BatteryLevel>0</BatteryLevel>
<CanSendSMS>false</CanSendSMS>
<CellularDataEnabled>false</CellularDataEnabled>
<DataRoamingEnabled>false</DataRoamingEnabled>
<DeviceId>00000000-0000-0000-0000-000000000000</DeviceId>
<Event>0001-01-01T00:00:00</Event>
<EventDetail1>String</EventDetail1>
<EventDetail2>String</EventDetail2>
<EventDetail3>String</EventDetail3>
<EventDetail4>String</EventDetail4>
<EventDetail5>String</EventDetail5>
<EventName>String</EventName>
<InternetConnectionStatus>String</InternetConnectionStatus>
<IsInLandscape>false</IsInLandscape>
<IsInPortrait>false</IsInPortrait>
<IsNetworkAvailable>false</IsNetworkAvailable>
<Latitude>0</Latitude>
<Log>String</Log>
<Longitude>0</Longitude>
<MediaFileId1>00000000-0000-0000-0000-000000000000</MediaFileId1>
<MediaFileId2>00000000-0000-0000-0000-000000000000</MediaFileId2>
<Orientation>String</Orientation>
</LogDeviceStatus>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<ResponseStatus xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<ErrorCode>String</ErrorCode>
<Message>String</Message>
<StackTrace>String</StackTrace>
<Errors>
<ResponseError>
<ErrorCode>String</ErrorCode>
<FieldName>String</FieldName>
<Message>String</Message>
<Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>String</d4p1:Key>
<d4p1:Value>String</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</Meta>
</ResponseError>
</Errors>
<Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringstring>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value>String</d2p1:Value>
</d2p1:KeyValueOfstringstring>
</Meta>
</ResponseStatus>