netbox_openapi/models/
writable_power_feed_request.rs

1/*
2 * NetBox REST API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 4.4.2-Docker-3.4.1 (4.4)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// WritablePowerFeedRequest : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct WritablePowerFeedRequest {
15    #[serde(rename = "power_panel")]
16    pub power_panel: Box<crate::models::PatchedWritablePowerFeedRequestPowerPanel>,
17    #[serde(
18        rename = "rack",
19        default,
20        with = "::serde_with::rust::double_option",
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub rack: Option<Option<Box<crate::models::DeviceWithConfigContextRequestRack>>>,
24    #[serde(rename = "name")]
25    pub name: String,
26    /// * `offline` - Offline * `active` - Active * `planned` - Planned * `failed` - Failed
27    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
28    pub status: Option<Status>,
29    /// * `primary` - Primary * `redundant` - Redundant
30    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
31    pub r#type: Option<RHashType>,
32    /// * `ac` - AC * `dc` - DC
33    #[serde(rename = "supply", skip_serializing_if = "Option::is_none")]
34    pub supply: Option<Supply>,
35    /// * `single-phase` - Single phase * `three-phase` - Three-phase
36    #[serde(rename = "phase", skip_serializing_if = "Option::is_none")]
37    pub phase: Option<Phase>,
38    #[serde(rename = "voltage", skip_serializing_if = "Option::is_none")]
39    pub voltage: Option<i32>,
40    #[serde(rename = "amperage", skip_serializing_if = "Option::is_none")]
41    pub amperage: Option<i32>,
42    /// Maximum permissible draw (percentage)
43    #[serde(rename = "max_utilization", skip_serializing_if = "Option::is_none")]
44    pub max_utilization: Option<i32>,
45    /// Treat as if a cable is connected
46    #[serde(rename = "mark_connected", skip_serializing_if = "Option::is_none")]
47    pub mark_connected: Option<bool>,
48    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
49    pub description: Option<String>,
50    #[serde(
51        rename = "tenant",
52        default,
53        with = "::serde_with::rust::double_option",
54        skip_serializing_if = "Option::is_none"
55    )]
56    pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
57    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
58    pub comments: Option<String>,
59    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
60    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
61    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
62    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
63}
64
65impl WritablePowerFeedRequest {
66    /// Adds support for custom fields and tags.
67    pub fn new(
68        power_panel: crate::models::PatchedWritablePowerFeedRequestPowerPanel,
69        name: String,
70    ) -> WritablePowerFeedRequest {
71        WritablePowerFeedRequest {
72            power_panel: Box::new(power_panel),
73            rack: None,
74            name,
75            status: None,
76            r#type: None,
77            supply: None,
78            phase: None,
79            voltage: None,
80            amperage: None,
81            max_utilization: None,
82            mark_connected: None,
83            description: None,
84            tenant: None,
85            comments: None,
86            tags: None,
87            custom_fields: None,
88        }
89    }
90}
91
92/// * `offline` - Offline * `active` - Active * `planned` - Planned * `failed` - Failed
93#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
94pub enum Status {
95    #[serde(rename = "offline")]
96    Offline,
97    #[serde(rename = "active")]
98    Active,
99    #[serde(rename = "planned")]
100    Planned,
101    #[serde(rename = "failed")]
102    Failed,
103}
104
105impl Default for Status {
106    fn default() -> Status {
107        Self::Offline
108    }
109}
110/// * `primary` - Primary * `redundant` - Redundant
111#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
112pub enum RHashType {
113    #[serde(rename = "primary")]
114    Primary,
115    #[serde(rename = "redundant")]
116    Redundant,
117}
118
119impl Default for RHashType {
120    fn default() -> RHashType {
121        Self::Primary
122    }
123}
124/// * `ac` - AC * `dc` - DC
125#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
126pub enum Supply {
127    #[serde(rename = "ac")]
128    Ac,
129    #[serde(rename = "dc")]
130    Dc,
131}
132
133impl Default for Supply {
134    fn default() -> Supply {
135        Self::Ac
136    }
137}
138/// * `single-phase` - Single phase * `three-phase` - Three-phase
139#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
140pub enum Phase {
141    #[serde(rename = "single-phase")]
142    SinglePhase,
143    #[serde(rename = "three-phase")]
144    ThreePhase,
145}
146
147impl Default for Phase {
148    fn default() -> Phase {
149        Self::SinglePhase
150    }
151}