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

/// VirtualServerRequest : VirtualServer Serializer.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct VirtualServerRequest {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(
        rename = "port",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub port: Option<Option<i32>>,
    #[serde(rename = "protocol")]
    pub protocol: Box<crate::models::BulkWritableVirtualServerRequestProtocol>,
    #[serde(rename = "source_nat_type", skip_serializing_if = "Option::is_none")]
    pub source_nat_type: Option<Box<crate::models::BulkWritableVirtualServerRequestSourceNatType>>,
    #[serde(rename = "load_balancer_type", skip_serializing_if = "Option::is_none")]
    pub load_balancer_type:
        Option<Box<crate::models::BulkWritableVirtualServerRequestLoadBalancerType>>,
    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    #[serde(rename = "ssl_offload", skip_serializing_if = "Option::is_none")]
    pub ssl_offload: Option<bool>,
    #[serde(rename = "vip")]
    pub vip: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
    #[serde(
        rename = "source_nat_pool",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub source_nat_pool: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(
        rename = "device",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub device: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(
        rename = "device_redundancy_group",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub device_redundancy_group: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(
        rename = "cloud_service",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub cloud_service: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(
        rename = "virtual_chassis",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub virtual_chassis: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[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 = "load_balancer_pool",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub load_balancer_pool: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(
        rename = "health_check_monitor",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub health_check_monitor: 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 VirtualServerRequest {
    /// VirtualServer Serializer.
    pub fn new(
        name: String,
        protocol: crate::models::BulkWritableVirtualServerRequestProtocol,
        vip: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
    ) -> VirtualServerRequest {
        VirtualServerRequest {
            id: None,
            name,
            port: None,
            protocol: Box::new(protocol),
            source_nat_type: None,
            load_balancer_type: None,
            enabled: None,
            ssl_offload: None,
            vip: Box::new(vip),
            source_nat_pool: None,
            device: None,
            device_redundancy_group: None,
            cloud_service: None,
            virtual_chassis: None,
            tenant: None,
            load_balancer_pool: None,
            health_check_monitor: None,
            custom_fields: None,
            relationships: None,
            tags: None,
        }
    }
}
