Skip to main content

netbox_openapi/models/
writable_ip_address_request.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.6.8 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// WritableIpAddressRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct WritableIpAddressRequest {
15    #[serde(rename = "address")]
16    pub address: String,
17    #[serde(
18        rename = "vrf",
19        default,
20        with = "::serde_with::rust::double_option",
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub vrf: Option<Option<Box<crate::models::BulkIpAddressRequestVrf>>>,
24    #[serde(
25        rename = "tenant",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
31    /// The operational status of this IP  * `active` - Active * `reserved` - Reserved * `deprecated` - Deprecated * `dhcp` - DHCP * `slaac` - SLAAC
32    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
33    pub status: Option<Status>,
34    /// The functional role of this IP  * `loopback` - Loopback * `secondary` - Secondary * `anycast` - Anycast * `vip` - VIP * `vrrp` - VRRP * `hsrp` - HSRP * `glbp` - GLBP * `carp` - CARP
35    #[serde(
36        rename = "role",
37        default,
38        with = "::serde_with::rust::double_option",
39        skip_serializing_if = "Option::is_none"
40    )]
41    pub role: Option<Option<Role>>,
42    #[serde(
43        rename = "assigned_object_type",
44        default,
45        with = "::serde_with::rust::double_option",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub assigned_object_type: Option<Option<String>>,
49    #[serde(
50        rename = "assigned_object_id",
51        default,
52        with = "::serde_with::rust::double_option",
53        skip_serializing_if = "Option::is_none"
54    )]
55    pub assigned_object_id: Option<Option<i64>>,
56    /// The IP for which this address is the \"outside\" IP
57    #[serde(
58        rename = "nat_inside",
59        default,
60        with = "::serde_with::rust::double_option",
61        skip_serializing_if = "Option::is_none"
62    )]
63    pub nat_inside: Option<Option<i32>>,
64    #[serde(rename = "dns_name", skip_serializing_if = "Option::is_none")]
65    pub dns_name: Option<Box<crate::models::BriefIpAddressDnsName>>,
66    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
67    pub description: Option<String>,
68    #[serde(
69        rename = "owner",
70        default,
71        with = "::serde_with::rust::double_option",
72        skip_serializing_if = "Option::is_none"
73    )]
74    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
75    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
76    pub comments: Option<String>,
77    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
78    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
79    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
80    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
81}
82
83impl WritableIpAddressRequest {
84    /// Base serializer class for models inheriting from PrimaryModel.
85    pub fn new(address: String) -> WritableIpAddressRequest {
86        WritableIpAddressRequest {
87            address,
88            vrf: None,
89            tenant: None,
90            status: None,
91            role: None,
92            assigned_object_type: None,
93            assigned_object_id: None,
94            nat_inside: None,
95            dns_name: None,
96            description: None,
97            owner: None,
98            comments: None,
99            tags: None,
100            custom_fields: None,
101        }
102    }
103}
104
105/// The operational status of this IP  * `active` - Active * `reserved` - Reserved * `deprecated` - Deprecated * `dhcp` - DHCP * `slaac` - SLAAC
106#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
107pub enum Status {
108    #[serde(rename = "active")]
109    Active,
110    #[serde(rename = "reserved")]
111    Reserved,
112    #[serde(rename = "deprecated")]
113    Deprecated,
114    #[serde(rename = "dhcp")]
115    Dhcp,
116    #[serde(rename = "slaac")]
117    Slaac,
118}
119
120impl Default for Status {
121    fn default() -> Status {
122        Self::Active
123    }
124}
125/// The functional role of this IP  * `loopback` - Loopback * `secondary` - Secondary * `anycast` - Anycast * `vip` - VIP * `vrrp` - VRRP * `hsrp` - HSRP * `glbp` - GLBP * `carp` - CARP
126#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
127pub enum Role {
128    #[serde(rename = "loopback")]
129    Loopback,
130    #[serde(rename = "secondary")]
131    Secondary,
132    #[serde(rename = "anycast")]
133    Anycast,
134    #[serde(rename = "vip")]
135    Vip,
136    #[serde(rename = "vrrp")]
137    Vrrp,
138    #[serde(rename = "hsrp")]
139    Hsrp,
140    #[serde(rename = "glbp")]
141    Glbp,
142    #[serde(rename = "carp")]
143    Carp,
144    #[serde(rename = "")]
145    Empty,
146    #[serde(rename = "null")]
147    Null,
148}
149
150impl Default for Role {
151    fn default() -> Role {
152        Self::Loopback
153    }
154}