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

/// PatchedIpAddressToInterfaceRequest : Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see <https://github.com/encode/django-rest-framework/issues/3144>)

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct PatchedIpAddressToInterfaceRequest {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    /// Is source address on interface
    #[serde(rename = "is_source", skip_serializing_if = "Option::is_none")]
    pub is_source: Option<bool>,
    /// Is destination address on interface
    #[serde(rename = "is_destination", skip_serializing_if = "Option::is_none")]
    pub is_destination: Option<bool>,
    /// Is default address on interface
    #[serde(rename = "is_default", skip_serializing_if = "Option::is_none")]
    pub is_default: Option<bool>,
    /// Is preferred address on interface
    #[serde(rename = "is_preferred", skip_serializing_if = "Option::is_none")]
    pub is_preferred: Option<bool>,
    /// Is primary address on interface
    #[serde(rename = "is_primary", skip_serializing_if = "Option::is_none")]
    pub is_primary: Option<bool>,
    /// Is secondary address on interface
    #[serde(rename = "is_secondary", skip_serializing_if = "Option::is_none")]
    pub is_secondary: Option<bool>,
    /// Is standby address on interface
    #[serde(rename = "is_standby", skip_serializing_if = "Option::is_none")]
    pub is_standby: Option<bool>,
    #[serde(rename = "ip_address", skip_serializing_if = "Option::is_none")]
    pub ip_address: Option<Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
    #[serde(
        rename = "interface",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub interface: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(
        rename = "vm_interface",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub vm_interface: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
}

impl PatchedIpAddressToInterfaceRequest {
    /// Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see <https://github.com/encode/django-rest-framework/issues/3144>)
    pub fn new() -> PatchedIpAddressToInterfaceRequest {
        PatchedIpAddressToInterfaceRequest {
            id: None,
            is_source: None,
            is_destination: None,
            is_default: None,
            is_preferred: None,
            is_primary: None,
            is_secondary: None,
            is_standby: None,
            ip_address: None,
            interface: None,
            vm_interface: None,
        }
    }
}
