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

/// ApprovalWorkflow : ApprovalWorkflow Serializer.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ApprovalWorkflow {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
    pub object_type: Option<String>,
    /// Human friendly display value
    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
    pub display: Option<String>,
    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    #[serde(rename = "natural_slug", skip_serializing_if = "Option::is_none")]
    pub natural_slug: Option<String>,
    #[serde(rename = "object_under_review_content_type")]
    pub object_under_review_content_type: String,
    #[serde(
        rename = "decision_date",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub decision_date: Option<Option<String>>,
    #[serde(rename = "object_under_review_object_id")]
    pub object_under_review_object_id: uuid::Uuid,
    #[serde(rename = "current_state", skip_serializing_if = "Option::is_none")]
    pub current_state: Option<crate::models::ApprovalWorkflowStateChoices>,
    #[serde(rename = "user_name", skip_serializing_if = "Option::is_none")]
    pub user_name: Option<String>,
    #[serde(
        rename = "approval_workflow_definition",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub approval_workflow_definition:
        Option<Option<Box<crate::models::ApprovalWorkflowApprovalWorkflowDefinition>>>,
    #[serde(
        rename = "user",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub user: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(
        rename = "created",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub created: Option<Option<String>>,
    #[serde(
        rename = "last_updated",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub last_updated: Option<Option<String>>,
    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
    pub notes_url: Option<String>,
    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
}

impl ApprovalWorkflow {
    /// ApprovalWorkflow Serializer.
    pub fn new(
        object_under_review_content_type: String,
        object_under_review_object_id: uuid::Uuid,
    ) -> ApprovalWorkflow {
        ApprovalWorkflow {
            id: None,
            object_type: None,
            display: None,
            url: None,
            natural_slug: None,
            object_under_review_content_type,
            decision_date: None,
            object_under_review_object_id,
            current_state: None,
            user_name: None,
            approval_workflow_definition: None,
            user: None,
            created: None,
            last_updated: None,
            notes_url: None,
            custom_fields: None,
        }
    }
}
