netbox_openapi/models/
fhrp_group_assignment.rs

1/*
2 * NetBox REST API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 4.4.2-Docker-3.4.1 (4.4)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// FhrpGroupAssignment : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct FhrpGroupAssignment {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<i32>,
17    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
18    pub url: Option<String>,
19    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
20    pub display: Option<String>,
21    #[serde(rename = "group")]
22    pub group: Box<crate::models::BriefFhrpGroup>,
23    #[serde(rename = "interface_type")]
24    pub interface_type: String,
25    #[serde(rename = "interface_id")]
26    pub interface_id: i64,
27    #[serde(
28        rename = "interface",
29        default,
30        with = "::serde_with::rust::double_option",
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub interface: Option<Option<serde_json::Value>>,
34    #[serde(rename = "priority")]
35    pub priority: i32,
36    #[serde(
37        rename = "created",
38        default,
39        with = "::serde_with::rust::double_option",
40        skip_serializing_if = "Option::is_none"
41    )]
42    pub created: Option<Option<String>>,
43    #[serde(
44        rename = "last_updated",
45        default,
46        with = "::serde_with::rust::double_option",
47        skip_serializing_if = "Option::is_none"
48    )]
49    pub last_updated: Option<Option<String>>,
50}
51
52impl FhrpGroupAssignment {
53    /// Adds support for custom fields and tags.
54    pub fn new(
55        group: crate::models::BriefFhrpGroup,
56        interface_type: String,
57        interface_id: i64,
58        priority: i32,
59    ) -> FhrpGroupAssignment {
60        FhrpGroupAssignment {
61            id: None,
62            url: None,
63            display: None,
64            group: Box::new(group),
65            interface_type,
66            interface_id,
67            interface: None,
68            priority,
69            created: None,
70            last_updated: None,
71        }
72    }
73}