Skip to main content

nautobot_openapi/models/
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/// Interface : 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 Interface {
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(
25        rename = "cable_peer_type",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub cable_peer_type: Option<Option<String>>,
31    #[serde(
32        rename = "cable_peer",
33        default,
34        with = "::serde_with::rust::double_option",
35        skip_serializing_if = "Option::is_none"
36    )]
37    pub cable_peer: Option<Option<Box<crate::models::CableTermination>>>,
38    #[serde(rename = "natural_slug", skip_serializing_if = "Option::is_none")]
39    pub natural_slug: Option<String>,
40    #[serde(
41        rename = "connected_endpoint_type",
42        default,
43        with = "::serde_with::rust::double_option",
44        skip_serializing_if = "Option::is_none"
45    )]
46    pub connected_endpoint_type: Option<Option<String>>,
47    #[serde(
48        rename = "connected_endpoint",
49        default,
50        with = "::serde_with::rust::double_option",
51        skip_serializing_if = "Option::is_none"
52    )]
53    pub connected_endpoint: Option<Option<Box<crate::models::PathEndpoint>>>,
54    #[serde(
55        rename = "connected_endpoint_reachable",
56        default,
57        with = "::serde_with::rust::double_option",
58        skip_serializing_if = "Option::is_none"
59    )]
60    pub connected_endpoint_reachable: Option<Option<bool>>,
61    #[serde(rename = "type")]
62    pub r#type: Box<crate::models::InterfaceType>,
63    #[serde(rename = "port_type", skip_serializing_if = "Option::is_none")]
64    pub port_type: Option<Box<crate::models::FrontPortType>>,
65    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
66    pub mode: Option<Box<crate::models::InterfaceMode>>,
67    #[serde(
68        rename = "mac_address",
69        default,
70        with = "::serde_with::rust::double_option",
71        skip_serializing_if = "Option::is_none"
72    )]
73    pub mac_address: Option<Option<String>>,
74    #[serde(rename = "ip_address_count", skip_serializing_if = "Option::is_none")]
75    pub ip_address_count: Option<i32>,
76    #[serde(
77        rename = "speed",
78        default,
79        with = "::serde_with::rust::double_option",
80        skip_serializing_if = "Option::is_none"
81    )]
82    pub speed: Option<Option<i32>>,
83    #[serde(rename = "duplex", skip_serializing_if = "Option::is_none")]
84    pub duplex: Option<Box<crate::models::InterfaceDuplex>>,
85    #[serde(rename = "name")]
86    pub name: String,
87    /// Physical label
88    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
89    pub label: Option<String>,
90    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
91    pub description: Option<String>,
92    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
93    pub enabled: Option<bool>,
94    #[serde(
95        rename = "mtu",
96        default,
97        with = "::serde_with::rust::double_option",
98        skip_serializing_if = "Option::is_none"
99    )]
100    pub mtu: Option<Option<i32>>,
101    /// This interface is used only for out-of-band management
102    #[serde(rename = "mgmt_only", skip_serializing_if = "Option::is_none")]
103    pub mgmt_only: Option<bool>,
104    #[serde(
105        rename = "device",
106        default,
107        with = "::serde_with::rust::double_option",
108        skip_serializing_if = "Option::is_none"
109    )]
110    pub device: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
111    #[serde(
112        rename = "module",
113        default,
114        with = "::serde_with::rust::double_option",
115        skip_serializing_if = "Option::is_none"
116    )]
117    pub module: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
118    #[serde(
119        rename = "cable",
120        default,
121        with = "::serde_with::rust::double_option",
122        skip_serializing_if = "Option::is_none"
123    )]
124    pub cable: Option<Option<Box<crate::models::CircuitCircuitTerminationA>>>,
125    #[serde(rename = "status")]
126    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
127    #[serde(
128        rename = "role",
129        default,
130        with = "::serde_with::rust::double_option",
131        skip_serializing_if = "Option::is_none"
132    )]
133    pub role: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
134    #[serde(
135        rename = "parent_interface",
136        default,
137        with = "::serde_with::rust::double_option",
138        skip_serializing_if = "Option::is_none"
139    )]
140    pub parent_interface:
141        Option<Option<Box<crate::models::BulkWritableInterfaceRequestParentInterface>>>,
142    #[serde(
143        rename = "bridge",
144        default,
145        with = "::serde_with::rust::double_option",
146        skip_serializing_if = "Option::is_none"
147    )]
148    pub bridge: Option<Option<Box<crate::models::BridgeInterface>>>,
149    #[serde(
150        rename = "lag",
151        default,
152        with = "::serde_with::rust::double_option",
153        skip_serializing_if = "Option::is_none"
154    )]
155    pub lag: Option<Option<Box<crate::models::ParentLag>>>,
156    #[serde(
157        rename = "untagged_vlan",
158        default,
159        with = "::serde_with::rust::double_option",
160        skip_serializing_if = "Option::is_none"
161    )]
162    pub untagged_vlan: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
163    #[serde(
164        rename = "vrf",
165        default,
166        with = "::serde_with::rust::double_option",
167        skip_serializing_if = "Option::is_none"
168    )]
169    pub vrf: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
170    #[serde(
171        rename = "created",
172        default,
173        with = "::serde_with::rust::double_option",
174        skip_serializing_if = "Option::is_none"
175    )]
176    pub created: Option<Option<String>>,
177    #[serde(
178        rename = "last_updated",
179        default,
180        with = "::serde_with::rust::double_option",
181        skip_serializing_if = "Option::is_none"
182    )]
183    pub last_updated: Option<Option<String>>,
184    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
185    pub notes_url: Option<String>,
186    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
187    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
188    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
189    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
190}
191
192impl Interface {
193    /// 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.
194    pub fn new(
195        r#type: crate::models::InterfaceType,
196        name: String,
197        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
198    ) -> Interface {
199        Interface {
200            id: None,
201            object_type: None,
202            display: None,
203            url: None,
204            cable_peer_type: None,
205            cable_peer: None,
206            natural_slug: None,
207            connected_endpoint_type: None,
208            connected_endpoint: None,
209            connected_endpoint_reachable: None,
210            r#type: Box::new(r#type),
211            port_type: None,
212            mode: None,
213            mac_address: None,
214            ip_address_count: None,
215            speed: None,
216            duplex: None,
217            name,
218            label: None,
219            description: None,
220            enabled: None,
221            mtu: None,
222            mgmt_only: None,
223            device: None,
224            module: None,
225            cable: None,
226            status: Box::new(status),
227            role: None,
228            parent_interface: None,
229            bridge: None,
230            lag: None,
231            untagged_vlan: None,
232            vrf: None,
233            created: None,
234            last_updated: None,
235            notes_url: None,
236            custom_fields: None,
237            tags: None,
238        }
239    }
240}