Skip to main content

nautobot_openapi/models/
location_type.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/// LocationType : 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 LocationType {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
18    pub object_type: Option<String>,
19    /// Human friendly display value
20    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
21    pub display: Option<String>,
22    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
23    pub url: Option<String>,
24    #[serde(rename = "natural_slug", skip_serializing_if = "Option::is_none")]
25    pub natural_slug: Option<String>,
26    #[serde(
27        rename = "tree_depth",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub tree_depth: Option<Option<i32>>,
33    #[serde(rename = "content_types", skip_serializing_if = "Option::is_none")]
34    pub content_types: Option<Vec<String>>,
35    #[serde(rename = "name")]
36    pub name: String,
37    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
38    pub description: Option<String>,
39    /// Allow Locations of this type to be parents/children of other Locations of this same type
40    #[serde(rename = "nestable", skip_serializing_if = "Option::is_none")]
41    pub nestable: Option<bool>,
42    #[serde(
43        rename = "parent",
44        default,
45        with = "::serde_with::rust::double_option",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub parent: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
49    #[serde(
50        rename = "created",
51        default,
52        with = "::serde_with::rust::double_option",
53        skip_serializing_if = "Option::is_none"
54    )]
55    pub created: Option<Option<String>>,
56    #[serde(
57        rename = "last_updated",
58        default,
59        with = "::serde_with::rust::double_option",
60        skip_serializing_if = "Option::is_none"
61    )]
62    pub last_updated: Option<Option<String>>,
63    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
64    pub notes_url: Option<String>,
65    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
66    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
67}
68
69impl LocationType {
70    /// Add a `tree_depth` field to non-nested model serializers based on django-tree-queries.
71    pub fn new(name: String) -> LocationType {
72        LocationType {
73            id: None,
74            object_type: None,
75            display: None,
76            url: None,
77            natural_slug: None,
78            tree_depth: None,
79            content_types: None,
80            name,
81            description: None,
82            nestable: None,
83            parent: None,
84            created: None,
85            last_updated: None,
86            notes_url: None,
87            custom_fields: None,
88        }
89    }
90}