Skip to main content

nautobot_openapi/models/
bulk_writable_location_request.rs

1/*
2 * API Documentation
3 *
4 * Source of truth and network automation platform
5 *
6 * The version of the OpenAPI document: 3.1.0 (3.1)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// BulkWritableLocationRequest : Add a `tree_depth` field to non-nested model serializers based on django-tree-queries.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BulkWritableLocationRequest {
15    #[serde(rename = "id")]
16    pub id: uuid::Uuid,
17    #[serde(
18        rename = "time_zone",
19        default,
20        with = "::serde_with::rust::double_option",
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub time_zone: Option<Option<String>>,
24    #[serde(rename = "name")]
25    pub name: String,
26    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
27    pub description: Option<String>,
28    /// Local facility ID or description
29    #[serde(rename = "facility", skip_serializing_if = "Option::is_none")]
30    pub facility: Option<String>,
31    /// 32-bit autonomous system number
32    #[serde(
33        rename = "asn",
34        default,
35        with = "::serde_with::rust::double_option",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub asn: Option<Option<i64>>,
39    #[serde(rename = "physical_address", skip_serializing_if = "Option::is_none")]
40    pub physical_address: Option<String>,
41    #[serde(rename = "shipping_address", skip_serializing_if = "Option::is_none")]
42    pub shipping_address: Option<String>,
43    /// GPS coordinate (latitude)
44    #[serde(
45        rename = "latitude",
46        default,
47        with = "::serde_with::rust::double_option",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub latitude: Option<Option<String>>,
51    /// GPS coordinate (longitude)
52    #[serde(
53        rename = "longitude",
54        default,
55        with = "::serde_with::rust::double_option",
56        skip_serializing_if = "Option::is_none"
57    )]
58    pub longitude: Option<Option<String>>,
59    #[serde(rename = "contact_name", skip_serializing_if = "Option::is_none")]
60    pub contact_name: Option<String>,
61    #[serde(rename = "contact_phone", skip_serializing_if = "Option::is_none")]
62    pub contact_phone: Option<String>,
63    #[serde(rename = "contact_email", skip_serializing_if = "Option::is_none")]
64    pub contact_email: Option<String>,
65    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
66    pub comments: Option<String>,
67    #[serde(
68        rename = "parent",
69        default,
70        with = "::serde_with::rust::double_option",
71        skip_serializing_if = "Option::is_none"
72    )]
73    pub parent: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
74    #[serde(rename = "location_type")]
75    pub location_type: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
76    #[serde(rename = "status")]
77    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
78    #[serde(
79        rename = "tenant",
80        default,
81        with = "::serde_with::rust::double_option",
82        skip_serializing_if = "Option::is_none"
83    )]
84    pub tenant: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
85    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
86    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
87    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
88    pub relationships: Option<
89        ::std::collections::HashMap<
90            String,
91            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
92        >,
93    >,
94    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
95    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
96}
97
98impl BulkWritableLocationRequest {
99    /// Add a `tree_depth` field to non-nested model serializers based on django-tree-queries.
100    pub fn new(
101        id: uuid::Uuid,
102        name: String,
103        location_type: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
104        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
105    ) -> BulkWritableLocationRequest {
106        BulkWritableLocationRequest {
107            id,
108            time_zone: None,
109            name,
110            description: None,
111            facility: None,
112            asn: None,
113            physical_address: None,
114            shipping_address: None,
115            latitude: None,
116            longitude: None,
117            contact_name: None,
118            contact_phone: None,
119            contact_email: None,
120            comments: None,
121            parent: None,
122            location_type: Box::new(location_type),
123            status: Box::new(status),
124            tenant: None,
125            custom_fields: None,
126            relationships: None,
127            tags: None,
128        }
129    }
130}