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
77
78
79
80
81
82
83
/*
* InternetData API
*
* The InternetData API: look up what every database InternetData publishes says about an IP address, an AS or a domain, download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
*
* The version of the OpenAPI document: 2026.11.17
* Contact: support@internetdata.io
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// DomainLookupResponse : What every database says about one domain.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DomainLookupResponse {
/// The domain, lowercase and in punycode.
#[serde(rename = "domain")]
pub domain: String,
/// In Domain List: a registered domain.
#[serde(rename = "is_registered")]
pub is_registered: bool,
/// In Disposable Domain. Paid plans and the trial.
#[serde(rename = "is_disposable", skip_serializing_if = "Option::is_none")]
pub is_disposable: Option<bool>,
/// It has A records.
#[serde(rename = "has_a")]
pub has_a: bool,
/// AAAA records.
#[serde(rename = "has_aaaa")]
pub has_aaaa: bool,
/// MX records.
#[serde(rename = "has_mx")]
pub has_mx: bool,
/// NS records.
#[serde(rename = "has_ns")]
pub has_ns: bool,
/// A CNAME record.
#[serde(rename = "has_cname")]
pub has_cname: bool,
#[serde(rename = "dns", skip_serializing_if = "Option::is_none")]
pub dns: Option<Box<models::DomainDns>>,
#[serde(rename = "ip_ranges", skip_serializing_if = "Option::is_none")]
pub ip_ranges: Option<Box<models::DomainIpRanges>>,
/// `{}` when `is_disposable` is false. Paid plans and the trial.
#[serde(rename = "disposable", skip_serializing_if = "Option::is_none")]
pub disposable: Option<Box<models::DisposableDetail>>,
/// On every answer to a key on the free plan, and on no other: `false` while the day's trial of every field lasts, `true` once the answer has Unlimited's fields.
#[serde(rename = "trial_expired", skip_serializing_if = "Option::is_none")]
pub trial_expired: Option<bool>,
/// On every answer to a key on a paid plan, and on no other: `false` while the answer has every field, `true` once its organization's overage cap is reached and the answer has Unlimited's. Lookups answered past the cap are not billed; raising or removing the cap in Billing turns it `false` again.
#[serde(rename = "cap_reached", skip_serializing_if = "Option::is_none")]
pub cap_reached: Option<bool>,
}
impl DomainLookupResponse {
/// What every database says about one domain.
pub fn new(
domain: String,
is_registered: bool,
has_a: bool,
has_aaaa: bool,
has_mx: bool,
has_ns: bool,
has_cname: bool,
) -> DomainLookupResponse {
DomainLookupResponse {
domain,
is_registered,
is_disposable: None,
has_a,
has_aaaa,
has_mx,
has_ns,
has_cname,
dns: None,
ip_ranges: None,
disposable: None,
trial_expired: None,
cap_reached: None,
}
}
}