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

/// VpnTunnelRequest : VPNTunnel Serializer.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct VpnTunnelRequest {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "tunnel_id", skip_serializing_if = "Option::is_none")]
    pub tunnel_id: Option<String>,
    #[serde(rename = "encapsulation", skip_serializing_if = "Option::is_none")]
    pub encapsulation: Option<Box<crate::models::BulkWritableVpnTunnelRequestEncapsulation>>,
    #[serde(
        rename = "vpn_profile",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub vpn_profile: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(
        rename = "vpn",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub vpn: Option<Option<Box<crate::models::BulkWritableVpnTunnelRequestVpn>>>,
    #[serde(
        rename = "role",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub role: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(rename = "status")]
    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
    #[serde(
        rename = "secrets_group",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub secrets_group: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(
        rename = "endpoint_a",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub endpoint_a: Option<Option<Box<crate::models::BulkWritableVpnTunnelRequestEndpointA>>>,
    #[serde(
        rename = "endpoint_z",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub endpoint_z: Option<Option<Box<crate::models::BulkWritableVpnTunnelRequestEndpointZ>>>,
    #[serde(
        rename = "tenant",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub tenant: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[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 VpnTunnelRequest {
    /// VPNTunnel Serializer.
    pub fn new(
        name: String,
        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
    ) -> VpnTunnelRequest {
        VpnTunnelRequest {
            id: None,
            name,
            description: None,
            tunnel_id: None,
            encapsulation: None,
            vpn_profile: None,
            vpn: None,
            role: None,
            status: Box::new(status),
            secrets_group: None,
            endpoint_a: None,
            endpoint_z: None,
            tenant: None,
            custom_fields: None,
            relationships: None,
            tags: None,
        }
    }
}
