| All Verbs | /qry/users/notifications |
|---|
# frozen_string_literal: true
# encoding: utf-8
require 'json'
require 'servicestack'
module Severity
SUCCESS = 0
INFO = 1
WARNING = 2
ERROR = 3
end
module NotificationType
DEFAULT = 0
SLIP_DELIVERY_CONFIRMATION_REQUEST = 1
SLIP_DELIVERY_ISSUE_RESOLVED = 2
end
class Notification
include ServiceStack::DTO
# @return [Severity]
attr_accessor :severity
# @return [NotificationType]
attr_accessor :type
# @return [RecordDictionary]
attr_accessor :data
def self.properties
{
severity: { name: 'severity' },
type: { name: 'type' },
data: { name: 'data', type: RecordDictionary },
}
end
end
class UserNotification
include ServiceStack::DTO
# @return [String]
attr_accessor :id
# @return [Notification]
attr_accessor :notification
# @return [DateTime]
attr_accessor :dispatched_at
def self.properties
{
id: { name: 'id' },
notification: { name: 'notification', type: Notification },
dispatched_at: { name: 'dispatchedAt', type: DateTime },
}
end
end
class UserNotifications
include ServiceStack::DTO
# @return [TrueClass]
attr_accessor :is_overflown
# @return [String]
attr_accessor :id
# @return [Integer]
attr_accessor :n
# @return [Integer]
attr_accessor :s
# @return [Integer]
attr_accessor :i
# @return [Integer]
attr_accessor :w
# @return [Integer]
attr_accessor :e
# @return [Dictionary]
attr_accessor :notifications
def self.properties
{
is_overflown: { name: 'isOverflown' },
id: { name: 'id' },
n: { name: 'n' },
s: { name: 's' },
i: { name: 'i' },
w: { name: 'w' },
e: { name: 'e' },
notifications: { name: 'notifications', type: { String => UserNotification } },
}
end
end
class GetUserNotifications
include ServiceStack::DTO
# @return [String]
attr_accessor :id
def self.properties
{
id: { name: 'id' },
}
end
def response_type() = UserNotifications
def get_type_name() = 'GetUserNotifications'
end
class RecordDictionary < Hash
end
Ruby GetUserNotifications DTOs
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 /qry/users/notifications HTTP/1.1
Host: api.bettor.webhop.biz
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GetUserNotifications xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Betting.WebApi.ServiceModel">
<Id>String</Id>
</GetUserNotifications>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<UserNotifications xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Betting.ReadModel">
<Id>String</Id>
<Notifications xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringUserNotifications.UserNotificationICRnA2uO>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value>
<DispatchedAt>0001-01-01T00:00:00</DispatchedAt>
<Id>String</Id>
<Notification xmlns:d5p1="http://schemas.datacontract.org/2004/07/Betting.Common">
<d5p1:Data>
<d2p1:KeyValueOfstringstring>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value>String</d2p1:Value>
</d2p1:KeyValueOfstringstring>
</d5p1:Data>
<d5p1:Severity>Success</d5p1:Severity>
<d5p1:Type>Default</d5p1:Type>
</Notification>
</d2p1:Value>
</d2p1:KeyValueOfstringUserNotifications.UserNotificationICRnA2uO>
</Notifications>
</UserNotifications>