Skip to main content

nautobot_openapi/models/
vm_interface.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/// VmInterface : 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 VmInterface {
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 = "mode", skip_serializing_if = "Option::is_none")]
27    pub mode: Option<Box<crate::models::InterfaceMode>>,
28    #[serde(
29        rename = "mac_address",
30        default,
31        with = "::serde_with::rust::double_option",
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub mac_address: Option<Option<String>>,
35    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
36    pub enabled: Option<bool>,
37    #[serde(
38        rename = "mtu",
39        default,
40        with = "::serde_with::rust::double_option",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub mtu: Option<Option<i32>>,
44    #[serde(rename = "name")]
45    pub name: String,
46    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
47    pub description: Option<String>,
48    #[serde(rename = "status")]
49    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
50    #[serde(
51        rename = "role",
52        default,
53        with = "::serde_with::rust::double_option",
54        skip_serializing_if = "Option::is_none"
55    )]
56    pub role: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
57    #[serde(
58        rename = "parent_interface",
59        default,
60        with = "::serde_with::rust::double_option",
61        skip_serializing_if = "Option::is_none"
62    )]
63    pub parent_interface:
64        Option<Option<Box<crate::models::BulkWritableInterfaceRequestParentInterface>>>,
65    #[serde(
66        rename = "bridge",
67        default,
68        with = "::serde_with::rust::double_option",
69        skip_serializing_if = "Option::is_none"
70    )]
71    pub bridge: Option<Option<Box<crate::models::BridgeInterface>>>,
72    #[serde(rename = "virtual_machine")]
73    pub virtual_machine: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
74    #[serde(
75        rename = "untagged_vlan",
76        default,
77        with = "::serde_with::rust::double_option",
78        skip_serializing_if = "Option::is_none"
79    )]
80    pub untagged_vlan: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
81    #[serde(
82        rename = "vrf",
83        default,
84        with = "::serde_with::rust::double_option",
85        skip_serializing_if = "Option::is_none"
86    )]
87    pub vrf: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
88    #[serde(
89        rename = "created",
90        default,
91        with = "::serde_with::rust::double_option",
92        skip_serializing_if = "Option::is_none"
93    )]
94    pub created: Option<Option<String>>,
95    #[serde(
96        rename = "last_updated",
97        default,
98        with = "::serde_with::rust::double_option",
99        skip_serializing_if = "Option::is_none"
100    )]
101    pub last_updated: Option<Option<String>>,
102    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
103    pub notes_url: Option<String>,
104    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
105    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
106    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
107    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
108}
109
110impl VmInterface {
111    /// 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.
112    pub fn new(
113        name: String,
114        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
115        virtual_machine: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
116    ) -> VmInterface {
117        VmInterface {
118            id: None,
119            object_type: None,
120            display: None,
121            url: None,
122            natural_slug: None,
123            mode: None,
124            mac_address: None,
125            enabled: None,
126            mtu: None,
127            name,
128            description: None,
129            status: Box::new(status),
130            role: None,
131            parent_interface: None,
132            bridge: None,
133            virtual_machine: Box::new(virtual_machine),
134            untagged_vlan: None,
135            vrf: None,
136            created: None,
137            last_updated: None,
138            notes_url: None,
139            custom_fields: None,
140            tags: None,
141        }
142    }
143}