| All Verbs | /qry/users/notifications |
|---|
import Foundation
import ServiceStack
public class GetUserNotifications : Codable
{
public var id:String
required public init(){}
}
public class UserNotifications : Codable
{
public var id:String
public var n:Int
public var s:Int
public var i:Int
public var w:Int
public var e:Int
public var notifications:[String:UserNotification]
required public init(){}
}
public class UserNotification : Codable
{
public var id:String
public var notification:Notification
public var dispatchedAt:Date
required public init(){}
}
public class Notification : Codable
{
public var severity:Severity
public var type:NotificationType
public var data:RecordDictionary<String, String>
required public init(){}
}
public enum Severity : Int, Codable
{
case Success = 0
case Info = 1
case Warning = 2
case Error = 3
}
public enum NotificationType : Int, Codable
{
case Default = 0
case SlipDeliveryConfirmationRequest = 1
case SlipDeliveryIssueResolved = 2
}
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)
}
}
Swift GetUserNotifications 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/users/notifications HTTP/1.1
Host: api.sbbet.ath.cx
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,
n: 1,
s: 1,
i: 0,
w: 0,
e: 0,
notifications:
{
String:
{
id: String,
notification:
{
severity: 0,
type: 0,
data:
{
String: String
}
},
dispatchedAt: 0001-01-01
}
}
}