securitytrails_rs/
json_objects.rs

1use serde::{Deserialize, Serialize};
2//use super::sys::bool_from_string;
3
4#[derive(Serialize, Deserialize, Debug)]
5pub struct Ping {
6    //#[serde(deserialize_with = "bool_from_string")]
7    pub success: bool,
8}
9
10#[derive(Serialize, Deserialize, Debug)]
11pub struct Usage {
12    pub current_monthly_usage: u32,
13    pub allowed_monthly_usage: u32,
14}
15
16#[derive(Serialize, Deserialize, Debug)]
17pub struct A{
18    pub ip_organization: Option<String>,
19    pub ip_count: u32,
20    pub ip: String,
21    pub h: Option<String>,
22}
23
24/* #[derive(Serialize, Deserialize, Debug)]
25pub struct AAAA{
26    pub ip_organization: String,
27    pub ip_count: u32,
28    pub ip: String,
29} */
30
31#[derive(Serialize, Deserialize, Debug)]
32pub struct MX{
33    pub priority: u32,
34    pub hostname_organization: Option<String>,
35    pub hostname_count: u32,
36    pub hostname: String,
37}
38
39#[derive(Serialize, Deserialize, Debug)]
40pub struct NS{
41    pub nameserver_organization: Option<String>,
42    pub nameserver_count: u32,
43    pub nameserver: String,
44}
45
46#[derive(Serialize, Deserialize, Debug)]
47pub struct SOA{
48    pub ttl: u32,
49    pub email_count: u32,
50    pub email: String,
51}
52
53#[derive(Serialize, Deserialize, Debug)]
54pub struct TXT{
55    pub value: String,
56}
57
58#[derive(Serialize, Deserialize, Debug)]
59pub struct DnsA{
60    pub values: Vec<A>,
61    pub first_seen: String,
62}
63
64/* #[derive(Serialize, Deserialize, Debug)]
65pub struct DnsAAAA{
66    pub values: Vec<AAAA>,
67    pub first_seen: String,
68} */
69
70#[derive(Serialize, Deserialize, Debug)]
71pub struct DnsMX{
72    pub values: Vec<MX>,
73    pub first_seen: String,
74}
75
76#[derive(Serialize, Deserialize, Debug)]
77pub struct DnsNS{
78    pub values: Vec<NS>,
79    pub first_seen: String,
80}
81
82#[derive(Serialize, Deserialize, Debug)]
83pub struct DnsSOA{
84    pub values: Vec<SOA>,
85    pub first_seen: String,
86}
87
88#[derive(Serialize, Deserialize, Debug)]
89pub struct DnsTXT {
90    pub values: Vec<TXT>,
91    pub first_seen: String,
92}
93
94#[derive(Serialize, Deserialize, Debug)]
95pub struct CurrentDns {
96    pub a: DnsA,
97    pub mx: DnsMX,
98    pub ns: DnsNS,
99    pub soa: DnsSOA,
100    pub txt: DnsTXT,
101}
102
103#[derive(Serialize, Deserialize, Debug)]
104pub struct Details {
105    pub hostname: String,
106    pub endpoint: String,
107    pub current_dns: CurrentDns,
108    pub alexa_rank: u32,
109}
110
111#[derive(Serialize, Deserialize, Debug)]
112pub struct Subdomains {
113    pub endpoint: String,
114    pub subdomains: Vec<String>,
115}
116
117#[derive(Serialize, Deserialize, Debug)]
118pub struct Tags {
119    pub endpoint: String,
120    pub tags: Vec<String>,
121}
122
123#[derive(Serialize, Deserialize, Debug)]
124pub struct Contact {
125    pub city: Option<String>,
126    pub country: Option<String>,
127    #[serde(rename = "countryCode")]
128    pub country_code: Option<String>,
129    pub email: Option<String>,
130    pub name: Option<String>,
131    pub name_count: Option<u32>,
132    pub organization: Option<String>,
133    pub organization_count: Option<u32>,
134    #[serde(rename = "postalCode")]
135    pub postal_code: Option<String>,
136    pub state: Option<String>,
137    pub street1: Option<String>,
138    pub telephone: Option<String>,
139    #[serde(rename = "type")]
140    pub contact_type: Option<String>,
141}
142
143#[derive(Serialize, Deserialize, Debug)]
144pub struct Whois {
145    #[serde(rename = "contactEmail")]
146    pub contact_email: String,
147    pub contacts: Vec<Contact>,
148    #[serde(rename = "createdDate")]
149    pub created_date: String,
150    pub domain: String,
151    pub endpoint: String,
152    #[serde(rename = "expiresDate")]
153    pub expires_date: String,
154    #[serde(rename = "nameServers")]
155    pub name_servers: Vec<String>,
156    pub private_registration: bool,
157    #[serde(rename = "registrarName")]
158    pub registrar_name: String,
159    pub status: String,
160    #[serde(rename = "updatedDate")]
161    pub updated_date: String,
162}