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

/// ApprovalWorkflowStageDefinitionRequest : ApprovalWorkflowStageDefinition Serializer.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ApprovalWorkflowStageDefinitionRequest {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    /// The group that will be assigned to approve this stage.
    #[serde(rename = "approver_group")]
    pub approver_group: String,
    /// The sequence dictates the order in which this stage will need to be approved. The lower the number, the earlier it will be.
    #[serde(rename = "sequence")]
    pub sequence: i32,
    #[serde(rename = "name")]
    pub name: String,
    /// Minimum number of approvers required to approve this stage.
    #[serde(rename = "min_approvers")]
    pub min_approvers: i32,
    /// Message to show when the stage is denied.
    #[serde(rename = "denial_message", skip_serializing_if = "Option::is_none")]
    pub denial_message: Option<String>,
    #[serde(rename = "approval_workflow_definition")]
    pub approval_workflow_definition:
        Box<crate::models::ApprovalWorkflowStageDefinitionApprovalWorkflowDefinition>,
    #[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 ApprovalWorkflowStageDefinitionRequest {
    /// ApprovalWorkflowStageDefinition Serializer.
    pub fn new(
        approver_group: String,
        sequence: i32,
        name: String,
        min_approvers: i32,
        approval_workflow_definition: crate::models::ApprovalWorkflowStageDefinitionApprovalWorkflowDefinition,
    ) -> ApprovalWorkflowStageDefinitionRequest {
        ApprovalWorkflowStageDefinitionRequest {
            id: None,
            approver_group,
            sequence,
            name,
            min_approvers,
            denial_message: None,
            approval_workflow_definition: Box::new(approval_workflow_definition),
            custom_fields: None,
            relationships: None,
        }
    }
}
