/*
* 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 WebhookSubscriptionRequest {
#[serde(rename = "url")]
pub url: String,
#[serde(rename = "events")]
pub events: Vec<Events>,
#[serde(rename = "filter_game", skip_serializing_if = "Option::is_none")]
pub filter_game: Option<String>,
#[serde(rename = "filter_league", skip_serializing_if = "Option::is_none")]
pub filter_league: Option<String>,
#[serde(rename = "filter_tournament", skip_serializing_if = "Option::is_none")]
pub filter_tournament: Option<String>,
}
impl WebhookSubscriptionRequest {
pub fn new(url: String, events: Vec<Events>) -> WebhookSubscriptionRequest {
WebhookSubscriptionRequest {
url,
events,
filter_game: None,
filter_league: None,
filter_tournament: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Events {
#[serde(rename = "match.scheduled")]
MatchScheduled,
#[serde(rename = "match.started")]
MatchStarted,
#[serde(rename = "match.completed")]
MatchCompleted,
#[serde(rename = "tournament.bracket_updated")]
TournamentBracketUpdated,
}
impl Default for Events {
fn default() -> Events {
Self::MatchScheduled
}
}