Skip to main content

nautobot_openapi/models/
bulk_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/// BulkWritableVmInterfaceRequest : 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 BulkWritableVmInterfaceRequest {
15    #[serde(rename = "id")]
16    pub id: uuid::Uuid,
17    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
18    pub mode: Option<crate::models::InterfaceModeChoices>,
19    #[serde(
20        rename = "mac_address",
21        default,
22        with = "::serde_with::rust::double_option",
23        skip_serializing_if = "Option::is_none"
24    )]
25    pub mac_address: Option<Option<String>>,
26    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
27    pub enabled: Option<bool>,
28    #[serde(
29        rename = "mtu",
30        default,
31        with = "::serde_with::rust::double_option",
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub mtu: Option<Option<i32>>,
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 BulkWritableVmInterfaceRequest {
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        id: uuid::Uuid,
98        name: String,
99        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
100        virtual_machine: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
101    ) -> BulkWritableVmInterfaceRequest {
102        BulkWritableVmInterfaceRequest {
103            id,
104            mode: None,
105            mac_address: None,
106            enabled: None,
107            mtu: None,
108            name,
109            description: None,
110            status: Box::new(status),
111            role: None,
112            parent_interface: None,
113            bridge: None,
114            virtual_machine: Box::new(virtual_machine),
115            untagged_vlan: None,
116            vrf: None,
117            tagged_vlans: None,
118            custom_fields: None,
119            relationships: None,
120            tags: None,
121        }
122    }
123}