Skip to main content

netbox_openapi/models/
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.6.2 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PowerFeedRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PowerFeedRequest {
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(
58        rename = "owner",
59        default,
60        with = "::serde_with::rust::double_option",
61        skip_serializing_if = "Option::is_none"
62    )]
63    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
64    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
65    pub comments: Option<String>,
66    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
67    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
68    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
69    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
70}
71
72impl PowerFeedRequest {
73    /// Base serializer class for models inheriting from PrimaryModel.
74    pub fn new(
75        power_panel: crate::models::PatchedWritablePowerFeedRequestPowerPanel,
76        name: String,
77    ) -> PowerFeedRequest {
78        PowerFeedRequest {
79            power_panel: Box::new(power_panel),
80            rack: None,
81            name,
82            status: None,
83            r#type: None,
84            supply: None,
85            phase: None,
86            voltage: None,
87            amperage: None,
88            max_utilization: None,
89            mark_connected: None,
90            description: None,
91            tenant: None,
92            owner: None,
93            comments: None,
94            tags: None,
95            custom_fields: None,
96        }
97    }
98}
99
100/// * `offline` - Offline * `active` - Active * `planned` - Planned * `failed` - Failed
101#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
102pub enum Status {
103    #[serde(rename = "offline")]
104    Offline,
105    #[serde(rename = "active")]
106    Active,
107    #[serde(rename = "planned")]
108    Planned,
109    #[serde(rename = "failed")]
110    Failed,
111}
112
113impl Default for Status {
114    fn default() -> Status {
115        Self::Offline
116    }
117}
118/// * `primary` - Primary * `redundant` - Redundant
119#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
120pub enum RHashType {
121    #[serde(rename = "primary")]
122    Primary,
123    #[serde(rename = "redundant")]
124    Redundant,
125}
126
127impl Default for RHashType {
128    fn default() -> RHashType {
129        Self::Primary
130    }
131}
132/// * `ac` - AC * `dc` - DC
133#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
134pub enum Supply {
135    #[serde(rename = "ac")]
136    Ac,
137    #[serde(rename = "dc")]
138    Dc,
139}
140
141impl Default for Supply {
142    fn default() -> Supply {
143        Self::Ac
144    }
145}
146/// * `single-phase` - Single phase * `three-phase` - Three-phase
147#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
148pub enum Phase {
149    #[serde(rename = "single-phase")]
150    SinglePhase,
151    #[serde(rename = "three-phase")]
152    ThreePhase,
153}
154
155impl Default for Phase {
156    fn default() -> Phase {
157        Self::SinglePhase
158    }
159}