Skip to main content

nautobot_openapi/models/
module.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/// Module : 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 Module {
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 = "serial",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub serial: Option<Option<String>>,
33    /// A unique tag used to identify this module
34    #[serde(
35        rename = "asset_tag",
36        default,
37        with = "::serde_with::rust::double_option",
38        skip_serializing_if = "Option::is_none"
39    )]
40    pub asset_tag: Option<Option<String>>,
41    #[serde(rename = "module_type")]
42    pub module_type: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
43    #[serde(
44        rename = "parent_module_bay",
45        default,
46        with = "::serde_with::rust::double_option",
47        skip_serializing_if = "Option::is_none"
48    )]
49    pub parent_module_bay: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
50    #[serde(rename = "status")]
51    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
52    #[serde(
53        rename = "role",
54        default,
55        with = "::serde_with::rust::double_option",
56        skip_serializing_if = "Option::is_none"
57    )]
58    pub role: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
59    #[serde(
60        rename = "tenant",
61        default,
62        with = "::serde_with::rust::double_option",
63        skip_serializing_if = "Option::is_none"
64    )]
65    pub tenant: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
66    #[serde(
67        rename = "location",
68        default,
69        with = "::serde_with::rust::double_option",
70        skip_serializing_if = "Option::is_none"
71    )]
72    pub location: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
73    #[serde(
74        rename = "created",
75        default,
76        with = "::serde_with::rust::double_option",
77        skip_serializing_if = "Option::is_none"
78    )]
79    pub created: Option<Option<String>>,
80    #[serde(
81        rename = "last_updated",
82        default,
83        with = "::serde_with::rust::double_option",
84        skip_serializing_if = "Option::is_none"
85    )]
86    pub last_updated: Option<Option<String>>,
87    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
88    pub notes_url: Option<String>,
89    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
90    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
91    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
92    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
93}
94
95impl Module {
96    /// 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.
97    pub fn new(
98        module_type: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
99        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
100    ) -> Module {
101        Module {
102            id: None,
103            object_type: None,
104            display: None,
105            url: None,
106            natural_slug: None,
107            serial: None,
108            asset_tag: None,
109            module_type: Box::new(module_type),
110            parent_module_bay: None,
111            status: Box::new(status),
112            role: None,
113            tenant: None,
114            location: None,
115            created: None,
116            last_updated: None,
117            notes_url: None,
118            custom_fields: None,
119            tags: None,
120        }
121    }
122}