Skip to main content

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