Skip to main content

netbox_openapi/models/
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/// BulkLocationRequest : Base serializer class for models inheriting from NestedGroupModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BulkLocationRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "name")]
18    pub name: String,
19    #[serde(rename = "slug")]
20    pub slug: String,
21    #[serde(rename = "site")]
22    pub site: 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 BulkLocationRequest {
61    /// Base serializer class for models inheriting from NestedGroupModel.
62    pub fn new(
63        id: i32,
64        name: String,
65        slug: String,
66        site: crate::models::BulkDeviceWithConfigContextRequestSite,
67    ) -> BulkLocationRequest {
68        BulkLocationRequest {
69            id,
70            name,
71            slug,
72            site: Box::new(site),
73            parent: None,
74            status: None,
75            tenant: None,
76            facility: None,
77            description: None,
78            tags: None,
79            custom_fields: None,
80            owner: None,
81            comments: None,
82        }
83    }
84}
85
86/// * `planned` - Planned * `staging` - Staging * `active` - Active * `decommissioning` - Decommissioning * `retired` - Retired
87#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
88pub enum Status {
89    #[serde(rename = "planned")]
90    Planned,
91    #[serde(rename = "staging")]
92    Staging,
93    #[serde(rename = "active")]
94    Active,
95    #[serde(rename = "decommissioning")]
96    Decommissioning,
97    #[serde(rename = "retired")]
98    Retired,
99}
100
101impl Default for Status {
102    fn default() -> Status {
103        Self::Planned
104    }
105}