Skip to main content

nautobot_openapi/models/
writable_interface_request.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/// WritableInterfaceRequest : 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 WritableInterfaceRequest {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(
18        rename = "mac_address",
19        default,
20        with = "::serde_with::rust::double_option",
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub mac_address: Option<Option<String>>,
24    #[serde(
25        rename = "speed",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub speed: Option<Option<i32>>,
31    #[serde(rename = "name")]
32    pub name: String,
33    /// Physical label
34    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
35    pub label: Option<String>,
36    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
37    pub description: Option<String>,
38    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
39    pub enabled: Option<bool>,
40    #[serde(
41        rename = "mtu",
42        default,
43        with = "::serde_with::rust::double_option",
44        skip_serializing_if = "Option::is_none"
45    )]
46    pub mtu: Option<Option<i32>>,
47    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
48    pub mode: Option<Box<crate::models::PatchedWritableInterfaceRequestMode>>,
49    #[serde(rename = "type")]
50    pub r#type: crate::models::InterfaceTypeChoices,
51    #[serde(rename = "port_type", skip_serializing_if = "Option::is_none")]
52    pub port_type: Option<Box<crate::models::PatchedWritableInterfaceRequestPortType>>,
53    /// This interface is used only for out-of-band management
54    #[serde(rename = "mgmt_only", skip_serializing_if = "Option::is_none")]
55    pub mgmt_only: Option<bool>,
56    #[serde(rename = "duplex", skip_serializing_if = "Option::is_none")]
57    pub duplex: Option<Box<crate::models::BulkWritableInterfaceTemplateRequestDuplex>>,
58    #[serde(
59        rename = "device",
60        default,
61        with = "::serde_with::rust::double_option",
62        skip_serializing_if = "Option::is_none"
63    )]
64    pub device: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
65    #[serde(
66        rename = "module",
67        default,
68        with = "::serde_with::rust::double_option",
69        skip_serializing_if = "Option::is_none"
70    )]
71    pub module: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
72    #[serde(rename = "status")]
73    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
74    #[serde(
75        rename = "role",
76        default,
77        with = "::serde_with::rust::double_option",
78        skip_serializing_if = "Option::is_none"
79    )]
80    pub role: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
81    #[serde(
82        rename = "parent_interface",
83        default,
84        with = "::serde_with::rust::double_option",
85        skip_serializing_if = "Option::is_none"
86    )]
87    pub parent_interface:
88        Option<Option<Box<crate::models::BulkWritableInterfaceRequestParentInterface>>>,
89    #[serde(
90        rename = "bridge",
91        default,
92        with = "::serde_with::rust::double_option",
93        skip_serializing_if = "Option::is_none"
94    )]
95    pub bridge: Option<Option<Box<crate::models::BridgeInterface>>>,
96    #[serde(
97        rename = "lag",
98        default,
99        with = "::serde_with::rust::double_option",
100        skip_serializing_if = "Option::is_none"
101    )]
102    pub lag: Option<Option<Box<crate::models::ParentLag>>>,
103    #[serde(
104        rename = "untagged_vlan",
105        default,
106        with = "::serde_with::rust::double_option",
107        skip_serializing_if = "Option::is_none"
108    )]
109    pub untagged_vlan: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
110    #[serde(
111        rename = "vrf",
112        default,
113        with = "::serde_with::rust::double_option",
114        skip_serializing_if = "Option::is_none"
115    )]
116    pub vrf: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
117    #[serde(rename = "tagged_vlans", skip_serializing_if = "Option::is_none")]
118    pub tagged_vlans: Option<Vec<crate::models::TaggedVlans>>,
119    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
120    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
121    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
122    pub relationships: Option<
123        ::std::collections::HashMap<
124            String,
125            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
126        >,
127    >,
128    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
129    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
130}
131
132impl WritableInterfaceRequest {
133    /// 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.
134    pub fn new(
135        name: String,
136        r#type: crate::models::InterfaceTypeChoices,
137        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
138    ) -> WritableInterfaceRequest {
139        WritableInterfaceRequest {
140            id: None,
141            mac_address: None,
142            speed: None,
143            name,
144            label: None,
145            description: None,
146            enabled: None,
147            mtu: None,
148            mode: None,
149            r#type,
150            port_type: None,
151            mgmt_only: None,
152            duplex: None,
153            device: None,
154            module: None,
155            status: Box::new(status),
156            role: None,
157            parent_interface: None,
158            bridge: None,
159            lag: None,
160            untagged_vlan: None,
161            vrf: None,
162            tagged_vlans: None,
163            custom_fields: None,
164            relationships: None,
165            tags: None,
166        }
167    }
168}