/*
* Stadar Esports Data API
*
* Read-only, betting-friendly esports data across all major competitive titles. Flat-tier pricing (no per-game gates), Polar- billed subscriptions (Merchant of Record), sandbox keys for evaluation. See https://stadar.net for tier pricing. All endpoints under `/v1/...`. The version in `info.version` matches the URL prefix; non-breaking field additions ship in `/v1`, breaking changes get a `/v2`. We commit to 24 months of `/v1` support after `/v2` ships. Times are UTC end-to-end (RFC 3339). Localization is the client's problem. Cursors are opaque base64 strings; treat them as such.
*
* The version of the OpenAPI document: v1
* Contact: api@stadar.net
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AccountCreateKey201Response {
#[serde(rename = "id")]
pub id: i64,
#[serde(rename = "name")]
pub name: String,
/// First 8 chars of the raw key (display hint only).
#[serde(rename = "prefix")]
pub prefix: String,
#[serde(rename = "created_at")]
pub created_at: chrono::DateTime<chrono::FixedOffset>,
#[serde(rename = "last_used_at", skip_serializing_if = "Option::is_none")]
pub last_used_at: Option<chrono::DateTime<chrono::FixedOffset>>,
/// The full secret. Shown ONCE.
#[serde(rename = "raw_key", skip_serializing_if = "Option::is_none")]
pub raw_key: Option<String>,
#[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
pub mode: Option<Mode>,
}
impl AccountCreateKey201Response {
pub fn new(id: i64, name: String, prefix: String, created_at: chrono::DateTime<chrono::FixedOffset>) -> AccountCreateKey201Response {
AccountCreateKey201Response {
id,
name,
prefix,
created_at,
last_used_at: None,
raw_key: None,
mode: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Mode {
#[serde(rename = "live")]
Live,
#[serde(rename = "sandbox")]
Sandbox,
}
impl Default for Mode {
fn default() -> Mode {
Self::Live
}
}