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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* VPNDetection API
*
* The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
*
* The version of the OpenAPI document: 2026.10.20
* Contact: support@vpndetection.io
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Location : Where the address is, to the country: the fields of our IP Country database. Free and paid plans. Each field is present whenever the object is, so an address in no country, or a private one, answers empty strings.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Location {
/// Continent code: AF, AN (Antarctica), AS, EU, NA, OC or SA.
#[serde(rename = "continent")]
pub continent: String,
/// Continent name.
#[serde(rename = "continent_name")]
pub continent_name: String,
/// ISO 3166-1 alpha-2 country code.
#[serde(rename = "country")]
pub country: String,
/// Country name.
#[serde(rename = "country_name")]
pub country_name: String,
/// IANA timezone of the address.
#[serde(rename = "timezone")]
pub timezone: String,
/// ISO 4217 code of the country's currency, where there is one.
#[serde(rename = "currency_code")]
pub currency_code: String,
/// Name of the country's currency, where there is one.
#[serde(rename = "currency_name")]
pub currency_name: String,
/// Symbol of the country's currency, where known.
#[serde(rename = "currency_symbol")]
pub currency_symbol: String,
/// The country's flag, as an emoji.
#[serde(rename = "flag_emoji")]
pub flag_emoji: String,
/// The Unicode code points of the flag emoji.
#[serde(rename = "flag_unicode")]
pub flag_unicode: String,
}
impl Location {
/// Where the address is, to the country: the fields of our IP Country database. Free and paid plans. Each field is present whenever the object is, so an address in no country, or a private one, answers empty strings.
pub fn new(
continent: String,
continent_name: String,
country: String,
country_name: String,
timezone: String,
currency_code: String,
currency_name: String,
currency_symbol: String,
flag_emoji: String,
flag_unicode: String,
) -> Location {
Location {
continent,
continent_name,
country,
country_name,
timezone,
currency_code,
currency_name,
currency_symbol,
flag_emoji,
flag_unicode,
}
}
}