Skip to main content

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