Coverage for fingerprint_server_sdk/models/event.py: 72%
154 statements
« prev ^ index » next coverage.py v7.14.3, created at 2026-09-25 15:12 +0000
« prev ^ index » next coverage.py v7.14.3, created at 2026-09-25 15:12 +0000
1"""
2Server API
3Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios.
4Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device.
5The API also supports collection of Automation Intelligence for requests to your server in edge, pre-origin, or middleware contexts.
7The version of the OpenAPI document: 4
8Contact: support@fingerprint.com
9Generated by OpenAPI Generator (https://openapi-generator.tech)
11Do not edit the class manually.
12""" # noqa: E501
14from __future__ import annotations
16import json
17import pprint
18import re # noqa: F401
19from typing import Annotated, Any, ClassVar, Optional, Union
21from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
22from typing_extensions import Self
24from fingerprint_server_sdk.models.bot_info import BotInfo
25from fingerprint_server_sdk.models.bot_result import BotResult
26from fingerprint_server_sdk.models.browser_details import BrowserDetails
27from fingerprint_server_sdk.models.device_details import DeviceDetails
28from fingerprint_server_sdk.models.event_rule_action import EventRuleAction
29from fingerprint_server_sdk.models.event_source import EventSource
30from fingerprint_server_sdk.models.identification import Identification
31from fingerprint_server_sdk.models.incremental_identification_status import (
32 IncrementalIdentificationStatus,
33)
34from fingerprint_server_sdk.models.ip_block_list import IPBlockList
35from fingerprint_server_sdk.models.ip_info import IPInfo
36from fingerprint_server_sdk.models.labels_inner import LabelsInner
37from fingerprint_server_sdk.models.proximity import Proximity
38from fingerprint_server_sdk.models.proxy_confidence import ProxyConfidence
39from fingerprint_server_sdk.models.proxy_details import ProxyDetails
40from fingerprint_server_sdk.models.rare_device_percentile_bucket import RareDevicePercentileBucket
41from fingerprint_server_sdk.models.raw_device_attributes import RawDeviceAttributes
42from fingerprint_server_sdk.models.sdk import SDK
43from fingerprint_server_sdk.models.supplementary_id_high_recall import SupplementaryIDHighRecall
44from fingerprint_server_sdk.models.tampering_confidence import TamperingConfidence
45from fingerprint_server_sdk.models.tampering_details import TamperingDetails
46from fingerprint_server_sdk.models.velocity import Velocity
47from fingerprint_server_sdk.models.vpn_confidence import VpnConfidence
48from fingerprint_server_sdk.models.vpn_methods import VpnMethods
51class Event(BaseModel):
52 """
53 Contains results from Fingerprint Identification and all active Smart Signals. Some Smart Signals are only supported for certain device types, these fields will be omitted for events not generated from the supported devices. Consult the [Smart Signals reference](https://docs.fingerprint.com/docs/smart-signals-reference) for more details.
54 """
56 event_id: StrictStr = Field(
57 description="Unique identifier of the user's request. The first portion of the event_id is a unix epoch milliseconds timestamp. "
58 )
59 timestamp: StrictInt = Field(
60 description='Timestamp of the event with millisecond precision in Unix time.'
61 )
62 source: Optional[EventSource] = None
63 incremental_identification_status: Optional[IncrementalIdentificationStatus] = None
64 linked_id: Optional[StrictStr] = Field(
65 default=None, description='A customer-provided ID that was sent with the request.'
66 )
67 environment_id: Optional[StrictStr] = Field(
68 default=None, description='Environment ID of the event.'
69 )
70 suspect: Optional[StrictBool] = Field(
71 default=None,
72 description='Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://docs.fingerprint.com/reference/server-api-update-event).',
73 )
74 sdk: Optional[SDK] = None
75 replayed: Optional[StrictBool] = Field(
76 default=None,
77 description='`true` if we determined that this payload was replayed, `false` otherwise. ',
78 )
79 identification: Optional[Identification] = None
80 supplementary_id_high_recall: Optional[SupplementaryIDHighRecall] = None
81 tags: Optional[dict[str, Any]] = Field(
82 default=None,
83 description='A customer-provided value or an object that was sent with the identification request or updated later.',
84 )
85 url: Optional[StrictStr] = Field(
86 default=None, description='Page URL from which the request was sent.'
87 )
88 bundle_id: Optional[StrictStr] = Field(
89 default=None,
90 description='Bundle ID of the iOS application integrated with the Fingerprint SDK for the event. ',
91 )
92 package_name: Optional[StrictStr] = Field(
93 default=None,
94 description='Package name of the Android application integrated with the Fingerprint SDK for the event. ',
95 )
96 ip_address: Optional[StrictStr] = Field(
97 default=None, description='IP address of the requesting browser or bot.'
98 )
99 user_agent: Optional[StrictStr] = Field(default=None, description='User Agent of the client.')
100 device: Optional[StrictStr] = Field(
101 default=None,
102 description='Device model or family extracted from the user agent string. On web, this field is also present inside `browser_details`. ',
103 )
104 os: Optional[StrictStr] = Field(
105 default=None,
106 description='Operating system family extracted from the user agent string. On web, this field is also present inside `browser_details`. ',
107 )
108 os_version: Optional[StrictStr] = Field(
109 default=None,
110 description='Operating system version string extracted from the user agent string. On web, this field is also present inside `browser_details`. ',
111 )
112 client_referrer: Optional[StrictStr] = Field(
113 default=None,
114 description='Client Referrer field corresponds to the `document.referrer` field gathered during an identification request. The value is an empty string if the user navigated to the page directly (not through a link, but, for example, by using a bookmark). ',
115 )
116 browser_details: Optional[BrowserDetails] = None
117 proximity: Optional[Proximity] = None
118 active_call: Optional[StrictBool] = Field(
119 default=None,
120 description='Indicates whether the mobile device had an active call (cellular or VoIP) at the time of the request. Available from SDK 2.16.0+ on iOS and Android. ',
121 )
122 bot: Optional[BotResult] = None
123 bot_type: Optional[StrictStr] = Field(
124 default=None, description='Additional classification of the bot type if detected. '
125 )
126 bot_info: Optional[BotInfo] = None
127 cloned_app: Optional[StrictBool] = Field(
128 default=None,
129 description='Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. ',
130 )
131 developer_tools: Optional[StrictBool] = Field(
132 default=None,
133 description='`true` if the browser has DevTools open (Chrome, Firefox) or the Android/iOS device has Developer Tools enabled, `false` otherwise. ',
134 )
135 device_details: Optional[DeviceDetails] = None
136 emulator: Optional[StrictBool] = Field(
137 default=None,
138 description='Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. ',
139 )
140 factory_reset_timestamp: Optional[StrictInt] = Field(
141 default=None,
142 description='The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC) as a value of 0. See [Factory Reset Detection](https://docs.fingerprint.com/docs/smart-signals-reference#factory-reset-detection) to learn more about this Smart Signal. ',
143 )
144 frida: Optional[StrictBool] = Field(
145 default=None,
146 description='[Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. ',
147 )
148 ip_blocklist: Optional[IPBlockList] = None
149 ip_info: Optional[IPInfo] = None
150 proxy: Optional[StrictBool] = Field(
151 default=None,
152 description='IP address was used by a public proxy provider or belonged to a known recent residential proxy ',
153 )
154 proxy_confidence: Optional[ProxyConfidence] = None
155 proxy_details: Optional[ProxyDetails] = None
156 proxy_ml_score: Optional[
157 Union[
158 Annotated[float, Field(le=1, strict=True, ge=0)],
159 Annotated[int, Field(le=1, strict=True, ge=0)],
160 ]
161 ] = Field(
162 default=None,
163 description='Machine learning–based proxy score, represented as a floating-point value between 0 and 1 (inclusive), with up to three decimal places of precision. A higher score means a higher confidence in the positive `proxy` detection result. This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). ',
164 )
165 incognito: Optional[StrictBool] = Field(
166 default=None,
167 description='`true` if we detected incognito mode used in the browser, `false` otherwise. ',
168 )
169 jailbroken: Optional[StrictBool] = Field(
170 default=None,
171 description='iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. ',
172 )
173 location_spoofing: Optional[StrictBool] = Field(
174 default=None,
175 description='Flag indicating whether the request came from a mobile device with location spoofing enabled.',
176 )
177 mitm_attack: Optional[StrictBool] = Field(
178 default=None,
179 description="* `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://docs.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. ",
180 )
181 privacy_settings: Optional[StrictBool] = Field(
182 default=None,
183 description='`true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. ',
184 )
185 root_apps: Optional[StrictBool] = Field(
186 default=None,
187 description="Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. ",
188 )
189 rule_action: Optional[EventRuleAction] = None
190 simulator: Optional[StrictBool] = Field(
191 default=None,
192 description='iOS specific simulator detection. There are 2 values: * `true` - Simulator environment detected. * `false` - No signs of simulator or the client is not iOS. ',
193 )
194 suspect_score: Optional[StrictInt] = Field(
195 default=None,
196 description='Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://docs.fingerprint.com/docs/suspect-score ',
197 )
198 tampering: Optional[StrictBool] = Field(
199 default=None,
200 description='The field can be used as a standalone flag for tampering detection. Alternatively, the more granular fields documented below can be used for workflows that require more context. * `true` if tampering is detected through an anomalous browser signature, anti-detect browser detection, or other tampering-related methods * `false` if none of the tampering checks return a positive result ',
201 )
202 tampering_confidence: Optional[TamperingConfidence] = None
203 tampering_ml_score: Optional[
204 Union[
205 Annotated[float, Field(le=1, strict=True, ge=0)],
206 Annotated[int, Field(le=1, strict=True, ge=0)],
207 ]
208 ] = Field(
209 default=None,
210 description='The output of this model is captured as tampering_ml_score, a number indicating how likely an event is coming from an anti detect browser. Values close to 1 signify higher confidence and we consider anything above the threshold of 0.8 to be actionable (the result and anti_detect_browser fields conveniently captures that fact) ',
211 )
212 tampering_details: Optional[TamperingDetails] = None
213 velocity: Optional[Velocity] = None
214 virtual_machine: Optional[StrictBool] = Field(
215 default=None,
216 description='`true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. ',
217 )
218 virtual_machine_ml_score: Optional[
219 Union[
220 Annotated[float, Field(le=1, strict=True, ge=0)],
221 Annotated[int, Field(le=1, strict=True, ge=0)],
222 ]
223 ] = Field(
224 default=None,
225 description='Machine learning–based virtual machine score, represented as a floating-point value between 0 and 1 (inclusive), with up to three decimal places of precision. A higher score means a higher confidence in the positive `virtual_machine` detection result. This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). ',
226 )
227 vpn: Optional[StrictBool] = Field(
228 default=None,
229 description='VPN or other anonymizing service has been used when sending the request. ',
230 )
231 vpn_confidence: Optional[VpnConfidence] = None
232 vpn_ml_score: Optional[
233 Union[
234 Annotated[float, Field(le=1, strict=True, ge=0)],
235 Annotated[int, Field(le=1, strict=True, ge=0)],
236 ]
237 ] = Field(
238 default=None,
239 description='Machine learning–based VPN score, represented as a floating-point value between 0 and 1 (inclusive), with up to three decimal places of precision. A higher score means a higher confidence in the positive `vpn` detection result. This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). ',
240 )
241 vpn_origin_timezone: Optional[StrictStr] = Field(
242 default=None, description='Local timezone which is used in timezone_mismatch method. '
243 )
244 vpn_origin_country: Optional[StrictStr] = Field(
245 default=None,
246 description='Country of the request (Android SDK version >= 2.4.0, iOS SDK version >= 2.9.0, JS agent >= 3.12.9 / 4.0.2), ISO 3166 format or unknown. ',
247 )
248 vpn_methods: Optional[VpnMethods] = None
249 high_activity_device: Optional[StrictBool] = Field(
250 default=None,
251 description='Flag indicating if the request came from a high-activity visitor.',
252 )
253 rare_device: Optional[StrictBool] = Field(
254 default=None,
255 description='`true` if the device is considered rare based on its combination of hardware and software attributes. A device is classified as rare if it falls within the top 99.9 percentile (lowest-frequency segment) of observed traffic, or if its configuration has not been previously seen (`not_seen`). > This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). ',
256 )
257 rare_device_percentile_bucket: Optional[RareDevicePercentileBucket] = None
258 raw_device_attributes: Optional[RawDeviceAttributes] = None
259 labels: Optional[list[LabelsInner]] = Field(
260 default=None,
261 description='Each label returns a prediction (true or false) for a specific use case (label field) based on a machine learning score. The machine learning score is determined by a model trained on customer data for that use case. This field is in the beta phase and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). ',
262 )
263 __properties: ClassVar[list[str]] = [
264 'event_id',
265 'timestamp',
266 'source',
267 'incremental_identification_status',
268 'linked_id',
269 'environment_id',
270 'suspect',
271 'sdk',
272 'replayed',
273 'identification',
274 'supplementary_id_high_recall',
275 'tags',
276 'url',
277 'bundle_id',
278 'package_name',
279 'ip_address',
280 'user_agent',
281 'device',
282 'os',
283 'os_version',
284 'client_referrer',
285 'browser_details',
286 'proximity',
287 'active_call',
288 'bot',
289 'bot_type',
290 'bot_info',
291 'cloned_app',
292 'developer_tools',
293 'device_details',
294 'emulator',
295 'factory_reset_timestamp',
296 'frida',
297 'ip_blocklist',
298 'ip_info',
299 'proxy',
300 'proxy_confidence',
301 'proxy_details',
302 'proxy_ml_score',
303 'incognito',
304 'jailbroken',
305 'location_spoofing',
306 'mitm_attack',
307 'privacy_settings',
308 'root_apps',
309 'rule_action',
310 'simulator',
311 'suspect_score',
312 'tampering',
313 'tampering_confidence',
314 'tampering_ml_score',
315 'tampering_details',
316 'velocity',
317 'virtual_machine',
318 'virtual_machine_ml_score',
319 'vpn',
320 'vpn_confidence',
321 'vpn_ml_score',
322 'vpn_origin_timezone',
323 'vpn_origin_country',
324 'vpn_methods',
325 'high_activity_device',
326 'rare_device',
327 'rare_device_percentile_bucket',
328 'raw_device_attributes',
329 'labels',
330 ]
332 model_config = ConfigDict(
333 populate_by_name=True,
334 validate_assignment=True,
335 protected_namespaces=(),
336 )
338 def to_str(self) -> str:
339 """Returns the string representation of the model using alias"""
340 return pprint.pformat(self.model_dump(by_alias=True))
342 def to_json(self) -> str:
343 """Returns the JSON representation of the model using alias"""
344 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
345 return json.dumps(self.to_dict())
347 @classmethod
348 def from_json(cls, json_str: str) -> Optional[Self]:
349 """Create an instance of Event from a JSON string"""
350 return cls.from_dict(json.loads(json_str))
352 def to_dict(self) -> dict[str, Any]:
353 """Return the dictionary representation of the model using alias.
355 This has the following differences from calling pydantic's
356 `self.model_dump(by_alias=True)`:
358 * `None` is only added to the output dict for nullable fields that
359 were set at model initialization. Other fields with value `None`
360 are ignored.
361 """
362 excluded_fields: set[str] = set([])
364 _dict = self.model_dump(
365 by_alias=True,
366 exclude=excluded_fields,
367 exclude_none=True,
368 )
369 # override the default output from pydantic by calling `to_dict()` of sdk
370 if self.sdk:
371 _dict['sdk'] = self.sdk.to_dict()
372 # override the default output from pydantic by calling `to_dict()` of identification
373 if self.identification:
374 _dict['identification'] = self.identification.to_dict()
375 # override the default output from pydantic by calling `to_dict()` of supplementary_id_high_recall
376 if self.supplementary_id_high_recall:
377 _dict['supplementary_id_high_recall'] = self.supplementary_id_high_recall.to_dict()
378 # override the default output from pydantic by calling `to_dict()` of browser_details
379 if self.browser_details:
380 _dict['browser_details'] = self.browser_details.to_dict()
381 # override the default output from pydantic by calling `to_dict()` of proximity
382 if self.proximity:
383 _dict['proximity'] = self.proximity.to_dict()
384 # override the default output from pydantic by calling `to_dict()` of bot_info
385 if self.bot_info:
386 _dict['bot_info'] = self.bot_info.to_dict()
387 # override the default output from pydantic by calling `to_dict()` of device_details
388 if self.device_details:
389 _dict['device_details'] = self.device_details.to_dict()
390 # override the default output from pydantic by calling `to_dict()` of ip_blocklist
391 if self.ip_blocklist:
392 _dict['ip_blocklist'] = self.ip_blocklist.to_dict()
393 # override the default output from pydantic by calling `to_dict()` of ip_info
394 if self.ip_info:
395 _dict['ip_info'] = self.ip_info.to_dict()
396 # override the default output from pydantic by calling `to_dict()` of proxy_details
397 if self.proxy_details:
398 _dict['proxy_details'] = self.proxy_details.to_dict()
399 # override the default output from pydantic by calling `to_dict()` of rule_action
400 if self.rule_action:
401 _dict['rule_action'] = self.rule_action.to_dict()
402 # override the default output from pydantic by calling `to_dict()` of tampering_details
403 if self.tampering_details:
404 _dict['tampering_details'] = self.tampering_details.to_dict()
405 # override the default output from pydantic by calling `to_dict()` of velocity
406 if self.velocity:
407 _dict['velocity'] = self.velocity.to_dict()
408 # override the default output from pydantic by calling `to_dict()` of vpn_methods
409 if self.vpn_methods:
410 _dict['vpn_methods'] = self.vpn_methods.to_dict()
411 # override the default output from pydantic by calling `to_dict()` of raw_device_attributes
412 if self.raw_device_attributes:
413 _dict['raw_device_attributes'] = self.raw_device_attributes.to_dict()
414 # override the default output from pydantic by calling `to_dict()` of each item in labels (list)
415 _items = []
416 if self.labels:
417 for _item_labels in self.labels:
418 if _item_labels:
419 _items.append(_item_labels.to_dict())
420 _dict['labels'] = _items
421 return _dict
423 @classmethod
424 def from_dict(cls, obj: Optional[dict[str, Any]]) -> Optional[Self]:
425 """Create an instance of Event from a dict"""
426 if obj is None:
427 return None
429 if not isinstance(obj, dict):
430 return cls.model_validate(obj)
432 _obj = cls.model_validate(
433 {
434 'event_id': obj.get('event_id'),
435 'timestamp': obj.get('timestamp'),
436 'source': obj.get('source'),
437 'incremental_identification_status': obj.get('incremental_identification_status'),
438 'linked_id': obj.get('linked_id'),
439 'environment_id': obj.get('environment_id'),
440 'suspect': obj.get('suspect'),
441 'sdk': SDK.from_dict(obj['sdk']) if obj.get('sdk') is not None else None,
442 'replayed': obj.get('replayed'),
443 'identification': Identification.from_dict(obj['identification'])
444 if obj.get('identification') is not None
445 else None,
446 'supplementary_id_high_recall': SupplementaryIDHighRecall.from_dict(
447 obj['supplementary_id_high_recall']
448 )
449 if obj.get('supplementary_id_high_recall') is not None
450 else None,
451 'tags': obj.get('tags'),
452 'url': obj.get('url'),
453 'bundle_id': obj.get('bundle_id'),
454 'package_name': obj.get('package_name'),
455 'ip_address': obj.get('ip_address'),
456 'user_agent': obj.get('user_agent'),
457 'device': obj.get('device'),
458 'os': obj.get('os'),
459 'os_version': obj.get('os_version'),
460 'client_referrer': obj.get('client_referrer'),
461 'browser_details': BrowserDetails.from_dict(obj['browser_details'])
462 if obj.get('browser_details') is not None
463 else None,
464 'proximity': Proximity.from_dict(obj['proximity'])
465 if obj.get('proximity') is not None
466 else None,
467 'active_call': obj.get('active_call'),
468 'bot': obj.get('bot'),
469 'bot_type': obj.get('bot_type'),
470 'bot_info': BotInfo.from_dict(obj['bot_info'])
471 if obj.get('bot_info') is not None
472 else None,
473 'cloned_app': obj.get('cloned_app'),
474 'developer_tools': obj.get('developer_tools'),
475 'device_details': DeviceDetails.from_dict(obj['device_details'])
476 if obj.get('device_details') is not None
477 else None,
478 'emulator': obj.get('emulator'),
479 'factory_reset_timestamp': obj.get('factory_reset_timestamp'),
480 'frida': obj.get('frida'),
481 'ip_blocklist': IPBlockList.from_dict(obj['ip_blocklist'])
482 if obj.get('ip_blocklist') is not None
483 else None,
484 'ip_info': IPInfo.from_dict(obj['ip_info'])
485 if obj.get('ip_info') is not None
486 else None,
487 'proxy': obj.get('proxy'),
488 'proxy_confidence': obj.get('proxy_confidence'),
489 'proxy_details': ProxyDetails.from_dict(obj['proxy_details'])
490 if obj.get('proxy_details') is not None
491 else None,
492 'proxy_ml_score': obj.get('proxy_ml_score'),
493 'incognito': obj.get('incognito'),
494 'jailbroken': obj.get('jailbroken'),
495 'location_spoofing': obj.get('location_spoofing'),
496 'mitm_attack': obj.get('mitm_attack'),
497 'privacy_settings': obj.get('privacy_settings'),
498 'root_apps': obj.get('root_apps'),
499 'rule_action': EventRuleAction.from_dict(obj['rule_action'])
500 if obj.get('rule_action') is not None
501 else None,
502 'simulator': obj.get('simulator'),
503 'suspect_score': obj.get('suspect_score'),
504 'tampering': obj.get('tampering'),
505 'tampering_confidence': obj.get('tampering_confidence'),
506 'tampering_ml_score': obj.get('tampering_ml_score'),
507 'tampering_details': TamperingDetails.from_dict(obj['tampering_details'])
508 if obj.get('tampering_details') is not None
509 else None,
510 'velocity': Velocity.from_dict(obj['velocity'])
511 if obj.get('velocity') is not None
512 else None,
513 'virtual_machine': obj.get('virtual_machine'),
514 'virtual_machine_ml_score': obj.get('virtual_machine_ml_score'),
515 'vpn': obj.get('vpn'),
516 'vpn_confidence': obj.get('vpn_confidence'),
517 'vpn_ml_score': obj.get('vpn_ml_score'),
518 'vpn_origin_timezone': obj.get('vpn_origin_timezone'),
519 'vpn_origin_country': obj.get('vpn_origin_country'),
520 'vpn_methods': VpnMethods.from_dict(obj['vpn_methods'])
521 if obj.get('vpn_methods') is not None
522 else None,
523 'high_activity_device': obj.get('high_activity_device'),
524 'rare_device': obj.get('rare_device'),
525 'rare_device_percentile_bucket': obj.get('rare_device_percentile_bucket'),
526 'raw_device_attributes': RawDeviceAttributes.from_dict(
527 obj['raw_device_attributes']
528 )
529 if obj.get('raw_device_attributes') is not None
530 else None,
531 'labels': [LabelsInner.from_dict(_item) for _item in obj['labels']]
532 if obj.get('labels') is not None
533 else None,
534 }
535 )
536 return _obj