#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::value::Data;
use jacquard_derive::{IntoStatic, open_union};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Address<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub addr: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub country_code: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub postal_code: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Coordinates<S: BosStr = DefaultStr> {
pub lat: i64,
pub lng: i64,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct EventComponent<S: BosStr = DefaultStr> {
pub data: Data<S>,
pub r#type: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct EventInstance<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub end: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub start: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<Data<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub venue_ids: Option<Vec<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum EventStatus<S: BosStr = DefaultStr> {
Planned,
Uncertain,
Postponed,
Cancelled,
Suspended,
Other(S),
}
impl<S: BosStr> EventStatus<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Planned => "planned",
Self::Uncertain => "uncertain",
Self::Postponed => "postponed",
Self::Cancelled => "cancelled",
Self::Suspended => "suspended",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"planned" => Self::Planned,
"uncertain" => Self::Uncertain,
"postponed" => Self::Postponed,
"cancelled" => Self::Cancelled,
"suspended" => Self::Suspended,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> AsRef<str> for EventStatus<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> core::fmt::Display for EventStatus<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> Serialize for EventStatus<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for EventStatus<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr> jacquard_common::IntoStatic for EventStatus<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = EventStatus<S::Output>;
fn into_static(self) -> Self::Output {
match self {
EventStatus::Planned => EventStatus::Planned,
EventStatus::Uncertain => EventStatus::Uncertain,
EventStatus::Postponed => EventStatus::Postponed,
EventStatus::Cancelled => EventStatus::Cancelled,
EventStatus::Suspended => EventStatus::Suspended,
EventStatus::Other(v) => EventStatus::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct OnlineVenue<S: BosStr = DefaultStr> {
pub id: S,
pub name: Data<S>,
pub r#type: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct PhysicalVenue<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub address: Option<Data<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub coordinates: Option<Data<S>>,
pub id: S,
pub name: Data<S>,
pub r#type: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct UnknownVenue<S: BosStr = DefaultStr> {
pub id: S,
pub name: Data<S>,
pub r#type: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Event<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub components: Option<Vec<Data<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub instances: Option<Vec<Data<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub label: Option<Data<S>>,
pub name: Data<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<Data<S>>,
pub v: i64,
#[serde(skip_serializing_if = "Option::is_none")]
pub venues: Option<Vec<EventVenuesItem<S>>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum EventVenuesItem<S: BosStr = DefaultStr> {}
impl<S: BosStr> LexiconSchema for Address<S> {
fn nsid() -> &'static str {
"directory.evnt.event"
}
fn def_name() -> &'static str {
"Address"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_directory_evnt_event()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Coordinates<S> {
fn nsid() -> &'static str {
"directory.evnt.event"
}
fn def_name() -> &'static str {
"Coordinates"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_directory_evnt_event()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for EventComponent<S> {
fn nsid() -> &'static str {
"directory.evnt.event"
}
fn def_name() -> &'static str {
"EventComponent"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_directory_evnt_event()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for EventInstance<S> {
fn nsid() -> &'static str {
"directory.evnt.event"
}
fn def_name() -> &'static str {
"EventInstance"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_directory_evnt_event()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for OnlineVenue<S> {
fn nsid() -> &'static str {
"directory.evnt.event"
}
fn def_name() -> &'static str {
"OnlineVenue"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_directory_evnt_event()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for PhysicalVenue<S> {
fn nsid() -> &'static str {
"directory.evnt.event"
}
fn def_name() -> &'static str {
"PhysicalVenue"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_directory_evnt_event()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for UnknownVenue<S> {
fn nsid() -> &'static str {
"directory.evnt.event"
}
fn def_name() -> &'static str {
"UnknownVenue"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_directory_evnt_event()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Event<S> {
fn nsid() -> &'static str {
"directory.evnt.event"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_directory_evnt_event()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
fn lexicon_doc_directory_evnt_event() -> LexiconDoc<'static> {
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
use alloc::collections::BTreeMap;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("directory.evnt.event"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("Address"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("addr"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("countryCode"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("postalCode"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("Coordinates"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("lat"), SmolStr::new_static("lng")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("lat"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lng"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("EventComponent"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("type"), SmolStr::new_static("data")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("data"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("type"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("EventInstance"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("end"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("start"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#eventStatus"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("venueIds"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("EventStatus"),
LexUserType::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("OnlineVenue"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("id"), SmolStr::new_static("type"),
SmolStr::new_static("name")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("type"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("url"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("PhysicalVenue"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("id"), SmolStr::new_static("type"),
SmolStr::new_static("name")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("address"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#address"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("coordinates"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#coordinates"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("type"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("UnknownVenue"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("id"), SmolStr::new_static("type"),
SmolStr::new_static("name")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("type"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("main"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("v"), SmolStr::new_static("name")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("components"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#eventComponent"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("instances"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#eventInstance"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("label"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#eventStatus"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("v"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("venues"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#physicalVenue"),
CowStr::new_static("#onlineVenue"),
CowStr::new_static("#unknownVenue")
],
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod coordinates_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Lng;
type Lat;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Lng = Unset;
type Lat = Unset;
}
pub struct SetLng<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetLng<St> {}
impl<St: State> State for SetLng<St> {
type Lng = Set<members::lng>;
type Lat = St::Lat;
}
pub struct SetLat<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetLat<St> {}
impl<St: State> State for SetLat<St> {
type Lng = St::Lng;
type Lat = Set<members::lat>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct lng(());
pub struct lat(());
}
}
pub struct CoordinatesBuilder<S: BosStr, St: coordinates_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<i64>, Option<i64>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Coordinates<S> {
pub fn new() -> CoordinatesBuilder<S, coordinates_state::Empty> {
CoordinatesBuilder::new()
}
}
impl<S: BosStr> CoordinatesBuilder<S, coordinates_state::Empty> {
pub fn new() -> Self {
CoordinatesBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> CoordinatesBuilder<S, St>
where
St: coordinates_state::State,
St::Lat: coordinates_state::IsUnset,
{
pub fn lat(
mut self,
value: impl Into<i64>,
) -> CoordinatesBuilder<S, coordinates_state::SetLat<St>> {
self._fields.0 = Option::Some(value.into());
CoordinatesBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> CoordinatesBuilder<S, St>
where
St: coordinates_state::State,
St::Lng: coordinates_state::IsUnset,
{
pub fn lng(
mut self,
value: impl Into<i64>,
) -> CoordinatesBuilder<S, coordinates_state::SetLng<St>> {
self._fields.1 = Option::Some(value.into());
CoordinatesBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> CoordinatesBuilder<S, St>
where
St: coordinates_state::State,
St::Lng: coordinates_state::IsSet,
St::Lat: coordinates_state::IsSet,
{
pub fn build(self) -> Coordinates<S> {
Coordinates {
lat: self._fields.0.unwrap(),
lng: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> Coordinates<S> {
Coordinates {
lat: self._fields.0.unwrap(),
lng: self._fields.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod event_component_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Data;
type Type;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Data = Unset;
type Type = Unset;
}
pub struct SetData<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetData<St> {}
impl<St: State> State for SetData<St> {
type Data = Set<members::data>;
type Type = St::Type;
}
pub struct SetType<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetType<St> {}
impl<St: State> State for SetType<St> {
type Data = St::Data;
type Type = Set<members::r#type>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct data(());
pub struct r#type(());
}
}
pub struct EventComponentBuilder<S: BosStr, St: event_component_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Data<S>>, Option<S>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> EventComponent<S> {
pub fn new() -> EventComponentBuilder<S, event_component_state::Empty> {
EventComponentBuilder::new()
}
}
impl<S: BosStr> EventComponentBuilder<S, event_component_state::Empty> {
pub fn new() -> Self {
EventComponentBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> EventComponentBuilder<S, St>
where
St: event_component_state::State,
St::Data: event_component_state::IsUnset,
{
pub fn data(
mut self,
value: impl Into<Data<S>>,
) -> EventComponentBuilder<S, event_component_state::SetData<St>> {
self._fields.0 = Option::Some(value.into());
EventComponentBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> EventComponentBuilder<S, St>
where
St: event_component_state::State,
St::Type: event_component_state::IsUnset,
{
pub fn r#type(
mut self,
value: impl Into<S>,
) -> EventComponentBuilder<S, event_component_state::SetType<St>> {
self._fields.1 = Option::Some(value.into());
EventComponentBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> EventComponentBuilder<S, St>
where
St: event_component_state::State,
St::Data: event_component_state::IsSet,
St::Type: event_component_state::IsSet,
{
pub fn build(self) -> EventComponent<S> {
EventComponent {
data: self._fields.0.unwrap(),
r#type: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> EventComponent<S> {
EventComponent {
data: self._fields.0.unwrap(),
r#type: self._fields.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod online_venue_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Type;
type Name;
type Id;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Type = Unset;
type Name = Unset;
type Id = Unset;
}
pub struct SetType<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetType<St> {}
impl<St: State> State for SetType<St> {
type Type = Set<members::r#type>;
type Name = St::Name;
type Id = St::Id;
}
pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetName<St> {}
impl<St: State> State for SetName<St> {
type Type = St::Type;
type Name = Set<members::name>;
type Id = St::Id;
}
pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetId<St> {}
impl<St: State> State for SetId<St> {
type Type = St::Type;
type Name = St::Name;
type Id = Set<members::id>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct r#type(());
pub struct name(());
pub struct id(());
}
}
pub struct OnlineVenueBuilder<S: BosStr, St: online_venue_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<Data<S>>, Option<S>, Option<S>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> OnlineVenue<S> {
pub fn new() -> OnlineVenueBuilder<S, online_venue_state::Empty> {
OnlineVenueBuilder::new()
}
}
impl<S: BosStr> OnlineVenueBuilder<S, online_venue_state::Empty> {
pub fn new() -> Self {
OnlineVenueBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> OnlineVenueBuilder<S, St>
where
St: online_venue_state::State,
St::Id: online_venue_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<S>,
) -> OnlineVenueBuilder<S, online_venue_state::SetId<St>> {
self._fields.0 = Option::Some(value.into());
OnlineVenueBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> OnlineVenueBuilder<S, St>
where
St: online_venue_state::State,
St::Name: online_venue_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<Data<S>>,
) -> OnlineVenueBuilder<S, online_venue_state::SetName<St>> {
self._fields.1 = Option::Some(value.into());
OnlineVenueBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> OnlineVenueBuilder<S, St>
where
St: online_venue_state::State,
St::Type: online_venue_state::IsUnset,
{
pub fn r#type(
mut self,
value: impl Into<S>,
) -> OnlineVenueBuilder<S, online_venue_state::SetType<St>> {
self._fields.2 = Option::Some(value.into());
OnlineVenueBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: online_venue_state::State> OnlineVenueBuilder<S, St> {
pub fn url(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_url(mut self, value: Option<S>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> OnlineVenueBuilder<S, St>
where
St: online_venue_state::State,
St::Type: online_venue_state::IsSet,
St::Name: online_venue_state::IsSet,
St::Id: online_venue_state::IsSet,
{
pub fn build(self) -> OnlineVenue<S> {
OnlineVenue {
id: self._fields.0.unwrap(),
name: self._fields.1.unwrap(),
r#type: self._fields.2.unwrap(),
url: self._fields.3,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> OnlineVenue<S> {
OnlineVenue {
id: self._fields.0.unwrap(),
name: self._fields.1.unwrap(),
r#type: self._fields.2.unwrap(),
url: self._fields.3,
extra_data: Some(extra_data),
}
}
}
pub mod physical_venue_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Id;
type Name;
type Type;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Id = Unset;
type Name = Unset;
type Type = Unset;
}
pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetId<St> {}
impl<St: State> State for SetId<St> {
type Id = Set<members::id>;
type Name = St::Name;
type Type = St::Type;
}
pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetName<St> {}
impl<St: State> State for SetName<St> {
type Id = St::Id;
type Name = Set<members::name>;
type Type = St::Type;
}
pub struct SetType<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetType<St> {}
impl<St: State> State for SetType<St> {
type Id = St::Id;
type Name = St::Name;
type Type = Set<members::r#type>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct id(());
pub struct name(());
pub struct r#type(());
}
}
pub struct PhysicalVenueBuilder<S: BosStr, St: physical_venue_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Data<S>>, Option<Data<S>>, Option<S>, Option<Data<S>>, Option<S>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> PhysicalVenue<S> {
pub fn new() -> PhysicalVenueBuilder<S, physical_venue_state::Empty> {
PhysicalVenueBuilder::new()
}
}
impl<S: BosStr> PhysicalVenueBuilder<S, physical_venue_state::Empty> {
pub fn new() -> Self {
PhysicalVenueBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: physical_venue_state::State> PhysicalVenueBuilder<S, St> {
pub fn address(mut self, value: impl Into<Option<Data<S>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_address(mut self, value: Option<Data<S>>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: physical_venue_state::State> PhysicalVenueBuilder<S, St> {
pub fn coordinates(mut self, value: impl Into<Option<Data<S>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_coordinates(mut self, value: Option<Data<S>>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> PhysicalVenueBuilder<S, St>
where
St: physical_venue_state::State,
St::Id: physical_venue_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<S>,
) -> PhysicalVenueBuilder<S, physical_venue_state::SetId<St>> {
self._fields.2 = Option::Some(value.into());
PhysicalVenueBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> PhysicalVenueBuilder<S, St>
where
St: physical_venue_state::State,
St::Name: physical_venue_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<Data<S>>,
) -> PhysicalVenueBuilder<S, physical_venue_state::SetName<St>> {
self._fields.3 = Option::Some(value.into());
PhysicalVenueBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> PhysicalVenueBuilder<S, St>
where
St: physical_venue_state::State,
St::Type: physical_venue_state::IsUnset,
{
pub fn r#type(
mut self,
value: impl Into<S>,
) -> PhysicalVenueBuilder<S, physical_venue_state::SetType<St>> {
self._fields.4 = Option::Some(value.into());
PhysicalVenueBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> PhysicalVenueBuilder<S, St>
where
St: physical_venue_state::State,
St::Id: physical_venue_state::IsSet,
St::Name: physical_venue_state::IsSet,
St::Type: physical_venue_state::IsSet,
{
pub fn build(self) -> PhysicalVenue<S> {
PhysicalVenue {
address: self._fields.0,
coordinates: self._fields.1,
id: self._fields.2.unwrap(),
name: self._fields.3.unwrap(),
r#type: self._fields.4.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> PhysicalVenue<S> {
PhysicalVenue {
address: self._fields.0,
coordinates: self._fields.1,
id: self._fields.2.unwrap(),
name: self._fields.3.unwrap(),
r#type: self._fields.4.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod unknown_venue_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Type;
type Name;
type Id;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Type = Unset;
type Name = Unset;
type Id = Unset;
}
pub struct SetType<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetType<St> {}
impl<St: State> State for SetType<St> {
type Type = Set<members::r#type>;
type Name = St::Name;
type Id = St::Id;
}
pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetName<St> {}
impl<St: State> State for SetName<St> {
type Type = St::Type;
type Name = Set<members::name>;
type Id = St::Id;
}
pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetId<St> {}
impl<St: State> State for SetId<St> {
type Type = St::Type;
type Name = St::Name;
type Id = Set<members::id>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct r#type(());
pub struct name(());
pub struct id(());
}
}
pub struct UnknownVenueBuilder<S: BosStr, St: unknown_venue_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<Data<S>>, Option<S>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> UnknownVenue<S> {
pub fn new() -> UnknownVenueBuilder<S, unknown_venue_state::Empty> {
UnknownVenueBuilder::new()
}
}
impl<S: BosStr> UnknownVenueBuilder<S, unknown_venue_state::Empty> {
pub fn new() -> Self {
UnknownVenueBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> UnknownVenueBuilder<S, St>
where
St: unknown_venue_state::State,
St::Id: unknown_venue_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<S>,
) -> UnknownVenueBuilder<S, unknown_venue_state::SetId<St>> {
self._fields.0 = Option::Some(value.into());
UnknownVenueBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> UnknownVenueBuilder<S, St>
where
St: unknown_venue_state::State,
St::Name: unknown_venue_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<Data<S>>,
) -> UnknownVenueBuilder<S, unknown_venue_state::SetName<St>> {
self._fields.1 = Option::Some(value.into());
UnknownVenueBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> UnknownVenueBuilder<S, St>
where
St: unknown_venue_state::State,
St::Type: unknown_venue_state::IsUnset,
{
pub fn r#type(
mut self,
value: impl Into<S>,
) -> UnknownVenueBuilder<S, unknown_venue_state::SetType<St>> {
self._fields.2 = Option::Some(value.into());
UnknownVenueBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> UnknownVenueBuilder<S, St>
where
St: unknown_venue_state::State,
St::Type: unknown_venue_state::IsSet,
St::Name: unknown_venue_state::IsSet,
St::Id: unknown_venue_state::IsSet,
{
pub fn build(self) -> UnknownVenue<S> {
UnknownVenue {
id: self._fields.0.unwrap(),
name: self._fields.1.unwrap(),
r#type: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> UnknownVenue<S> {
UnknownVenue {
id: self._fields.0.unwrap(),
name: self._fields.1.unwrap(),
r#type: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod event_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Name;
type V;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Name = Unset;
type V = Unset;
}
pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetName<St> {}
impl<St: State> State for SetName<St> {
type Name = Set<members::name>;
type V = St::V;
}
pub struct SetV<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetV<St> {}
impl<St: State> State for SetV<St> {
type Name = St::Name;
type V = Set<members::v>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct name(());
pub struct v(());
}
}
pub struct EventBuilder<S: BosStr, St: event_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Vec<Data<S>>>,
Option<Vec<Data<S>>>,
Option<Data<S>>,
Option<Data<S>>,
Option<Data<S>>,
Option<i64>,
Option<Vec<EventVenuesItem<S>>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Event<S> {
pub fn new() -> EventBuilder<S, event_state::Empty> {
EventBuilder::new()
}
}
impl<S: BosStr> EventBuilder<S, event_state::Empty> {
pub fn new() -> Self {
EventBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: event_state::State> EventBuilder<S, St> {
pub fn components(mut self, value: impl Into<Option<Vec<Data<S>>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_components(mut self, value: Option<Vec<Data<S>>>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: event_state::State> EventBuilder<S, St> {
pub fn instances(mut self, value: impl Into<Option<Vec<Data<S>>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_instances(mut self, value: Option<Vec<Data<S>>>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: event_state::State> EventBuilder<S, St> {
pub fn label(mut self, value: impl Into<Option<Data<S>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_label(mut self, value: Option<Data<S>>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> EventBuilder<S, St>
where
St: event_state::State,
St::Name: event_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<Data<S>>,
) -> EventBuilder<S, event_state::SetName<St>> {
self._fields.3 = Option::Some(value.into());
EventBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: event_state::State> EventBuilder<S, St> {
pub fn status(mut self, value: impl Into<Option<Data<S>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<Data<S>>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> EventBuilder<S, St>
where
St: event_state::State,
St::V: event_state::IsUnset,
{
pub fn v(mut self, value: impl Into<i64>) -> EventBuilder<S, event_state::SetV<St>> {
self._fields.5 = Option::Some(value.into());
EventBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: event_state::State> EventBuilder<S, St> {
pub fn venues(mut self, value: impl Into<Option<Vec<EventVenuesItem<S>>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_venues(mut self, value: Option<Vec<EventVenuesItem<S>>>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St> EventBuilder<S, St>
where
St: event_state::State,
St::Name: event_state::IsSet,
St::V: event_state::IsSet,
{
pub fn build(self) -> Event<S> {
Event {
components: self._fields.0,
instances: self._fields.1,
label: self._fields.2,
name: self._fields.3.unwrap(),
status: self._fields.4,
v: self._fields.5.unwrap(),
venues: self._fields.6,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Event<S> {
Event {
components: self._fields.0,
instances: self._fields.1,
label: self._fields.2,
name: self._fields.3.unwrap(),
status: self._fields.4,
v: self._fields.5.unwrap(),
venues: self._fields.6,
extra_data: Some(extra_data),
}
}
}