Skip to main content

nautobot_openapi/models/
vrf_device_assignment_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/// VrfDeviceAssignmentRequest : 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 VrfDeviceAssignmentRequest {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    /// Unique route distinguisher (as defined in RFC 4364)
18    #[serde(
19        rename = "rd",
20        default,
21        with = "::serde_with::rust::double_option",
22        skip_serializing_if = "Option::is_none"
23    )]
24    pub rd: Option<Option<String>>,
25    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
26    pub name: Option<String>,
27    #[serde(rename = "vrf")]
28    pub vrf: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
29    #[serde(
30        rename = "device",
31        default,
32        with = "::serde_with::rust::double_option",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub device: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
36    #[serde(
37        rename = "virtual_machine",
38        default,
39        with = "::serde_with::rust::double_option",
40        skip_serializing_if = "Option::is_none"
41    )]
42    pub virtual_machine: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
43    #[serde(
44        rename = "virtual_device_context",
45        default,
46        with = "::serde_with::rust::double_option",
47        skip_serializing_if = "Option::is_none"
48    )]
49    pub virtual_device_context: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
50}
51
52impl VrfDeviceAssignmentRequest {
53    /// 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>)
54    pub fn new(
55        vrf: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
56    ) -> VrfDeviceAssignmentRequest {
57        VrfDeviceAssignmentRequest {
58            id: None,
59            rd: None,
60            name: None,
61            vrf: Box::new(vrf),
62            device: None,
63            virtual_machine: None,
64            virtual_device_context: None,
65        }
66    }
67}