Skip to main content

netbox_openapi/models/
patched_bulk_site_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/// PatchedBulkSiteRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedBulkSiteRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    /// Full name of the site
18    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
19    pub name: Option<String>,
20    #[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
21    pub slug: Option<String>,
22    /// * `planned` - Planned * `staging` - Staging * `active` - Active * `decommissioning` - Decommissioning * `retired` - Retired
23    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
24    pub status: Option<Status>,
25    #[serde(
26        rename = "region",
27        default,
28        with = "::serde_with::rust::double_option",
29        skip_serializing_if = "Option::is_none"
30    )]
31    pub region: Option<Option<Box<crate::models::BulkSiteRequestRegion>>>,
32    #[serde(
33        rename = "group",
34        default,
35        with = "::serde_with::rust::double_option",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub group: Option<Option<Box<crate::models::BulkSiteRequestGroup>>>,
39    #[serde(
40        rename = "tenant",
41        default,
42        with = "::serde_with::rust::double_option",
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
46    /// Local facility ID or description
47    #[serde(rename = "facility", skip_serializing_if = "Option::is_none")]
48    pub facility: Option<String>,
49    #[serde(
50        rename = "time_zone",
51        default,
52        with = "::serde_with::rust::double_option",
53        skip_serializing_if = "Option::is_none"
54    )]
55    pub time_zone: Option<Option<String>>,
56    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
57    pub description: Option<String>,
58    /// Physical location of the building
59    #[serde(rename = "physical_address", skip_serializing_if = "Option::is_none")]
60    pub physical_address: Option<String>,
61    /// If different from the physical address
62    #[serde(rename = "shipping_address", skip_serializing_if = "Option::is_none")]
63    pub shipping_address: Option<String>,
64    /// GPS coordinate in decimal format (xx.yyyyyy)
65    #[serde(
66        rename = "latitude",
67        default,
68        with = "::serde_with::rust::double_option",
69        skip_serializing_if = "Option::is_none"
70    )]
71    pub latitude: Option<Option<f64>>,
72    /// GPS coordinate in decimal format (xx.yyyyyy)
73    #[serde(
74        rename = "longitude",
75        default,
76        with = "::serde_with::rust::double_option",
77        skip_serializing_if = "Option::is_none"
78    )]
79    pub longitude: Option<Option<f64>>,
80    #[serde(
81        rename = "owner",
82        default,
83        with = "::serde_with::rust::double_option",
84        skip_serializing_if = "Option::is_none"
85    )]
86    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
87    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
88    pub comments: Option<String>,
89    #[serde(rename = "asns", skip_serializing_if = "Option::is_none")]
90    pub asns: Option<Vec<i32>>,
91    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
92    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
93    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
94    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
95}
96
97impl PatchedBulkSiteRequest {
98    /// Base serializer class for models inheriting from PrimaryModel.
99    pub fn new(id: i32) -> PatchedBulkSiteRequest {
100        PatchedBulkSiteRequest {
101            id,
102            name: None,
103            slug: None,
104            status: None,
105            region: None,
106            group: None,
107            tenant: None,
108            facility: None,
109            time_zone: None,
110            description: None,
111            physical_address: None,
112            shipping_address: None,
113            latitude: None,
114            longitude: None,
115            owner: None,
116            comments: None,
117            asns: None,
118            tags: None,
119            custom_fields: None,
120        }
121    }
122}
123
124/// * `planned` - Planned * `staging` - Staging * `active` - Active * `decommissioning` - Decommissioning * `retired` - Retired
125#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
126pub enum Status {
127    #[serde(rename = "planned")]
128    Planned,
129    #[serde(rename = "staging")]
130    Staging,
131    #[serde(rename = "active")]
132    Active,
133    #[serde(rename = "decommissioning")]
134    Decommissioning,
135    #[serde(rename = "retired")]
136    Retired,
137}
138
139impl Default for Status {
140    fn default() -> Status {
141        Self::Planned
142    }
143}