Skip to main content

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