1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Hetzner Cloud API
*
* Copied from the official API documentation for the Public Hetzner Cloud.
*
* The version of the OpenAPI document: 0.28.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// ServerPublicNet : Public network information. The Server's IPv4 address can be found in `public_net->ipv4->ip`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServerPublicNet {
/// Firewalls applied to the public network interface of this Server.
#[serde(rename = "firewalls", skip_serializing_if = "Option::is_none")]
pub firewalls: Option<Vec<models::ServerPublicNetFirewall>>,
/// IDs of Floating IPs assigned to this Server.
#[serde(rename = "floating_ips")]
pub floating_ips: Vec<i64>,
/// IP address (v4) and its reverse DNS entry of this Server.
#[serde(rename = "ipv4", deserialize_with = "Option::deserialize")]
pub ipv4: Option<Box<models::Ipv4>>,
/// IPv6 network assigned to this Server and its reverse DNS entry.
#[serde(rename = "ipv6", deserialize_with = "Option::deserialize")]
pub ipv6: Option<Box<models::Ipv6>>,
}
impl ServerPublicNet {
/// Public network information. The Server's IPv4 address can be found in `public_net->ipv4->ip`.
pub fn new(
floating_ips: Vec<i64>,
ipv4: Option<models::Ipv4>,
ipv6: Option<models::Ipv6>,
) -> ServerPublicNet {
ServerPublicNet {
firewalls: None,
floating_ips,
ipv4: ipv4.map(Box::new),
ipv6: ipv6.map(Box::new),
}
}
}