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

/// PowerFeed : 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 PowerFeed {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
    pub object_type: Option<String>,
    /// Human friendly display value
    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
    pub display: Option<String>,
    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    #[serde(rename = "natural_slug", skip_serializing_if = "Option::is_none")]
    pub natural_slug: Option<String>,
    #[serde(
        rename = "cable_peer_type",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub cable_peer_type: Option<Option<String>>,
    #[serde(
        rename = "cable_peer",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub cable_peer: Option<Option<Box<crate::models::CableTermination>>>,
    #[serde(
        rename = "connected_endpoint_type",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub connected_endpoint_type: Option<Option<String>>,
    #[serde(
        rename = "connected_endpoint",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub connected_endpoint: Option<Option<Box<crate::models::PathEndpoint>>>,
    #[serde(
        rename = "connected_endpoint_reachable",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub connected_endpoint_reachable: Option<Option<bool>>,
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<Box<crate::models::PowerFeedType>>,
    #[serde(rename = "power_path", skip_serializing_if = "Option::is_none")]
    pub power_path: Option<Box<crate::models::PowerFeedPowerPath>>,
    #[serde(rename = "supply", skip_serializing_if = "Option::is_none")]
    pub supply: Option<Box<crate::models::PowerFeedSupply>>,
    #[serde(rename = "phase", skip_serializing_if = "Option::is_none")]
    pub phase: Option<Box<crate::models::PowerFeedPhase>>,
    #[serde(
        rename = "breaker_pole_count",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub breaker_pole_count: Option<Option<Box<crate::models::PowerFeedBreakerPoleCount>>>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "voltage", skip_serializing_if = "Option::is_none")]
    pub voltage: Option<i32>,
    #[serde(rename = "amperage", skip_serializing_if = "Option::is_none")]
    pub amperage: Option<i32>,
    /// Maximum permissible draw (percentage)
    #[serde(rename = "max_utilization", skip_serializing_if = "Option::is_none")]
    pub max_utilization: Option<i32>,
    /// Starting circuit breaker position in panel
    #[serde(
        rename = "breaker_position",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub breaker_position: Option<Option<i32>>,
    #[serde(rename = "available_power", skip_serializing_if = "Option::is_none")]
    pub available_power: Option<i32>,
    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
    pub comments: Option<String>,
    #[serde(
        rename = "cable",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub cable: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(rename = "power_panel")]
    pub power_panel: Box<crate::models::BulkWritablePowerFeedRequestPowerPanel>,
    #[serde(
        rename = "destination_panel",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub destination_panel:
        Option<Option<Box<crate::models::BulkWritablePowerFeedRequestDestinationPanel>>>,
    #[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 = "status")]
    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
    #[serde(
        rename = "created",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub created: Option<Option<String>>,
    #[serde(
        rename = "last_updated",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub last_updated: Option<Option<String>>,
    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
    pub notes_url: Option<String>,
    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
}

impl PowerFeed {
    /// 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(
        name: String,
        power_panel: crate::models::BulkWritablePowerFeedRequestPowerPanel,
        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
    ) -> PowerFeed {
        PowerFeed {
            id: None,
            object_type: None,
            display: None,
            url: None,
            natural_slug: None,
            cable_peer_type: None,
            cable_peer: None,
            connected_endpoint_type: None,
            connected_endpoint: None,
            connected_endpoint_reachable: None,
            r#type: None,
            power_path: None,
            supply: None,
            phase: None,
            breaker_pole_count: None,
            name,
            voltage: None,
            amperage: None,
            max_utilization: None,
            breaker_position: None,
            available_power: None,
            comments: None,
            cable: None,
            power_panel: Box::new(power_panel),
            destination_panel: None,
            rack: None,
            status: Box::new(status),
            created: None,
            last_updated: None,
            notes_url: None,
            custom_fields: None,
            tags: None,
        }
    }
}
