Skip to main content

nautobot_openapi/models/
bulk_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/// BulkWritableInterfaceRequest : 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 BulkWritableInterfaceRequest {
15    #[serde(rename = "id")]
16    pub id: uuid::Uuid,
17    #[serde(rename = "type")]
18    pub r#type: crate::models::InterfaceTypeChoices,
19    #[serde(rename = "port_type", skip_serializing_if = "Option::is_none")]
20    pub port_type: Option<crate::models::PortTypeChoices>,
21    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
22    pub mode: Option<crate::models::InterfaceModeChoices>,
23    #[serde(
24        rename = "mac_address",
25        default,
26        with = "::serde_with::rust::double_option",
27        skip_serializing_if = "Option::is_none"
28    )]
29    pub mac_address: Option<Option<String>>,
30    #[serde(
31        rename = "speed",
32        default,
33        with = "::serde_with::rust::double_option",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub speed: Option<Option<i32>>,
37    #[serde(rename = "duplex", skip_serializing_if = "Option::is_none")]
38    pub duplex: Option<crate::models::DuplexEnum>,
39    #[serde(rename = "name")]
40    pub name: String,
41    /// Physical label
42    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
43    pub label: Option<String>,
44    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
45    pub description: Option<String>,
46    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
47    pub enabled: Option<bool>,
48    #[serde(
49        rename = "mtu",
50        default,
51        with = "::serde_with::rust::double_option",
52        skip_serializing_if = "Option::is_none"
53    )]
54    pub mtu: Option<Option<i32>>,
55    /// This interface is used only for out-of-band management
56    #[serde(rename = "mgmt_only", skip_serializing_if = "Option::is_none")]
57    pub mgmt_only: Option<bool>,
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 BulkWritableInterfaceRequest {
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        id: uuid::Uuid,
136        r#type: crate::models::InterfaceTypeChoices,
137        name: String,
138        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
139    ) -> BulkWritableInterfaceRequest {
140        BulkWritableInterfaceRequest {
141            id,
142            r#type,
143            port_type: None,
144            mode: None,
145            mac_address: None,
146            speed: None,
147            duplex: None,
148            name,
149            label: None,
150            description: None,
151            enabled: None,
152            mtu: None,
153            mgmt_only: None,
154            device: None,
155            module: None,
156            status: Box::new(status),
157            role: None,
158            parent_interface: None,
159            bridge: None,
160            lag: None,
161            untagged_vlan: None,
162            vrf: None,
163            tagged_vlans: None,
164            custom_fields: None,
165            relationships: None,
166            tags: None,
167        }
168    }
169}