Skip to main content

linkbreakers/models/
device.rs

1/*
2 * Linkbreakers API
3 *
4 * This is a documentation of all the APIs of Linkbreakers
5 *
6 * The version of the OpenAPI document: 1.131.8
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Device : Tracks the fingerprint of a visitor's hardware/software so Linkbreakers can de-duplicate scans, enrich analytics, and power security heuristics.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Device {
17    #[serde(rename = "asn", skip_serializing_if = "Option::is_none")]
18    pub asn: Option<i64>,
19    #[serde(rename = "browserLanguage", skip_serializing_if = "Option::is_none")]
20    pub browser_language: Option<String>,
21    #[serde(rename = "browserName", skip_serializing_if = "Option::is_none")]
22    pub browser_name: Option<String>,
23    #[serde(rename = "browserVersion", skip_serializing_if = "Option::is_none")]
24    pub browser_version: Option<String>,
25    #[serde(rename = "city", skip_serializing_if = "Option::is_none")]
26    pub city: Option<String>,
27    #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
28    pub country: Option<String>,
29    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
30    pub created_at: Option<String>,
31    /// DeviceActor represents WHO or WHAT is operating the device. This distinguishes between a real human visitor, an automated crawler/scraper bot (e.g. Googlebot, BingBot), and an AI/LLM agent acting on behalf of a user (e.g. GPTBot, ClaudeBot, Gemini, Grok).   - DEVICE_ACTOR_UNSPECIFIED: Actor not specified or not yet detected  - DEVICE_ACTOR_HUMAN: Human visitor using a browser (covers MOBILE, TABLET, DESKTOP device types)  - DEVICE_ACTOR_BOT: Automated crawler or scraper bot (e.g. Googlebot, BingBot, Applebot)  - DEVICE_ACTOR_AGENT: AI/LLM agent browsing on behalf of a user (e.g. GPTBot, ClaudeBot, Gemini, Grok)  - DEVICE_ACTOR_UNKNOWN: Unable to classify the actor
32    #[serde(rename = "deviceActor", skip_serializing_if = "Option::is_none")]
33    pub device_actor: Option<DeviceActor>,
34    /// Specific actor or crawler name for non-human traffic (e.g. \"Googlebot\", \"GPTBot\", \"ClaudeBot\"). Only populated when device_actor is BOT or AGENT. Null/empty for HUMAN visitors.
35    #[serde(rename = "deviceActorName", skip_serializing_if = "Option::is_none")]
36    pub device_actor_name: Option<String>,
37    /// Company or organization behind the actor (e.g. \"Google\", \"OpenAI\", \"Anthropic\"). Only populated when device_actor is BOT or AGENT. Null/empty for HUMAN visitors.
38    #[serde(rename = "deviceActorOrigin", skip_serializing_if = "Option::is_none")]
39    pub device_actor_origin: Option<String>,
40    #[serde(rename = "deviceBrand", skip_serializing_if = "Option::is_none")]
41    pub device_brand: Option<String>,
42    #[serde(rename = "deviceConcurrency", skip_serializing_if = "Option::is_none")]
43    pub device_concurrency: Option<i32>,
44    #[serde(rename = "deviceMemory", skip_serializing_if = "Option::is_none")]
45    pub device_memory: Option<f64>,
46    #[serde(rename = "deviceName", skip_serializing_if = "Option::is_none")]
47    pub device_name: Option<String>,
48    /// DeviceType represents the physical form factor of the device. This describes the hardware category (phone, tablet, laptop, etc.), NOT who or what is operating it — see DeviceActor for that.   - DEVICE_TYPE_UNSPECIFIED: Device type not specified or not yet detected  - DEVICE_TYPE_NATIVE: Native QR scanner (no browser capabilities reported)  - DEVICE_TYPE_MOBILE: Mobile handset browser  - DEVICE_TYPE_TABLET: Tablet browser  - DEVICE_TYPE_DESKTOP: Desktop or laptop browser  - DEVICE_TYPE_UNKNOWN: Unable to classify the device
49    #[serde(rename = "deviceType", skip_serializing_if = "Option::is_none")]
50    pub device_type: Option<DeviceType>,
51    #[serde(rename = "gpu", skip_serializing_if = "Option::is_none")]
52    pub gpu: Option<String>,
53    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
54    pub id: Option<String>,
55    #[serde(rename = "ipAddress", skip_serializing_if = "Option::is_none")]
56    pub ip_address: Option<String>,
57    #[serde(rename = "isp", skip_serializing_if = "Option::is_none")]
58    pub isp: Option<String>,
59    #[serde(rename = "lastUsedAt", skip_serializing_if = "Option::is_none")]
60    pub last_used_at: Option<String>,
61    #[serde(rename = "networkBandwidth", skip_serializing_if = "Option::is_none")]
62    pub network_bandwidth: Option<f64>,
63    #[serde(rename = "networkConnection", skip_serializing_if = "Option::is_none")]
64    pub network_connection: Option<String>,
65    #[serde(rename = "networkRtt", skip_serializing_if = "Option::is_none")]
66    pub network_rtt: Option<f64>,
67    #[serde(rename = "platformName", skip_serializing_if = "Option::is_none")]
68    pub platform_name: Option<String>,
69    #[serde(rename = "platformVersion", skip_serializing_if = "Option::is_none")]
70    pub platform_version: Option<String>,
71    #[serde(rename = "region", skip_serializing_if = "Option::is_none")]
72    pub region: Option<String>,
73    #[serde(rename = "screenHeight", skip_serializing_if = "Option::is_none")]
74    pub screen_height: Option<f64>,
75    #[serde(rename = "screenRatio", skip_serializing_if = "Option::is_none")]
76    pub screen_ratio: Option<f64>,
77    #[serde(rename = "screenWidth", skip_serializing_if = "Option::is_none")]
78    pub screen_width: Option<f64>,
79    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
80    pub state: Option<String>,
81    #[serde(rename = "timezone", skip_serializing_if = "Option::is_none")]
82    pub timezone: Option<String>,
83    #[serde(rename = "touchScreen", skip_serializing_if = "Option::is_none")]
84    pub touch_screen: Option<bool>,
85    #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
86    pub updated_at: Option<String>,
87    #[serde(rename = "userAgent", skip_serializing_if = "Option::is_none")]
88    pub user_agent: Option<String>,
89}
90
91impl Device {
92    /// Tracks the fingerprint of a visitor's hardware/software so Linkbreakers can de-duplicate scans, enrich analytics, and power security heuristics.
93    pub fn new() -> Device {
94        Device {
95            asn: None,
96            browser_language: None,
97            browser_name: None,
98            browser_version: None,
99            city: None,
100            country: None,
101            created_at: None,
102            device_actor: None,
103            device_actor_name: None,
104            device_actor_origin: None,
105            device_brand: None,
106            device_concurrency: None,
107            device_memory: None,
108            device_name: None,
109            device_type: None,
110            gpu: None,
111            id: None,
112            ip_address: None,
113            isp: None,
114            last_used_at: None,
115            network_bandwidth: None,
116            network_connection: None,
117            network_rtt: None,
118            platform_name: None,
119            platform_version: None,
120            region: None,
121            screen_height: None,
122            screen_ratio: None,
123            screen_width: None,
124            state: None,
125            timezone: None,
126            touch_screen: None,
127            updated_at: None,
128            user_agent: None,
129        }
130    }
131}
132/// DeviceActor represents WHO or WHAT is operating the device. This distinguishes between a real human visitor, an automated crawler/scraper bot (e.g. Googlebot, BingBot), and an AI/LLM agent acting on behalf of a user (e.g. GPTBot, ClaudeBot, Gemini, Grok).   - DEVICE_ACTOR_UNSPECIFIED: Actor not specified or not yet detected  - DEVICE_ACTOR_HUMAN: Human visitor using a browser (covers MOBILE, TABLET, DESKTOP device types)  - DEVICE_ACTOR_BOT: Automated crawler or scraper bot (e.g. Googlebot, BingBot, Applebot)  - DEVICE_ACTOR_AGENT: AI/LLM agent browsing on behalf of a user (e.g. GPTBot, ClaudeBot, Gemini, Grok)  - DEVICE_ACTOR_UNKNOWN: Unable to classify the actor
133#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
134pub enum DeviceActor {
135    #[serde(rename = "DEVICE_ACTOR_UNSPECIFIED")]
136    DeviceActorUnspecified,
137    #[serde(rename = "DEVICE_ACTOR_HUMAN")]
138    DeviceActorHuman,
139    #[serde(rename = "DEVICE_ACTOR_BOT")]
140    DeviceActorBot,
141    #[serde(rename = "DEVICE_ACTOR_AGENT")]
142    DeviceActorAgent,
143    #[serde(rename = "DEVICE_ACTOR_UNKNOWN")]
144    DeviceActorUnknown,
145}
146
147impl Default for DeviceActor {
148    fn default() -> DeviceActor {
149        Self::DeviceActorUnspecified
150    }
151}
152/// DeviceType represents the physical form factor of the device. This describes the hardware category (phone, tablet, laptop, etc.), NOT who or what is operating it — see DeviceActor for that.   - DEVICE_TYPE_UNSPECIFIED: Device type not specified or not yet detected  - DEVICE_TYPE_NATIVE: Native QR scanner (no browser capabilities reported)  - DEVICE_TYPE_MOBILE: Mobile handset browser  - DEVICE_TYPE_TABLET: Tablet browser  - DEVICE_TYPE_DESKTOP: Desktop or laptop browser  - DEVICE_TYPE_UNKNOWN: Unable to classify the device
153#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
154pub enum DeviceType {
155    #[serde(rename = "DEVICE_TYPE_UNSPECIFIED")]
156    DeviceTypeUnspecified,
157    #[serde(rename = "DEVICE_TYPE_NATIVE")]
158    DeviceTypeNative,
159    #[serde(rename = "DEVICE_TYPE_MOBILE")]
160    DeviceTypeMobile,
161    #[serde(rename = "DEVICE_TYPE_TABLET")]
162    DeviceTypeTablet,
163    #[serde(rename = "DEVICE_TYPE_DESKTOP")]
164    DeviceTypeDesktop,
165    #[serde(rename = "DEVICE_TYPE_UNKNOWN")]
166    DeviceTypeUnknown,
167}
168
169impl Default for DeviceType {
170    fn default() -> DeviceType {
171        Self::DeviceTypeUnspecified
172    }
173}
174