@@ -4,88 +4,129 @@ use serde::{Deserialize, Serialize};
4
4
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
5
5
pub struct Country < ' a > {
6
6
#[ serde( borrow) ]
7
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
7
8
pub continent : Option < country:: Continent < ' a > > ,
9
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
8
10
pub country : Option < country:: Country < ' a > > ,
11
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
9
12
pub registered_country : Option < country:: Country < ' a > > ,
13
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
10
14
pub represented_country : Option < country:: RepresentedCountry < ' a > > ,
15
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
11
16
pub traits : Option < country:: Traits > ,
12
17
}
13
18
14
19
/// GeoIP2 City record
15
20
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
16
21
pub struct City < ' a > {
17
22
#[ serde( borrow) ]
23
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
18
24
pub city : Option < city:: City < ' a > > ,
25
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
19
26
pub continent : Option < city:: Continent < ' a > > ,
27
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
20
28
pub country : Option < city:: Country < ' a > > ,
29
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
21
30
pub location : Option < city:: Location < ' a > > ,
31
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
22
32
pub postal : Option < city:: Postal < ' a > > ,
33
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
23
34
pub registered_country : Option < city:: Country < ' a > > ,
35
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
24
36
pub represented_country : Option < city:: RepresentedCountry < ' a > > ,
37
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
25
38
pub subdivisions : Option < Vec < city:: Subdivision < ' a > > > ,
39
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
26
40
pub traits : Option < city:: Traits > ,
27
41
}
28
42
29
43
/// GeoIP2 Enterprise record
30
44
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
31
45
pub struct Enterprise < ' a > {
32
46
#[ serde( borrow) ]
47
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
33
48
pub city : Option < enterprise:: City < ' a > > ,
49
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
34
50
pub continent : Option < enterprise:: Continent < ' a > > ,
51
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
35
52
pub country : Option < enterprise:: Country < ' a > > ,
53
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
36
54
pub location : Option < enterprise:: Location < ' a > > ,
55
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
37
56
pub postal : Option < enterprise:: Postal < ' a > > ,
57
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
38
58
pub registered_country : Option < enterprise:: Country < ' a > > ,
59
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
39
60
pub represented_country : Option < enterprise:: RepresentedCountry < ' a > > ,
61
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
40
62
pub subdivisions : Option < Vec < enterprise:: Subdivision < ' a > > > ,
63
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
41
64
pub traits : Option < enterprise:: Traits < ' a > > ,
42
65
}
43
66
44
67
/// GeoIP2 ISP record
45
68
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
46
69
pub struct Isp < ' a > {
70
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
47
71
pub autonomous_system_number : Option < u32 > ,
72
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
48
73
pub autonomous_system_organization : Option < & ' a str > ,
74
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
49
75
pub isp : Option < & ' a str > ,
76
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
50
77
pub mobile_country_code : Option < & ' a str > ,
78
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
51
79
pub mobile_network_code : Option < & ' a str > ,
80
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
52
81
pub organization : Option < & ' a str > ,
53
82
}
54
83
55
84
/// GeoIP2 Connection-Type record
56
85
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
57
86
pub struct ConnectionType < ' a > {
87
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
58
88
pub connection_type : Option < & ' a str > ,
59
89
}
60
90
61
91
/// GeoIP2 Anonymous Ip record
62
92
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
63
93
pub struct AnonymousIp {
94
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
64
95
pub is_anonymous : Option < bool > ,
96
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
65
97
pub is_anonymous_vpn : Option < bool > ,
98
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
66
99
pub is_hosting_provider : Option < bool > ,
100
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
67
101
pub is_public_proxy : Option < bool > ,
102
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
68
103
pub is_residential_proxy : Option < bool > ,
104
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
69
105
pub is_tor_exit_node : Option < bool > ,
70
106
}
71
107
72
108
/// GeoIP2 DensityIncome record
73
109
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
74
110
pub struct DensityIncome {
111
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
75
112
pub average_income : Option < u32 > ,
113
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
76
114
pub population_density : Option < u32 > ,
77
115
}
78
116
79
117
/// GeoIP2 Domain record
80
118
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
81
119
pub struct Domain < ' a > {
120
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
82
121
pub domain : Option < & ' a str > ,
83
122
}
84
123
85
124
/// GeoIP2 Asn record
86
125
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
87
126
pub struct Asn < ' a > {
127
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
88
128
pub autonomous_system_number : Option < u32 > ,
129
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
89
130
pub autonomous_system_organization : Option < & ' a str > ,
90
131
}
91
132
@@ -96,33 +137,48 @@ pub mod country {
96
137
97
138
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
98
139
pub struct Continent < ' a > {
140
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
99
141
pub code : Option < & ' a str > ,
142
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
100
143
pub geoname_id : Option < u32 > ,
144
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
101
145
pub names : Option < BTreeMap < & ' a str , & ' a str > > ,
102
146
}
103
147
104
148
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
105
149
pub struct Country < ' a > {
150
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
106
151
pub geoname_id : Option < u32 > ,
152
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
107
153
pub is_in_european_union : Option < bool > ,
154
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
108
155
pub iso_code : Option < & ' a str > ,
156
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
109
157
pub names : Option < BTreeMap < & ' a str , & ' a str > > ,
110
158
}
111
159
112
160
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
113
161
pub struct RepresentedCountry < ' a > {
162
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
114
163
pub geoname_id : Option < u32 > ,
164
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
115
165
pub is_in_european_union : Option < bool > ,
166
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
116
167
pub iso_code : Option < & ' a str > ,
168
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
117
169
pub names : Option < BTreeMap < & ' a str , & ' a str > > ,
118
170
#[ serde( rename = "type" ) ]
171
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
119
172
pub representation_type : Option < & ' a str > ,
120
173
}
121
174
122
175
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
123
176
pub struct Traits {
177
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
124
178
pub is_anonymous_proxy : Option < bool > ,
179
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
125
180
pub is_anycast : Option < bool > ,
181
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
126
182
pub is_satellite_provider : Option < bool > ,
127
183
}
128
184
}
@@ -136,29 +192,40 @@ pub mod city {
136
192
137
193
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
138
194
pub struct City < ' a > {
195
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
139
196
pub geoname_id : Option < u32 > ,
140
197
#[ serde( borrow) ]
198
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
141
199
pub names : Option < BTreeMap < & ' a str , & ' a str > > ,
142
200
}
143
201
144
202
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
145
203
pub struct Location < ' a > {
204
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
146
205
pub accuracy_radius : Option < u16 > ,
206
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
147
207
pub latitude : Option < f64 > ,
208
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
148
209
pub longitude : Option < f64 > ,
210
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
149
211
pub metro_code : Option < u16 > ,
212
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
150
213
pub time_zone : Option < & ' a str > ,
151
214
}
152
215
153
216
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
154
217
pub struct Postal < ' a > {
218
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
155
219
pub code : Option < & ' a str > ,
156
220
}
157
221
158
222
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
159
223
pub struct Subdivision < ' a > {
224
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
160
225
pub geoname_id : Option < u32 > ,
226
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
161
227
pub iso_code : Option < & ' a str > ,
228
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
162
229
pub names : Option < BTreeMap < & ' a str , & ' a str > > ,
163
230
}
164
231
}
@@ -172,63 +239,100 @@ pub mod enterprise {
172
239
173
240
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
174
241
pub struct City < ' a > {
242
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
175
243
pub confidence : Option < u8 > ,
244
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
176
245
pub geoname_id : Option < u32 > ,
177
246
#[ serde( borrow) ]
247
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
178
248
pub names : Option < BTreeMap < & ' a str , & ' a str > > ,
179
249
}
180
250
181
251
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
182
252
pub struct Country < ' a > {
253
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
183
254
pub confidence : Option < u8 > ,
255
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
184
256
pub geoname_id : Option < u32 > ,
257
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
185
258
pub is_in_european_union : Option < bool > ,
259
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
186
260
pub iso_code : Option < & ' a str > ,
261
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
187
262
pub names : Option < BTreeMap < & ' a str , & ' a str > > ,
188
263
}
189
264
190
265
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
191
266
pub struct Location < ' a > {
267
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
192
268
pub accuracy_radius : Option < u16 > ,
269
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
193
270
pub latitude : Option < f64 > ,
271
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
194
272
pub longitude : Option < f64 > ,
273
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
195
274
pub metro_code : Option < u16 > ,
275
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
196
276
pub time_zone : Option < & ' a str > ,
197
277
}
198
278
199
279
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
200
280
pub struct Postal < ' a > {
281
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
201
282
pub code : Option < & ' a str > ,
283
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
202
284
pub confidence : Option < u8 > ,
203
285
}
204
286
205
287
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
206
288
pub struct Subdivision < ' a > {
289
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
207
290
pub confidence : Option < u8 > ,
291
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
208
292
pub geoname_id : Option < u32 > ,
293
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
209
294
pub iso_code : Option < & ' a str > ,
295
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
210
296
pub names : Option < BTreeMap < & ' a str , & ' a str > > ,
211
297
}
212
298
213
299
#[ derive( Deserialize , Serialize , Clone , Debug ) ]
214
300
pub struct Traits < ' a > {
301
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
215
302
pub autonomous_system_number : Option < u32 > ,
303
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
216
304
pub autonomous_system_organization : Option < & ' a str > ,
305
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
217
306
pub connection_type : Option < & ' a str > ,
307
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
218
308
pub domain : Option < & ' a str > ,
309
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
219
310
pub is_anonymous : Option < bool > ,
311
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
220
312
pub is_anonymous_proxy : Option < bool > ,
313
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
221
314
pub is_anonymous_vpn : Option < bool > ,
315
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
222
316
pub is_anycast : Option < bool > ,
317
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
223
318
pub is_hosting_provider : Option < bool > ,
319
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
224
320
pub isp : Option < & ' a str > ,
321
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
225
322
pub is_public_proxy : Option < bool > ,
323
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
226
324
pub is_residential_proxy : Option < bool > ,
325
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
227
326
pub is_satellite_provider : Option < bool > ,
327
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
228
328
pub is_tor_exit_node : Option < bool > ,
329
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
229
330
pub mobile_country_code : Option < & ' a str > ,
331
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
230
332
pub mobile_network_code : Option < & ' a str > ,
333
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
231
334
pub organization : Option < & ' a str > ,
335
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
232
336
pub user_type : Option < & ' a str > ,
233
337
}
234
338
}
0 commit comments