Skip to main content

nautobot_openapi/models/
vrf_device_assignment.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/// VrfDeviceAssignment : Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see <https://github.com/encode/django-rest-framework/issues/3144>)
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct VrfDeviceAssignment {
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(rename = "natural_slug", skip_serializing_if = "Option::is_none")]
25    pub natural_slug: Option<String>,
26    /// Unique route distinguisher (as defined in RFC 4364)
27    #[serde(
28        rename = "rd",
29        default,
30        with = "::serde_with::rust::double_option",
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub rd: Option<Option<String>>,
34    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
35    pub name: Option<String>,
36    #[serde(rename = "vrf")]
37    pub vrf: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
38    #[serde(
39        rename = "device",
40        default,
41        with = "::serde_with::rust::double_option",
42        skip_serializing_if = "Option::is_none"
43    )]
44    pub device: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
45    #[serde(
46        rename = "virtual_machine",
47        default,
48        with = "::serde_with::rust::double_option",
49        skip_serializing_if = "Option::is_none"
50    )]
51    pub virtual_machine: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
52    #[serde(
53        rename = "virtual_device_context",
54        default,
55        with = "::serde_with::rust::double_option",
56        skip_serializing_if = "Option::is_none"
57    )]
58    pub virtual_device_context: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
59}
60
61impl VrfDeviceAssignment {
62    /// Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see <https://github.com/encode/django-rest-framework/issues/3144>)
63    pub fn new(
64        vrf: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
65    ) -> VrfDeviceAssignment {
66        VrfDeviceAssignment {
67            id: None,
68            object_type: None,
69            display: None,
70            url: None,
71            natural_slug: None,
72            rd: None,
73            name: None,
74            vrf: Box::new(vrf),
75            device: None,
76            virtual_machine: None,
77            virtual_device_context: None,
78        }
79    }
80}