/*
 * Pescheck API
 *
 * Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
 *
 * The version of the OpenAPI document: 2.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DivisionReadOnly {
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub name: Option<Option<String>>,
    #[serde(rename = "parent")]
    pub parent: String,
    #[serde(rename = "created_at")]
    pub created_at: chrono::DateTime<chrono::FixedOffset>,
    #[serde(rename = "updated_at")]
    pub updated_at: chrono::DateTime<chrono::FixedOffset>,
    #[serde(rename = "city", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub city: Option<Option<String>>,
    #[serde(rename = "address", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub address: Option<Option<String>>,
    #[serde(rename = "postal", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub postal: Option<Option<String>>,
    #[serde(rename = "phone", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub phone: Option<Option<String>>,
    #[serde(rename = "contact_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub contact_name: Option<Option<String>>,
    #[serde(rename = "contact_email", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub contact_email: Option<Option<String>>,
    #[serde(rename = "invoice_email", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub invoice_email: Option<Option<String>>,
    #[serde(rename = "use_parent_on_email", skip_serializing_if = "Option::is_none")]
    pub use_parent_on_email: Option<bool>,
    #[serde(rename = "use_parent_on_billing", skip_serializing_if = "Option::is_none")]
    pub use_parent_on_billing: Option<bool>,
    #[serde(rename = "use_parent_on_report", skip_serializing_if = "Option::is_none")]
    pub use_parent_on_report: Option<bool>,
}

impl DivisionReadOnly {
    pub fn new(id: uuid::Uuid, parent: String, created_at: chrono::DateTime<chrono::FixedOffset>, updated_at: chrono::DateTime<chrono::FixedOffset>) -> DivisionReadOnly {
        DivisionReadOnly {
            id,
            name: None,
            parent,
            created_at,
            updated_at,
            city: None,
            address: None,
            postal: None,
            phone: None,
            contact_name: None,
            contact_email: None,
            invoice_email: None,
            use_parent_on_email: None,
            use_parent_on_billing: None,
            use_parent_on_report: None,
        }
    }
}

