Skip to main content

nautobot_openapi/models/
ip_address_to_interface.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/// IpAddressToInterface : 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 IpAddressToInterface {
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    /// Is source address on interface
27    #[serde(rename = "is_source", skip_serializing_if = "Option::is_none")]
28    pub is_source: Option<bool>,
29    /// Is destination address on interface
30    #[serde(rename = "is_destination", skip_serializing_if = "Option::is_none")]
31    pub is_destination: Option<bool>,
32    /// Is default address on interface
33    #[serde(rename = "is_default", skip_serializing_if = "Option::is_none")]
34    pub is_default: Option<bool>,
35    /// Is preferred address on interface
36    #[serde(rename = "is_preferred", skip_serializing_if = "Option::is_none")]
37    pub is_preferred: Option<bool>,
38    /// Is primary address on interface
39    #[serde(rename = "is_primary", skip_serializing_if = "Option::is_none")]
40    pub is_primary: Option<bool>,
41    /// Is secondary address on interface
42    #[serde(rename = "is_secondary", skip_serializing_if = "Option::is_none")]
43    pub is_secondary: Option<bool>,
44    /// Is standby address on interface
45    #[serde(rename = "is_standby", skip_serializing_if = "Option::is_none")]
46    pub is_standby: Option<bool>,
47    #[serde(rename = "ip_address")]
48    pub ip_address: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
49    #[serde(
50        rename = "interface",
51        default,
52        with = "::serde_with::rust::double_option",
53        skip_serializing_if = "Option::is_none"
54    )]
55    pub interface: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
56    #[serde(
57        rename = "vm_interface",
58        default,
59        with = "::serde_with::rust::double_option",
60        skip_serializing_if = "Option::is_none"
61    )]
62    pub vm_interface: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
63}
64
65impl IpAddressToInterface {
66    /// 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>)
67    pub fn new(
68        ip_address: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
69    ) -> IpAddressToInterface {
70        IpAddressToInterface {
71            id: None,
72            object_type: None,
73            display: None,
74            url: None,
75            natural_slug: None,
76            is_source: None,
77            is_destination: None,
78            is_default: None,
79            is_preferred: None,
80            is_primary: None,
81            is_secondary: None,
82            is_standby: None,
83            ip_address: Box::new(ip_address),
84            interface: None,
85            vm_interface: None,
86        }
87    }
88}