netbox-openapi 0.6.0

low level netbox bindings (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * NetBox REST API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 4.6.2 (4.6)
 *
 * Generated by: https://openapi-generator.tech
 */

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct DcimPowerFeedsCreateRequest {
    #[serde(rename = "power_panel")]
    pub power_panel: Box<crate::models::PatchedWritablePowerFeedRequestPowerPanel>,
    #[serde(
        rename = "rack",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub rack: Option<Option<Box<crate::models::DeviceWithConfigContextRequestRack>>>,
    #[serde(rename = "name")]
    pub name: String,
    /// * `offline` - Offline * `active` - Active * `planned` - Planned * `failed` - Failed
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    /// * `primary` - Primary * `redundant` - Redundant
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<RHashType>,
    /// * `ac` - AC * `dc` - DC
    #[serde(rename = "supply", skip_serializing_if = "Option::is_none")]
    pub supply: Option<Supply>,
    /// * `single-phase` - Single phase * `three-phase` - Three-phase
    #[serde(rename = "phase", skip_serializing_if = "Option::is_none")]
    pub phase: Option<Phase>,
    #[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>,
    /// Treat as if a cable is connected
    #[serde(rename = "mark_connected", skip_serializing_if = "Option::is_none")]
    pub mark_connected: Option<bool>,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(
        rename = "tenant",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
    #[serde(
        rename = "owner",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
    pub comments: Option<String>,
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
}

impl DcimPowerFeedsCreateRequest {
    pub fn new(
        power_panel: crate::models::PatchedWritablePowerFeedRequestPowerPanel,
        name: String,
    ) -> DcimPowerFeedsCreateRequest {
        DcimPowerFeedsCreateRequest {
            power_panel: Box::new(power_panel),
            rack: None,
            name,
            status: None,
            r#type: None,
            supply: None,
            phase: None,
            voltage: None,
            amperage: None,
            max_utilization: None,
            mark_connected: None,
            description: None,
            tenant: None,
            owner: None,
            comments: None,
            tags: None,
            custom_fields: None,
        }
    }
}

/// * `offline` - Offline * `active` - Active * `planned` - Planned * `failed` - Failed
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "offline")]
    Offline,
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "planned")]
    Planned,
    #[serde(rename = "failed")]
    Failed,
}

impl Default for Status {
    fn default() -> Status {
        Self::Offline
    }
}
/// * `primary` - Primary * `redundant` - Redundant
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum RHashType {
    #[serde(rename = "primary")]
    Primary,
    #[serde(rename = "redundant")]
    Redundant,
}

impl Default for RHashType {
    fn default() -> RHashType {
        Self::Primary
    }
}
/// * `ac` - AC * `dc` - DC
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Supply {
    #[serde(rename = "ac")]
    Ac,
    #[serde(rename = "dc")]
    Dc,
}

impl Default for Supply {
    fn default() -> Supply {
        Self::Ac
    }
}
/// * `single-phase` - Single phase * `three-phase` - Three-phase
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Phase {
    #[serde(rename = "single-phase")]
    SinglePhase,
    #[serde(rename = "three-phase")]
    ThreePhase,
}

impl Default for Phase {
    fn default() -> Phase {
        Self::SinglePhase
    }
}