netbox_openapi/models/
patched_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/// PatchedWritablePowerFeedRequest : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedWritablePowerFeedRequest {
15    #[serde(rename = "power_panel", skip_serializing_if = "Option::is_none")]
16    pub power_panel: Option<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", skip_serializing_if = "Option::is_none")]
25    pub name: Option<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 PatchedWritablePowerFeedRequest {
66    /// Adds support for custom fields and tags.
67    pub fn new() -> PatchedWritablePowerFeedRequest {
68        PatchedWritablePowerFeedRequest {
69            power_panel: None,
70            rack: None,
71            name: None,
72            status: None,
73            r#type: None,
74            supply: None,
75            phase: None,
76            voltage: None,
77            amperage: None,
78            max_utilization: None,
79            mark_connected: None,
80            description: None,
81            tenant: None,
82            comments: None,
83            tags: None,
84            custom_fields: None,
85        }
86    }
87}
88
89/// * `offline` - Offline * `active` - Active * `planned` - Planned * `failed` - Failed
90#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
91pub enum Status {
92    #[serde(rename = "offline")]
93    Offline,
94    #[serde(rename = "active")]
95    Active,
96    #[serde(rename = "planned")]
97    Planned,
98    #[serde(rename = "failed")]
99    Failed,
100}
101
102impl Default for Status {
103    fn default() -> Status {
104        Self::Offline
105    }
106}
107/// * `primary` - Primary * `redundant` - Redundant
108#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
109pub enum RHashType {
110    #[serde(rename = "primary")]
111    Primary,
112    #[serde(rename = "redundant")]
113    Redundant,
114}
115
116impl Default for RHashType {
117    fn default() -> RHashType {
118        Self::Primary
119    }
120}
121/// * `ac` - AC * `dc` - DC
122#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
123pub enum Supply {
124    #[serde(rename = "ac")]
125    Ac,
126    #[serde(rename = "dc")]
127    Dc,
128}
129
130impl Default for Supply {
131    fn default() -> Supply {
132        Self::Ac
133    }
134}
135/// * `single-phase` - Single phase * `three-phase` - Three-phase
136#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
137pub enum Phase {
138    #[serde(rename = "single-phase")]
139    SinglePhase,
140    #[serde(rename = "three-phase")]
141    ThreePhase,
142}
143
144impl Default for Phase {
145    fn default() -> Phase {
146        Self::SinglePhase
147    }
148}