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

/// JobVariable : Serializer used for responses from the JobModelViewSet.variables() detail endpoint.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct JobVariable {
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
    pub label: Option<String>,
    #[serde(rename = "help_text", skip_serializing_if = "Option::is_none")]
    pub help_text: Option<String>,
    #[serde(
        rename = "default",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub default: Option<Option<serde_json::Value>>,
    #[serde(rename = "required", skip_serializing_if = "Option::is_none")]
    pub required: Option<bool>,
    #[serde(rename = "min_length", skip_serializing_if = "Option::is_none")]
    pub min_length: Option<i32>,
    #[serde(rename = "max_length", skip_serializing_if = "Option::is_none")]
    pub max_length: Option<i32>,
    #[serde(rename = "min_value", skip_serializing_if = "Option::is_none")]
    pub min_value: Option<i32>,
    #[serde(rename = "max_value", skip_serializing_if = "Option::is_none")]
    pub max_value: Option<i32>,
    #[serde(
        rename = "choices",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub choices: Option<Option<serde_json::Value>>,
    #[serde(rename = "model", skip_serializing_if = "Option::is_none")]
    pub model: Option<String>,
}

impl JobVariable {
    /// Serializer used for responses from the JobModelViewSet.variables() detail endpoint.
    pub fn new() -> JobVariable {
        JobVariable {
            name: None,
            r#type: None,
            label: None,
            help_text: None,
            default: None,
            required: None,
            min_length: None,
            max_length: None,
            min_value: None,
            max_value: None,
            choices: None,
            model: None,
        }
    }
}
