Coverage for fingerprint_server_sdk/models/rare_device_percentile_bucket.py: 92%

24 statements  

« prev     ^ index     » next       coverage.py v7.14.3, created at 2026-07-14 10:45 +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. 

6 

7The version of the OpenAPI document: 4 

8Contact: support@fingerprint.com 

9Generated by OpenAPI Generator (https://openapi-generator.tech) 

10 

11Do not edit the class manually. 

12""" # noqa: E501 

13 

14from __future__ import annotations 

15 

16import json 

17from enum import Enum 

18 

19from typing_extensions import Self 

20 

21 

22class RareDevicePercentileBucket(str, Enum): 

23 """ 

24 The rarity percentile bucket of the device, indicating how uncommon the device configuration is compared to all observed devices. > 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/). 

25 """ 

26 

27 """ 

28 allowed enum values 

29 """ 

30 LESS_THAN_P95 = '<p95' 

31 P95_MINUS_P99 = 'p95-p99' 

32 P99_MINUS_P99_DOT_5 = 'p99-p99.5' 

33 P99_DOT_5_MINUS_P99_DOT_9 = 'p99.5-p99.9' 

34 P99_DOT_9_PLUS = 'p99.9+' 

35 NOT_SEEN = 'not_seen' 

36 

37 @classmethod 

38 def from_json(cls, json_str: str) -> Self: 

39 """Create an instance of RareDevicePercentileBucket from a JSON string""" 

40 return cls(json.loads(json_str)) 

41 

42 @classmethod 

43 def _missing_(cls, value: object) -> Self: 

44 """Accept unknown enum values gracefully.""" 

45 if not isinstance(value, str): 

46 raise ValueError(f'{value!r} is not a valid {cls.__name__}') 

47 obj = str.__new__(cls, value) 

48 obj._name_ = str(value) 

49 obj._value_ = value 

50 # cache it so the same value won't trigger `_missing_` again 

51 cls._value2member_map_[value] = obj 

52 return obj