Skip to main content

netbox_openapi/models/
patched_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.2 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedWritableIpAddressRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedWritableIpAddressRequest {
15    #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
16    pub address: Option<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::IpAddressRequestVrf>>>,
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    /// Hostname or FQDN (not case-sensitive)
65    #[serde(rename = "dns_name", skip_serializing_if = "Option::is_none")]
66    pub dns_name: Option<String>,
67    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
68    pub description: Option<String>,
69    #[serde(
70        rename = "owner",
71        default,
72        with = "::serde_with::rust::double_option",
73        skip_serializing_if = "Option::is_none"
74    )]
75    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
76    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
77    pub comments: Option<String>,
78    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
79    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
80    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
81    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
82}
83
84impl PatchedWritableIpAddressRequest {
85    /// Base serializer class for models inheriting from PrimaryModel.
86    pub fn new() -> PatchedWritableIpAddressRequest {
87        PatchedWritableIpAddressRequest {
88            address: None,
89            vrf: None,
90            tenant: None,
91            status: None,
92            role: None,
93            assigned_object_type: None,
94            assigned_object_id: None,
95            nat_inside: None,
96            dns_name: None,
97            description: None,
98            owner: None,
99            comments: None,
100            tags: None,
101            custom_fields: None,
102        }
103    }
104}
105
106/// The operational status of this IP  * `active` - Active * `reserved` - Reserved * `deprecated` - Deprecated * `dhcp` - DHCP * `slaac` - SLAAC
107#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
108pub enum Status {
109    #[serde(rename = "active")]
110    Active,
111    #[serde(rename = "reserved")]
112    Reserved,
113    #[serde(rename = "deprecated")]
114    Deprecated,
115    #[serde(rename = "dhcp")]
116    Dhcp,
117    #[serde(rename = "slaac")]
118    Slaac,
119}
120
121impl Default for Status {
122    fn default() -> Status {
123        Self::Active
124    }
125}
126/// The functional role of this IP  * `loopback` - Loopback * `secondary` - Secondary * `anycast` - Anycast * `vip` - VIP * `vrrp` - VRRP * `hsrp` - HSRP * `glbp` - GLBP * `carp` - CARP
127#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
128pub enum Role {
129    #[serde(rename = "loopback")]
130    Loopback,
131    #[serde(rename = "secondary")]
132    Secondary,
133    #[serde(rename = "anycast")]
134    Anycast,
135    #[serde(rename = "vip")]
136    Vip,
137    #[serde(rename = "vrrp")]
138    Vrrp,
139    #[serde(rename = "hsrp")]
140    Hsrp,
141    #[serde(rename = "glbp")]
142    Glbp,
143    #[serde(rename = "carp")]
144    Carp,
145    #[serde(rename = "")]
146    Empty,
147    #[serde(rename = "null")]
148    Null,
149}
150
151impl Default for Role {
152    fn default() -> Role {
153        Self::Loopback
154    }
155}