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