Skip to main content

netbox_openapi/models/
dcim_power_feeds_create_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#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct DcimPowerFeedsCreateRequest {
13    #[serde(rename = "power_panel")]
14    pub power_panel: Box<crate::models::PatchedWritablePowerFeedRequestPowerPanel>,
15    #[serde(
16        rename = "rack",
17        default,
18        with = "::serde_with::rust::double_option",
19        skip_serializing_if = "Option::is_none"
20    )]
21    pub rack: Option<Option<Box<crate::models::DeviceWithConfigContextRequestRack>>>,
22    #[serde(rename = "name")]
23    pub name: String,
24    /// * `offline` - Offline * `active` - Active * `planned` - Planned * `failed` - Failed
25    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
26    pub status: Option<Status>,
27    /// * `primary` - Primary * `redundant` - Redundant
28    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
29    pub r#type: Option<RHashType>,
30    /// * `ac` - AC * `dc` - DC
31    #[serde(rename = "supply", skip_serializing_if = "Option::is_none")]
32    pub supply: Option<Supply>,
33    /// * `single-phase` - Single phase * `three-phase` - Three-phase
34    #[serde(rename = "phase", skip_serializing_if = "Option::is_none")]
35    pub phase: Option<Phase>,
36    #[serde(rename = "voltage", skip_serializing_if = "Option::is_none")]
37    pub voltage: Option<i32>,
38    #[serde(rename = "amperage", skip_serializing_if = "Option::is_none")]
39    pub amperage: Option<i32>,
40    /// Maximum permissible draw (percentage)
41    #[serde(rename = "max_utilization", skip_serializing_if = "Option::is_none")]
42    pub max_utilization: Option<i32>,
43    /// Treat as if a cable is connected
44    #[serde(rename = "mark_connected", skip_serializing_if = "Option::is_none")]
45    pub mark_connected: Option<bool>,
46    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
47    pub description: Option<String>,
48    #[serde(
49        rename = "tenant",
50        default,
51        with = "::serde_with::rust::double_option",
52        skip_serializing_if = "Option::is_none"
53    )]
54    pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
55    #[serde(
56        rename = "owner",
57        default,
58        with = "::serde_with::rust::double_option",
59        skip_serializing_if = "Option::is_none"
60    )]
61    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
62    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
63    pub comments: Option<String>,
64    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
65    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
66    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
67    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
68}
69
70impl DcimPowerFeedsCreateRequest {
71    pub fn new(
72        power_panel: crate::models::PatchedWritablePowerFeedRequestPowerPanel,
73        name: String,
74    ) -> DcimPowerFeedsCreateRequest {
75        DcimPowerFeedsCreateRequest {
76            power_panel: Box::new(power_panel),
77            rack: None,
78            name,
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}