Coverage for fingerprint_server_sdk/models/bot_info_category.py: 76%

34 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 BotInfoCategory(str, Enum): 

23 """ 

24 The type and purpose of the bot. 

25 """ 

26 

27 """ 

28 allowed enum values 

29 """ 

30 ADVERTISING_AND_MARKETING = 'advertising_and_marketing' 

31 AGGREGATOR = 'aggregator' 

32 AI_AGENT = 'ai_agent' 

33 AI_ASSISTANT = 'ai_assistant' 

34 AI_BROWSER = 'ai_browser' 

35 AI_CRAWLER = 'ai_crawler' 

36 AI_SEARCH = 'ai_search' 

37 BROWSER_AUTOMATION = 'browser_automation' 

38 ECOMMERCE = 'ecommerce' 

39 MONITORING_AND_ANALYTICS = 'monitoring_and_analytics' 

40 OTHER = 'other' 

41 SCRAPING = 'scraping' 

42 SECURITY = 'security' 

43 SEARCH_ENGINE_CRAWLER = 'search_engine_crawler' 

44 SEARCH_ENGINE_OPTIMIZATION = 'search_engine_optimization' 

45 UNKNOWN = 'unknown' 

46 

47 @classmethod 

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

49 """Create an instance of BotInfoCategory from a JSON string""" 

50 return cls(json.loads(json_str)) 

51 

52 @classmethod 

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

54 """Accept unknown enum values gracefully.""" 

55 if not isinstance(value, str): 

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

57 obj = str.__new__(cls, value) 

58 obj._name_ = str(value) 

59 obj._value_ = value 

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

61 cls._value2member_map_[value] = obj 

62 return obj