use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SubdivisionResponse {
#[serde(rename = "category")]
pub category: Vec<models::LocalizedText>,
#[serde(rename = "children", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub children: Option<Option<Vec<models::SubdivisionResponse>>>,
#[serde(rename = "code")]
pub code: String,
#[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
pub comment: Option<Vec<models::LocalizedText>>,
#[serde(rename = "isoCode", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub iso_code: Option<Option<String>>,
#[serde(rename = "name")]
pub name: Vec<models::LocalizedText>,
#[serde(rename = "officialLanguages")]
pub official_languages: Vec<String>,
#[serde(rename = "shortName")]
pub short_name: String,
}
impl SubdivisionResponse {
pub fn new(category: Vec<models::LocalizedText>, code: String, name: Vec<models::LocalizedText>, official_languages: Vec<String>, short_name: String) -> SubdivisionResponse {
SubdivisionResponse {
category,
children: None,
code,
comment: None,
iso_code: None,
name,
official_languages,
short_name,
}
}
}