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

/// SoftwareVersionRequest : Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct SoftwareVersionRequest {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    #[serde(rename = "version")]
    pub version: String,
    /// Optional alternative label for this version
    #[serde(rename = "alias", skip_serializing_if = "Option::is_none")]
    pub alias: Option<String>,
    #[serde(
        rename = "release_date",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub release_date: Option<Option<String>>,
    #[serde(
        rename = "end_of_support_date",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub end_of_support_date: Option<Option<String>>,
    #[serde(rename = "documentation_url", skip_serializing_if = "Option::is_none")]
    pub documentation_url: Option<String>,
    /// Is a Long Term Support version
    #[serde(rename = "long_term_support", skip_serializing_if = "Option::is_none")]
    pub long_term_support: Option<bool>,
    /// Is a Pre-Release version
    #[serde(rename = "pre_release", skip_serializing_if = "Option::is_none")]
    pub pre_release: Option<bool>,
    #[serde(rename = "platform")]
    pub platform: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
    #[serde(rename = "status")]
    pub status: Box<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,
        >,
    >,
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
}

impl SoftwareVersionRequest {
    /// Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
    pub fn new(
        version: String,
        platform: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
    ) -> SoftwareVersionRequest {
        SoftwareVersionRequest {
            id: None,
            version,
            alias: None,
            release_date: None,
            end_of_support_date: None,
            documentation_url: None,
            long_term_support: None,
            pre_release: None,
            platform: Box::new(platform),
            status: Box::new(status),
            custom_fields: None,
            relationships: None,
            tags: None,
        }
    }
}
