Skip to main content

netbox_openapi/models/
dcim_power_panels_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 DcimPowerPanelsCreateRequest {
13    #[serde(rename = "site")]
14    pub site: Box<crate::models::DeviceWithConfigContextRequestSite>,
15    #[serde(
16        rename = "location",
17        default,
18        with = "::serde_with::rust::double_option",
19        skip_serializing_if = "Option::is_none"
20    )]
21    pub location: Option<Option<Box<crate::models::DeviceWithConfigContextRequestLocation>>>,
22    #[serde(rename = "name")]
23    pub name: String,
24    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
25    pub description: Option<String>,
26    #[serde(
27        rename = "owner",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
33    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
34    pub comments: Option<String>,
35    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
36    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
37    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
38    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
39}
40
41impl DcimPowerPanelsCreateRequest {
42    pub fn new(
43        site: crate::models::DeviceWithConfigContextRequestSite,
44        name: String,
45    ) -> DcimPowerPanelsCreateRequest {
46        DcimPowerPanelsCreateRequest {
47            site: Box::new(site),
48            location: None,
49            name,
50            description: None,
51            owner: None,
52            comments: None,
53            tags: None,
54            custom_fields: None,
55        }
56    }
57}