Betting.WebApi

<back to all web services

GetUserNotifications

Requires Authentication
The following routes are available for this service:
All Verbs/qry/users/notifications
#![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, Copy, PartialEq, Eq, Hash, Default)]
#[repr(i32)]
pub enum Severity {
    #[default]
    Success = 0,
    Info = 1,
    Warning = 2,
    Error = 3,
}

#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[repr(i32)]
pub enum NotificationType {
    #[default]
    Default = 0,
    SlipDeliveryConfirmationRequest = 1,
    SlipDeliveryIssueResolved = 2,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct Notification {
    pub severity: Severity,
    pub r#type: NotificationType,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<RecordDictionary>,
}

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

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct UserNotifications {
    #[serde(rename = "isOverflown")]
    pub is_overflown: bool,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    pub n: i32,
    pub s: i32,
    pub i: i32,
    pub w: i32,
    pub e: i32,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub notifications: Option<HashMap<String, UserNotification>>,
}

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

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct RecordDictionary(pub HashMap<TKey, TVal>);

Rust GetUserNotifications DTOs

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

HTTP + 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.bettor.webhop.biz 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	id: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	isOverflown: False,
	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
		}
	}
}