/*
 * 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};

/// V2ProfileUpdate : Replaces the profile - name, description and full checks list. Entries matched by profile_check_id are updated in place; entries without one are added; existing checks not referenced in the request are removed.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct V2ProfileUpdate {
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "checks")]
    pub checks: Vec<models::V2ProfileUpdateCheck>,
}

impl V2ProfileUpdate {
    /// Replaces the profile - name, description and full checks list. Entries matched by profile_check_id are updated in place; entries without one are added; existing checks not referenced in the request are removed.
    pub fn new(name: String, checks: Vec<models::V2ProfileUpdateCheck>) -> V2ProfileUpdate {
        V2ProfileUpdate {
            name,
            description: None,
            checks,
        }
    }
}

