Skip to main content

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