Betting.WebApi

<back to all web services

NotifyFrontend

The following routes are available for this service:
All Verbs/cmd/notify/frontend/
# frozen_string_literal: true
# encoding: utf-8


require 'json'
require 'servicestack'


module SlipSubmissionStatus
    PENDING = 0
    ACCEPTED = 2
    REJECTED = 3
    FAILED = 4
end

class BettingApp
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :name
    # @return [String]
    attr_accessor :version

    def self.properties
        {
            name: { name: 'name' },
            version: { name: 'version' },
        }
    end

end

class Ref
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :id
    # @return [String]
    attr_accessor :val

    def self.properties
        {
            id: { name: 'id' },
            val: { name: 'val' },
        }
    end

end

class RefEx < Ref
    # @return [RecordDictionary]
    attr_accessor :data

    def self.properties
        {
            data: { name: 'data', type: RecordDictionary },
        }
    end

end

class Origin
    include ServiceStack::DTO

    # @return [BettingApp]
    attr_accessor :application
    # @return [String]
    attr_accessor :ip
    # @return [RefEx]
    attr_accessor :organization
    # @return [Ref]
    attr_accessor :region
    # @return [Ref]
    attr_accessor :location_group
    # @return [RefEx]
    attr_accessor :location
    # @return [RefEx]
    attr_accessor :device
    # @return [Ref]
    attr_accessor :clerk

    def self.properties
        {
            application: { name: 'application', type: BettingApp },
            ip: { name: 'ip' },
            organization: { name: 'organization', type: RefEx },
            region: { name: 'region', type: Ref },
            location_group: { name: 'locationGroup', type: Ref },
            location: { name: 'location', type: RefEx },
            device: { name: 'device', type: RefEx },
            clerk: { name: 'clerk', type: Ref },
        }
    end

end

class AcceptedSlipInfo
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :id
    # @return [Origin]
    attr_accessor :origin
    # @return [Ref]
    attr_accessor :bettor
    # @return [SlipSubmissionStatus]
    attr_accessor :slip_submission_status
    # @return [RecordDictionary]
    attr_accessor :payload

    def self.properties
        {
            id: { name: 'id' },
            origin: { name: 'origin', type: Origin },
            bettor: { name: 'bettor', type: Ref },
            slip_submission_status: { name: 'slipSubmissionStatus' },
            payload: { name: 'payload', type: RecordDictionary },
        }
    end

end

class ErrorInfo
    include ServiceStack::DTO

    # @return [Origin]
    attr_accessor :origin
    # @return [String]
    attr_accessor :error_code
    # @return [String]
    attr_accessor :error_description
    # @return [Dictionary]
    attr_accessor :payload

    def self.properties
        {
            origin: { name: 'origin', type: Origin },
            error_code: { name: 'errorCode' },
            error_description: { name: 'errorDescription' },
            payload: { name: 'payload' },
        }
    end

end

class ConfirmationInfo
    include ServiceStack::DTO

    # @return [Ref]
    attr_accessor :bettor
    # @return [Origin]
    attr_accessor :origin
    # @return [String]
    attr_accessor :confirmation_code
    # @return [String]
    attr_accessor :confirmation_description
    # @return [Dictionary]
    attr_accessor :payload

    def self.properties
        {
            bettor: { name: 'bettor', type: Ref },
            origin: { name: 'origin', type: Origin },
            confirmation_code: { name: 'confirmationCode' },
            confirmation_description: { name: 'confirmationDescription' },
            payload: { name: 'payload' },
        }
    end

end

class WalletTransactionInfo
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :reason

    def self.properties
        {
            reason: { name: 'reason' },
        }
    end

end

class WalletUpdateInfo
    include ServiceStack::DTO

    # @return [Ref]
    attr_accessor :bettor
    # @return [Origin]
    attr_accessor :origin
    # @return [WalletTransactionInfo]
    attr_accessor :transaction_info

    def self.properties
        {
            bettor: { name: 'bettor', type: Ref },
            origin: { name: 'origin', type: Origin },
            transaction_info: { name: 'transactionInfo', type: WalletTransactionInfo },
        }
    end

end

class UserNotificationsUpdatedInfo
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :id

    def self.properties
        {
            id: { name: 'id' },
        }
    end

end

class ApplicationEventsUpdated
    include ServiceStack::DTO

end

