/*
 * API Documentation
 *
 * Source of truth and network automation platform
 *
 * The version of the OpenAPI document: 3.1.0 (3.1)
 *
 * Generated by: https://openapi-generator.tech
 */

/// UniqueValidationRuleRequest : Serializer for `UniqueValidationRule` objects.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct UniqueValidationRuleRequest {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    #[serde(rename = "content_type")]
    pub content_type: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "field")]
    pub field: String,
    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    /// Optional error message to display when validation fails.
    #[serde(rename = "error_message", skip_serializing_if = "Option::is_none")]
    pub error_message: Option<String>,
    #[serde(rename = "max_instances", skip_serializing_if = "Option::is_none")]
    pub max_instances: Option<i32>,
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
    pub relationships: Option<
        ::std::collections::HashMap<
            String,
            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
        >,
    >,
}

impl UniqueValidationRuleRequest {
    /// Serializer for `UniqueValidationRule` objects.
    pub fn new(content_type: String, name: String, field: String) -> UniqueValidationRuleRequest {
        UniqueValidationRuleRequest {
            id: None,
            content_type,
            name,
            field,
            enabled: None,
            error_message: None,
            max_instances: None,
            tags: None,
            custom_fields: None,
            relationships: None,
        }
    }
}
