use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Venue {
pub location: crate::types::Location,
pub title: Box<str>,
pub address: Box<str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub foursquare_id: Option<Box<str>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub foursquare_type: Option<Box<str>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub google_place_id: Option<Box<str>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub google_place_type: Option<Box<str>>,
}
impl Venue {
#[must_use]
pub fn new<T0: Into<crate::types::Location>, T1: Into<Box<str>>, T2: Into<Box<str>>>(
location: T0,
title: T1,
address: T2,
) -> Self {
Self {
location: location.into(),
title: title.into(),
address: address.into(),
foursquare_id: None,
foursquare_type: None,
google_place_id: None,
google_place_type: None,
}
}
#[must_use]
pub fn location<T: Into<crate::types::Location>>(self, val: T) -> Self {
let mut this = self;
this.location = val.into();
this
}
#[must_use]
pub fn title<T: Into<Box<str>>>(self, val: T) -> Self {
let mut this = self;
this.title = val.into();
this
}
#[must_use]
pub fn address<T: Into<Box<str>>>(self, val: T) -> Self {
let mut this = self;
this.address = val.into();
this
}
#[must_use]
pub fn foursquare_id<T: Into<Box<str>>>(self, val: T) -> Self {
let mut this = self;
this.foursquare_id = Some(val.into());
this
}
#[must_use]
pub fn foursquare_id_option<T: Into<Box<str>>>(self, val: Option<T>) -> Self {
let mut this = self;
this.foursquare_id = val.map(Into::into);
this
}
#[must_use]
pub fn foursquare_type<T: Into<Box<str>>>(self, val: T) -> Self {
let mut this = self;
this.foursquare_type = Some(val.into());
this
}
#[must_use]
pub fn foursquare_type_option<T: Into<Box<str>>>(self, val: Option<T>) -> Self {
let mut this = self;
this.foursquare_type = val.map(Into::into);
this
}
#[must_use]
pub fn google_place_id<T: Into<Box<str>>>(self, val: T) -> Self {
let mut this = self;
this.google_place_id = Some(val.into());
this
}
#[must_use]
pub fn google_place_id_option<T: Into<Box<str>>>(self, val: Option<T>) -> Self {
let mut this = self;
this.google_place_id = val.map(Into::into);
this
}
#[must_use]
pub fn google_place_type<T: Into<Box<str>>>(self, val: T) -> Self {
let mut this = self;
this.google_place_type = Some(val.into());
this
}
#[must_use]
pub fn google_place_type_option<T: Into<Box<str>>>(self, val: Option<T>) -> Self {
let mut this = self;
this.google_place_type = val.map(Into::into);
this
}
}