Skip to main content

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