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

/// ContactAssociationRequest : 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 ContactAssociationRequest {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    #[serde(rename = "associated_object_type")]
    pub associated_object_type: String,
    #[serde(rename = "associated_object_id")]
    pub associated_object_id: uuid::Uuid,
    #[serde(
        rename = "contact",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub contact: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(
        rename = "team",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub team: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(rename = "role")]
    pub role: 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,
        >,
    >,
}

impl ContactAssociationRequest {
    /// 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(
        associated_object_type: String,
        associated_object_id: uuid::Uuid,
        role: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
    ) -> ContactAssociationRequest {
        ContactAssociationRequest {
            id: None,
            associated_object_type,
            associated_object_id,
            contact: None,
            team: None,
            role: Box::new(role),
            status: Box::new(status),
            custom_fields: None,
            relationships: None,
        }
    }
}
