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

/// PatchedWritableInterfaceRequest : 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 PatchedWritableInterfaceRequest {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    #[serde(
        rename = "mac_address",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub mac_address: Option<Option<String>>,
    #[serde(
        rename = "speed",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub speed: Option<Option<i32>>,
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Physical label
    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
    pub label: Option<String>,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    #[serde(
        rename = "mtu",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub mtu: Option<Option<i32>>,
    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
    pub mode: Option<Box<crate::models::PatchedWritableInterfaceRequestMode>>,
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<crate::models::InterfaceTypeChoices>,
    #[serde(rename = "port_type", skip_serializing_if = "Option::is_none")]
    pub port_type: Option<Box<crate::models::PatchedWritableInterfaceRequestPortType>>,
    /// This interface is used only for out-of-band management
    #[serde(rename = "mgmt_only", skip_serializing_if = "Option::is_none")]
    pub mgmt_only: Option<bool>,
    #[serde(rename = "duplex", skip_serializing_if = "Option::is_none")]
    pub duplex: Option<Box<crate::models::BulkWritableInterfaceTemplateRequestDuplex>>,
    #[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 = "module",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub module: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
    #[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 = "parent_interface",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub parent_interface:
        Option<Option<Box<crate::models::BulkWritableInterfaceRequestParentInterface>>>,
    #[serde(
        rename = "bridge",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub bridge: Option<Option<Box<crate::models::BridgeInterface>>>,
    #[serde(
        rename = "lag",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub lag: Option<Option<Box<crate::models::ParentLag>>>,
    #[serde(
        rename = "untagged_vlan",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub untagged_vlan: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(
        rename = "vrf",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub vrf: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(rename = "tagged_vlans", skip_serializing_if = "Option::is_none")]
    pub tagged_vlans: Option<Vec<crate::models::TaggedVlans>>,
    #[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 PatchedWritableInterfaceRequest {
    /// 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() -> PatchedWritableInterfaceRequest {
        PatchedWritableInterfaceRequest {
            id: None,
            mac_address: None,
            speed: None,
            name: None,
            label: None,
            description: None,
            enabled: None,
            mtu: None,
            mode: None,
            r#type: None,
            port_type: None,
            mgmt_only: None,
            duplex: None,
            device: None,
            module: None,
            status: None,
            role: None,
            parent_interface: None,
            bridge: None,
            lag: None,
            untagged_vlan: None,
            vrf: None,
            tagged_vlans: None,
            custom_fields: None,
            relationships: None,
            tags: None,
        }
    }
}
