Coverage for fingerprint_server_sdk/models/event_source.py: 90%
20 statements
« prev ^ index » next coverage.py v7.14.3, created at 2026-08-13 12:56 +0000
« prev ^ index » next coverage.py v7.14.3, created at 2026-08-13 12:56 +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
17from enum import Enum
19from typing_extensions import Self
22class EventSource(str, Enum):
23 """
24 Identifies how the event was generated. - `device` - the event was generated by the JS agent or a mobile SDK running on an end-user device. - `edge` - the event was generated by the Automation Intelligence API (`/edge` endpoint), analyzing a request intercepted at the edge.
25 """
27 """
28 allowed enum values
29 """
30 DEVICE = 'device'
31 EDGE = 'edge'
33 @classmethod
34 def from_json(cls, json_str: str) -> Self:
35 """Create an instance of EventSource from a JSON string"""
36 return cls(json.loads(json_str))
38 @classmethod
39 def _missing_(cls, value: object) -> Self:
40 """Accept unknown enum values gracefully."""
41 if not isinstance(value, str):
42 raise ValueError(f'{value!r} is not a valid {cls.__name__}')
43 obj = str.__new__(cls, value)
44 obj._name_ = str(value)
45 obj._value_ = value
46 # cache it so the same value won't trigger `_missing_` again
47 cls._value2member_map_[value] = obj
48 return obj