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.4.2-Docker-3.4.1 (4.4)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedWritableLocationRequest : Extends PrimaryModelSerializer to include MPTT support.
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(rename = "comments", skip_serializing_if = "Option::is_none")]
48    pub comments: Option<String>,
49}
50
51impl PatchedWritableLocationRequest {
52    /// Extends PrimaryModelSerializer to include MPTT support.
53    pub fn new() -> PatchedWritableLocationRequest {
54        PatchedWritableLocationRequest {
55            name: None,
56            slug: None,
57            site: None,
58            parent: None,
59            status: None,
60            tenant: None,
61            facility: None,
62            description: None,
63            tags: None,
64            custom_fields: None,
65            comments: None,
66        }
67    }
68}
69
70/// * `planned` - Planned * `staging` - Staging * `active` - Active * `decommissioning` - Decommissioning * `retired` - Retired
71#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
72pub enum Status {
73    #[serde(rename = "planned")]
74    Planned,
75    #[serde(rename = "staging")]
76    Staging,
77    #[serde(rename = "active")]
78    Active,
79    #[serde(rename = "decommissioning")]
80    Decommissioning,
81    #[serde(rename = "retired")]
82    Retired,
83}
84
85impl Default for Status {
86    fn default() -> Status {
87        Self::Planned
88    }
89}