Betting.WebApi

<back to all web services

GetDeviceConfiguration

The following routes are available for this service:
All Verbs/qry/configurations/devices
const std = @import("std");

pub const DeviceOperationalStatus = enum(i32) {
    Active = 1,
    Deactivated = 2,
    Retired = 3,
};

pub const Ref = struct {
    id: ?[]const u8 = null,
    val: ?[]const u8 = null,
};

pub const ProductReference = struct {
    id: ?[]const u8 = null,
    value: ?[]const u8 = null,
    category: ?[]const u8 = null,
    productProvider: ?Ref = null,
};

pub const ProductInstanceRef = struct {
    id: ?[]const u8 = null,
    name: ?[]const u8 = null,
    title: ?[]const u8 = null,
    product: ?ProductReference = null,
};

pub const GPSCoordinates = struct {
    lat: f64 = 0,
    lng: f64 = 0,
};

pub const Address = struct {
    street: ?[]const u8 = null,
    city: ?[]const u8 = null,
    state: ?[]const u8 = null,
    postalCode: ?[]const u8 = null,
    country: ?Ref = null,
    gps: ?GPSCoordinates = null,
    data: ?RecordDictionary = null,
};

pub const LocationRef = struct {
    id: ?[]const u8 = null,
    name: ?[]const u8 = null,
    group: ?Ref = null,
    region: ?Ref = null,
    address: ?Address = null,
    integrationsData: ?RecordDictionary = null,
};

pub const OrganizationRef = struct {
    id: ?[]const u8 = null,
    name: ?[]const u8 = null,
    address: ?Address = null,
    integrationsData: ?RecordDictionary = null,
};

pub const DeviceConfiguration = struct {
    id: ?[]const u8 = null,
    name: ?[]const u8 = null,
    isActive: bool = false,
    isRetired: bool = false,
    operationalStatus: ?DeviceOperationalStatus = null,
    productInstances: ?RecordList = null,
    timeZone: ?Ref = null,
    currency: ?Ref = null,
    language: ?Ref = null,
    location: ?LocationRef = null,
    organization: ?OrganizationRef = null,
};

pub const GetDeviceConfiguration = struct {
    id: ?[]const u8 = null,
};

pub fn RecordList(comptime T: type) type {
    _ = T;
    return struct {
        pub const ss_collection = "items";

        items: []T = &.{},
    };

    pub fn RecordDictionary(comptime TKey: type, comptime TVal: type) type {
        _ = TKey;
        _ = TVal;
        return struct {};
    }

Zig GetDeviceConfiguration 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/configurations/devices 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

{
	id: String,
	name: String,
	isActive: False,
	isRetired: False,
	operationalStatus: 2,
	productInstances: 
	[
		{
			id: String,
			name: String,
			title: String,
			product: 
			{
				id: String,
				value: String,
				category: String,
				productProvider: 
				{
					id: String,
					val: String
				}
			}
		}
	],
	timeZone: 
	{
		id: String,
		val: String
	},
	currency: 
	{
		id: String,
		val: String
	},
	language: 
	{
		id: String,
		val: String
	},
	location: 
	{
		id: String,
		name: String,
		group: 
		{
			id: String,
			val: String
		},
		region: 
		{
			id: String,
			val: String
		},
		address: 
		{
			street: String,
			city: String,
			state: String,
			postalCode: String,
			country: 
			{
				id: String,
				val: String
			},
			gps: 
			{
				lat: 0,
				lng: 0
			},
			data: 
			{
				String: String
			}
		},
		integrationsData: 
		{
			String: String
		}
	},
	organization: 
	{
		id: String,
		name: String,
		address: 
		{
			street: String,
			city: String,
			state: String,
			postalCode: String,
			country: 
			{
				id: String,
				val: String
			},
			gps: 
			{
				lat: 0,
				lng: 0
			},
			data: 
			{
				String: String
			}
		},
		integrationsData: 
		{
			String: String
		}
	}
}