/*
 * 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 V2ProfileDetail {
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
    pub description: Option<String>,
    #[serde(rename = "is_custom", skip_serializing_if = "Option::is_none")]
    pub is_custom: Option<bool>,
    #[serde(rename = "checks")]
    pub checks: Vec<models::V2ProfileCheckEntry>,
    #[serde(rename = "total_price")]
    pub total_price: Box<models::V2Money>,
    #[serde(rename = "supported_countries_of_work")]
    pub supported_countries_of_work: Vec<String>,
    #[serde(rename = "supported_countries_of_residence")]
    pub supported_countries_of_residence: Vec<String>,
    #[serde(rename = "candidate_fields")]
    pub candidate_fields: Vec<serde_json::Value>,
    #[serde(rename = "created_at")]
    pub created_at: chrono::DateTime<chrono::FixedOffset>,
    #[serde(rename = "updated_at")]
    pub updated_at: chrono::DateTime<chrono::FixedOffset>,
}

impl V2ProfileDetail {
    pub fn new(id: uuid::Uuid, name: String, description: Option<String>, checks: Vec<models::V2ProfileCheckEntry>, total_price: models::V2Money, supported_countries_of_work: Vec<String>, supported_countries_of_residence: Vec<String>, candidate_fields: Vec<serde_json::Value>, created_at: chrono::DateTime<chrono::FixedOffset>, updated_at: chrono::DateTime<chrono::FixedOffset>) -> V2ProfileDetail {
        V2ProfileDetail {
            id,
            name,
            description,
            is_custom: None,
            checks,
            total_price: Box::new(total_price),
            supported_countries_of_work,
            supported_countries_of_residence,
            candidate_fields,
            created_at,
            updated_at,
        }
    }
}

