fiftyone_ip_intelligence_shared/
ip_intelligence_data.rs1#![allow(rustdoc::bare_urls, rustdoc::invalid_html_tags)]
38
39use crate::data::IpIntelligenceDataBase;
40use fiftyone_pipeline_core::{PropertyValueType, WeightedValue};
41use fiftyone_pipeline_engines::{AspectData, AspectPropertyValue};
42
43pub trait IpIntelligenceData: AspectData {
49 fn accuracy_radius_max(&self) -> AspectPropertyValue<i32>;
51
52 fn accuracy_radius_min(&self) -> AspectPropertyValue<i32>;
54
55 fn areas(&self) -> AspectPropertyValue<String>;
57
58 fn asn(&self) -> AspectPropertyValue<String>;
60
61 fn asn_name(&self) -> AspectPropertyValue<String>;
63
64 fn browser_diversity(&self) -> AspectPropertyValue<i32>;
66
67 fn connection_type(&self) -> AspectPropertyValue<String>;
69
70 fn continent_code2(&self) -> AspectPropertyValue<String>;
72
73 fn continent_name(&self) -> AspectPropertyValue<String>;
75
76 fn country(&self) -> AspectPropertyValue<String>;
78
79 fn country_code(&self) -> AspectPropertyValue<String>;
81
82 fn country_code3(&self) -> AspectPropertyValue<String>;
84
85 fn country_codes_geographical(&self) -> AspectPropertyValue<Vec<WeightedValue<String>>>;
87
88 fn country_codes_population(&self) -> AspectPropertyValue<Vec<WeightedValue<String>>>;
90
91 fn county(&self) -> AspectPropertyValue<String>;
93
94 fn currency_code(&self) -> AspectPropertyValue<String>;
96
97 fn dial_code(&self) -> AspectPropertyValue<String>;
99
100 fn hardware_diversity(&self) -> AspectPropertyValue<i32>;
102
103 fn human_probability(&self) -> AspectPropertyValue<i32>;
105
106 fn ip(&self) -> AspectPropertyValue<String>;
108
109 fn ip_range_end(&self) -> AspectPropertyValue<String>;
111
112 fn ip_range_start(&self) -> AspectPropertyValue<String>;
114
115 fn ip_v6(&self) -> AspectPropertyValue<String>;
117
118 fn is_broadband(&self) -> AspectPropertyValue<bool>;
120
121 fn is_cellular(&self) -> AspectPropertyValue<bool>;
123
124 fn is_eu(&self) -> AspectPropertyValue<bool>;
126
127 fn is_hosted(&self) -> AspectPropertyValue<bool>;
129
130 fn iso31662_lvl4(&self) -> AspectPropertyValue<String>;
132
133 fn iso31662_lvl4_subdivision_only(&self) -> AspectPropertyValue<String>;
135
136 fn iso31662_lvl8(&self) -> AspectPropertyValue<String>;
138
139 fn iso31662_lvl8_subdivision_only(&self) -> AspectPropertyValue<String>;
141
142 fn is_proxy(&self) -> AspectPropertyValue<bool>;
144
145 fn is_public_router(&self) -> AspectPropertyValue<bool>;
147
148 fn is_tor(&self) -> AspectPropertyValue<bool>;
150
151 fn is_vpn(&self) -> AspectPropertyValue<bool>;
153
154 fn language_code(&self) -> AspectPropertyValue<String>;
156
157 fn latitude(&self) -> AspectPropertyValue<f32>;
159
160 fn location_confidence(&self) -> AspectPropertyValue<String>;
162
163 fn longitude(&self) -> AspectPropertyValue<f32>;
165
166 fn mcc(&self) -> AspectPropertyValue<Vec<WeightedValue<String>>>;
168
169 fn platform_diversity(&self) -> AspectPropertyValue<i32>;
171
172 fn region(&self) -> AspectPropertyValue<String>;
174
175 fn registered_country(&self) -> AspectPropertyValue<String>;
177
178 fn registered_name(&self) -> AspectPropertyValue<String>;
180
181 fn registered_owner(&self) -> AspectPropertyValue<String>;
183
184 fn state(&self) -> AspectPropertyValue<String>;
186
187 fn suburb(&self) -> AspectPropertyValue<String>;
189
190 fn time_zone_iana(&self) -> AspectPropertyValue<String>;
192
193 fn time_zone_offset(&self) -> AspectPropertyValue<i32>;
195
196 fn town(&self) -> AspectPropertyValue<String>;
198
199 fn zip_code(&self) -> AspectPropertyValue<String>;
201}
202
203impl IpIntelligenceData for IpIntelligenceDataBase {
204 fn accuracy_radius_max(&self) -> AspectPropertyValue<i32> {
205 self.integer("AccuracyRadiusMax")
206 }
207
208 fn accuracy_radius_min(&self) -> AspectPropertyValue<i32> {
209 self.integer("AccuracyRadiusMin")
210 }
211
212 fn areas(&self) -> AspectPropertyValue<String> {
213 self.string("Areas")
214 }
215
216 fn asn(&self) -> AspectPropertyValue<String> {
217 self.string("Asn")
218 }
219
220 fn asn_name(&self) -> AspectPropertyValue<String> {
221 self.string("AsnName")
222 }
223
224 fn browser_diversity(&self) -> AspectPropertyValue<i32> {
225 self.integer("BrowserDiversity")
226 }
227
228 fn connection_type(&self) -> AspectPropertyValue<String> {
229 self.string("ConnectionType")
230 }
231
232 fn continent_code2(&self) -> AspectPropertyValue<String> {
233 self.string("ContinentCode2")
234 }
235
236 fn continent_name(&self) -> AspectPropertyValue<String> {
237 self.string("ContinentName")
238 }
239
240 fn country(&self) -> AspectPropertyValue<String> {
241 self.string("Country")
242 }
243
244 fn country_code(&self) -> AspectPropertyValue<String> {
245 self.string("CountryCode")
246 }
247
248 fn country_code3(&self) -> AspectPropertyValue<String> {
249 self.string("CountryCode3")
250 }
251
252 fn country_codes_geographical(&self) -> AspectPropertyValue<Vec<WeightedValue<String>>> {
253 self.weighted_string("CountryCodesGeographical")
254 }
255
256 fn country_codes_population(&self) -> AspectPropertyValue<Vec<WeightedValue<String>>> {
257 self.weighted_string("CountryCodesPopulation")
258 }
259
260 fn county(&self) -> AspectPropertyValue<String> {
261 self.string("County")
262 }
263
264 fn currency_code(&self) -> AspectPropertyValue<String> {
265 self.string("CurrencyCode")
266 }
267
268 fn dial_code(&self) -> AspectPropertyValue<String> {
269 self.string("DialCode")
270 }
271
272 fn hardware_diversity(&self) -> AspectPropertyValue<i32> {
273 self.integer("HardwareDiversity")
274 }
275
276 fn human_probability(&self) -> AspectPropertyValue<i32> {
277 self.integer("HumanProbability")
278 }
279
280 fn ip(&self) -> AspectPropertyValue<String> {
281 self.string("Ip")
282 }
283
284 fn ip_range_end(&self) -> AspectPropertyValue<String> {
285 self.string("IpRangeEnd")
286 }
287
288 fn ip_range_start(&self) -> AspectPropertyValue<String> {
289 self.string("IpRangeStart")
290 }
291
292 fn ip_v6(&self) -> AspectPropertyValue<String> {
293 self.string("IpV6")
294 }
295
296 fn is_broadband(&self) -> AspectPropertyValue<bool> {
297 self.boolean("IsBroadband")
298 }
299
300 fn is_cellular(&self) -> AspectPropertyValue<bool> {
301 self.boolean("IsCellular")
302 }
303
304 fn is_eu(&self) -> AspectPropertyValue<bool> {
305 self.boolean("IsEu")
306 }
307
308 fn is_hosted(&self) -> AspectPropertyValue<bool> {
309 self.boolean("IsHosted")
310 }
311
312 fn iso31662_lvl4(&self) -> AspectPropertyValue<String> {
313 self.string("Iso31662Lvl4")
314 }
315
316 fn iso31662_lvl4_subdivision_only(&self) -> AspectPropertyValue<String> {
317 self.string("Iso31662Lvl4SubdivisionOnly")
318 }
319
320 fn iso31662_lvl8(&self) -> AspectPropertyValue<String> {
321 self.string("Iso31662Lvl8")
322 }
323
324 fn iso31662_lvl8_subdivision_only(&self) -> AspectPropertyValue<String> {
325 self.string("Iso31662Lvl8SubdivisionOnly")
326 }
327
328 fn is_proxy(&self) -> AspectPropertyValue<bool> {
329 self.boolean("IsProxy")
330 }
331
332 fn is_public_router(&self) -> AspectPropertyValue<bool> {
333 self.boolean("IsPublicRouter")
334 }
335
336 fn is_tor(&self) -> AspectPropertyValue<bool> {
337 self.boolean("IsTor")
338 }
339
340 fn is_vpn(&self) -> AspectPropertyValue<bool> {
341 self.boolean("IsVPN")
342 }
343
344 fn language_code(&self) -> AspectPropertyValue<String> {
345 self.string("LanguageCode")
346 }
347
348 fn latitude(&self) -> AspectPropertyValue<f32> {
349 self.float("Latitude")
350 }
351
352 fn location_confidence(&self) -> AspectPropertyValue<String> {
353 self.string("LocationConfidence")
354 }
355
356 fn longitude(&self) -> AspectPropertyValue<f32> {
357 self.float("Longitude")
358 }
359
360 fn mcc(&self) -> AspectPropertyValue<Vec<WeightedValue<String>>> {
361 self.weighted_string("Mcc")
362 }
363
364 fn platform_diversity(&self) -> AspectPropertyValue<i32> {
365 self.integer("PlatformDiversity")
366 }
367
368 fn region(&self) -> AspectPropertyValue<String> {
369 self.string("Region")
370 }
371
372 fn registered_country(&self) -> AspectPropertyValue<String> {
373 self.string("RegisteredCountry")
374 }
375
376 fn registered_name(&self) -> AspectPropertyValue<String> {
377 self.string("RegisteredName")
378 }
379
380 fn registered_owner(&self) -> AspectPropertyValue<String> {
381 self.string("RegisteredOwner")
382 }
383
384 fn state(&self) -> AspectPropertyValue<String> {
385 self.string("State")
386 }
387
388 fn suburb(&self) -> AspectPropertyValue<String> {
389 self.string("Suburb")
390 }
391
392 fn time_zone_iana(&self) -> AspectPropertyValue<String> {
393 self.string("TimeZoneIana")
394 }
395
396 fn time_zone_offset(&self) -> AspectPropertyValue<i32> {
397 self.integer("TimeZoneOffset")
398 }
399
400 fn town(&self) -> AspectPropertyValue<String> {
401 self.string("Town")
402 }
403
404 fn zip_code(&self) -> AspectPropertyValue<String> {
405 self.string("ZipCode")
406 }
407}
408
409pub const GENERATED_PROPERTY_TYPES: &[(&str, PropertyValueType)] = &[
412 ("AccuracyRadiusMax", PropertyValueType::Integer),
413 ("AccuracyRadiusMin", PropertyValueType::Integer),
414 ("Areas", PropertyValueType::String),
415 ("Asn", PropertyValueType::String),
416 ("AsnName", PropertyValueType::String),
417 ("BrowserDiversity", PropertyValueType::Integer),
418 ("ConnectionType", PropertyValueType::String),
419 ("ContinentCode2", PropertyValueType::String),
420 ("ContinentName", PropertyValueType::String),
421 ("Country", PropertyValueType::String),
422 ("CountryCode", PropertyValueType::String),
423 ("CountryCode3", PropertyValueType::String),
424 ("CountryCodesGeographical", PropertyValueType::KeyValueList),
425 ("CountryCodesPopulation", PropertyValueType::KeyValueList),
426 ("County", PropertyValueType::String),
427 ("CurrencyCode", PropertyValueType::String),
428 ("DialCode", PropertyValueType::String),
429 ("HardwareDiversity", PropertyValueType::Integer),
430 ("HumanProbability", PropertyValueType::Integer),
431 ("Ip", PropertyValueType::String),
432 ("IpRangeEnd", PropertyValueType::String),
433 ("IpRangeStart", PropertyValueType::String),
434 ("IpV6", PropertyValueType::String),
435 ("IsBroadband", PropertyValueType::Bool),
436 ("IsCellular", PropertyValueType::Bool),
437 ("IsEu", PropertyValueType::Bool),
438 ("IsHosted", PropertyValueType::Bool),
439 ("Iso31662Lvl4", PropertyValueType::String),
440 ("Iso31662Lvl4SubdivisionOnly", PropertyValueType::String),
441 ("Iso31662Lvl8", PropertyValueType::String),
442 ("Iso31662Lvl8SubdivisionOnly", PropertyValueType::String),
443 ("IsProxy", PropertyValueType::Bool),
444 ("IsPublicRouter", PropertyValueType::Bool),
445 ("IsTor", PropertyValueType::Bool),
446 ("IsVPN", PropertyValueType::Bool),
447 ("LanguageCode", PropertyValueType::String),
448 ("Latitude", PropertyValueType::Double),
449 ("LocationConfidence", PropertyValueType::String),
450 ("Longitude", PropertyValueType::Double),
451 ("Mcc", PropertyValueType::KeyValueList),
452 ("PlatformDiversity", PropertyValueType::Integer),
453 ("Region", PropertyValueType::String),
454 ("RegisteredCountry", PropertyValueType::String),
455 ("RegisteredName", PropertyValueType::String),
456 ("RegisteredOwner", PropertyValueType::String),
457 ("State", PropertyValueType::String),
458 ("Suburb", PropertyValueType::String),
459 ("TimeZoneIana", PropertyValueType::String),
460 ("TimeZoneOffset", PropertyValueType::Integer),
461 ("Town", PropertyValueType::String),
462 ("ZipCode", PropertyValueType::String),
463];