use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct HolidayResponse {
#[serde(rename = "comment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub comment: Option<Option<Vec<models::LocalizedText>>>,
#[serde(rename = "endDate")]
pub end_date: chrono::NaiveDate,
#[serde(rename = "id")]
pub id: uuid::Uuid,
#[serde(rename = "name")]
pub name: Vec<models::LocalizedText>,
#[serde(rename = "nationwide")]
pub nationwide: bool,
#[serde(rename = "regionalScope", skip_serializing_if = "Option::is_none")]
pub regional_scope: Option<models::RegionalScope>,
#[serde(rename = "startDate")]
pub start_date: chrono::NaiveDate,
#[serde(rename = "subdivisions", skip_serializing_if = "Option::is_none")]
pub subdivisions: Option<Vec<models::SubdivisionReference>>,
#[serde(rename = "temporalScope", skip_serializing_if = "Option::is_none")]
pub temporal_scope: Option<models::TemporalScope>,
#[serde(rename = "type")]
pub r#type: models::HolidayType,
}
impl HolidayResponse {
pub fn new(end_date: chrono::NaiveDate, id: uuid::Uuid, name: Vec<models::LocalizedText>, nationwide: bool, start_date: chrono::NaiveDate, r#type: models::HolidayType) -> HolidayResponse {
HolidayResponse {
comment: None,
end_date,
id,
name,
nationwide,
regional_scope: None,
start_date,
subdivisions: None,
temporal_scope: None,
r#type,
}
}
}