/*
 * 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 DivisionWrite {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "city")]
    pub city: String,
    #[serde(rename = "address")]
    pub address: String,
    #[serde(rename = "postal")]
    pub postal: String,
    #[serde(rename = "phone")]
    pub phone: String,
    #[serde(rename = "contact_name")]
    pub contact_name: String,
    #[serde(rename = "contact_email")]
    pub contact_email: String,
    #[serde(rename = "invoice_email")]
    pub invoice_email: 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 DivisionWrite {
    pub fn new(name: String, city: String, address: String, postal: String, phone: String, contact_name: String, contact_email: String, invoice_email: String) -> DivisionWrite {
        DivisionWrite {
            id: None,
            name,
            city,
            address,
            postal,
            phone,
            contact_name,
            contact_email,
            invoice_email,
            use_parent_on_email: None,
            use_parent_on_billing: None,
            use_parent_on_report: None,
        }
    }
}

