Coverage for fingerprint_server_sdk / models / error_code.py: 96%

27 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-03-11 18:41 +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. 

5 

6The version of the OpenAPI document: 4 

7Contact: support@fingerprint.com 

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

9 

10Do not edit the class manually. 

11""" # noqa: E501 

12 

13from __future__ import annotations 

14 

15import json 

16from enum import Enum 

17 

18from typing_extensions import Self 

19 

20 

21class ErrorCode(str, Enum): 

22 """ 

23 Error code: * `request_cannot_be_parsed` - The query parameters or JSON payload contains some errors that prevented us from parsing it (wrong type/surpassed limits). * `secret_api_key_required` - secret API key in header is missing or empty. * `secret_api_key_not_found` - No Fingerprint workspace found for specified secret API key. * `public_api_key_required` - public API key in header is missing or empty. * `public_api_key_not_found` - No Fingerprint workspace found for specified public API key. * `subscription_not_active` - Fingerprint workspace is not active. * `wrong_region` - Server and workspace region differ. * `feature_not_enabled` - This feature (for example, Delete API) is not enabled for your workspace. * `request_not_found` - The specified event ID was not found. It never existed, expired, or it has been deleted. * `visitor_not_found` - The specified visitor ID was not found. It never existed or it may have already been deleted. * `too_many_requests` - The limit on secret API key requests per second has been exceeded. * `state_not_ready` - The event specified with event ID is not ready for updates yet. Try again. This error happens in rare cases when update API is called immediately after receiving the event ID on the client. In case you need to send information right away, we recommend using the JS agent API instead. * `failed` - Internal server error. * `event_not_found` - The specified event ID was not found. It never existed, expired, or it has been deleted. * `missing_module` - The request is invalid because it is missing a required module. * `payload_too_large` - The request payload is too large and cannot be processed. * `service_unavailable` - The service was unable to process the request. * `ruleset_not_found` - The specified ruleset was not found. It never existed or it has been deleted. 

24 """ 

25 

26 """ 

27 allowed enum values 

28 """ 

29 REQUEST_CANNOT_BE_PARSED = 'request_cannot_be_parsed' 

30 SECRET_API_KEY_REQUIRED = 'secret_api_key_required' 

31 SECRET_API_KEY_NOT_FOUND = 'secret_api_key_not_found' 

32 PUBLIC_API_KEY_REQUIRED = 'public_api_key_required' 

33 PUBLIC_API_KEY_NOT_FOUND = 'public_api_key_not_found' 

34 SUBSCRIPTION_NOT_ACTIVE = 'subscription_not_active' 

35 WRONG_REGION = 'wrong_region' 

36 FEATURE_NOT_ENABLED = 'feature_not_enabled' 

37 REQUEST_NOT_FOUND = 'request_not_found' 

38 VISITOR_NOT_FOUND = 'visitor_not_found' 

39 TOO_MANY_REQUESTS = 'too_many_requests' 

40 STATE_NOT_READY = 'state_not_ready' 

41 FAILED = 'failed' 

42 EVENT_NOT_FOUND = 'event_not_found' 

43 MISSING_MODULE = 'missing_module' 

44 PAYLOAD_TOO_LARGE = 'payload_too_large' 

45 SERVICE_UNAVAILABLE = 'service_unavailable' 

46 RULESET_NOT_FOUND = 'ruleset_not_found' 

47 

48 @classmethod 

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

50 """Create an instance of ErrorCode from a JSON string""" 

51 return cls(json.loads(json_str))