Skip to main content

nautobot_openapi/models/
metadata_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/// MetadataType : Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct MetadataType {
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(rename = "content_types")]
27    pub content_types: Vec<String>,
28    #[serde(rename = "name")]
29    pub name: String,
30    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
31    pub description: Option<String>,
32    #[serde(rename = "data_type")]
33    pub data_type: crate::models::DataTypeEnum,
34    #[serde(
35        rename = "created",
36        default,
37        with = "::serde_with::rust::double_option",
38        skip_serializing_if = "Option::is_none"
39    )]
40    pub created: Option<Option<String>>,
41    #[serde(
42        rename = "last_updated",
43        default,
44        with = "::serde_with::rust::double_option",
45        skip_serializing_if = "Option::is_none"
46    )]
47    pub last_updated: Option<Option<String>>,
48    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
49    pub notes_url: Option<String>,
50    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
51    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
52    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
53    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
54}
55
56impl MetadataType {
57    /// Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
58    pub fn new(
59        content_types: Vec<String>,
60        name: String,
61        data_type: crate::models::DataTypeEnum,
62    ) -> MetadataType {
63        MetadataType {
64            id: None,
65            object_type: None,
66            display: None,
67            url: None,
68            natural_slug: None,
69            content_types,
70            name,
71            description: None,
72            data_type,
73            created: None,
74            last_updated: None,
75            notes_url: None,
76            custom_fields: None,
77            tags: None,
78        }
79    }
80}