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

/// PatchedBulkWritableDeviceRequest : 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 PatchedBulkWritableDeviceRequest {
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "face", skip_serializing_if = "Option::is_none")]
    pub face: Option<crate::models::FaceEnum>,
    #[serde(
        rename = "local_config_context_data",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub local_config_context_data: Option<Option<serde_json::Value>>,
    #[serde(
        rename = "local_config_context_data_owner_object_id",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub local_config_context_data_owner_object_id: Option<Option<uuid::Uuid>>,
    #[serde(
        rename = "name",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub name: Option<Option<String>>,
    #[serde(rename = "serial", skip_serializing_if = "Option::is_none")]
    pub serial: Option<String>,
    /// A unique tag used to identify this device
    #[serde(
        rename = "asset_tag",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub asset_tag: Option<Option<String>>,
    /// The lowest-numbered unit occupied by the device
    #[serde(
        rename = "position",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub position: Option<Option<i32>>,
    /// The priority the device has in the device redundancy group.
    #[serde(
        rename = "device_redundancy_group_priority",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub device_redundancy_group_priority: Option<Option<i32>>,
    #[serde(
        rename = "vc_position",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub vc_position: Option<Option<i32>>,
    #[serde(
        rename = "vc_priority",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub vc_priority: Option<Option<i32>>,
    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
    pub comments: Option<String>,
    #[serde(
        rename = "local_config_context_schema",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub local_config_context_schema:
        Option<Option<Box<crate::models::BulkWritableConfigContextRequestConfigContextSchema>>>,
    #[serde(
        rename = "local_config_context_data_owner_content_type",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub local_config_context_data_owner_content_type:
        Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(rename = "device_type", skip_serializing_if = "Option::is_none")]
    pub device_type: Option<Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
    #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
    pub role: Option<Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
    #[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 = "platform",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub platform: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(rename = "location", skip_serializing_if = "Option::is_none")]
    pub location: Option<Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
    #[serde(
        rename = "rack",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub rack: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(
        rename = "primary_ip4",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub primary_ip4: Option<Option<Box<crate::models::PrimaryIpv4>>>,
    #[serde(
        rename = "primary_ip6",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub primary_ip6: Option<Option<Box<crate::models::PrimaryIpv6>>>,
    #[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 = "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 = "software_version",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub software_version:
        Option<Option<Box<crate::models::BulkWritableDeviceRequestSoftwareVersion>>>,
    #[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 = "controller_managed_device_group",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub controller_managed_device_group: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    /// Override the software image files associated with the software version for this device
    #[serde(
        rename = "software_image_files",
        skip_serializing_if = "Option::is_none"
    )]
    pub software_image_files: Option<Vec<crate::models::SoftwareImageFiles>>,
    #[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>>,
    #[serde(
        rename = "parent_bay",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub parent_bay: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
}

impl PatchedBulkWritableDeviceRequest {
    /// 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(id: uuid::Uuid) -> PatchedBulkWritableDeviceRequest {
        PatchedBulkWritableDeviceRequest {
            id,
            face: None,
            local_config_context_data: None,
            local_config_context_data_owner_object_id: None,
            name: None,
            serial: None,
            asset_tag: None,
            position: None,
            device_redundancy_group_priority: None,
            vc_position: None,
            vc_priority: None,
            comments: None,
            local_config_context_schema: None,
            local_config_context_data_owner_content_type: None,
            device_type: None,
            status: None,
            role: None,
            tenant: None,
            platform: None,
            location: None,
            rack: None,
            primary_ip4: None,
            primary_ip6: None,
            virtual_chassis: None,
            device_redundancy_group: None,
            software_version: None,
            secrets_group: None,
            controller_managed_device_group: None,
            software_image_files: None,
            custom_fields: None,
            relationships: None,
            tags: None,
            parent_bay: None,
        }
    }
}
