1#[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 #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
28 pub status: Option<Status>,
29 #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
31 pub r#type: Option<RHashType>,
32 #[serde(rename = "supply", skip_serializing_if = "Option::is_none")]
34 pub supply: Option<Supply>,
35 #[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 #[serde(rename = "max_utilization", skip_serializing_if = "Option::is_none")]
44 pub max_utilization: Option<i32>,
45 #[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 WritablePowerFeedRequest {
73 pub fn new(
75 power_panel: crate::models::PatchedWritablePowerFeedRequestPowerPanel,
76 name: String,
77 ) -> WritablePowerFeedRequest {
78 WritablePowerFeedRequest {
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#[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#[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#[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#[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}