Skip to main content

netbox_openapi/models/
patched_writable_location_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/// PatchedWritableLocationRequest : Base serializer class for models inheriting from NestedGroupModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedWritableLocationRequest {
15    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
16    pub name: Option<String>,
17    #[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
18    pub slug: Option<String>,
19    #[serde(rename = "site", skip_serializing_if = "Option::is_none")]
20    pub site: Option<Box<crate::models::DeviceWithConfigContextRequestSite>>,
21    #[serde(
22        rename = "parent",
23        default,
24        with = "::serde_with::rust::double_option",
25        skip_serializing_if = "Option::is_none"
26    )]
27    pub parent: Option<Option<i32>>,
28    /// * `planned` - Planned * `staging` - Staging * `active` - Active * `decommissioning` - Decommissioning * `retired` - Retired
29    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
30    pub status: Option<Status>,
31    #[serde(
32        rename = "tenant",
33        default,
34        with = "::serde_with::rust::double_option",
35        skip_serializing_if = "Option::is_none"
36    )]
37    pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
38    /// Local facility ID or description
39    #[serde(rename = "facility", skip_serializing_if = "Option::is_none")]
40    pub facility: Option<String>,
41    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
42    pub description: Option<String>,
43    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
44    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
45    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
46    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
47    #[serde(
48        rename = "owner",
49        default,
50        with = "::serde_with::rust::double_option",
51        skip_serializing_if = "Option::is_none"
52    )]
53    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
54    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
55    pub comments: Option<String>,
56}
57
58impl PatchedWritableLocationRequest {
59    /// Base serializer class for models inheriting from NestedGroupModel.
60    pub fn new() -> PatchedWritableLocationRequest {
61        PatchedWritableLocationRequest {
62            name: None,
63            slug: None,
64            site: None,
65            parent: None,
66            status: None,
67            tenant: None,
68            facility: None,
69            description: None,
70            tags: None,
71            custom_fields: None,
72            owner: None,
73            comments: None,
74        }
75    }
76}
77
78/// * `planned` - Planned * `staging` - Staging * `active` - Active * `decommissioning` - Decommissioning * `retired` - Retired
79#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
80pub enum Status {
81    #[serde(rename = "planned")]
82    Planned,
83    #[serde(rename = "staging")]
84    Staging,
85    #[serde(rename = "active")]
86    Active,
87    #[serde(rename = "decommissioning")]
88    Decommissioning,
89    #[serde(rename = "retired")]
90    Retired,
91}
92
93impl Default for Status {
94    fn default() -> Status {
95        Self::Planned
96    }
97}