class SlipDeliveryIssueRefundRequestUpdated
    include ServiceStack::DTO

end

class NotifyFrontend
    include ServiceStack::DTO

    # @return [AcceptedSlipInfo]
    attr_accessor :accepted_slip_info
    # @return [ErrorInfo]
    attr_accessor :error_info
    # @return [ConfirmationInfo]
    attr_accessor :confirmation_info
    # @return [String]
    attr_accessor :slip_cancellation_id
    # @return [WalletUpdateInfo]
    attr_accessor :wallet_updated_info
    # @return [UserNotificationsUpdatedInfo]
    attr_accessor :user_notifications_updated
    # @return [ApplicationEventsUpdated]
    attr_accessor :application_events_updated
    # @return [SlipDeliveryIssueRefundRequestUpdated]
    attr_accessor :slip_delivery_issue_refund_request_updated

    def self.properties
        {
            accepted_slip_info: { name: 'acceptedSlipInfo', type: AcceptedSlipInfo },
            error_info: { name: 'errorInfo', type: ErrorInfo },
            confirmation_info: { name: 'confirmationInfo', type: ConfirmationInfo },
            slip_cancellation_id: { name: 'slipCancellationId' },
            wallet_updated_info: { name: 'walletUpdatedInfo', type: WalletUpdateInfo },
            user_notifications_updated: { name: 'userNotificationsUpdated', type: UserNotificationsUpdatedInfo },
            application_events_updated: { name: 'applicationEventsUpdated', type: ApplicationEventsUpdated },
            slip_delivery_issue_refund_request_updated: { name: 'slipDeliveryIssueRefundRequestUpdated', type: SlipDeliveryIssueRefundRequestUpdated },
        }
    end

    def response_type() = ServiceStack::ResponseStatus
    def get_type_name() = 'NotifyFrontend'
end

class RecordDictionary < Hash
end

Ruby NotifyFrontend DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /cmd/notify/frontend/ HTTP/1.1 
Host: api.bettor.webhop.biz 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"acceptedSlipInfo":{"id":"String","origin":{"application":{"name":"String","version":"String"},"ip":"String","organization":{"data":{"String":"String"},"id":"String","val":"String"},"region":{"id":"String","val":"String"},"locationGroup":{"id":"String","val":"String"},"location":{"data":{"String":"String"},"id":"String","val":"String"},"device":{"data":{"String":"String"},"id":"String","val":"String"},"clerk":{"id":"String","val":"String"}},"bettor":{"id":"String","val":"String"},"slipSubmissionStatus":0,"payload":{"String":"String"}},"errorInfo":{"origin":{"application":{"name":"String","version":"String"},"ip":"String","organization":{"data":{"String":"String"},"id":"String","val":"String"},"region":{"id":"String","val":"String"},"locationGroup":{"id":"String","val":"String"},"location":{"data":{"String":"String"},"id":"String","val":"String"},"device":{"data":{"String":"String"},"id":"String","val":"String"},"clerk":{"id":"String","val":"String"}},"errorCode":"String","errorDescription":"String","payload":{"String":"String"}},"confirmationInfo":{"bettor":{"id":"String","val":"String"},"origin":{"application":{"name":"String","version":"String"},"ip":"String","organization":{"data":{"String":"String"},"id":"String","val":"String"},"region":{"id":"String","val":"String"},"locationGroup":{"id":"String","val":"String"},"location":{"data":{"String":"String"},"id":"String","val":"String"},"device":{"data":{"String":"String"},"id":"String","val":"String"},"clerk":{"id":"String","val":"String"}},"confirmationCode":"String","confirmationDescription":"String","payload":{"String":"String"}},"slipCancellationId":"String","walletUpdatedInfo":{"bettor":{"id":"String","val":"String"},"origin":{"application":{"name":"String","version":"String"},"ip":"String","organization":{"data":{"String":"String"},"id":"String","val":"String"},"region":{"id":"String","val":"String"},"locationGroup":{"id":"String","val":"String"},"location":{"data":{"String":"String"},"id":"String","val":"String"},"device":{"data":{"String":"String"},"id":"String","val":"String"},"clerk":{"id":"String","val":"String"}},"transactionInfo":{"reason":"String"}},"userNotificationsUpdated":{"id":"String"},"applicationEventsUpdated":{},"slipDeliveryIssueRefundRequestUpdated":{}}
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"}}