Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Eros.Subtle.Canvara.WebAPIModel.ServiceModel
Namespace Global
Namespace Eros.Subtle.Canvara.WebAPIModel.ServiceModel
'''<Summary>
'''Logs details of an event(crash,error,unexpected result) and the device status at the time of the event.
'''</Summary>
<Api(Description:="Logs details of an event(crash,error,unexpected result) and the device status at the time of the event.")>
Public Partial Class LogDeviceStatus
'''<Summary>
'''Guid of the Appliance this Device is logging an event status for.
'''</Summary>
<ApiMember(DataType:="Guid", Description:="Guid of the Appliance this Device is logging an event status for.", IsRequired:=true, Name:="ApplianceId", ParameterType:="query")>
Public Overridable Property ApplianceId As Guid
'''<Summary>
'''Guid representing the saved Device
'''</Summary>
<ApiMember(DataType:="Guid", Description:="Guid representing the saved Device", IsRequired:=true, Name:="DeviceId", ParameterType:="query")>
Public Overridable Property DeviceId As Guid
'''<Summary>
'''The latitude the device was last located at.
'''</Summary>
<ApiMember(DataType:="double", Description:="The latitude the device was last located at.", IsRequired:=true, Name:="Latitude", ParameterType:="query")>
Public Overridable Property Latitude As Double
'''<Summary>
'''The longitude the device was last located at.
'''</Summary>
<ApiMember(DataType:="double", Description:="The longitude the device was last located at.", IsRequired:=true, Name:="Longitude", ParameterType:="query")>
Public Overridable Property Longitude As Double
'''<Summary>
'''Name of the event we're logging.
'''</Summary>
<ApiMember(DataType:="string", Description:="Name of the event we're logging.", Name:="EventName", ParameterType:="query")>
Public Overridable Property EventName As String
'''<Summary>
'''Details of the event up to (255 char).
'''</Summary>
<ApiMember(DataType:="string", Description:="Details of the event up to (255 char).", Name:="EventDetail1", ParameterType:="query")>
Public Overridable Property EventDetail1 As String
'''<Summary>
'''Details of the event up to (255 char).
'''</Summary>
<ApiMember(DataType:="string", Description:="Details of the event up to (255 char).", Name:="EventDetail2", ParameterType:="query")>
Public Overridable Property EventDetail2 As String
'''<Summary>
'''Details of the event up to (255 char).
'''</Summary>
<ApiMember(DataType:="string", Description:="Details of the event up to (255 char).", Name:="EventDetail3", ParameterType:="query")>
Public Overridable Property EventDetail3 As String
'''<Summary>
'''Details of the event up to (255 char).
'''</Summary>
<ApiMember(DataType:="string", Description:="Details of the event up to (255 char).", Name:="EventDetail4", ParameterType:="query")>
Public Overridable Property EventDetail4 As String
'''<Summary>
'''Details of the event up to (255 char).
'''</Summary>
<ApiMember(DataType:="string", Description:="Details of the event up to (255 char).", Name:="EventDetail5", ParameterType:="query")>
Public Overridable Property EventDetail5 As String
'''<Summary>
'''Details of the event up to (255 char).
'''</Summary>
<ApiMember(DataType:="string", Description:="Details of the event up to (255 char).", Name:="Orientation", ParameterType:="query")>
Public Overridable Property Orientation As String
'''<Summary>
'''The device internet connection status.
'''</Summary>
<ApiMember(DataType:="string", Description:="The device internet connection status.", Name:="InternetConnectionStatus", ParameterType:="query")>
Public Overridable Property InternetConnectionStatus As String
'''<Summary>
'''Unlimited text field for logging details of the event.
'''</Summary>
<ApiMember(DataType:="string", Description:="Unlimited text field for logging details of the event.", Name:="Log", ParameterType:="query")>
Public Overridable Property Log As String
'''<Summary>
'''Date and Time of the event.
'''</Summary>
<ApiMember(DataType:="DateTime", Description:="Date and Time of the event.", Name:="Event", ParameterType:="query")>
Public Overridable Property [Event] As Date
'''<Summary>
'''True if the device is in portrait mode.
'''</Summary>
<ApiMember(DataType:="bool", Description:="True if the device is in portrait mode.", Name:="IsInPortrait", ParameterType:="query")>
Public Overridable Property IsInPortrait As Boolean
'''<Summary>
'''True if the device is in landscape mode.
'''</Summary>
<ApiMember(DataType:="bool", Description:="True if the device is in landscape mode.", Name:="IsInLandscape", ParameterType:="query")>
Public Overridable Property IsInLandscape As Boolean
'''<Summary>
'''True if cellular data is enabled.
'''</Summary>
<ApiMember(DataType:="bool", Description:="True if cellular data is enabled.", Name:="CellularDataEnabled", ParameterType:="query")>
Public Overridable Property CellularDataEnabled As Boolean
'''<Summary>
'''True if data roaming is enabled.
'''</Summary>
<ApiMember(DataType:="bool", Description:="True if data roaming is enabled.", Name:="DataRoamingEnabled", ParameterType:="query")>
Public Overridable Property DataRoamingEnabled As Boolean
'''<Summary>
'''True if the network is available.
'''</Summary>
<ApiMember(DataType:="bool", Description:="True if the network is available.", Name:="IsNetworkAvailable", ParameterType:="query")>
Public Overridable Property IsNetworkAvailable As Boolean
'''<Summary>
'''True if the device can send an sms.
'''</Summary>
<ApiMember(DataType:="bool", Description:="True if the device can send an sms.", Name:="CanSendSMS", ParameterType:="query")>
Public Overridable Property CanSendSMS As Boolean
'''<Summary>
'''True if the battery is charging.
'''</Summary>
<ApiMember(DataType:="bool", Description:="True if the battery is charging.", Name:="BatteryCharging", ParameterType:="query")>
Public Overridable Property BatteryCharging As Boolean
'''<Summary>
'''The amount of battery life left as a percentage.
'''</Summary>
<ApiMember(DataType:="int", Description:="The amount of battery life left as a percentage.", Name:="BatteryLevel", ParameterType:="query")>
Public Overridable Property BatteryLevel As Integer
'''<Summary>
'''The Guid of a saved Media Object.
'''</Summary>
<ApiMember(DataType:="Guid", Description:="The Guid of a saved Media Object.", Name:="MediaFileId1", ParameterType:="query")>
Public Overridable Property MediaFileId1 As Guid
'''<Summary>
'''The Guid of a saved Media Object.
'''</Summary>
<ApiMember(DataType:="Guid", Description:="The Guid of a saved Media Object.", Name:="MediaFileId2", ParameterType:="query")>
Public Overridable Property MediaFileId2 As Guid
End Class
'''<Summary>
'''Logs multiple device event details. Details include an event(crash,error,unexpected result) and the device status at the time of the event.
'''</Summary>
<Api(Description:="Logs multiple device event details. Details include an event(crash,error,unexpected result) and the device status at the time of the event.")>
Public Partial Class LogDeviceStatuses
'''<Summary>
'''A list of logged event statuses for a device.
'''</Summary>
<ApiMember(DataType:="int", Description:="A list of logged event statuses for a device.", IsRequired:=true, Name:="DeviceStatuses", ParameterType:="query")>
Public Overridable Property DeviceStatuses As List(Of LogDeviceStatus) = New List(Of LogDeviceStatus)
End Class
End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /jsonl/reply/LogDeviceStatuses HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"DeviceStatuses":[{"ApplianceId":"00000000-0000-0000-0000-000000000000","DeviceId":"00000000-0000-0000-0000-000000000000","Latitude":0,"Longitude":0,"EventName":"String","EventDetail1":"String","EventDetail2":"String","EventDetail3":"String","EventDetail4":"String","EventDetail5":"String","Orientation":"String","InternetConnectionStatus":"String","Log":"String","Event":"0001-01-01T00:00:00.0000000","IsInPortrait":false,"IsInLandscape":false,"CellularDataEnabled":false,"DataRoamingEnabled":false,"IsNetworkAvailable":false,"CanSendSMS":false,"BatteryCharging":false,"BatteryLevel":0,"MediaFileId1":"00000000-0000-0000-0000-000000000000","MediaFileId2":"00000000-0000-0000-0000-000000000000"}]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}