Betting.WebApi

<back to all web services

GetSelfServiceDeviceBettingSession

Requires Authentication
The following routes are available for this service:
GET/qry/self-service-device-betting-sessions/{Id}
#![allow(
    dead_code,
    non_camel_case_types,
    non_snake_case,
    clippy::upper_case_acronyms
)]

use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct Ref {
    pub id: String,
    pub val: String,
}

#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[repr(i32)]
pub enum SessionStatus {
    #[default]
    Opening = 1,
    Open = 2,
    Ending = 3,
    Ended = 4,
    Rejected = 5,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct Money {
    pub amount: f64,
    pub currency: String,
}

#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[repr(i32)]
pub enum TopUpStatus {
    #[default]
    Pending = 1,
    Completed = 2,
    Failed = 3,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct SessionTopUp {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub amount: Option<Money>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub clerk: Option<Ref>,
    pub status: TopUpStatus,
    #[serde(rename = "failureReason")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub failure_reason: Option<String>,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct SelfServiceDeviceBettingSession {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub device: Option<Ref>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub location: Option<Ref>,
    pub status: SessionStatus,
    #[serde(rename = "startedAt")]
    pub started_at: String,
    #[serde(rename = "issuedByClerk")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub issued_by_clerk: Option<Ref>,
    #[serde(rename = "patronName")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub patron_name: Option<String>,
    #[serde(rename = "initialCredit")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub initial_credit: Option<Money>,
    #[serde(rename = "topUps")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub top_ups: Option<RecordList>,
    #[serde(rename = "payoutId")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub payout_id: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub payout: Option<Money>,
    #[serde(rename = "rejectionReason")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub rejection_reason: Option<String>,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct GetSelfServiceDeviceBettingSession {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct RecordList(pub Vec<T>);

Rust GetSelfServiceDeviceBettingSession DTOs

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

HTTP + XML

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

GET /qry/self-service-device-betting-sessions/{Id} HTTP/1.1 
Host: api.testenv.webhop.biz 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<SelfServiceDeviceBettingSession xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Betting.ReadModel">
  <Device xmlns:d2p1="http://schemas.datacontract.org/2004/07/Starnet.Common">
    <d2p1:_x003C_Id_x003E_k__BackingField>String</d2p1:_x003C_Id_x003E_k__BackingField>
    <d2p1:_x003C_Val_x003E_k__BackingField>String</d2p1:_x003C_Val_x003E_k__BackingField>
  </Device>
  <Id>String</Id>
  <InitialCredit xmlns:d2p1="http://schemas.datacontract.org/2004/07/Starnet.Common">
    <d2p1:Amount>0</d2p1:Amount>
    <d2p1:Currency>String</d2p1:Currency>
  </InitialCredit>
  <IssuedByClerk xmlns:d2p1="http://schemas.datacontract.org/2004/07/Starnet.Common">
    <d2p1:_x003C_Id_x003E_k__BackingField>String</d2p1:_x003C_Id_x003E_k__BackingField>
    <d2p1:_x003C_Val_x003E_k__BackingField>String</d2p1:_x003C_Val_x003E_k__BackingField>
  </IssuedByClerk>
  <Location xmlns:d2p1="http://schemas.datacontract.org/2004/07/Starnet.Common">
    <d2p1:_x003C_Id_x003E_k__BackingField>String</d2p1:_x003C_Id_x003E_k__BackingField>
    <d2p1:_x003C_Val_x003E_k__BackingField>String</d2p1:_x003C_Val_x003E_k__BackingField>
  </Location>
  <PatronName>String</PatronName>
  <Payout xmlns:d2p1="http://schemas.datacontract.org/2004/07/Starnet.Common">
    <d2p1:Amount>0</d2p1:Amount>
    <d2p1:Currency>String</d2p1:Currency>
  </Payout>
  <PayoutId>String</PayoutId>
  <RejectionReason>String</RejectionReason>
  <StartedAt>0001-01-01T00:00:00</StartedAt>
  <Status>Opening</Status>
  <TopUps>
    <SessionTopUp>
      <Amount xmlns:d4p1="http://schemas.datacontract.org/2004/07/Starnet.Common">
        <d4p1:Amount>0</d4p1:Amount>
        <d4p1:Currency>String</d4p1:Currency>
      </Amount>
      <Clerk xmlns:d4p1="http://schemas.datacontract.org/2004/07/Starnet.Common">
        <d4p1:_x003C_Id_x003E_k__BackingField>String</d4p1:_x003C_Id_x003E_k__BackingField>
        <d4p1:_x003C_Val_x003E_k__BackingField>String</d4p1:_x003C_Val_x003E_k__BackingField>
      </Clerk>
      <FailureReason>String</FailureReason>
      <Id>String</Id>
      <Status>Pending</Status>
    </SessionTopUp>
  </TopUps>
</SelfServiceDeviceBettingSession>