diff --git a/.env.example b/.env.example index c2deb2e8..979b570e 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,7 @@ PRIVATE_KEY= REQUEST_ID= VISITOR_ID= +VISITOR_ID_TO_DELETE= # for delete visitor example +REQUEST_ID_TO_UPDATE= # for update event example # put 'eu' or 'ap' if necessary, 'us' is default -REGION= \ No newline at end of file +REGION= diff --git a/.swagger-codegen-ignore b/.swagger-codegen-ignore index f7f714dd..61c7d35c 100644 --- a/.swagger-codegen-ignore +++ b/.swagger-codegen-ignore @@ -27,6 +27,6 @@ git_push.sh tox.ini test/*.py -fingerprint_pro_server_api_sdk/models/many_requests_response.py +fingerprint_pro_server_api_sdk/models/too_many_requests_response.py requirements.txt -test-requirements.txt \ No newline at end of file +test-requirements.txt diff --git a/README.md b/README.md index 1971e62f..bc324463 100644 --- a/README.md +++ b/README.md @@ -95,11 +95,11 @@ from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY") api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration) -visitor_id = 'visitor_id_example' # str | -#request_id = 'request_id_example' # str | Filter events by requestId (optional) -#linked_id = 'linked_id_example' # str | Filter events by custom identifier (optional) -limit = 10 # int | Limit scanned results (optional) -#before = 56 # int | Used to paginate results (optional) +visitor_id = 'visitor_id_example' # str | Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. +#request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). +#linked_id = 'linked_id_example' # str | Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. (optional) +limit = 10 # int | Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. (optional) +#pagination_key = 'pagination_key_example' # str | Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned. (optional) try: api_response: Response = api_instance.get_visits(visitor_id, limit=2) @@ -108,7 +108,26 @@ except KnownApiException as e: structured_error = e.structured_error print("Error: %s\n" % structured_error.error) except ApiException as e: - print("Exception when calling DefaultApi->visitors_visitor_id_get: %s\n" % e) + print("Exception when calling FingerprintApi->visitors_visitor_id_get: %s\n" % e) +``` + +Delete visits using visitorId: +```python +import fingerprint_pro_server_api_sdk +from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException + +configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY") +api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration) + +visitor_id = 'visitor_id_example' # str | Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. + +try: + api_instance.delete_visitor_data(visitor_id) +except KnownApiException as e: + structured_error = e.structured_error + print("Error: %s\n" % structured_error.error) +except ApiException as e: + print("Exception when calling FingerprintApi->delete_visitor_data: %s\n" % e) ``` Fetching events for requestId: @@ -120,7 +139,7 @@ from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY") api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration) -request_id = 'request_id_example' # str +request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). try: events_response: EventResponse = api_instance.get_event(request_id) @@ -129,7 +148,31 @@ except KnownApiException as e: structured_error = e.structured_error print("Error code: %s. Error message: %s\n" % (structured_error.error.code, structured_error.error.message)) except ApiException as e: - print("Exception when calling DefaultApi->get_event: %s\n" % e) + print("Exception when calling FingerprintApi->get_event: %s\n" % e) +``` + +Update event for requestId: +```python +import fingerprint_pro_server_api_sdk +from fingerprint_pro_server_api_sdk import EventUpdateRequest +from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException + +configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY") +api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration) + +request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). +body = EventUpdateRequest(linked_id='foo') # EventUpdateRequest | +# body = EventUpdateRequest(tag={'bar': 123}) +# body = EventUpdateRequest(suspect=True) +# body = EventUpdateRequest(linked_id='foo', tag={'bar': 123}, suspect=False) + +try: + api_instance.update_event(request_id, body) +except KnownApiException as e: + structured_error = e.structured_error + print("Error code: %s. Error message: %s\n" % (structured_error.error.code, structured_error.error.message)) +except ApiException as e: + print("Exception when calling FingerprintApi->update_event: %s\n" % e) ``` ## Sealed results @@ -168,8 +211,10 @@ All URIs are relative to *https://api.fpjs.io* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*FingerprintApi* | [**get_event**](docs/FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by requestId -*FingerprintApi* | [**get_visits**](docs/FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitorId +*FingerprintApi* | [**delete_visitor_data**](docs/FingerprintApi.md#delete_visitor_data) | **DELETE** /visitors/{visitor_id} | Delete data by visitor ID +*FingerprintApi* | [**get_event**](docs/FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by request ID +*FingerprintApi* | [**get_visits**](docs/FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID +*FingerprintApi* | [**update_event**](docs/FingerprintApi.md#update_event) | **PUT** /events/{request_id} | Update an event with a given request ID ## Documentation For Models @@ -178,17 +223,28 @@ Class | Method | HTTP request | Description - [BotdResult](docs/BotdResult.md) - [BrowserDetails](docs/BrowserDetails.md) - [ClonedAppResult](docs/ClonedAppResult.md) + - [Common403ErrorResponse](docs/Common403ErrorResponse.md) - [Confidence](docs/Confidence.md) - [DataCenter](docs/DataCenter.md) - [DeprecatedIPLocation](docs/DeprecatedIPLocation.md) - [DeprecatedIPLocationCity](docs/DeprecatedIPLocationCity.md) - [EmulatorResult](docs/EmulatorResult.md) - - [ErrorEvent403Response](docs/ErrorEvent403Response.md) - - [ErrorEvent403ResponseError](docs/ErrorEvent403ResponseError.md) + - [ErrorCommon403Response](docs/ErrorCommon403Response.md) + - [ErrorCommon429Response](docs/ErrorCommon429Response.md) + - [ErrorCommon429ResponseError](docs/ErrorCommon429ResponseError.md) - [ErrorEvent404Response](docs/ErrorEvent404Response.md) - [ErrorEvent404ResponseError](docs/ErrorEvent404ResponseError.md) + - [ErrorUpdateEvent400Response](docs/ErrorUpdateEvent400Response.md) + - [ErrorUpdateEvent400ResponseError](docs/ErrorUpdateEvent400ResponseError.md) + - [ErrorUpdateEvent409Response](docs/ErrorUpdateEvent409Response.md) + - [ErrorUpdateEvent409ResponseError](docs/ErrorUpdateEvent409ResponseError.md) + - [ErrorVisitor400Response](docs/ErrorVisitor400Response.md) + - [ErrorVisitor400ResponseError](docs/ErrorVisitor400ResponseError.md) + - [ErrorVisitor404Response](docs/ErrorVisitor404Response.md) + - [ErrorVisitor404ResponseError](docs/ErrorVisitor404ResponseError.md) - [ErrorVisits403](docs/ErrorVisits403.md) - [EventResponse](docs/EventResponse.md) + - [EventUpdateRequest](docs/EventUpdateRequest.md) - [FactoryResetResult](docs/FactoryResetResult.md) - [FridaResult](docs/FridaResult.md) - [HighActivityResult](docs/HighActivityResult.md) @@ -204,7 +260,6 @@ Class | Method | HTTP request | Description - [JailbrokenResult](docs/JailbrokenResult.md) - [Location](docs/Location.md) - [LocationSpoofingResult](docs/LocationSpoofingResult.md) - - [ManyRequestsResponse](docs/ManyRequestsResponse.md) - [PrivacySettingsResult](docs/PrivacySettingsResult.md) - [ProductError](docs/ProductError.md) - [ProductsResponse](docs/ProductsResponse.md) @@ -213,6 +268,7 @@ Class | Method | HTTP request | Description - [ProductsResponseIdentificationData](docs/ProductsResponseIdentificationData.md) - [ProxyResult](docs/ProxyResult.md) - [RawDeviceAttributesResult](docs/RawDeviceAttributesResult.md) + - [RemoteControlResult](docs/RemoteControlResult.md) - [Response](docs/Response.md) - [ResponseVisits](docs/ResponseVisits.md) - [RootAppsResult](docs/RootAppsResult.md) @@ -230,16 +286,22 @@ Class | Method | HTTP request | Description - [SignalResponsePrivacySettings](docs/SignalResponsePrivacySettings.md) - [SignalResponseProxy](docs/SignalResponseProxy.md) - [SignalResponseRawDeviceAttributes](docs/SignalResponseRawDeviceAttributes.md) + - [SignalResponseRemoteControl](docs/SignalResponseRemoteControl.md) - [SignalResponseRootApps](docs/SignalResponseRootApps.md) - [SignalResponseSuspectScore](docs/SignalResponseSuspectScore.md) - [SignalResponseTampering](docs/SignalResponseTampering.md) - [SignalResponseTor](docs/SignalResponseTor.md) + - [SignalResponseVelocity](docs/SignalResponseVelocity.md) - [SignalResponseVirtualMachine](docs/SignalResponseVirtualMachine.md) - [SignalResponseVpn](docs/SignalResponseVpn.md) - [Subdivision](docs/Subdivision.md) - [SuspectScoreResult](docs/SuspectScoreResult.md) - [TamperingResult](docs/TamperingResult.md) + - [TooManyRequestsResponse](docs/TooManyRequestsResponse.md) - [TorResult](docs/TorResult.md) + - [VelocityIntervalResult](docs/VelocityIntervalResult.md) + - [VelocityIntervals](docs/VelocityIntervals.md) + - [VelocityResult](docs/VelocityResult.md) - [VirtualMachineResult](docs/VirtualMachineResult.md) - [Visit](docs/Visit.md) - [VpnResult](docs/VpnResult.md) @@ -274,4 +336,4 @@ If you need private support, you can email us at [oss-support@fingerprint.com](m ## License -This project is licensed under the [MIT License](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/blob/main/LICENSE). \ No newline at end of file +This project is licensed under the [MIT License](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/blob/main/LICENSE). diff --git a/commitlint.config.js b/commitlint.config.js index 422b1944..ca894a01 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1 +1 @@ -module.exports = { extends: ['@commitlint/config-conventional'] }; +module.exports = { extends: ['@fingerprintjs/commit-lint-dx-team'] }; diff --git a/delete_visitor_example.py b/delete_visitor_example.py new file mode 100644 index 00000000..4f52e100 --- /dev/null +++ b/delete_visitor_example.py @@ -0,0 +1,26 @@ +import os + +import fingerprint_pro_server_api_sdk +from fingerprint_pro_server_api_sdk.rest import ApiException + +from dotenv import load_dotenv + +load_dotenv() + +# configure +configuration = fingerprint_pro_server_api_sdk.Configuration( + api_key=os.environ["PRIVATE_KEY"], region=os.environ.get("REGION", "us")) + +# create an instance of the API class +api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration) +visitor_id = os.environ["VISITOR_ID_TO_DELETE"] + +try: + api_instance.delete_visitor_data(visitor_id) +except ApiException as e: + print("Exception when calling DefaultApi->delete_visitor_data: %s\n" % e) + exit(1) + +print("Visitor data deleted!") + +exit(0) diff --git a/docs/ErrorEvent403ResponseError.md b/docs/Common403ErrorResponse.md similarity index 50% rename from docs/ErrorEvent403ResponseError.md rename to docs/Common403ErrorResponse.md index 100685ab..20f21f61 100644 --- a/docs/ErrorEvent403ResponseError.md +++ b/docs/Common403ErrorResponse.md @@ -1,9 +1,9 @@ -# ErrorEvent403ResponseError +# Common403ErrorResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **str** | Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - subscription not found for specified secret key * `SubscriptionNotActive` - subscription is not active * `WrongRegion` - server and subscription region differ | +**code** | **str** | Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - No Fingerprint application found for specified secret key * `SubscriptionNotActive` - Fingerprint application is not active * `WrongRegion` - server and application region differ * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application | **message** | **str** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Confidence.md b/docs/Confidence.md index b1ee40b6..eba9ccd6 100644 --- a/docs/Confidence.md +++ b/docs/Confidence.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **score** | **float** | The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. | +**revision** | **str** | The revision name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ErrorEvent403Response.md b/docs/ErrorCommon403Response.md similarity index 70% rename from docs/ErrorEvent403Response.md rename to docs/ErrorCommon403Response.md index b8a3b792..c6420125 100644 --- a/docs/ErrorEvent403Response.md +++ b/docs/ErrorCommon403Response.md @@ -1,9 +1,9 @@ -# ErrorEvent403Response +# ErrorCommon403Response ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**error** | [**ErrorEvent403ResponseError**](ErrorEvent403ResponseError.md) | | [optional] +**error** | [**Common403ErrorResponse**](Common403ErrorResponse.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ErrorCommon429Response.md b/docs/ErrorCommon429Response.md new file mode 100644 index 00000000..c966cb85 --- /dev/null +++ b/docs/ErrorCommon429Response.md @@ -0,0 +1,9 @@ +# ErrorCommon429Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**ErrorCommon429ResponseError**](ErrorCommon429ResponseError.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ErrorCommon429ResponseError.md b/docs/ErrorCommon429ResponseError.md new file mode 100644 index 00000000..9c26339b --- /dev/null +++ b/docs/ErrorCommon429ResponseError.md @@ -0,0 +1,10 @@ +# ErrorCommon429ResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | Error code: * `TooManyRequests` - The request is throttled. | +**message** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ErrorEvent404ResponseError.md b/docs/ErrorEvent404ResponseError.md index 885f39b5..96e1f53d 100644 --- a/docs/ErrorEvent404ResponseError.md +++ b/docs/ErrorEvent404ResponseError.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **str** | Error code: * `RequestNotFound` - request not found for specified id | +**code** | **str** | Error code: * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. | **message** | **str** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ErrorUpdateEvent400Response.md b/docs/ErrorUpdateEvent400Response.md new file mode 100644 index 00000000..78f7be65 --- /dev/null +++ b/docs/ErrorUpdateEvent400Response.md @@ -0,0 +1,9 @@ +# ErrorUpdateEvent400Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**ErrorUpdateEvent400ResponseError**](ErrorUpdateEvent400ResponseError.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ErrorUpdateEvent400ResponseError.md b/docs/ErrorUpdateEvent400ResponseError.md new file mode 100644 index 00000000..29675a95 --- /dev/null +++ b/docs/ErrorUpdateEvent400ResponseError.md @@ -0,0 +1,10 @@ +# ErrorUpdateEvent400ResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | Error code: * `RequestCannotBeParsed` - the JSON content of the request contains some errors that prevented us from parsing it (wrong type/surpassed limits) * `Failed` - the event is more than 10 days old and cannot be updated | +**message** | **str** | Details about the underlying issue with the input payload | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ErrorUpdateEvent409Response.md b/docs/ErrorUpdateEvent409Response.md new file mode 100644 index 00000000..68e6bd53 --- /dev/null +++ b/docs/ErrorUpdateEvent409Response.md @@ -0,0 +1,9 @@ +# ErrorUpdateEvent409Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**ErrorUpdateEvent409ResponseError**](ErrorUpdateEvent409ResponseError.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ErrorUpdateEvent409ResponseError.md b/docs/ErrorUpdateEvent409ResponseError.md new file mode 100644 index 00000000..72eaee85 --- /dev/null +++ b/docs/ErrorUpdateEvent409ResponseError.md @@ -0,0 +1,10 @@ +# ErrorUpdateEvent409ResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | Error code: * `StateNotReady` - The event specified with request id is not ready for updates yet. Try again. This error happens in rare cases when update API is called immediately after receiving the request id on the client. In case you need to send information right away, we recommend using the JS agent API instead. | +**message** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ErrorVisitor400Response.md b/docs/ErrorVisitor400Response.md new file mode 100644 index 00000000..91df7398 --- /dev/null +++ b/docs/ErrorVisitor400Response.md @@ -0,0 +1,9 @@ +# ErrorVisitor400Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**ErrorVisitor400ResponseError**](ErrorVisitor400ResponseError.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ErrorVisitor400ResponseError.md b/docs/ErrorVisitor400ResponseError.md new file mode 100644 index 00000000..896f53e4 --- /dev/null +++ b/docs/ErrorVisitor400ResponseError.md @@ -0,0 +1,10 @@ +# ErrorVisitor400ResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | Error code: * `RequestCannotBeParsed` - The visitor ID parameter is missing or in the wrong format. | +**message** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ErrorVisitor404Response.md b/docs/ErrorVisitor404Response.md new file mode 100644 index 00000000..8fe25083 --- /dev/null +++ b/docs/ErrorVisitor404Response.md @@ -0,0 +1,9 @@ +# ErrorVisitor404Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**ErrorVisitor404ResponseError**](ErrorVisitor404ResponseError.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ErrorVisitor404ResponseError.md b/docs/ErrorVisitor404ResponseError.md new file mode 100644 index 00000000..cf0b636f --- /dev/null +++ b/docs/ErrorVisitor404ResponseError.md @@ -0,0 +1,10 @@ +# ErrorVisitor404ResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | Error code: * `VisitorNotFound` - The specified visitor ID was not found. It never existed or it may have already been deleted. | +**message** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/EventUpdateRequest.md b/docs/EventUpdateRequest.md new file mode 100644 index 00000000..d6d0319b --- /dev/null +++ b/docs/EventUpdateRequest.md @@ -0,0 +1,11 @@ +# EventUpdateRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**linked_id** | **str** | LinkedID value to assign to the existing event | [optional] +**tag** | **object** | Full `tag` value to be set to the existing event. Replaces any existing `tag` payload completely. | [optional] +**suspect** | **bool** | Suspect flag indicating observed suspicious or fraudulent event | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/FingerprintApi.md b/docs/FingerprintApi.md index 897b9172..9c5a684b 100644 --- a/docs/FingerprintApi.md +++ b/docs/FingerprintApi.md @@ -4,15 +4,67 @@ All URIs are relative to *https://api.fpjs.io* Method | HTTP request | Description ------------- | ------------- | ------------- -[**get_event**](FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by requestId -[**get_visits**](FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitorId +[**delete_visitor_data**](FingerprintApi.md#delete_visitor_data) | **DELETE** /visitors/{visitor_id} | Delete data by visitor ID +[**get_event**](FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by request ID +[**get_visits**](FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID +[**update_event**](FingerprintApi.md#update_event) | **PUT** /events/{request_id} | Update an event with a given request ID + +# **delete_visitor_data** +> delete_visitor_data(visitor_id) + +Delete data by visitor ID + +Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. All delete requests are queued: * Recent data (10 days or newer) belonging to the specified visitor will be deleted within 24 hours. * Data from older (11 days or more) identification events will be deleted after 90 days. If you are interested in using this API, please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + +### Example +```python +import fingerprint_pro_server_api_sdk +from fingerprint_pro_server_api_sdk import Response +from fingerprint_pro_server_api_sdk.rest import ApiException + +# Configure API key authorization and region +configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY") +# configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY", region="eu") + +# create an instance of the API class +api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration) + +visitor_id = 'visitor_id_example' # str | The [visitor ID](https://dev.fingerprint.com/docs/js-agent#visitorid) you want to delete. + +try: + # Delete data by visitor ID + api_instance.delete_visitor_data(visitor_id) +except ApiException as e: + print("Exception when calling FingerprintApi->delete_visitor_data: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **visitor_id** | **str**| The [visitor ID](https://dev.fingerprint.com/docs/js-agent#visitorid) you want to delete. | + +### Return type + +void (empty response body) + +### Authorization + +[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_event** > EventResponse get_event(request_id) -Get event by requestId +Get event by request ID -This endpoint allows you to get a detailed analysis of an individual request. **Only for Enterprise customers:** Please note that the response includes mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`. +Get a detailed analysis of an individual identification event, including Smart Signals. Please note that the response includes mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`. ### Example ```python @@ -26,24 +78,22 @@ configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API # create an instance of the API class api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration) -visitor_id = 'visitor_id_example' # str | -#request_id = 'request_id_example' # str | Filter events by requestId (optional) -#linked_id = 'linked_id_example' # str | Filter events by custom identifier (optional) -limit = 10 # int | Limit scanned results (optional) -#before = 56 # int | Used to paginate results (optional) + +request_id = 'request_id_example' # str | The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request. try: - api_response: Response = api_instance.get_visits(visitor_id, limit=2) + # Get event by request ID + api_response = api_instance.get_event(request_id) print(api_response) except ApiException as e: - print("Exception when calling DefaultApi->visitors_visitor_id_get: %s\n" % e) + print("Exception when calling FingerprintApi->get_event: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **request_id** | **str**| The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. | + **request_id** | **str**| The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request. | ### Return type @@ -63,9 +113,9 @@ Name | Type | Description | Notes # **get_visits** > Response get_visits(visitor_id, request_id=request_id, linked_id=linked_id, limit=limit, pagination_key=pagination_key, before=before) -Get visits by visitorId +Get visits by visitor ID -This endpoint allows you to get a history of visits for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. #### Headers * `Retry-After` — Present in case of `429 Too many requests`. Indicates how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received. +Get a history of visits (identification events) for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. #### Headers * `Retry-After` — Present in case of `429 Too many requests`. Indicates how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received. ### Example ```python @@ -79,24 +129,27 @@ configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API # create an instance of the API class api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration) -visitor_id = 'visitor_id_example' # str | -#request_id = 'request_id_example' # str | Filter events by requestId (optional) -#linked_id = 'linked_id_example' # str | Filter events by custom identifier (optional) -limit = 10 # int | Limit scanned results (optional) -#before = 56 # int | Used to paginate results (optional) + +visitor_id = 'visitor_id_example' # str | Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. +request_id = 'request_id_example' # str | Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. (optional) +linked_id = 'linked_id_example' # str | Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. (optional) +limit = 56 # int | Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. (optional) +pagination_key = 'pagination_key_example' # str | Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned. (optional) +before = 789 # int | ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. (optional) try: - api_response: Response = api_instance.get_visits(visitor_id, limit=2) + # Get visits by visitor ID + api_response = api_instance.get_visits(visitor_id, request_id=request_id, linked_id=linked_id, limit=limit, pagination_key=pagination_key, before=before) print(api_response) except ApiException as e: - print("Exception when calling DefaultApi->visitors_visitor_id_get: %s\n" % e) + print("Exception when calling FingerprintApi->get_visits: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **visitor_id** | **str**| Unique identifier of the visitor issued by Fingerprint Pro. | + **visitor_id** | **str**| Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. | **request_id** | **str**| Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. | [optional] **linked_id** | **str**| Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. | [optional] **limit** | **int**| Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. | [optional] @@ -118,3 +171,55 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_event** +> update_event(body, request_id) + +Update an event with a given request ID + +Change information in existing events specified by `requestId` or *flag suspicious events*. When an event is created, it is assigned `linkedId` and `tag` submitted through the JS agent parameters. This information might not be available on the client so the Server API allows for updating the attributes after the fact. **Warning** It's not possible to update events older than 10 days. + +### Example +```python +import fingerprint_pro_server_api_sdk +from fingerprint_pro_server_api_sdk import Response +from fingerprint_pro_server_api_sdk.rest import ApiException + +# Configure API key authorization and region +configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY") +# configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY", region="eu") + +# create an instance of the API class +api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration) + +body = fingerprint_pro_server_api_sdk.EventUpdateRequest() # EventUpdateRequest | +request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). + +try: + # Update an event with a given request ID + api_instance.update_event(body, request_id) +except ApiException as e: + print("Exception when calling FingerprintApi->update_event: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**EventUpdateRequest**](EventUpdateRequest.md)| | + **request_id** | **str**| The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). | + +### Return type + +void (empty response body) + +### Authorization + +[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/ProductsResponse.md b/docs/ProductsResponse.md index 009f3eed..e8abb006 100644 --- a/docs/ProductsResponse.md +++ b/docs/ProductsResponse.md @@ -26,6 +26,8 @@ Name | Type | Description | Notes **location_spoofing** | [**SignalResponseLocationSpoofing**](SignalResponseLocationSpoofing.md) | | [optional] **suspect_score** | [**SignalResponseSuspectScore**](SignalResponseSuspectScore.md) | | [optional] **raw_device_attributes** | [**SignalResponseRawDeviceAttributes**](SignalResponseRawDeviceAttributes.md) | | [optional] +**remote_control** | [**SignalResponseRemoteControl**](SignalResponseRemoteControl.md) | | [optional] +**velocity** | [**SignalResponseVelocity**](SignalResponseVelocity.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/RemoteControlResult.md b/docs/RemoteControlResult.md new file mode 100644 index 00000000..990907a3 --- /dev/null +++ b/docs/RemoteControlResult.md @@ -0,0 +1,9 @@ +# RemoteControlResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | **bool** | `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SignalResponseIncognito.md b/docs/SignalResponseIncognito.md index db037e8a..b8154f64 100644 --- a/docs/SignalResponseIncognito.md +++ b/docs/SignalResponseIncognito.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**IncognitoResult**](IncognitoResult.md) | | [optional] -**error** | [**ProductError**](ProductError.md) | | [optional] +**error** | [**IdentificationError**](IdentificationError.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SignalResponseRawDeviceAttributes.md b/docs/SignalResponseRawDeviceAttributes.md index 6a5a2027..d3092528 100644 --- a/docs/SignalResponseRawDeviceAttributes.md +++ b/docs/SignalResponseRawDeviceAttributes.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**RawDeviceAttributesResult**](RawDeviceAttributesResult.md) | | [optional] -**error** | [**ProductError**](ProductError.md) | | [optional] +**error** | [**IdentificationError**](IdentificationError.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SignalResponseRemoteControl.md b/docs/SignalResponseRemoteControl.md new file mode 100644 index 00000000..69b5e492 --- /dev/null +++ b/docs/SignalResponseRemoteControl.md @@ -0,0 +1,10 @@ +# SignalResponseRemoteControl + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**RemoteControlResult**](RemoteControlResult.md) | | [optional] +**error** | [**ProductError**](ProductError.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SignalResponseTampering.md b/docs/SignalResponseTampering.md index 328826d2..3fec7b6c 100644 --- a/docs/SignalResponseTampering.md +++ b/docs/SignalResponseTampering.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**TamperingResult**](TamperingResult.md) | | [optional] -**error** | [**ProductError**](ProductError.md) | | [optional] +**error** | [**IdentificationError**](IdentificationError.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SignalResponseVelocity.md b/docs/SignalResponseVelocity.md new file mode 100644 index 00000000..c1702ccb --- /dev/null +++ b/docs/SignalResponseVelocity.md @@ -0,0 +1,10 @@ +# SignalResponseVelocity + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**VelocityResult**](VelocityResult.md) | | [optional] +**error** | [**ProductError**](ProductError.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ManyRequestsResponse.md b/docs/TooManyRequestsResponse.md similarity index 92% rename from docs/ManyRequestsResponse.md rename to docs/TooManyRequestsResponse.md index 5d23e8ea..2d19e161 100644 --- a/docs/ManyRequestsResponse.md +++ b/docs/TooManyRequestsResponse.md @@ -1,4 +1,4 @@ -# ManyRequestsResponse +# TooManyRequestsResponse ## Properties Name | Type | Description | Notes diff --git a/docs/VelocityIntervalResult.md b/docs/VelocityIntervalResult.md new file mode 100644 index 00000000..93206bbf --- /dev/null +++ b/docs/VelocityIntervalResult.md @@ -0,0 +1,13 @@ +# VelocityIntervalResult +Is absent if the velocity data could not be generated for the visitor ID. + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_5m** | **int** | | +**_1h** | **int** | | +**_24h** | **int** | The `24h` interval of `distinctIp`, `distinctLinkedId`, and `distinctCountry` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/VelocityIntervals.md b/docs/VelocityIntervals.md new file mode 100644 index 00000000..6f3f6bb7 --- /dev/null +++ b/docs/VelocityIntervals.md @@ -0,0 +1,9 @@ +# VelocityIntervals + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**intervals** | [**VelocityIntervalResult**](VelocityIntervalResult.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/VelocityResult.md b/docs/VelocityResult.md new file mode 100644 index 00000000..fb6e0236 --- /dev/null +++ b/docs/VelocityResult.md @@ -0,0 +1,14 @@ +# VelocityResult +Sums key data points for a specific `visitorId` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: - Number of identification events attributed to the visitor ID - Number of distinct IP addresses associated to the visitor ID. - Number of distinct countries associated with the visitor ID. - Number of distinct `linkedId`s associated with the visitor ID. The `24h` interval of `distinctIp`, `distinctLinkedId`, and `distinctCountry` will be omitted if the number of `events` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**distinct_ip** | [**VelocityIntervals**](VelocityIntervals.md) | | +**distinct_linked_id** | [**VelocityIntervals**](VelocityIntervals.md) | | +**distinct_country** | [**VelocityIntervals**](VelocityIntervals.md) | | +**events** | [**VelocityIntervals**](VelocityIntervals.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/VpnResultMethods.md b/docs/VpnResultMethods.md index 74528c95..287a4c1a 100644 --- a/docs/VpnResultMethods.md +++ b/docs/VpnResultMethods.md @@ -3,9 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**timezone_mismatch** | **bool** | User's browser timezone doesn't match the timezone from which the request was originally made. | +**timezone_mismatch** | **bool** | The browser timezone doesn't match the timezone inferred from the request IP address. | **public_vpn** | **bool** | Request IP address is owned and used by a public VPN service provider. | **auxiliary_mobile** | **bool** | This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. | +**os_mismatch** | **bool** | The browser runs on a different operating system than the operating system inferred from the request network signature. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/WebhookVisit.md b/docs/WebhookVisit.md index ba6c33f5..f4a3d87c 100644 --- a/docs/WebhookVisit.md +++ b/docs/WebhookVisit.md @@ -26,6 +26,8 @@ Name | Type | Description | Notes **high_activity** | [**HighActivityResult**](HighActivityResult.md) | | [optional] **location_spoofing** | [**LocationSpoofingResult**](LocationSpoofingResult.md) | | [optional] **suspect_score** | [**SuspectScoreResult**](SuspectScoreResult.md) | | [optional] +**remote_control** | [**RemoteControlResult**](RemoteControlResult.md) | | [optional] +**velocity** | [**VelocityResult**](VelocityResult.md) | | [optional] **request_id** | **str** | Unique identifier of the user's identification request. | **browser_details** | [**BrowserDetails**](BrowserDetails.md) | | **ip** | **str** | | diff --git a/fingerprint_pro_server_api_sdk/__init__.py b/fingerprint_pro_server_api_sdk/__init__.py index dea46c32..ff47fe5e 100644 --- a/fingerprint_pro_server_api_sdk/__init__.py +++ b/fingerprint_pro_server_api_sdk/__init__.py @@ -25,17 +25,28 @@ from fingerprint_pro_server_api_sdk.models.botd_result import BotdResult from fingerprint_pro_server_api_sdk.models.browser_details import BrowserDetails from fingerprint_pro_server_api_sdk.models.cloned_app_result import ClonedAppResult +from fingerprint_pro_server_api_sdk.models.common403_error_response import Common403ErrorResponse from fingerprint_pro_server_api_sdk.models.confidence import Confidence from fingerprint_pro_server_api_sdk.models.data_center import DataCenter from fingerprint_pro_server_api_sdk.models.deprecated_ip_location import DeprecatedIPLocation from fingerprint_pro_server_api_sdk.models.deprecated_ip_location_city import DeprecatedIPLocationCity from fingerprint_pro_server_api_sdk.models.emulator_result import EmulatorResult -from fingerprint_pro_server_api_sdk.models.error_event403_response import ErrorEvent403Response -from fingerprint_pro_server_api_sdk.models.error_event403_response_error import ErrorEvent403ResponseError +from fingerprint_pro_server_api_sdk.models.error_common403_response import ErrorCommon403Response +from fingerprint_pro_server_api_sdk.models.error_common429_response import ErrorCommon429Response +from fingerprint_pro_server_api_sdk.models.error_common429_response_error import ErrorCommon429ResponseError from fingerprint_pro_server_api_sdk.models.error_event404_response import ErrorEvent404Response from fingerprint_pro_server_api_sdk.models.error_event404_response_error import ErrorEvent404ResponseError +from fingerprint_pro_server_api_sdk.models.error_update_event400_response import ErrorUpdateEvent400Response +from fingerprint_pro_server_api_sdk.models.error_update_event400_response_error import ErrorUpdateEvent400ResponseError +from fingerprint_pro_server_api_sdk.models.error_update_event409_response import ErrorUpdateEvent409Response +from fingerprint_pro_server_api_sdk.models.error_update_event409_response_error import ErrorUpdateEvent409ResponseError +from fingerprint_pro_server_api_sdk.models.error_visitor400_response import ErrorVisitor400Response +from fingerprint_pro_server_api_sdk.models.error_visitor400_response_error import ErrorVisitor400ResponseError +from fingerprint_pro_server_api_sdk.models.error_visitor404_response import ErrorVisitor404Response +from fingerprint_pro_server_api_sdk.models.error_visitor404_response_error import ErrorVisitor404ResponseError from fingerprint_pro_server_api_sdk.models.error_visits403 import ErrorVisits403 from fingerprint_pro_server_api_sdk.models.event_response import EventResponse +from fingerprint_pro_server_api_sdk.models.event_update_request import EventUpdateRequest from fingerprint_pro_server_api_sdk.models.factory_reset_result import FactoryResetResult from fingerprint_pro_server_api_sdk.models.frida_result import FridaResult from fingerprint_pro_server_api_sdk.models.high_activity_result import HighActivityResult @@ -51,7 +62,6 @@ from fingerprint_pro_server_api_sdk.models.jailbroken_result import JailbrokenResult from fingerprint_pro_server_api_sdk.models.location import Location from fingerprint_pro_server_api_sdk.models.location_spoofing_result import LocationSpoofingResult -from fingerprint_pro_server_api_sdk.models.many_requests_response import ManyRequestsResponse from fingerprint_pro_server_api_sdk.models.privacy_settings_result import PrivacySettingsResult from fingerprint_pro_server_api_sdk.models.product_error import ProductError from fingerprint_pro_server_api_sdk.models.products_response import ProductsResponse @@ -60,6 +70,7 @@ from fingerprint_pro_server_api_sdk.models.products_response_identification_data import ProductsResponseIdentificationData from fingerprint_pro_server_api_sdk.models.proxy_result import ProxyResult from fingerprint_pro_server_api_sdk.models.raw_device_attributes_result import RawDeviceAttributesResult +from fingerprint_pro_server_api_sdk.models.remote_control_result import RemoteControlResult from fingerprint_pro_server_api_sdk.models.response import Response from fingerprint_pro_server_api_sdk.models.response_visits import ResponseVisits from fingerprint_pro_server_api_sdk.models.root_apps_result import RootAppsResult @@ -77,16 +88,22 @@ from fingerprint_pro_server_api_sdk.models.signal_response_privacy_settings import SignalResponsePrivacySettings from fingerprint_pro_server_api_sdk.models.signal_response_proxy import SignalResponseProxy from fingerprint_pro_server_api_sdk.models.signal_response_raw_device_attributes import SignalResponseRawDeviceAttributes +from fingerprint_pro_server_api_sdk.models.signal_response_remote_control import SignalResponseRemoteControl from fingerprint_pro_server_api_sdk.models.signal_response_root_apps import SignalResponseRootApps from fingerprint_pro_server_api_sdk.models.signal_response_suspect_score import SignalResponseSuspectScore from fingerprint_pro_server_api_sdk.models.signal_response_tampering import SignalResponseTampering from fingerprint_pro_server_api_sdk.models.signal_response_tor import SignalResponseTor +from fingerprint_pro_server_api_sdk.models.signal_response_velocity import SignalResponseVelocity from fingerprint_pro_server_api_sdk.models.signal_response_virtual_machine import SignalResponseVirtualMachine from fingerprint_pro_server_api_sdk.models.signal_response_vpn import SignalResponseVpn from fingerprint_pro_server_api_sdk.models.subdivision import Subdivision from fingerprint_pro_server_api_sdk.models.suspect_score_result import SuspectScoreResult from fingerprint_pro_server_api_sdk.models.tampering_result import TamperingResult +from fingerprint_pro_server_api_sdk.models.too_many_requests_response import TooManyRequestsResponse from fingerprint_pro_server_api_sdk.models.tor_result import TorResult +from fingerprint_pro_server_api_sdk.models.velocity_interval_result import VelocityIntervalResult +from fingerprint_pro_server_api_sdk.models.velocity_intervals import VelocityIntervals +from fingerprint_pro_server_api_sdk.models.velocity_result import VelocityResult from fingerprint_pro_server_api_sdk.models.virtual_machine_result import VirtualMachineResult from fingerprint_pro_server_api_sdk.models.visit import Visit from fingerprint_pro_server_api_sdk.models.vpn_result import VpnResult diff --git a/fingerprint_pro_server_api_sdk/api/fingerprint_api.py b/fingerprint_pro_server_api_sdk/api/fingerprint_api.py index 6faf74ec..f992d000 100644 --- a/fingerprint_pro_server_api_sdk/api/fingerprint_api.py +++ b/fingerprint_pro_server_api_sdk/api/fingerprint_api.py @@ -34,17 +34,128 @@ def __init__(self, configuration=None, pool=None): raise ValueError("Missing the required parameter `configuration` when calling `FingerprintApi`") # noqa: E501 self.api_client = ApiClient(configuration, pool=pool) + def delete_visitor_data(self, visitor_id, **kwargs): # noqa: E501 + """Delete data by visitor ID # noqa: E501 + + Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. All delete requests are queued: * Recent data (10 days or newer) belonging to the specified visitor will be deleted within 24 hours. * Data from older (11 days or more) identification events will be deleted after 90 days. If you are interested in using this API, please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_visitor_data(visitor_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str visitor_id: The [visitor ID](https://dev.fingerprint.com/docs/js-agent#visitorid) you want to delete. (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_visitor_data_with_http_info(visitor_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_visitor_data_with_http_info(visitor_id, **kwargs) # noqa: E501 + return data + + def delete_visitor_data_with_http_info(self, visitor_id, **kwargs): # noqa: E501 + """Delete data by visitor ID # noqa: E501 + + Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. All delete requests are queued: * Recent data (10 days or newer) belonging to the specified visitor will be deleted within 24 hours. * Data from older (11 days or more) identification events will be deleted after 90 days. If you are interested in using this API, please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_visitor_data_with_http_info(visitor_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str visitor_id: The [visitor ID](https://dev.fingerprint.com/docs/js-agent#visitorid) you want to delete. (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['visitor_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_visitor_data" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'visitor_id' is set + if ('visitor_id' not in params or + params['visitor_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `visitor_id` when calling `delete_visitor_data`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'visitor_id' in params: + path_params['visitor_id'] = params['visitor_id'] # noqa: E501 + + query_params = [] + query_params.append(('ii', 'fingerprint-pro-server-python-sdk/6.0.0')) + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501 + + try: + return self.api_client.call_api( + '/visitors/{visitor_id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + except ApiException as e: + if e.status == 400: + error = self.api_client.deserialize(e, 'ErrorVisitor400Response', True) + raise extend_exception(e, error) + if e.status == 403: + error = self.api_client.deserialize(e, 'ErrorCommon403Response', True) + raise extend_exception(e, error) + if e.status == 404: + error = self.api_client.deserialize(e, 'ErrorVisitor404Response', True) + raise extend_exception(e, error) + if e.status == 429: + error = self.api_client.deserialize(e, 'ErrorCommon429Response', True) + raise extend_exception(e, error) + raise e + def get_event(self, request_id, **kwargs): # noqa: E501 - """Get event by requestId # noqa: E501 + """Get event by request ID # noqa: E501 - This endpoint allows you to get a detailed analysis of an individual request. **Only for Enterprise customers:** Please note that the response includes mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`. # noqa: E501 + Get a detailed analysis of an individual identification event, including Smart Signals. Please note that the response includes mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_event(request_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str request_id: The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. (required) + :param str request_id: The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request. (required) :return: EventResponse If the method is called asynchronously, returns the request thread. @@ -57,16 +168,16 @@ def get_event(self, request_id, **kwargs): # noqa: E501 return data def get_event_with_http_info(self, request_id, **kwargs): # noqa: E501 - """Get event by requestId # noqa: E501 + """Get event by request ID # noqa: E501 - This endpoint allows you to get a detailed analysis of an individual request. **Only for Enterprise customers:** Please note that the response includes mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`. # noqa: E501 + Get a detailed analysis of an individual identification event, including Smart Signals. Please note that the response includes mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_event_with_http_info(request_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str request_id: The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. (required) + :param str request_id: The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request. (required) :return: EventResponse If the method is called asynchronously, returns the request thread. @@ -132,7 +243,7 @@ def get_event_with_http_info(self, request_id, **kwargs): # noqa: E501 collection_formats=collection_formats) except ApiException as e: if e.status == 403: - error = self.api_client.deserialize(e, 'ErrorEvent403Response', True) + error = self.api_client.deserialize(e, 'ErrorCommon403Response', True) raise extend_exception(e, error) if e.status == 404: error = self.api_client.deserialize(e, 'ErrorEvent404Response', True) @@ -140,16 +251,16 @@ def get_event_with_http_info(self, request_id, **kwargs): # noqa: E501 raise e def get_visits(self, visitor_id, **kwargs): # noqa: E501 - """Get visits by visitorId # noqa: E501 + """Get visits by visitor ID # noqa: E501 - This endpoint allows you to get a history of visits for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. #### Headers * `Retry-After` — Present in case of `429 Too many requests`. Indicates how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received. # noqa: E501 + Get a history of visits (identification events) for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. #### Headers * `Retry-After` — Present in case of `429 Too many requests`. Indicates how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_visits(visitor_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str visitor_id: Unique identifier of the visitor issued by Fingerprint Pro. (required) + :param str visitor_id: Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. (required) :param str request_id: Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. :param str linked_id: Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. :param int limit: Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. @@ -167,16 +278,16 @@ def get_visits(self, visitor_id, **kwargs): # noqa: E501 return data def get_visits_with_http_info(self, visitor_id, **kwargs): # noqa: E501 - """Get visits by visitorId # noqa: E501 + """Get visits by visitor ID # noqa: E501 - This endpoint allows you to get a history of visits for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. #### Headers * `Retry-After` — Present in case of `429 Too many requests`. Indicates how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received. # noqa: E501 + Get a history of visits (identification events) for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. #### Headers * `Retry-After` — Present in case of `429 Too many requests`. Indicates how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_visits_with_http_info(visitor_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str visitor_id: Unique identifier of the visitor issued by Fingerprint Pro. (required) + :param str visitor_id: Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. (required) :param str request_id: Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. :param str linked_id: Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. :param int limit: Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. @@ -260,6 +371,129 @@ def get_visits_with_http_info(self, visitor_id, **kwargs): # noqa: E501 error = self.api_client.deserialize(e, 'ErrorVisits403', True) raise extend_exception(e, error) if e.status == 429: - error = self.api_client.deserialize(e, 'ManyRequestsResponse', True) + error = self.api_client.deserialize(e, 'TooManyRequestsResponse', True) + raise extend_exception(e, error) + raise e + + def update_event(self, body, request_id, **kwargs): # noqa: E501 + """Update an event with a given request ID # noqa: E501 + + Change information in existing events specified by `requestId` or *flag suspicious events*. When an event is created, it is assigned `linkedId` and `tag` submitted through the JS agent parameters. This information might not be available on the client so the Server API allows for updating the attributes after the fact. **Warning** It's not possible to update events older than 10 days. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_event(body, request_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param EventUpdateRequest body: (required) + :param str request_id: The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_event_with_http_info(body, request_id, **kwargs) # noqa: E501 + else: + (data) = self.update_event_with_http_info(body, request_id, **kwargs) # noqa: E501 + return data + + def update_event_with_http_info(self, body, request_id, **kwargs): # noqa: E501 + """Update an event with a given request ID # noqa: E501 + + Change information in existing events specified by `requestId` or *flag suspicious events*. When an event is created, it is assigned `linkedId` and `tag` submitted through the JS agent parameters. This information might not be available on the client so the Server API allows for updating the attributes after the fact. **Warning** It's not possible to update events older than 10 days. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_event_with_http_info(body, request_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param EventUpdateRequest body: (required) + :param str request_id: The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'request_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_event" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `update_event`") # noqa: E501 + # verify the required parameter 'request_id' is set + if ('request_id' not in params or + params['request_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `request_id` when calling `update_event`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'request_id' in params: + path_params['request_id'] = params['request_id'] # noqa: E501 + + query_params = [] + query_params.append(('ii', 'fingerprint-pro-server-python-sdk/6.0.0')) + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501 + + try: + return self.api_client.call_api( + '/events/{request_id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + except ApiException as e: + if e.status == 400: + error = self.api_client.deserialize(e, 'ErrorUpdateEvent400Response', True) + raise extend_exception(e, error) + if e.status == 403: + error = self.api_client.deserialize(e, 'ErrorCommon403Response', True) + raise extend_exception(e, error) + if e.status == 404: + error = self.api_client.deserialize(e, 'ErrorEvent404Response', True) + raise extend_exception(e, error) + if e.status == 409: + error = self.api_client.deserialize(e, 'ErrorUpdateEvent409Response', True) raise extend_exception(e, error) raise e diff --git a/fingerprint_pro_server_api_sdk/models/__init__.py b/fingerprint_pro_server_api_sdk/models/__init__.py index 81e3854a..703d4ba0 100644 --- a/fingerprint_pro_server_api_sdk/models/__init__.py +++ b/fingerprint_pro_server_api_sdk/models/__init__.py @@ -19,17 +19,28 @@ from fingerprint_pro_server_api_sdk.models.botd_result import BotdResult from fingerprint_pro_server_api_sdk.models.browser_details import BrowserDetails from fingerprint_pro_server_api_sdk.models.cloned_app_result import ClonedAppResult +from fingerprint_pro_server_api_sdk.models.common403_error_response import Common403ErrorResponse from fingerprint_pro_server_api_sdk.models.confidence import Confidence from fingerprint_pro_server_api_sdk.models.data_center import DataCenter from fingerprint_pro_server_api_sdk.models.deprecated_ip_location import DeprecatedIPLocation from fingerprint_pro_server_api_sdk.models.deprecated_ip_location_city import DeprecatedIPLocationCity from fingerprint_pro_server_api_sdk.models.emulator_result import EmulatorResult -from fingerprint_pro_server_api_sdk.models.error_event403_response import ErrorEvent403Response -from fingerprint_pro_server_api_sdk.models.error_event403_response_error import ErrorEvent403ResponseError +from fingerprint_pro_server_api_sdk.models.error_common403_response import ErrorCommon403Response +from fingerprint_pro_server_api_sdk.models.error_common429_response import ErrorCommon429Response +from fingerprint_pro_server_api_sdk.models.error_common429_response_error import ErrorCommon429ResponseError from fingerprint_pro_server_api_sdk.models.error_event404_response import ErrorEvent404Response from fingerprint_pro_server_api_sdk.models.error_event404_response_error import ErrorEvent404ResponseError +from fingerprint_pro_server_api_sdk.models.error_update_event400_response import ErrorUpdateEvent400Response +from fingerprint_pro_server_api_sdk.models.error_update_event400_response_error import ErrorUpdateEvent400ResponseError +from fingerprint_pro_server_api_sdk.models.error_update_event409_response import ErrorUpdateEvent409Response +from fingerprint_pro_server_api_sdk.models.error_update_event409_response_error import ErrorUpdateEvent409ResponseError +from fingerprint_pro_server_api_sdk.models.error_visitor400_response import ErrorVisitor400Response +from fingerprint_pro_server_api_sdk.models.error_visitor400_response_error import ErrorVisitor400ResponseError +from fingerprint_pro_server_api_sdk.models.error_visitor404_response import ErrorVisitor404Response +from fingerprint_pro_server_api_sdk.models.error_visitor404_response_error import ErrorVisitor404ResponseError from fingerprint_pro_server_api_sdk.models.error_visits403 import ErrorVisits403 from fingerprint_pro_server_api_sdk.models.event_response import EventResponse +from fingerprint_pro_server_api_sdk.models.event_update_request import EventUpdateRequest from fingerprint_pro_server_api_sdk.models.factory_reset_result import FactoryResetResult from fingerprint_pro_server_api_sdk.models.frida_result import FridaResult from fingerprint_pro_server_api_sdk.models.high_activity_result import HighActivityResult @@ -45,7 +56,6 @@ from fingerprint_pro_server_api_sdk.models.jailbroken_result import JailbrokenResult from fingerprint_pro_server_api_sdk.models.location import Location from fingerprint_pro_server_api_sdk.models.location_spoofing_result import LocationSpoofingResult -from fingerprint_pro_server_api_sdk.models.many_requests_response import ManyRequestsResponse from fingerprint_pro_server_api_sdk.models.privacy_settings_result import PrivacySettingsResult from fingerprint_pro_server_api_sdk.models.product_error import ProductError from fingerprint_pro_server_api_sdk.models.products_response import ProductsResponse @@ -54,6 +64,7 @@ from fingerprint_pro_server_api_sdk.models.products_response_identification_data import ProductsResponseIdentificationData from fingerprint_pro_server_api_sdk.models.proxy_result import ProxyResult from fingerprint_pro_server_api_sdk.models.raw_device_attributes_result import RawDeviceAttributesResult +from fingerprint_pro_server_api_sdk.models.remote_control_result import RemoteControlResult from fingerprint_pro_server_api_sdk.models.response import Response from fingerprint_pro_server_api_sdk.models.response_visits import ResponseVisits from fingerprint_pro_server_api_sdk.models.root_apps_result import RootAppsResult @@ -71,16 +82,22 @@ from fingerprint_pro_server_api_sdk.models.signal_response_privacy_settings import SignalResponsePrivacySettings from fingerprint_pro_server_api_sdk.models.signal_response_proxy import SignalResponseProxy from fingerprint_pro_server_api_sdk.models.signal_response_raw_device_attributes import SignalResponseRawDeviceAttributes +from fingerprint_pro_server_api_sdk.models.signal_response_remote_control import SignalResponseRemoteControl from fingerprint_pro_server_api_sdk.models.signal_response_root_apps import SignalResponseRootApps from fingerprint_pro_server_api_sdk.models.signal_response_suspect_score import SignalResponseSuspectScore from fingerprint_pro_server_api_sdk.models.signal_response_tampering import SignalResponseTampering from fingerprint_pro_server_api_sdk.models.signal_response_tor import SignalResponseTor +from fingerprint_pro_server_api_sdk.models.signal_response_velocity import SignalResponseVelocity from fingerprint_pro_server_api_sdk.models.signal_response_virtual_machine import SignalResponseVirtualMachine from fingerprint_pro_server_api_sdk.models.signal_response_vpn import SignalResponseVpn from fingerprint_pro_server_api_sdk.models.subdivision import Subdivision from fingerprint_pro_server_api_sdk.models.suspect_score_result import SuspectScoreResult from fingerprint_pro_server_api_sdk.models.tampering_result import TamperingResult +from fingerprint_pro_server_api_sdk.models.too_many_requests_response import TooManyRequestsResponse from fingerprint_pro_server_api_sdk.models.tor_result import TorResult +from fingerprint_pro_server_api_sdk.models.velocity_interval_result import VelocityIntervalResult +from fingerprint_pro_server_api_sdk.models.velocity_intervals import VelocityIntervals +from fingerprint_pro_server_api_sdk.models.velocity_result import VelocityResult from fingerprint_pro_server_api_sdk.models.virtual_machine_result import VirtualMachineResult from fingerprint_pro_server_api_sdk.models.visit import Visit from fingerprint_pro_server_api_sdk.models.vpn_result import VpnResult diff --git a/fingerprint_pro_server_api_sdk/models/asn.py b/fingerprint_pro_server_api_sdk/models/asn.py index 2b32f603..be6125d1 100644 --- a/fingerprint_pro_server_api_sdk/models/asn.py +++ b/fingerprint_pro_server_api_sdk/models/asn.py @@ -136,6 +136,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(ASN, dict): diff --git a/fingerprint_pro_server_api_sdk/models/botd_detection_result.py b/fingerprint_pro_server_api_sdk/models/botd_detection_result.py index da06dc89..24551998 100644 --- a/fingerprint_pro_server_api_sdk/models/botd_detection_result.py +++ b/fingerprint_pro_server_api_sdk/models/botd_detection_result.py @@ -120,6 +120,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(BotdDetectionResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/botd_result.py b/fingerprint_pro_server_api_sdk/models/botd_result.py index 04c797ff..f5f92b02 100644 --- a/fingerprint_pro_server_api_sdk/models/botd_result.py +++ b/fingerprint_pro_server_api_sdk/models/botd_result.py @@ -253,6 +253,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(BotdResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/browser_details.py b/fingerprint_pro_server_api_sdk/models/browser_details.py index b81aac6f..411af85b 100644 --- a/fingerprint_pro_server_api_sdk/models/browser_details.py +++ b/fingerprint_pro_server_api_sdk/models/browser_details.py @@ -271,6 +271,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(BrowserDetails, dict): diff --git a/fingerprint_pro_server_api_sdk/models/cloned_app_result.py b/fingerprint_pro_server_api_sdk/models/cloned_app_result.py index 9e785557..4acd89ff 100644 --- a/fingerprint_pro_server_api_sdk/models/cloned_app_result.py +++ b/fingerprint_pro_server_api_sdk/models/cloned_app_result.py @@ -85,6 +85,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(ClonedAppResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/common403_error_response.py b/fingerprint_pro_server_api_sdk/models/common403_error_response.py new file mode 100644 index 00000000..971b63b9 --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/common403_error_response.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Common403ErrorResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'code': 'str', + 'message': 'str' + } + + attribute_map = { + 'code': 'code', + 'message': 'message' + } + + def __init__(self, code=None, message=None): # noqa: E501 + """Common403ErrorResponse - a model defined in Swagger""" # noqa: E501 + self._code = None + self._message = None + self.discriminator = None + self.code = code + self.message = message + + @property + def code(self): + """Gets the code of this Common403ErrorResponse. # noqa: E501 + + Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - No Fingerprint application found for specified secret key * `SubscriptionNotActive` - Fingerprint application is not active * `WrongRegion` - server and application region differ * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application # noqa: E501 + + :return: The code of this Common403ErrorResponse. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this Common403ErrorResponse. + + Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - No Fingerprint application found for specified secret key * `SubscriptionNotActive` - Fingerprint application is not active * `WrongRegion` - server and application region differ * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application # noqa: E501 + + :param code: The code of this Common403ErrorResponse. # noqa: E501 + :type: str + """ + if code is None: + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + allowed_values = ["TokenRequired", "TokenNotFound", "SubscriptionNotActive", "WrongRegion", "FeatureNotEnabled"] # noqa: E501 + if (code not in allowed_values): + raise ValueError( + "Invalid value for `code` ({0}), must be one of {1}" # noqa: E501 + .format(code, allowed_values) + ) + + self._code = code + + @property + def message(self): + """Gets the message of this Common403ErrorResponse. # noqa: E501 + + + :return: The message of this Common403ErrorResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this Common403ErrorResponse. + + + :param message: The message of this Common403ErrorResponse. # noqa: E501 + :type: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(Common403ErrorResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Common403ErrorResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Common403ErrorResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/confidence.py b/fingerprint_pro_server_api_sdk/models/confidence.py index af078d21..cf4ae812 100644 --- a/fingerprint_pro_server_api_sdk/models/confidence.py +++ b/fingerprint_pro_server_api_sdk/models/confidence.py @@ -28,18 +28,23 @@ class Confidence(object): and the value is json key in definition. """ swagger_types = { - 'score': 'float' + 'score': 'float', + 'revision': 'str' } attribute_map = { - 'score': 'score' + 'score': 'score', + 'revision': 'revision' } - def __init__(self, score=None): # noqa: E501 + def __init__(self, score=None, revision=None): # noqa: E501 """Confidence - a model defined in Swagger""" # noqa: E501 self._score = None + self._revision = None self.discriminator = None self.score = score + if revision is not None: + self.revision = revision @property def score(self): @@ -66,6 +71,29 @@ def score(self, score): self._score = score + @property + def revision(self): + """Gets the revision of this Confidence. # noqa: E501 + + The revision name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. # noqa: E501 + + :return: The revision of this Confidence. # noqa: E501 + :rtype: str + """ + return self._revision + + @revision.setter + def revision(self, revision): + """Sets the revision of this Confidence. + + The revision name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. # noqa: E501 + + :param revision: The revision of this Confidence. # noqa: E501 + :type: str + """ + + self._revision = revision + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -85,6 +113,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(Confidence, dict): diff --git a/fingerprint_pro_server_api_sdk/models/data_center.py b/fingerprint_pro_server_api_sdk/models/data_center.py index 804cdb80..e2c4e46f 100644 --- a/fingerprint_pro_server_api_sdk/models/data_center.py +++ b/fingerprint_pro_server_api_sdk/models/data_center.py @@ -109,6 +109,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(DataCenter, dict): diff --git a/fingerprint_pro_server_api_sdk/models/deprecated_ip_location.py b/fingerprint_pro_server_api_sdk/models/deprecated_ip_location.py index 7695dd3b..369c6db9 100644 --- a/fingerprint_pro_server_api_sdk/models/deprecated_ip_location.py +++ b/fingerprint_pro_server_api_sdk/models/deprecated_ip_location.py @@ -295,6 +295,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(DeprecatedIPLocation, dict): diff --git a/fingerprint_pro_server_api_sdk/models/deprecated_ip_location_city.py b/fingerprint_pro_server_api_sdk/models/deprecated_ip_location_city.py index 96abca3b..99d9553d 100644 --- a/fingerprint_pro_server_api_sdk/models/deprecated_ip_location_city.py +++ b/fingerprint_pro_server_api_sdk/models/deprecated_ip_location_city.py @@ -82,6 +82,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(DeprecatedIPLocationCity, dict): diff --git a/fingerprint_pro_server_api_sdk/models/emulator_result.py b/fingerprint_pro_server_api_sdk/models/emulator_result.py index 687afb67..de87991e 100644 --- a/fingerprint_pro_server_api_sdk/models/emulator_result.py +++ b/fingerprint_pro_server_api_sdk/models/emulator_result.py @@ -85,6 +85,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(EmulatorResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/error_event403_response.py b/fingerprint_pro_server_api_sdk/models/error_common403_response.py similarity index 79% rename from fingerprint_pro_server_api_sdk/models/error_event403_response.py rename to fingerprint_pro_server_api_sdk/models/error_common403_response.py index 77289f81..c6fab01e 100644 --- a/fingerprint_pro_server_api_sdk/models/error_event403_response.py +++ b/fingerprint_pro_server_api_sdk/models/error_common403_response.py @@ -15,7 +15,7 @@ import six -class ErrorEvent403Response(object): +class ErrorCommon403Response(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,7 +28,7 @@ class ErrorEvent403Response(object): and the value is json key in definition. """ swagger_types = { - 'error': 'ErrorEvent403ResponseError' + 'error': 'Common403ErrorResponse' } attribute_map = { @@ -36,7 +36,7 @@ class ErrorEvent403Response(object): } def __init__(self, error=None): # noqa: E501 - """ErrorEvent403Response - a model defined in Swagger""" # noqa: E501 + """ErrorCommon403Response - a model defined in Swagger""" # noqa: E501 self._error = None self.discriminator = None if error is not None: @@ -44,21 +44,21 @@ def __init__(self, error=None): # noqa: E501 @property def error(self): - """Gets the error of this ErrorEvent403Response. # noqa: E501 + """Gets the error of this ErrorCommon403Response. # noqa: E501 - :return: The error of this ErrorEvent403Response. # noqa: E501 - :rtype: ErrorEvent403ResponseError + :return: The error of this ErrorCommon403Response. # noqa: E501 + :rtype: Common403ErrorResponse """ return self._error @error.setter def error(self, error): - """Sets the error of this ErrorEvent403Response. + """Sets the error of this ErrorCommon403Response. - :param error: The error of this ErrorEvent403Response. # noqa: E501 - :type: ErrorEvent403ResponseError + :param error: The error of this ErrorCommon403Response. # noqa: E501 + :type: Common403ErrorResponse """ self._error = error @@ -82,9 +82,11 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value - if issubclass(ErrorEvent403Response, dict): + if issubclass(ErrorCommon403Response, dict): for key, value in self.items(): result[key] = value @@ -100,14 +102,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, ErrorEvent403Response): + if not isinstance(other, ErrorCommon403Response): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, ErrorEvent403Response): + if not isinstance(other, ErrorCommon403Response): return True return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/error_common429_response.py b/fingerprint_pro_server_api_sdk/models/error_common429_response.py new file mode 100644 index 00000000..f0109d98 --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/error_common429_response.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ErrorCommon429Response(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'error': 'ErrorCommon429ResponseError' + } + + attribute_map = { + 'error': 'error' + } + + def __init__(self, error=None): # noqa: E501 + """ErrorCommon429Response - a model defined in Swagger""" # noqa: E501 + self._error = None + self.discriminator = None + if error is not None: + self.error = error + + @property + def error(self): + """Gets the error of this ErrorCommon429Response. # noqa: E501 + + + :return: The error of this ErrorCommon429Response. # noqa: E501 + :rtype: ErrorCommon429ResponseError + """ + return self._error + + @error.setter + def error(self, error): + """Sets the error of this ErrorCommon429Response. + + + :param error: The error of this ErrorCommon429Response. # noqa: E501 + :type: ErrorCommon429ResponseError + """ + + self._error = error + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(ErrorCommon429Response, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ErrorCommon429Response): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ErrorCommon429Response): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/error_event403_response_error.py b/fingerprint_pro_server_api_sdk/models/error_common429_response_error.py similarity index 70% rename from fingerprint_pro_server_api_sdk/models/error_event403_response_error.py rename to fingerprint_pro_server_api_sdk/models/error_common429_response_error.py index 4dd075c1..4e52c866 100644 --- a/fingerprint_pro_server_api_sdk/models/error_event403_response_error.py +++ b/fingerprint_pro_server_api_sdk/models/error_common429_response_error.py @@ -15,7 +15,7 @@ import six -class ErrorEvent403ResponseError(object): +class ErrorCommon429ResponseError(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -38,7 +38,7 @@ class ErrorEvent403ResponseError(object): } def __init__(self, code=None, message=None): # noqa: E501 - """ErrorEvent403ResponseError - a model defined in Swagger""" # noqa: E501 + """ErrorCommon429ResponseError - a model defined in Swagger""" # noqa: E501 self._code = None self._message = None self.discriminator = None @@ -47,27 +47,27 @@ def __init__(self, code=None, message=None): # noqa: E501 @property def code(self): - """Gets the code of this ErrorEvent403ResponseError. # noqa: E501 + """Gets the code of this ErrorCommon429ResponseError. # noqa: E501 - Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - subscription not found for specified secret key * `SubscriptionNotActive` - subscription is not active * `WrongRegion` - server and subscription region differ # noqa: E501 + Error code: * `TooManyRequests` - The request is throttled. # noqa: E501 - :return: The code of this ErrorEvent403ResponseError. # noqa: E501 + :return: The code of this ErrorCommon429ResponseError. # noqa: E501 :rtype: str """ return self._code @code.setter def code(self, code): - """Sets the code of this ErrorEvent403ResponseError. + """Sets the code of this ErrorCommon429ResponseError. - Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - subscription not found for specified secret key * `SubscriptionNotActive` - subscription is not active * `WrongRegion` - server and subscription region differ # noqa: E501 + Error code: * `TooManyRequests` - The request is throttled. # noqa: E501 - :param code: The code of this ErrorEvent403ResponseError. # noqa: E501 + :param code: The code of this ErrorCommon429ResponseError. # noqa: E501 :type: str """ if code is None: raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 - allowed_values = ["TokenRequired", "TokenNotFound", "SubscriptionNotActive", "WrongRegion"] # noqa: E501 + allowed_values = ["TooManyRequests"] # noqa: E501 if (code not in allowed_values): raise ValueError( "Invalid value for `code` ({0}), must be one of {1}" # noqa: E501 @@ -78,20 +78,20 @@ def code(self, code): @property def message(self): - """Gets the message of this ErrorEvent403ResponseError. # noqa: E501 + """Gets the message of this ErrorCommon429ResponseError. # noqa: E501 - :return: The message of this ErrorEvent403ResponseError. # noqa: E501 + :return: The message of this ErrorCommon429ResponseError. # noqa: E501 :rtype: str """ return self._message @message.setter def message(self, message): - """Sets the message of this ErrorEvent403ResponseError. + """Sets the message of this ErrorCommon429ResponseError. - :param message: The message of this ErrorEvent403ResponseError. # noqa: E501 + :param message: The message of this ErrorCommon429ResponseError. # noqa: E501 :type: str """ if message is None: @@ -118,9 +118,11 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value - if issubclass(ErrorEvent403ResponseError, dict): + if issubclass(ErrorCommon429ResponseError, dict): for key, value in self.items(): result[key] = value @@ -136,14 +138,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, ErrorEvent403ResponseError): + if not isinstance(other, ErrorCommon429ResponseError): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, ErrorEvent403ResponseError): + if not isinstance(other, ErrorCommon429ResponseError): return True return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/error_event404_response.py b/fingerprint_pro_server_api_sdk/models/error_event404_response.py index 47fbdd32..43960cd5 100644 --- a/fingerprint_pro_server_api_sdk/models/error_event404_response.py +++ b/fingerprint_pro_server_api_sdk/models/error_event404_response.py @@ -82,6 +82,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(ErrorEvent404Response, dict): diff --git a/fingerprint_pro_server_api_sdk/models/error_event404_response_error.py b/fingerprint_pro_server_api_sdk/models/error_event404_response_error.py index af699771..d7d16eb8 100644 --- a/fingerprint_pro_server_api_sdk/models/error_event404_response_error.py +++ b/fingerprint_pro_server_api_sdk/models/error_event404_response_error.py @@ -49,7 +49,7 @@ def __init__(self, code=None, message=None): # noqa: E501 def code(self): """Gets the code of this ErrorEvent404ResponseError. # noqa: E501 - Error code: * `RequestNotFound` - request not found for specified id # noqa: E501 + Error code: * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. # noqa: E501 :return: The code of this ErrorEvent404ResponseError. # noqa: E501 :rtype: str @@ -60,7 +60,7 @@ def code(self): def code(self, code): """Sets the code of this ErrorEvent404ResponseError. - Error code: * `RequestNotFound` - request not found for specified id # noqa: E501 + Error code: * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. # noqa: E501 :param code: The code of this ErrorEvent404ResponseError. # noqa: E501 :type: str @@ -118,6 +118,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(ErrorEvent404ResponseError, dict): diff --git a/fingerprint_pro_server_api_sdk/models/error_update_event400_response.py b/fingerprint_pro_server_api_sdk/models/error_update_event400_response.py new file mode 100644 index 00000000..6aa95fe2 --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/error_update_event400_response.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ErrorUpdateEvent400Response(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'error': 'ErrorUpdateEvent400ResponseError' + } + + attribute_map = { + 'error': 'error' + } + + def __init__(self, error=None): # noqa: E501 + """ErrorUpdateEvent400Response - a model defined in Swagger""" # noqa: E501 + self._error = None + self.discriminator = None + if error is not None: + self.error = error + + @property + def error(self): + """Gets the error of this ErrorUpdateEvent400Response. # noqa: E501 + + + :return: The error of this ErrorUpdateEvent400Response. # noqa: E501 + :rtype: ErrorUpdateEvent400ResponseError + """ + return self._error + + @error.setter + def error(self, error): + """Sets the error of this ErrorUpdateEvent400Response. + + + :param error: The error of this ErrorUpdateEvent400Response. # noqa: E501 + :type: ErrorUpdateEvent400ResponseError + """ + + self._error = error + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(ErrorUpdateEvent400Response, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ErrorUpdateEvent400Response): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ErrorUpdateEvent400Response): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/error_update_event400_response_error.py b/fingerprint_pro_server_api_sdk/models/error_update_event400_response_error.py new file mode 100644 index 00000000..c1d2faa2 --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/error_update_event400_response_error.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ErrorUpdateEvent400ResponseError(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'code': 'str', + 'message': 'str' + } + + attribute_map = { + 'code': 'code', + 'message': 'message' + } + + def __init__(self, code=None, message=None): # noqa: E501 + """ErrorUpdateEvent400ResponseError - a model defined in Swagger""" # noqa: E501 + self._code = None + self._message = None + self.discriminator = None + self.code = code + self.message = message + + @property + def code(self): + """Gets the code of this ErrorUpdateEvent400ResponseError. # noqa: E501 + + Error code: * `RequestCannotBeParsed` - the JSON content of the request contains some errors that prevented us from parsing it (wrong type/surpassed limits) * `Failed` - the event is more than 10 days old and cannot be updated # noqa: E501 + + :return: The code of this ErrorUpdateEvent400ResponseError. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ErrorUpdateEvent400ResponseError. + + Error code: * `RequestCannotBeParsed` - the JSON content of the request contains some errors that prevented us from parsing it (wrong type/surpassed limits) * `Failed` - the event is more than 10 days old and cannot be updated # noqa: E501 + + :param code: The code of this ErrorUpdateEvent400ResponseError. # noqa: E501 + :type: str + """ + if code is None: + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + allowed_values = ["RequestCannotBeParsed", "Failed"] # noqa: E501 + if (code not in allowed_values): + raise ValueError( + "Invalid value for `code` ({0}), must be one of {1}" # noqa: E501 + .format(code, allowed_values) + ) + + self._code = code + + @property + def message(self): + """Gets the message of this ErrorUpdateEvent400ResponseError. # noqa: E501 + + Details about the underlying issue with the input payload # noqa: E501 + + :return: The message of this ErrorUpdateEvent400ResponseError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ErrorUpdateEvent400ResponseError. + + Details about the underlying issue with the input payload # noqa: E501 + + :param message: The message of this ErrorUpdateEvent400ResponseError. # noqa: E501 + :type: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(ErrorUpdateEvent400ResponseError, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ErrorUpdateEvent400ResponseError): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ErrorUpdateEvent400ResponseError): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/error_update_event409_response.py b/fingerprint_pro_server_api_sdk/models/error_update_event409_response.py new file mode 100644 index 00000000..1c2b0586 --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/error_update_event409_response.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ErrorUpdateEvent409Response(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'error': 'ErrorUpdateEvent409ResponseError' + } + + attribute_map = { + 'error': 'error' + } + + def __init__(self, error=None): # noqa: E501 + """ErrorUpdateEvent409Response - a model defined in Swagger""" # noqa: E501 + self._error = None + self.discriminator = None + if error is not None: + self.error = error + + @property + def error(self): + """Gets the error of this ErrorUpdateEvent409Response. # noqa: E501 + + + :return: The error of this ErrorUpdateEvent409Response. # noqa: E501 + :rtype: ErrorUpdateEvent409ResponseError + """ + return self._error + + @error.setter + def error(self, error): + """Sets the error of this ErrorUpdateEvent409Response. + + + :param error: The error of this ErrorUpdateEvent409Response. # noqa: E501 + :type: ErrorUpdateEvent409ResponseError + """ + + self._error = error + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(ErrorUpdateEvent409Response, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ErrorUpdateEvent409Response): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ErrorUpdateEvent409Response): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/error_update_event409_response_error.py b/fingerprint_pro_server_api_sdk/models/error_update_event409_response_error.py new file mode 100644 index 00000000..485aee18 --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/error_update_event409_response_error.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ErrorUpdateEvent409ResponseError(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'code': 'str', + 'message': 'str' + } + + attribute_map = { + 'code': 'code', + 'message': 'message' + } + + def __init__(self, code=None, message=None): # noqa: E501 + """ErrorUpdateEvent409ResponseError - a model defined in Swagger""" # noqa: E501 + self._code = None + self._message = None + self.discriminator = None + self.code = code + self.message = message + + @property + def code(self): + """Gets the code of this ErrorUpdateEvent409ResponseError. # noqa: E501 + + Error code: * `StateNotReady` - The event specified with request id is not ready for updates yet. Try again. This error happens in rare cases when update API is called immediately after receiving the request id on the client. In case you need to send information right away, we recommend using the JS agent API instead. # noqa: E501 + + :return: The code of this ErrorUpdateEvent409ResponseError. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ErrorUpdateEvent409ResponseError. + + Error code: * `StateNotReady` - The event specified with request id is not ready for updates yet. Try again. This error happens in rare cases when update API is called immediately after receiving the request id on the client. In case you need to send information right away, we recommend using the JS agent API instead. # noqa: E501 + + :param code: The code of this ErrorUpdateEvent409ResponseError. # noqa: E501 + :type: str + """ + if code is None: + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + allowed_values = ["StateNotReady"] # noqa: E501 + if (code not in allowed_values): + raise ValueError( + "Invalid value for `code` ({0}), must be one of {1}" # noqa: E501 + .format(code, allowed_values) + ) + + self._code = code + + @property + def message(self): + """Gets the message of this ErrorUpdateEvent409ResponseError. # noqa: E501 + + + :return: The message of this ErrorUpdateEvent409ResponseError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ErrorUpdateEvent409ResponseError. + + + :param message: The message of this ErrorUpdateEvent409ResponseError. # noqa: E501 + :type: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(ErrorUpdateEvent409ResponseError, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ErrorUpdateEvent409ResponseError): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ErrorUpdateEvent409ResponseError): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/error_visitor400_response.py b/fingerprint_pro_server_api_sdk/models/error_visitor400_response.py new file mode 100644 index 00000000..d3020f45 --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/error_visitor400_response.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ErrorVisitor400Response(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'error': 'ErrorVisitor400ResponseError' + } + + attribute_map = { + 'error': 'error' + } + + def __init__(self, error=None): # noqa: E501 + """ErrorVisitor400Response - a model defined in Swagger""" # noqa: E501 + self._error = None + self.discriminator = None + if error is not None: + self.error = error + + @property + def error(self): + """Gets the error of this ErrorVisitor400Response. # noqa: E501 + + + :return: The error of this ErrorVisitor400Response. # noqa: E501 + :rtype: ErrorVisitor400ResponseError + """ + return self._error + + @error.setter + def error(self, error): + """Sets the error of this ErrorVisitor400Response. + + + :param error: The error of this ErrorVisitor400Response. # noqa: E501 + :type: ErrorVisitor400ResponseError + """ + + self._error = error + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(ErrorVisitor400Response, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ErrorVisitor400Response): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ErrorVisitor400Response): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/error_visitor400_response_error.py b/fingerprint_pro_server_api_sdk/models/error_visitor400_response_error.py new file mode 100644 index 00000000..bc005ffe --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/error_visitor400_response_error.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ErrorVisitor400ResponseError(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'code': 'str', + 'message': 'str' + } + + attribute_map = { + 'code': 'code', + 'message': 'message' + } + + def __init__(self, code=None, message=None): # noqa: E501 + """ErrorVisitor400ResponseError - a model defined in Swagger""" # noqa: E501 + self._code = None + self._message = None + self.discriminator = None + self.code = code + self.message = message + + @property + def code(self): + """Gets the code of this ErrorVisitor400ResponseError. # noqa: E501 + + Error code: * `RequestCannotBeParsed` - The visitor ID parameter is missing or in the wrong format. # noqa: E501 + + :return: The code of this ErrorVisitor400ResponseError. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ErrorVisitor400ResponseError. + + Error code: * `RequestCannotBeParsed` - The visitor ID parameter is missing or in the wrong format. # noqa: E501 + + :param code: The code of this ErrorVisitor400ResponseError. # noqa: E501 + :type: str + """ + if code is None: + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + allowed_values = ["RequestCannotBeParsed"] # noqa: E501 + if (code not in allowed_values): + raise ValueError( + "Invalid value for `code` ({0}), must be one of {1}" # noqa: E501 + .format(code, allowed_values) + ) + + self._code = code + + @property + def message(self): + """Gets the message of this ErrorVisitor400ResponseError. # noqa: E501 + + + :return: The message of this ErrorVisitor400ResponseError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ErrorVisitor400ResponseError. + + + :param message: The message of this ErrorVisitor400ResponseError. # noqa: E501 + :type: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(ErrorVisitor400ResponseError, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ErrorVisitor400ResponseError): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ErrorVisitor400ResponseError): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/error_visitor404_response.py b/fingerprint_pro_server_api_sdk/models/error_visitor404_response.py new file mode 100644 index 00000000..d093e07e --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/error_visitor404_response.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ErrorVisitor404Response(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'error': 'ErrorVisitor404ResponseError' + } + + attribute_map = { + 'error': 'error' + } + + def __init__(self, error=None): # noqa: E501 + """ErrorVisitor404Response - a model defined in Swagger""" # noqa: E501 + self._error = None + self.discriminator = None + if error is not None: + self.error = error + + @property + def error(self): + """Gets the error of this ErrorVisitor404Response. # noqa: E501 + + + :return: The error of this ErrorVisitor404Response. # noqa: E501 + :rtype: ErrorVisitor404ResponseError + """ + return self._error + + @error.setter + def error(self, error): + """Sets the error of this ErrorVisitor404Response. + + + :param error: The error of this ErrorVisitor404Response. # noqa: E501 + :type: ErrorVisitor404ResponseError + """ + + self._error = error + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(ErrorVisitor404Response, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ErrorVisitor404Response): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ErrorVisitor404Response): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/error_visitor404_response_error.py b/fingerprint_pro_server_api_sdk/models/error_visitor404_response_error.py new file mode 100644 index 00000000..5e383ce9 --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/error_visitor404_response_error.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ErrorVisitor404ResponseError(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'code': 'str', + 'message': 'str' + } + + attribute_map = { + 'code': 'code', + 'message': 'message' + } + + def __init__(self, code=None, message=None): # noqa: E501 + """ErrorVisitor404ResponseError - a model defined in Swagger""" # noqa: E501 + self._code = None + self._message = None + self.discriminator = None + self.code = code + self.message = message + + @property + def code(self): + """Gets the code of this ErrorVisitor404ResponseError. # noqa: E501 + + Error code: * `VisitorNotFound` - The specified visitor ID was not found. It never existed or it may have already been deleted. # noqa: E501 + + :return: The code of this ErrorVisitor404ResponseError. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ErrorVisitor404ResponseError. + + Error code: * `VisitorNotFound` - The specified visitor ID was not found. It never existed or it may have already been deleted. # noqa: E501 + + :param code: The code of this ErrorVisitor404ResponseError. # noqa: E501 + :type: str + """ + if code is None: + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + allowed_values = ["VisitorNotFound"] # noqa: E501 + if (code not in allowed_values): + raise ValueError( + "Invalid value for `code` ({0}), must be one of {1}" # noqa: E501 + .format(code, allowed_values) + ) + + self._code = code + + @property + def message(self): + """Gets the message of this ErrorVisitor404ResponseError. # noqa: E501 + + + :return: The message of this ErrorVisitor404ResponseError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ErrorVisitor404ResponseError. + + + :param message: The message of this ErrorVisitor404ResponseError. # noqa: E501 + :type: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(ErrorVisitor404ResponseError, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ErrorVisitor404ResponseError): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ErrorVisitor404ResponseError): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/error_visits403.py b/fingerprint_pro_server_api_sdk/models/error_visits403.py index 5911fa5b..0d623c3a 100644 --- a/fingerprint_pro_server_api_sdk/models/error_visits403.py +++ b/fingerprint_pro_server_api_sdk/models/error_visits403.py @@ -85,6 +85,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(ErrorVisits403, dict): diff --git a/fingerprint_pro_server_api_sdk/models/event_response.py b/fingerprint_pro_server_api_sdk/models/event_response.py index 34b77b02..e040f93c 100644 --- a/fingerprint_pro_server_api_sdk/models/event_response.py +++ b/fingerprint_pro_server_api_sdk/models/event_response.py @@ -112,6 +112,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(EventResponse, dict): diff --git a/fingerprint_pro_server_api_sdk/models/event_update_request.py b/fingerprint_pro_server_api_sdk/models/event_update_request.py new file mode 100644 index 00000000..1d9e5e2d --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/event_update_request.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class EventUpdateRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'linked_id': 'str', + 'tag': 'object', + 'suspect': 'bool' + } + + attribute_map = { + 'linked_id': 'linkedId', + 'tag': 'tag', + 'suspect': 'suspect' + } + + def __init__(self, linked_id=None, tag=None, suspect=None): # noqa: E501 + """EventUpdateRequest - a model defined in Swagger""" # noqa: E501 + self._linked_id = None + self._tag = None + self._suspect = None + self.discriminator = None + if linked_id is not None: + self.linked_id = linked_id + if tag is not None: + self.tag = tag + if suspect is not None: + self.suspect = suspect + + @property + def linked_id(self): + """Gets the linked_id of this EventUpdateRequest. # noqa: E501 + + LinkedID value to assign to the existing event # noqa: E501 + + :return: The linked_id of this EventUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._linked_id + + @linked_id.setter + def linked_id(self, linked_id): + """Sets the linked_id of this EventUpdateRequest. + + LinkedID value to assign to the existing event # noqa: E501 + + :param linked_id: The linked_id of this EventUpdateRequest. # noqa: E501 + :type: str + """ + + self._linked_id = linked_id + + @property + def tag(self): + """Gets the tag of this EventUpdateRequest. # noqa: E501 + + Full `tag` value to be set to the existing event. Replaces any existing `tag` payload completely. # noqa: E501 + + :return: The tag of this EventUpdateRequest. # noqa: E501 + :rtype: object + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this EventUpdateRequest. + + Full `tag` value to be set to the existing event. Replaces any existing `tag` payload completely. # noqa: E501 + + :param tag: The tag of this EventUpdateRequest. # noqa: E501 + :type: object + """ + + self._tag = tag + + @property + def suspect(self): + """Gets the suspect of this EventUpdateRequest. # noqa: E501 + + Suspect flag indicating observed suspicious or fraudulent event # noqa: E501 + + :return: The suspect of this EventUpdateRequest. # noqa: E501 + :rtype: bool + """ + return self._suspect + + @suspect.setter + def suspect(self, suspect): + """Sets the suspect of this EventUpdateRequest. + + Suspect flag indicating observed suspicious or fraudulent event # noqa: E501 + + :param suspect: The suspect of this EventUpdateRequest. # noqa: E501 + :type: bool + """ + + self._suspect = suspect + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(EventUpdateRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EventUpdateRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, EventUpdateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/factory_reset_result.py b/fingerprint_pro_server_api_sdk/models/factory_reset_result.py index 75635530..fab8c7d8 100644 --- a/fingerprint_pro_server_api_sdk/models/factory_reset_result.py +++ b/fingerprint_pro_server_api_sdk/models/factory_reset_result.py @@ -114,6 +114,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(FactoryResetResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/frida_result.py b/fingerprint_pro_server_api_sdk/models/frida_result.py index 855940e3..0d763de8 100644 --- a/fingerprint_pro_server_api_sdk/models/frida_result.py +++ b/fingerprint_pro_server_api_sdk/models/frida_result.py @@ -85,6 +85,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(FridaResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/high_activity_result.py b/fingerprint_pro_server_api_sdk/models/high_activity_result.py index 6bdaf6e8..65bd60e6 100644 --- a/fingerprint_pro_server_api_sdk/models/high_activity_result.py +++ b/fingerprint_pro_server_api_sdk/models/high_activity_result.py @@ -113,6 +113,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(HighActivityResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/identification_error.py b/fingerprint_pro_server_api_sdk/models/identification_error.py index 0463ec29..80b9cb4d 100644 --- a/fingerprint_pro_server_api_sdk/models/identification_error.py +++ b/fingerprint_pro_server_api_sdk/models/identification_error.py @@ -118,6 +118,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(IdentificationError, dict): diff --git a/fingerprint_pro_server_api_sdk/models/incognito_result.py b/fingerprint_pro_server_api_sdk/models/incognito_result.py index d251f37b..50cda1db 100644 --- a/fingerprint_pro_server_api_sdk/models/incognito_result.py +++ b/fingerprint_pro_server_api_sdk/models/incognito_result.py @@ -85,6 +85,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(IncognitoResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/ip_block_list_result.py b/fingerprint_pro_server_api_sdk/models/ip_block_list_result.py index 5ae947e9..f1c2c4cb 100644 --- a/fingerprint_pro_server_api_sdk/models/ip_block_list_result.py +++ b/fingerprint_pro_server_api_sdk/models/ip_block_list_result.py @@ -112,6 +112,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(IpBlockListResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/ip_block_list_result_details.py b/fingerprint_pro_server_api_sdk/models/ip_block_list_result_details.py index 4af784f8..12cf31d5 100644 --- a/fingerprint_pro_server_api_sdk/models/ip_block_list_result_details.py +++ b/fingerprint_pro_server_api_sdk/models/ip_block_list_result_details.py @@ -114,6 +114,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(IpBlockListResultDetails, dict): diff --git a/fingerprint_pro_server_api_sdk/models/ip_info_result.py b/fingerprint_pro_server_api_sdk/models/ip_info_result.py index 0fa494e9..f11d5c0a 100644 --- a/fingerprint_pro_server_api_sdk/models/ip_info_result.py +++ b/fingerprint_pro_server_api_sdk/models/ip_info_result.py @@ -111,6 +111,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(IpInfoResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/ip_info_result_v4.py b/fingerprint_pro_server_api_sdk/models/ip_info_result_v4.py index 90a157b0..2f930cba 100644 --- a/fingerprint_pro_server_api_sdk/models/ip_info_result_v4.py +++ b/fingerprint_pro_server_api_sdk/models/ip_info_result_v4.py @@ -162,6 +162,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(IpInfoResultV4, dict): diff --git a/fingerprint_pro_server_api_sdk/models/ip_info_result_v6.py b/fingerprint_pro_server_api_sdk/models/ip_info_result_v6.py index b1446197..1f901a35 100644 --- a/fingerprint_pro_server_api_sdk/models/ip_info_result_v6.py +++ b/fingerprint_pro_server_api_sdk/models/ip_info_result_v6.py @@ -162,6 +162,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(IpInfoResultV6, dict): diff --git a/fingerprint_pro_server_api_sdk/models/ip_location.py b/fingerprint_pro_server_api_sdk/models/ip_location.py index fc5710f4..9387f94b 100644 --- a/fingerprint_pro_server_api_sdk/models/ip_location.py +++ b/fingerprint_pro_server_api_sdk/models/ip_location.py @@ -292,6 +292,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(IPLocation, dict): diff --git a/fingerprint_pro_server_api_sdk/models/ip_location_city.py b/fingerprint_pro_server_api_sdk/models/ip_location_city.py index cb82e9a5..beebd283 100644 --- a/fingerprint_pro_server_api_sdk/models/ip_location_city.py +++ b/fingerprint_pro_server_api_sdk/models/ip_location_city.py @@ -82,6 +82,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(IPLocationCity, dict): diff --git a/fingerprint_pro_server_api_sdk/models/jailbroken_result.py b/fingerprint_pro_server_api_sdk/models/jailbroken_result.py index 74a30a9d..debb8c82 100644 --- a/fingerprint_pro_server_api_sdk/models/jailbroken_result.py +++ b/fingerprint_pro_server_api_sdk/models/jailbroken_result.py @@ -85,6 +85,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(JailbrokenResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/location.py b/fingerprint_pro_server_api_sdk/models/location.py index 99b9dd59..e6586871 100644 --- a/fingerprint_pro_server_api_sdk/models/location.py +++ b/fingerprint_pro_server_api_sdk/models/location.py @@ -110,6 +110,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(Location, dict): diff --git a/fingerprint_pro_server_api_sdk/models/location_spoofing_result.py b/fingerprint_pro_server_api_sdk/models/location_spoofing_result.py index ca386ac8..e3c03213 100644 --- a/fingerprint_pro_server_api_sdk/models/location_spoofing_result.py +++ b/fingerprint_pro_server_api_sdk/models/location_spoofing_result.py @@ -85,6 +85,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(LocationSpoofingResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/privacy_settings_result.py b/fingerprint_pro_server_api_sdk/models/privacy_settings_result.py index 8ea30c6d..b6e0aec2 100644 --- a/fingerprint_pro_server_api_sdk/models/privacy_settings_result.py +++ b/fingerprint_pro_server_api_sdk/models/privacy_settings_result.py @@ -85,6 +85,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(PrivacySettingsResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/product_error.py b/fingerprint_pro_server_api_sdk/models/product_error.py index f2873363..ffe4261a 100644 --- a/fingerprint_pro_server_api_sdk/models/product_error.py +++ b/fingerprint_pro_server_api_sdk/models/product_error.py @@ -118,6 +118,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(ProductError, dict): diff --git a/fingerprint_pro_server_api_sdk/models/products_response.py b/fingerprint_pro_server_api_sdk/models/products_response.py index 95d42dd9..f4ca5b84 100644 --- a/fingerprint_pro_server_api_sdk/models/products_response.py +++ b/fingerprint_pro_server_api_sdk/models/products_response.py @@ -51,7 +51,9 @@ class ProductsResponse(object): 'high_activity': 'SignalResponseHighActivity', 'location_spoofing': 'SignalResponseLocationSpoofing', 'suspect_score': 'SignalResponseSuspectScore', - 'raw_device_attributes': 'SignalResponseRawDeviceAttributes' + 'raw_device_attributes': 'SignalResponseRawDeviceAttributes', + 'remote_control': 'SignalResponseRemoteControl', + 'velocity': 'SignalResponseVelocity' } attribute_map = { @@ -75,10 +77,12 @@ class ProductsResponse(object): 'high_activity': 'highActivity', 'location_spoofing': 'locationSpoofing', 'suspect_score': 'suspectScore', - 'raw_device_attributes': 'rawDeviceAttributes' + 'raw_device_attributes': 'rawDeviceAttributes', + 'remote_control': 'remoteControl', + 'velocity': 'velocity' } - def __init__(self, identification=None, botd=None, ip_info=None, incognito=None, root_apps=None, emulator=None, cloned_app=None, factory_reset=None, jailbroken=None, frida=None, ip_blocklist=None, tor=None, privacy_settings=None, virtual_machine=None, vpn=None, proxy=None, tampering=None, high_activity=None, location_spoofing=None, suspect_score=None, raw_device_attributes=None): # noqa: E501 + def __init__(self, identification=None, botd=None, ip_info=None, incognito=None, root_apps=None, emulator=None, cloned_app=None, factory_reset=None, jailbroken=None, frida=None, ip_blocklist=None, tor=None, privacy_settings=None, virtual_machine=None, vpn=None, proxy=None, tampering=None, high_activity=None, location_spoofing=None, suspect_score=None, raw_device_attributes=None, remote_control=None, velocity=None): # noqa: E501 """ProductsResponse - a model defined in Swagger""" # noqa: E501 self._identification = None self._botd = None @@ -101,6 +105,8 @@ def __init__(self, identification=None, botd=None, ip_info=None, incognito=None, self._location_spoofing = None self._suspect_score = None self._raw_device_attributes = None + self._remote_control = None + self._velocity = None self.discriminator = None if identification is not None: self.identification = identification @@ -144,6 +150,10 @@ def __init__(self, identification=None, botd=None, ip_info=None, incognito=None, self.suspect_score = suspect_score if raw_device_attributes is not None: self.raw_device_attributes = raw_device_attributes + if remote_control is not None: + self.remote_control = remote_control + if velocity is not None: + self.velocity = velocity @property def identification(self): @@ -586,6 +596,48 @@ def raw_device_attributes(self, raw_device_attributes): self._raw_device_attributes = raw_device_attributes + @property + def remote_control(self): + """Gets the remote_control of this ProductsResponse. # noqa: E501 + + + :return: The remote_control of this ProductsResponse. # noqa: E501 + :rtype: SignalResponseRemoteControl + """ + return self._remote_control + + @remote_control.setter + def remote_control(self, remote_control): + """Sets the remote_control of this ProductsResponse. + + + :param remote_control: The remote_control of this ProductsResponse. # noqa: E501 + :type: SignalResponseRemoteControl + """ + + self._remote_control = remote_control + + @property + def velocity(self): + """Gets the velocity of this ProductsResponse. # noqa: E501 + + + :return: The velocity of this ProductsResponse. # noqa: E501 + :rtype: SignalResponseVelocity + """ + return self._velocity + + @velocity.setter + def velocity(self, velocity): + """Sets the velocity of this ProductsResponse. + + + :param velocity: The velocity of this ProductsResponse. # noqa: E501 + :type: SignalResponseVelocity + """ + + self._velocity = velocity + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -605,6 +657,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(ProductsResponse, dict): diff --git a/fingerprint_pro_server_api_sdk/models/products_response_botd.py b/fingerprint_pro_server_api_sdk/models/products_response_botd.py index c49ea392..7f1b21ac 100644 --- a/fingerprint_pro_server_api_sdk/models/products_response_botd.py +++ b/fingerprint_pro_server_api_sdk/models/products_response_botd.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(ProductsResponseBotd, dict): diff --git a/fingerprint_pro_server_api_sdk/models/products_response_identification.py b/fingerprint_pro_server_api_sdk/models/products_response_identification.py index b490ba5e..9fe3837e 100644 --- a/fingerprint_pro_server_api_sdk/models/products_response_identification.py +++ b/fingerprint_pro_server_api_sdk/models/products_response_identification.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(ProductsResponseIdentification, dict): diff --git a/fingerprint_pro_server_api_sdk/models/products_response_identification_data.py b/fingerprint_pro_server_api_sdk/models/products_response_identification_data.py index f89f1f44..dbb4541e 100644 --- a/fingerprint_pro_server_api_sdk/models/products_response_identification_data.py +++ b/fingerprint_pro_server_api_sdk/models/products_response_identification_data.py @@ -476,6 +476,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(ProductsResponseIdentificationData, dict): diff --git a/fingerprint_pro_server_api_sdk/models/proxy_result.py b/fingerprint_pro_server_api_sdk/models/proxy_result.py index 7f0e0880..a372ec45 100644 --- a/fingerprint_pro_server_api_sdk/models/proxy_result.py +++ b/fingerprint_pro_server_api_sdk/models/proxy_result.py @@ -85,6 +85,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(ProxyResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/raw_device_attributes_result.py b/fingerprint_pro_server_api_sdk/models/raw_device_attributes_result.py index 09f72765..7ec9f320 100644 --- a/fingerprint_pro_server_api_sdk/models/raw_device_attributes_result.py +++ b/fingerprint_pro_server_api_sdk/models/raw_device_attributes_result.py @@ -59,6 +59,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(RawDeviceAttributesResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/remote_control_result.py b/fingerprint_pro_server_api_sdk/models/remote_control_result.py new file mode 100644 index 00000000..387e541f --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/remote_control_result.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class RemoteControlResult(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'result': 'bool' + } + + attribute_map = { + 'result': 'result' + } + + def __init__(self, result=None): # noqa: E501 + """RemoteControlResult - a model defined in Swagger""" # noqa: E501 + self._result = None + self.discriminator = None + self.result = result + + @property + def result(self): + """Gets the result of this RemoteControlResult. # noqa: E501 + + `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. # noqa: E501 + + :return: The result of this RemoteControlResult. # noqa: E501 + :rtype: bool + """ + return self._result + + @result.setter + def result(self, result): + """Sets the result of this RemoteControlResult. + + `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. # noqa: E501 + + :param result: The result of this RemoteControlResult. # noqa: E501 + :type: bool + """ + if result is None: + raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 + + self._result = result + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(RemoteControlResult, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RemoteControlResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, RemoteControlResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/response.py b/fingerprint_pro_server_api_sdk/models/response.py index 5d01f962..1b5806ee 100644 --- a/fingerprint_pro_server_api_sdk/models/response.py +++ b/fingerprint_pro_server_api_sdk/models/response.py @@ -169,6 +169,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(Response, dict): diff --git a/fingerprint_pro_server_api_sdk/models/response_visits.py b/fingerprint_pro_server_api_sdk/models/response_visits.py index ca2676bf..f38d2e38 100644 --- a/fingerprint_pro_server_api_sdk/models/response_visits.py +++ b/fingerprint_pro_server_api_sdk/models/response_visits.py @@ -447,6 +447,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(ResponseVisits, dict): diff --git a/fingerprint_pro_server_api_sdk/models/root_apps_result.py b/fingerprint_pro_server_api_sdk/models/root_apps_result.py index c08f51a9..88178021 100644 --- a/fingerprint_pro_server_api_sdk/models/root_apps_result.py +++ b/fingerprint_pro_server_api_sdk/models/root_apps_result.py @@ -85,6 +85,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(RootAppsResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/seen_at.py b/fingerprint_pro_server_api_sdk/models/seen_at.py index 837f3716..43e2b4f5 100644 --- a/fingerprint_pro_server_api_sdk/models/seen_at.py +++ b/fingerprint_pro_server_api_sdk/models/seen_at.py @@ -106,6 +106,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SeenAt, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_cloned_app.py b/fingerprint_pro_server_api_sdk/models/signal_response_cloned_app.py index d83ac05c..4183b318 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_cloned_app.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_cloned_app.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseClonedApp, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_emulator.py b/fingerprint_pro_server_api_sdk/models/signal_response_emulator.py index f87139cc..cb280089 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_emulator.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_emulator.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseEmulator, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_factory_reset.py b/fingerprint_pro_server_api_sdk/models/signal_response_factory_reset.py index 01b47238..3e6e263b 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_factory_reset.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_factory_reset.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseFactoryReset, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_frida.py b/fingerprint_pro_server_api_sdk/models/signal_response_frida.py index 14c69874..71d08b42 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_frida.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_frida.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseFrida, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_high_activity.py b/fingerprint_pro_server_api_sdk/models/signal_response_high_activity.py index 84195238..1f85d67d 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_high_activity.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_high_activity.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseHighActivity, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_incognito.py b/fingerprint_pro_server_api_sdk/models/signal_response_incognito.py index 0937e73d..8bf15594 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_incognito.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_incognito.py @@ -29,7 +29,7 @@ class SignalResponseIncognito(object): """ swagger_types = { 'data': 'IncognitoResult', - 'error': 'ProductError' + 'error': 'IdentificationError' } attribute_map = { @@ -74,7 +74,7 @@ def error(self): :return: The error of this SignalResponseIncognito. # noqa: E501 - :rtype: ProductError + :rtype: IdentificationError """ return self._error @@ -84,7 +84,7 @@ def error(self, error): :param error: The error of this SignalResponseIncognito. # noqa: E501 - :type: ProductError + :type: IdentificationError """ self._error = error @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseIncognito, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_ip_blocklist.py b/fingerprint_pro_server_api_sdk/models/signal_response_ip_blocklist.py index 5acea552..045d8a21 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_ip_blocklist.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_ip_blocklist.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseIpBlocklist, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_ip_info.py b/fingerprint_pro_server_api_sdk/models/signal_response_ip_info.py index 6a2ca92c..462bcae9 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_ip_info.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_ip_info.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseIpInfo, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_jailbroken.py b/fingerprint_pro_server_api_sdk/models/signal_response_jailbroken.py index 2208b454..8e21fba6 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_jailbroken.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_jailbroken.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseJailbroken, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_location_spoofing.py b/fingerprint_pro_server_api_sdk/models/signal_response_location_spoofing.py index b6e30e12..f457c0f2 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_location_spoofing.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_location_spoofing.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseLocationSpoofing, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_privacy_settings.py b/fingerprint_pro_server_api_sdk/models/signal_response_privacy_settings.py index 2d11213f..e15515c9 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_privacy_settings.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_privacy_settings.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponsePrivacySettings, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_proxy.py b/fingerprint_pro_server_api_sdk/models/signal_response_proxy.py index 0d71ec77..c77c3943 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_proxy.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_proxy.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseProxy, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_raw_device_attributes.py b/fingerprint_pro_server_api_sdk/models/signal_response_raw_device_attributes.py index 1fcca218..3ff68549 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_raw_device_attributes.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_raw_device_attributes.py @@ -29,7 +29,7 @@ class SignalResponseRawDeviceAttributes(object): """ swagger_types = { 'data': 'RawDeviceAttributesResult', - 'error': 'ProductError' + 'error': 'IdentificationError' } attribute_map = { @@ -74,7 +74,7 @@ def error(self): :return: The error of this SignalResponseRawDeviceAttributes. # noqa: E501 - :rtype: ProductError + :rtype: IdentificationError """ return self._error @@ -84,7 +84,7 @@ def error(self, error): :param error: The error of this SignalResponseRawDeviceAttributes. # noqa: E501 - :type: ProductError + :type: IdentificationError """ self._error = error @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseRawDeviceAttributes, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_remote_control.py b/fingerprint_pro_server_api_sdk/models/signal_response_remote_control.py new file mode 100644 index 00000000..2c238b22 --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/signal_response_remote_control.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SignalResponseRemoteControl(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data': 'RemoteControlResult', + 'error': 'ProductError' + } + + attribute_map = { + 'data': 'data', + 'error': 'error' + } + + def __init__(self, data=None, error=None): # noqa: E501 + """SignalResponseRemoteControl - a model defined in Swagger""" # noqa: E501 + self._data = None + self._error = None + self.discriminator = None + if data is not None: + self.data = data + if error is not None: + self.error = error + + @property + def data(self): + """Gets the data of this SignalResponseRemoteControl. # noqa: E501 + + + :return: The data of this SignalResponseRemoteControl. # noqa: E501 + :rtype: RemoteControlResult + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this SignalResponseRemoteControl. + + + :param data: The data of this SignalResponseRemoteControl. # noqa: E501 + :type: RemoteControlResult + """ + + self._data = data + + @property + def error(self): + """Gets the error of this SignalResponseRemoteControl. # noqa: E501 + + + :return: The error of this SignalResponseRemoteControl. # noqa: E501 + :rtype: ProductError + """ + return self._error + + @error.setter + def error(self, error): + """Sets the error of this SignalResponseRemoteControl. + + + :param error: The error of this SignalResponseRemoteControl. # noqa: E501 + :type: ProductError + """ + + self._error = error + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(SignalResponseRemoteControl, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SignalResponseRemoteControl): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SignalResponseRemoteControl): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_root_apps.py b/fingerprint_pro_server_api_sdk/models/signal_response_root_apps.py index 7cfb63b2..a6b76837 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_root_apps.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_root_apps.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseRootApps, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_suspect_score.py b/fingerprint_pro_server_api_sdk/models/signal_response_suspect_score.py index d5fabff1..ac034298 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_suspect_score.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_suspect_score.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseSuspectScore, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_tampering.py b/fingerprint_pro_server_api_sdk/models/signal_response_tampering.py index 28e8f52e..242fcb6a 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_tampering.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_tampering.py @@ -29,7 +29,7 @@ class SignalResponseTampering(object): """ swagger_types = { 'data': 'TamperingResult', - 'error': 'ProductError' + 'error': 'IdentificationError' } attribute_map = { @@ -74,7 +74,7 @@ def error(self): :return: The error of this SignalResponseTampering. # noqa: E501 - :rtype: ProductError + :rtype: IdentificationError """ return self._error @@ -84,7 +84,7 @@ def error(self, error): :param error: The error of this SignalResponseTampering. # noqa: E501 - :type: ProductError + :type: IdentificationError """ self._error = error @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseTampering, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_tor.py b/fingerprint_pro_server_api_sdk/models/signal_response_tor.py index c1861bc0..0611a024 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_tor.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_tor.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseTor, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_velocity.py b/fingerprint_pro_server_api_sdk/models/signal_response_velocity.py new file mode 100644 index 00000000..ce378864 --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/signal_response_velocity.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SignalResponseVelocity(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data': 'VelocityResult', + 'error': 'ProductError' + } + + attribute_map = { + 'data': 'data', + 'error': 'error' + } + + def __init__(self, data=None, error=None): # noqa: E501 + """SignalResponseVelocity - a model defined in Swagger""" # noqa: E501 + self._data = None + self._error = None + self.discriminator = None + if data is not None: + self.data = data + if error is not None: + self.error = error + + @property + def data(self): + """Gets the data of this SignalResponseVelocity. # noqa: E501 + + + :return: The data of this SignalResponseVelocity. # noqa: E501 + :rtype: VelocityResult + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this SignalResponseVelocity. + + + :param data: The data of this SignalResponseVelocity. # noqa: E501 + :type: VelocityResult + """ + + self._data = data + + @property + def error(self): + """Gets the error of this SignalResponseVelocity. # noqa: E501 + + + :return: The error of this SignalResponseVelocity. # noqa: E501 + :rtype: ProductError + """ + return self._error + + @error.setter + def error(self, error): + """Sets the error of this SignalResponseVelocity. + + + :param error: The error of this SignalResponseVelocity. # noqa: E501 + :type: ProductError + """ + + self._error = error + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(SignalResponseVelocity, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SignalResponseVelocity): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SignalResponseVelocity): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_virtual_machine.py b/fingerprint_pro_server_api_sdk/models/signal_response_virtual_machine.py index e26dffef..43105583 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_virtual_machine.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_virtual_machine.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseVirtualMachine, dict): diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_vpn.py b/fingerprint_pro_server_api_sdk/models/signal_response_vpn.py index 095c1ac2..56a204de 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_vpn.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_vpn.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SignalResponseVpn, dict): diff --git a/fingerprint_pro_server_api_sdk/models/subdivision.py b/fingerprint_pro_server_api_sdk/models/subdivision.py index 37ca31a7..9158a15e 100644 --- a/fingerprint_pro_server_api_sdk/models/subdivision.py +++ b/fingerprint_pro_server_api_sdk/models/subdivision.py @@ -108,6 +108,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(Subdivision, dict): diff --git a/fingerprint_pro_server_api_sdk/models/suspect_score_result.py b/fingerprint_pro_server_api_sdk/models/suspect_score_result.py index b7684285..2a7f28d4 100644 --- a/fingerprint_pro_server_api_sdk/models/suspect_score_result.py +++ b/fingerprint_pro_server_api_sdk/models/suspect_score_result.py @@ -85,6 +85,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(SuspectScoreResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/tampering_result.py b/fingerprint_pro_server_api_sdk/models/tampering_result.py index e0b105aa..5d2abef6 100644 --- a/fingerprint_pro_server_api_sdk/models/tampering_result.py +++ b/fingerprint_pro_server_api_sdk/models/tampering_result.py @@ -114,6 +114,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(TamperingResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/many_requests_response.py b/fingerprint_pro_server_api_sdk/models/too_many_requests_response.py similarity index 79% rename from fingerprint_pro_server_api_sdk/models/many_requests_response.py rename to fingerprint_pro_server_api_sdk/models/too_many_requests_response.py index 92b50080..ebb5c99d 100644 --- a/fingerprint_pro_server_api_sdk/models/many_requests_response.py +++ b/fingerprint_pro_server_api_sdk/models/too_many_requests_response.py @@ -3,7 +3,7 @@ """ Fingerprint Pro Server API - Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. This API can be used for data exports, decision-making, and data analysis scenarios. # noqa: E501 + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 OpenAPI spec version: 3 Contact: support@fingerprint.com @@ -15,8 +15,7 @@ import six - -class ManyRequestsResponse(object): +class TooManyRequestsResponse(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -39,7 +38,7 @@ class ManyRequestsResponse(object): } def __init__(self, error=None): # noqa: E501 - """ManyRequestsResponse - a model defined in Swagger""" # noqa: E501 + """TooManyRequestsResponse - a model defined in Swagger""" # noqa: E501 self._error = None self.discriminator = None self.error = error @@ -47,22 +46,22 @@ def __init__(self, error=None): # noqa: E501 @property def error(self): - """Gets the error of this ManyRequestsResponse. # noqa: E501 + """Gets the error of this TooManyRequestsResponse. # noqa: E501 Error text. # noqa: E501 - :return: The error of this ManyRequestsResponse. # noqa: E501 + :return: The error of this TooManyRequestsResponse. # noqa: E501 :rtype: str """ return self._error @error.setter def error(self, error): - """Sets the error of this ManyRequestsResponse. + """Sets the error of this TooManyRequestsResponse. Error text. # noqa: E501 - :param error: The error of this ManyRequestsResponse. # noqa: E501 + :param error: The error of this TooManyRequestsResponse. # noqa: E501 :type: str """ if error is None: @@ -99,7 +98,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(ManyRequestsResponse, dict): + if issubclass(TooManyRequestsResponse, dict): for key, value in self.items(): result[key] = value @@ -115,14 +114,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, ManyRequestsResponse): + if not isinstance(other, TooManyRequestsResponse): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, ManyRequestsResponse): + if not isinstance(other, TooManyRequestsResponse): return True return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/tor_result.py b/fingerprint_pro_server_api_sdk/models/tor_result.py index 4978a588..59db2fed 100644 --- a/fingerprint_pro_server_api_sdk/models/tor_result.py +++ b/fingerprint_pro_server_api_sdk/models/tor_result.py @@ -85,6 +85,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(TorResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/velocity_interval_result.py b/fingerprint_pro_server_api_sdk/models/velocity_interval_result.py new file mode 100644 index 00000000..3b0d8288 --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/velocity_interval_result.py @@ -0,0 +1,174 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class VelocityIntervalResult(object): + """ + Is absent if the velocity data could not be generated for the visitor ID. + + NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_5m': 'int', + '_1h': 'int', + '_24h': 'int' + } + + attribute_map = { + '_5m': '5m', + '_1h': '1h', + '_24h': '24h' + } + + def __init__(self, _5m=None, _1h=None, _24h=None): # noqa: E501 + """VelocityIntervalResult - a model defined in Swagger""" # noqa: E501 + self.__5m = None + self.__1h = None + self.__24h = None + self.discriminator = None + self._5m = _5m + self._1h = _1h + if _24h is not None: + self._24h = _24h + + @property + def _5m(self): + """Gets the _5m of this VelocityIntervalResult. # noqa: E501 + + + :return: The _5m of this VelocityIntervalResult. # noqa: E501 + :rtype: int + """ + return self.__5m + + @_5m.setter + def _5m(self, _5m): + """Sets the _5m of this VelocityIntervalResult. + + + :param _5m: The _5m of this VelocityIntervalResult. # noqa: E501 + :type: int + """ + if _5m is None: + raise ValueError("Invalid value for `_5m`, must not be `None`") # noqa: E501 + + self.__5m = _5m + + @property + def _1h(self): + """Gets the _1h of this VelocityIntervalResult. # noqa: E501 + + + :return: The _1h of this VelocityIntervalResult. # noqa: E501 + :rtype: int + """ + return self.__1h + + @_1h.setter + def _1h(self, _1h): + """Sets the _1h of this VelocityIntervalResult. + + + :param _1h: The _1h of this VelocityIntervalResult. # noqa: E501 + :type: int + """ + if _1h is None: + raise ValueError("Invalid value for `_1h`, must not be `None`") # noqa: E501 + + self.__1h = _1h + + @property + def _24h(self): + """Gets the _24h of this VelocityIntervalResult. # noqa: E501 + + The `24h` interval of `distinctIp`, `distinctLinkedId`, and `distinctCountry` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. # noqa: E501 + + :return: The _24h of this VelocityIntervalResult. # noqa: E501 + :rtype: int + """ + return self.__24h + + @_24h.setter + def _24h(self, _24h): + """Sets the _24h of this VelocityIntervalResult. + + The `24h` interval of `distinctIp`, `distinctLinkedId`, and `distinctCountry` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. # noqa: E501 + + :param _24h: The _24h of this VelocityIntervalResult. # noqa: E501 + :type: int + """ + + self.__24h = _24h + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(VelocityIntervalResult, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, VelocityIntervalResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, VelocityIntervalResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/velocity_intervals.py b/fingerprint_pro_server_api_sdk/models/velocity_intervals.py new file mode 100644 index 00000000..c619185e --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/velocity_intervals.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class VelocityIntervals(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'intervals': 'VelocityIntervalResult' + } + + attribute_map = { + 'intervals': 'intervals' + } + + def __init__(self, intervals=None): # noqa: E501 + """VelocityIntervals - a model defined in Swagger""" # noqa: E501 + self._intervals = None + self.discriminator = None + if intervals is not None: + self.intervals = intervals + + @property + def intervals(self): + """Gets the intervals of this VelocityIntervals. # noqa: E501 + + + :return: The intervals of this VelocityIntervals. # noqa: E501 + :rtype: VelocityIntervalResult + """ + return self._intervals + + @intervals.setter + def intervals(self, intervals): + """Sets the intervals of this VelocityIntervals. + + + :param intervals: The intervals of this VelocityIntervals. # noqa: E501 + :type: VelocityIntervalResult + """ + + self._intervals = intervals + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(VelocityIntervals, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, VelocityIntervals): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, VelocityIntervals): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/velocity_result.py b/fingerprint_pro_server_api_sdk/models/velocity_result.py new file mode 100644 index 00000000..3e2086b2 --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/velocity_result.py @@ -0,0 +1,200 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server 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. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class VelocityResult(object): + """ + Sums key data points for a specific `visitorId` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: - Number of identification events attributed to the visitor ID - Number of distinct IP addresses associated to the visitor ID. - Number of distinct countries associated with the visitor ID. - Number of distinct `linkedId`s associated with the visitor ID. The `24h` interval of `distinctIp`, `distinctLinkedId`, and `distinctCountry` will be omitted if the number of `events` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. + + NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'distinct_ip': 'VelocityIntervals', + 'distinct_linked_id': 'VelocityIntervals', + 'distinct_country': 'VelocityIntervals', + 'events': 'VelocityIntervals' + } + + attribute_map = { + 'distinct_ip': 'distinctIp', + 'distinct_linked_id': 'distinctLinkedId', + 'distinct_country': 'distinctCountry', + 'events': 'events' + } + + def __init__(self, distinct_ip=None, distinct_linked_id=None, distinct_country=None, events=None): # noqa: E501 + """VelocityResult - a model defined in Swagger""" # noqa: E501 + self._distinct_ip = None + self._distinct_linked_id = None + self._distinct_country = None + self._events = None + self.discriminator = None + self.distinct_ip = distinct_ip + self.distinct_linked_id = distinct_linked_id + self.distinct_country = distinct_country + self.events = events + + @property + def distinct_ip(self): + """Gets the distinct_ip of this VelocityResult. # noqa: E501 + + + :return: The distinct_ip of this VelocityResult. # noqa: E501 + :rtype: VelocityIntervals + """ + return self._distinct_ip + + @distinct_ip.setter + def distinct_ip(self, distinct_ip): + """Sets the distinct_ip of this VelocityResult. + + + :param distinct_ip: The distinct_ip of this VelocityResult. # noqa: E501 + :type: VelocityIntervals + """ + if distinct_ip is None: + raise ValueError("Invalid value for `distinct_ip`, must not be `None`") # noqa: E501 + + self._distinct_ip = distinct_ip + + @property + def distinct_linked_id(self): + """Gets the distinct_linked_id of this VelocityResult. # noqa: E501 + + + :return: The distinct_linked_id of this VelocityResult. # noqa: E501 + :rtype: VelocityIntervals + """ + return self._distinct_linked_id + + @distinct_linked_id.setter + def distinct_linked_id(self, distinct_linked_id): + """Sets the distinct_linked_id of this VelocityResult. + + + :param distinct_linked_id: The distinct_linked_id of this VelocityResult. # noqa: E501 + :type: VelocityIntervals + """ + if distinct_linked_id is None: + raise ValueError("Invalid value for `distinct_linked_id`, must not be `None`") # noqa: E501 + + self._distinct_linked_id = distinct_linked_id + + @property + def distinct_country(self): + """Gets the distinct_country of this VelocityResult. # noqa: E501 + + + :return: The distinct_country of this VelocityResult. # noqa: E501 + :rtype: VelocityIntervals + """ + return self._distinct_country + + @distinct_country.setter + def distinct_country(self, distinct_country): + """Sets the distinct_country of this VelocityResult. + + + :param distinct_country: The distinct_country of this VelocityResult. # noqa: E501 + :type: VelocityIntervals + """ + if distinct_country is None: + raise ValueError("Invalid value for `distinct_country`, must not be `None`") # noqa: E501 + + self._distinct_country = distinct_country + + @property + def events(self): + """Gets the events of this VelocityResult. # noqa: E501 + + + :return: The events of this VelocityResult. # noqa: E501 + :rtype: VelocityIntervals + """ + return self._events + + @events.setter + def events(self, events): + """Sets the events of this VelocityResult. + + + :param events: The events of this VelocityResult. # noqa: E501 + :type: VelocityIntervals + """ + if events is None: + raise ValueError("Invalid value for `events`, must not be `None`") # noqa: E501 + + self._events = events + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + elif value is None: + continue + else: + result[attr] = value + if issubclass(VelocityResult, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, VelocityResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, VelocityResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/virtual_machine_result.py b/fingerprint_pro_server_api_sdk/models/virtual_machine_result.py index 67038bb4..c714261f 100644 --- a/fingerprint_pro_server_api_sdk/models/virtual_machine_result.py +++ b/fingerprint_pro_server_api_sdk/models/virtual_machine_result.py @@ -85,6 +85,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(VirtualMachineResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/visit.py b/fingerprint_pro_server_api_sdk/models/visit.py index b6e52d57..a8b64fbb 100644 --- a/fingerprint_pro_server_api_sdk/models/visit.py +++ b/fingerprint_pro_server_api_sdk/models/visit.py @@ -447,6 +447,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(Visit, dict): diff --git a/fingerprint_pro_server_api_sdk/models/vpn_result.py b/fingerprint_pro_server_api_sdk/models/vpn_result.py index ed5db6f4..caca02f4 100644 --- a/fingerprint_pro_server_api_sdk/models/vpn_result.py +++ b/fingerprint_pro_server_api_sdk/models/vpn_result.py @@ -169,6 +169,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(VpnResult, dict): diff --git a/fingerprint_pro_server_api_sdk/models/vpn_result_methods.py b/fingerprint_pro_server_api_sdk/models/vpn_result_methods.py index 0205afc4..0b75ca20 100644 --- a/fingerprint_pro_server_api_sdk/models/vpn_result_methods.py +++ b/fingerprint_pro_server_api_sdk/models/vpn_result_methods.py @@ -30,30 +30,34 @@ class VpnResultMethods(object): swagger_types = { 'timezone_mismatch': 'bool', 'public_vpn': 'bool', - 'auxiliary_mobile': 'bool' + 'auxiliary_mobile': 'bool', + 'os_mismatch': 'bool' } attribute_map = { 'timezone_mismatch': 'timezoneMismatch', 'public_vpn': 'publicVPN', - 'auxiliary_mobile': 'auxiliaryMobile' + 'auxiliary_mobile': 'auxiliaryMobile', + 'os_mismatch': 'osMismatch' } - def __init__(self, timezone_mismatch=None, public_vpn=None, auxiliary_mobile=None): # noqa: E501 + def __init__(self, timezone_mismatch=None, public_vpn=None, auxiliary_mobile=None, os_mismatch=None): # noqa: E501 """VpnResultMethods - a model defined in Swagger""" # noqa: E501 self._timezone_mismatch = None self._public_vpn = None self._auxiliary_mobile = None + self._os_mismatch = None self.discriminator = None self.timezone_mismatch = timezone_mismatch self.public_vpn = public_vpn self.auxiliary_mobile = auxiliary_mobile + self.os_mismatch = os_mismatch @property def timezone_mismatch(self): """Gets the timezone_mismatch of this VpnResultMethods. # noqa: E501 - User's browser timezone doesn't match the timezone from which the request was originally made. # noqa: E501 + The browser timezone doesn't match the timezone inferred from the request IP address. # noqa: E501 :return: The timezone_mismatch of this VpnResultMethods. # noqa: E501 :rtype: bool @@ -64,7 +68,7 @@ def timezone_mismatch(self): def timezone_mismatch(self, timezone_mismatch): """Sets the timezone_mismatch of this VpnResultMethods. - User's browser timezone doesn't match the timezone from which the request was originally made. # noqa: E501 + The browser timezone doesn't match the timezone inferred from the request IP address. # noqa: E501 :param timezone_mismatch: The timezone_mismatch of this VpnResultMethods. # noqa: E501 :type: bool @@ -124,6 +128,31 @@ def auxiliary_mobile(self, auxiliary_mobile): self._auxiliary_mobile = auxiliary_mobile + @property + def os_mismatch(self): + """Gets the os_mismatch of this VpnResultMethods. # noqa: E501 + + The browser runs on a different operating system than the operating system inferred from the request network signature. # noqa: E501 + + :return: The os_mismatch of this VpnResultMethods. # noqa: E501 + :rtype: bool + """ + return self._os_mismatch + + @os_mismatch.setter + def os_mismatch(self, os_mismatch): + """Sets the os_mismatch of this VpnResultMethods. + + The browser runs on a different operating system than the operating system inferred from the request network signature. # noqa: E501 + + :param os_mismatch: The os_mismatch of this VpnResultMethods. # noqa: E501 + :type: bool + """ + if os_mismatch is None: + raise ValueError("Invalid value for `os_mismatch`, must not be `None`") # noqa: E501 + + self._os_mismatch = os_mismatch + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -143,6 +172,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(VpnResultMethods, dict): diff --git a/fingerprint_pro_server_api_sdk/models/webhook_visit.py b/fingerprint_pro_server_api_sdk/models/webhook_visit.py index 3f0aa14f..6bd7d5ac 100644 --- a/fingerprint_pro_server_api_sdk/models/webhook_visit.py +++ b/fingerprint_pro_server_api_sdk/models/webhook_visit.py @@ -51,6 +51,8 @@ class WebhookVisit(object): 'high_activity': 'HighActivityResult', 'location_spoofing': 'LocationSpoofingResult', 'suspect_score': 'SuspectScoreResult', + 'remote_control': 'RemoteControlResult', + 'velocity': 'VelocityResult', 'request_id': 'str', 'browser_details': 'BrowserDetails', 'ip': 'str', @@ -90,6 +92,8 @@ class WebhookVisit(object): 'high_activity': 'highActivity', 'location_spoofing': 'locationSpoofing', 'suspect_score': 'suspectScore', + 'remote_control': 'remoteControl', + 'velocity': 'velocity', 'request_id': 'requestId', 'browser_details': 'browserDetails', 'ip': 'ip', @@ -105,7 +109,7 @@ class WebhookVisit(object): 'last_seen_at': 'lastSeenAt' } - def __init__(self, visitor_id=None, client_referrer=None, user_agent=None, bot=None, ip_info=None, incognito=None, root_apps=None, emulator=None, cloned_app=None, factory_reset=None, jailbroken=None, frida=None, ip_blocklist=None, tor=None, privacy_settings=None, virtual_machine=None, vpn=None, proxy=None, tampering=None, raw_device_attributes=None, high_activity=None, location_spoofing=None, suspect_score=None, request_id=None, browser_details=None, ip=None, ip_location=None, timestamp=None, time=None, url=None, tag=None, linked_id=None, confidence=None, visitor_found=None, first_seen_at=None, last_seen_at=None): # noqa: E501 + def __init__(self, visitor_id=None, client_referrer=None, user_agent=None, bot=None, ip_info=None, incognito=None, root_apps=None, emulator=None, cloned_app=None, factory_reset=None, jailbroken=None, frida=None, ip_blocklist=None, tor=None, privacy_settings=None, virtual_machine=None, vpn=None, proxy=None, tampering=None, raw_device_attributes=None, high_activity=None, location_spoofing=None, suspect_score=None, remote_control=None, velocity=None, request_id=None, browser_details=None, ip=None, ip_location=None, timestamp=None, time=None, url=None, tag=None, linked_id=None, confidence=None, visitor_found=None, first_seen_at=None, last_seen_at=None): # noqa: E501 """WebhookVisit - a model defined in Swagger""" # noqa: E501 self._visitor_id = None self._client_referrer = None @@ -130,6 +134,8 @@ def __init__(self, visitor_id=None, client_referrer=None, user_agent=None, bot=N self._high_activity = None self._location_spoofing = None self._suspect_score = None + self._remote_control = None + self._velocity = None self._request_id = None self._browser_details = None self._ip = None @@ -188,6 +194,10 @@ def __init__(self, visitor_id=None, client_referrer=None, user_agent=None, bot=N self.location_spoofing = location_spoofing if suspect_score is not None: self.suspect_score = suspect_score + if remote_control is not None: + self.remote_control = remote_control + if velocity is not None: + self.velocity = velocity self.request_id = request_id self.browser_details = browser_details self.ip = ip @@ -694,6 +704,48 @@ def suspect_score(self, suspect_score): self._suspect_score = suspect_score + @property + def remote_control(self): + """Gets the remote_control of this WebhookVisit. # noqa: E501 + + + :return: The remote_control of this WebhookVisit. # noqa: E501 + :rtype: RemoteControlResult + """ + return self._remote_control + + @remote_control.setter + def remote_control(self, remote_control): + """Sets the remote_control of this WebhookVisit. + + + :param remote_control: The remote_control of this WebhookVisit. # noqa: E501 + :type: RemoteControlResult + """ + + self._remote_control = remote_control + + @property + def velocity(self): + """Gets the velocity of this WebhookVisit. # noqa: E501 + + + :return: The velocity of this WebhookVisit. # noqa: E501 + :rtype: VelocityResult + """ + return self._velocity + + @velocity.setter + def velocity(self, velocity): + """Sets the velocity of this WebhookVisit. + + + :param velocity: The velocity of this WebhookVisit. # noqa: E501 + :type: VelocityResult + """ + + self._velocity = velocity + @property def request_id(self): """Gets the request_id of this WebhookVisit. # noqa: E501 @@ -1020,6 +1072,8 @@ def to_dict(self): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass(WebhookVisit, dict): diff --git a/generate.sh b/generate.sh index cdc997ca..be94e69c 100755 --- a/generate.sh +++ b/generate.sh @@ -22,7 +22,7 @@ fi find ./docs -type f ! -name "DecryptionKey.md" ! -name "SealedResults.md" -exec rm {} + cd fingerprint_pro_server_api_sdk/models shopt -s extglob -rm !("many_requests_response.py") +rm !("too_many_requests_response.py") cd ../.. java -jar ./bin/swagger-codegen-cli.jar generate -t ./template -l python -i ./res/fingerprint-server-api.yaml -o ./ -c config.json -DpackageVersion=$VERSION diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index 792ce049..fee91c43 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -36,14 +36,13 @@ paths: tags: - Fingerprint operationId: getEvent - summary: Get event by requestId + summary: Get event by request ID description: > - This endpoint allows you to get a detailed analysis of an individual - request. + Get a detailed analysis of an individual identification event, including + Smart Signals. - **Only for Enterprise customers:** Please note that the response - includes mobile signals (e.g. `rootApps`) even if the request originated - from a non-mobile platform. + Please note that the response includes mobile signals (e.g. `rootApps`) + even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. @@ -57,7 +56,7 @@ paths: description: >- The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of - each analysis request. + each identification request. required: true schema: type: string @@ -73,21 +72,80 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ErrorEvent403Response' + $ref: '#/components/schemas/ErrorCommon403Response' '404': description: Not found content: application/json: schema: $ref: '#/components/schemas/ErrorEvent404Response' + put: + tags: + - Fingerprint + operationId: updateEvent + summary: Update an event with a given request ID + description: > + Change information in existing events specified by `requestId` or *flag + suspicious events*. + + + When an event is created, it is assigned `linkedId` and `tag` submitted + through the JS agent parameters. This information might not be available + on the client so the Server API allows for updating the attributes after + the fact. + + + **Warning** It's not possible to update events older than 10 days. + parameters: + - name: request_id + in: path + description: >- + The unique event + [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventUpdateRequest' + responses: + '200': + description: OK + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorUpdateEvent400Response' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorCommon403Response' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorEvent404Response' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorUpdateEvent409Response' /visitors/{visitor_id}: get: tags: - Fingerprint operationId: getVisits - summary: Get visits by visitorId + summary: Get visits by visitor ID description: > - This endpoint allows you to get a history of visits for a specific + Get a history of visits (identification events) for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. @@ -102,7 +160,10 @@ paths: response is received. parameters: - name: visitor_id - description: Unique identifier of the visitor issued by Fingerprint Pro. + description: >- + Unique [visitor + identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) + issued by Fingerprint Pro. in: path required: true schema: @@ -210,8 +271,8 @@ paths: headers: Retry-After: description: >- - Indicates how long you should wait before attempting the next - request. + Indicates how many seconds you should wait before attempting the + next request. schema: type: integer format: int32 @@ -219,7 +280,70 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ManyRequestsResponse' + $ref: '#/components/schemas/TooManyRequestsResponse' + delete: + tags: + - Fingerprint + operationId: deleteVisitorData + summary: Delete data by visitor ID + description: > + Request deleting all data associated with the specified visitor ID. This + API is useful for compliance with privacy regulations. + + All delete requests are queued: + + + * Recent data (10 days or newer) belonging to the specified visitor will + be deleted within 24 hours. + + * Data from older (11 days or more) identification events will be + deleted after 90 days. + + + If you are interested in using this API, please [contact our support + team](https://fingerprint.com/support/) to enable it for you. Otherwise, + you will receive a 403. + parameters: + - name: visitor_id + in: path + description: >- + The [visitor + ID](https://dev.fingerprint.com/docs/js-agent#visitorid) you want to + delete. + required: true + schema: + type: string + responses: + '200': + description: OK. The visitor ID is scheduled for deletion. + '400': + description: >- + Bad request. The visitor ID parameter is missing or in the wrong + format. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorVisitor400Response' + '403': + description: Forbidden. Access to this API is denied. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorCommon403Response' + '404': + description: >- + Not found. The visitor ID cannot be found in this application's + data. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorVisitor404Response' + '429': + description: Too Many Requests. The request is throttled. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorCommon429Response' /webhook: trace: tags: @@ -346,6 +470,7 @@ paths: timezoneMismatch: false publicVPN: false auxiliaryMobile: false + osMismatch: false proxy: result: false tampering: @@ -388,6 +513,25 @@ paths: result: true suspectScore: result: 0 + remoteControl: + result: false + velocity: + distinctIp: + intervals: + 5m: 1 + 1h: 1 + 24h: 1 + distinctLinkedId: {} + distinctCountry: + intervals: + 5m: 1 + 1h: 2 + 24h: 2 + events: + intervals: + 5m: 1 + 1h: 5 + 24h: 5 responses: default: description: The server doesn't validate the answer. @@ -547,28 +691,30 @@ components: description: >- Fields `lastTimestamp` and `paginationKey` added when `limit` or `before` parameter provided and there is more data to show - ErrorEvent403Response: + ErrorCommon403Response: type: object additionalProperties: false properties: error: type: object additionalProperties: false - title: ErrorEvent403ResponseError + title: Common403ErrorResponse properties: code: type: string description: | Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty - * `TokenNotFound` - subscription not found for specified secret key - * `SubscriptionNotActive` - subscription is not active - * `WrongRegion` - server and subscription region differ + * `TokenNotFound` - No Fingerprint application found for specified secret key + * `SubscriptionNotActive` - Fingerprint application is not active + * `WrongRegion` - server and application region differ + * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application enum: - TokenRequired - TokenNotFound - SubscriptionNotActive - WrongRegion + - FeatureNotEnabled example: TokenRequired message: type: string @@ -576,6 +722,27 @@ components: required: - code - message + ErrorCommon429Response: + type: object + additionalProperties: false + properties: + error: + type: object + additionalProperties: false + properties: + code: + type: string + description: | + Error code: * `TooManyRequests` - The request is throttled. + enum: + - TooManyRequests + example: TooManyRequests + message: + type: string + example: request throttled + required: + - code + - message ErrorEvent404Response: type: object additionalProperties: false @@ -589,7 +756,7 @@ components: type: string description: | Error code: - * `RequestNotFound` - request not found for specified id + * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. enum: - RequestNotFound example: RequestNotFound @@ -609,7 +776,7 @@ components: example: Forbidden (HTTP 403) required: - error - ManyRequestsResponse: + TooManyRequestsResponse: type: object additionalProperties: false properties: @@ -619,6 +786,51 @@ components: example: request throttled required: - error + ErrorVisitor404Response: + type: object + additionalProperties: false + properties: + error: + type: object + additionalProperties: false + title: ErrorVisitor404ResponseError + properties: + code: + type: string + description: > + Error code: * `VisitorNotFound` - The specified visitor ID was + not found. It never existed or it may have already been deleted. + enum: + - VisitorNotFound + example: VisitorNotFound + message: + type: string + example: visitor not found + required: + - code + - message + ErrorVisitor400Response: + type: object + additionalProperties: false + properties: + error: + type: object + additionalProperties: false + properties: + code: + type: string + description: > + Error code: * `RequestCannotBeParsed` - The visitor ID parameter + is missing or in the wrong format. + enum: + - RequestCannotBeParsed + example: RequestCannotBeParsed + message: + type: string + example: invalid visitor id + required: + - code + - message WebhookVisit: type: object properties: @@ -674,6 +886,10 @@ components: $ref: '#/components/schemas/LocationSpoofingResult' suspectScore: $ref: '#/components/schemas/SuspectScoreResult' + remoteControl: + $ref: '#/components/schemas/RemoteControlResult' + velocity: + $ref: '#/components/schemas/VelocityResult' requestId: description: Unique identifier of the user's identification request. type: string @@ -942,6 +1158,12 @@ components: format: float minimum: 0 maximum: 1 + revision: + description: >- + The revision name of the method used to calculate the Confidence + score. This field is only present for customers who opted in to an + alternative calculation method. + type: string required: - score title: Confidence @@ -1234,7 +1456,7 @@ components: data: $ref: '#/components/schemas/IncognitoResult' error: - $ref: '#/components/schemas/ProductError' + $ref: '#/components/schemas/IdentificationError' rootApps: title: SignalResponseRootApps type: object @@ -1351,7 +1573,7 @@ components: data: $ref: '#/components/schemas/TamperingResult' error: - $ref: '#/components/schemas/ProductError' + $ref: '#/components/schemas/IdentificationError' highActivity: title: SignalResponseHighActivity type: object @@ -1386,6 +1608,24 @@ components: properties: data: $ref: '#/components/schemas/RawDeviceAttributesResult' + error: + $ref: '#/components/schemas/IdentificationError' + remoteControl: + title: SignalResponseRemoteControl + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/RemoteControlResult' + error: + $ref: '#/components/schemas/ProductError' + velocity: + title: SignalResponseVelocity + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/VelocityResult' error: $ref: '#/components/schemas/ProductError' EventResponse: @@ -1582,8 +1822,8 @@ components: timezoneMismatch: type: boolean description: >- - User's browser timezone doesn't match the timezone from which - the request was originally made. + The browser timezone doesn't match the timezone inferred from + the request IP address. example: false publicVPN: type: boolean @@ -1597,10 +1837,17 @@ components: This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. example: false + osMismatch: + type: boolean + description: >- + The browser runs on a different operating system than the + operating system inferred from the request network signature. + example: false required: - timezoneMismatch - publicVPN - auxiliaryMobile + - osMismatch required: - result - originTimezone @@ -1672,6 +1919,36 @@ components: example: 0 required: - result + VelocityResult: + type: object + description: > + Sums key data points for a specific `visitorId` at three distinct time + intervals: 5 minutes, 1 hour, and 24 hours as follows: + + - Number of identification events attributed to the visitor ID - Number + of distinct IP addresses associated to the visitor ID. - Number of + distinct countries associated with the visitor ID. - Number of distinct + `linkedId`s associated with the visitor ID. + + The `24h` interval of `distinctIp`, `distinctLinkedId`, and + `distinctCountry` will be omitted if the number of `events` for the + visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher + than 20.000. + additionalProperties: false + properties: + distinctIp: + $ref: '#/components/schemas/VelocityIntervals' + distinctLinkedId: + $ref: '#/components/schemas/VelocityIntervals' + distinctCountry: + $ref: '#/components/schemas/VelocityIntervals' + events: + $ref: '#/components/schemas/VelocityIntervals' + required: + - distinctIp + - distinctLinkedId + - distinctCountry + - events RawDeviceAttributesResult: type: object description: > @@ -1877,3 +2154,114 @@ components: required: - code - message + RemoteControlResult: + type: object + additionalProperties: false + properties: + result: + type: boolean + description: > + `true` if the request came from a machine being remotely controlled + (e.g. TeamViewer), `false` otherwise. + example: false + required: + - result + EventUpdateRequest: + type: object + properties: + linkedId: + type: string + description: LinkedID value to assign to the existing event + tag: + type: object + description: >- + Full `tag` value to be set to the existing event. Replaces any + existing `tag` payload completely. + suspect: + type: boolean + description: Suspect flag indicating observed suspicious or fraudulent event + ErrorUpdateEvent400Response: + type: object + additionalProperties: false + properties: + error: + type: object + additionalProperties: false + title: ErrorUpdateEvent400ResponseError + properties: + code: + type: string + description: > + Error code: * `RequestCannotBeParsed` - the JSON content of the + request contains some errors that prevented us from parsing it + (wrong type/surpassed limits) * `Failed` - the event is more + than 10 days old and cannot be updated + enum: + - RequestCannotBeParsed + - Failed + example: RequestCannotBeParsed + message: + type: string + description: Details about the underlying issue with the input payload + example: suspect flag must be a boolean + required: + - code + - message + ErrorUpdateEvent409Response: + type: object + additionalProperties: false + properties: + error: + type: object + additionalProperties: false + title: ErrorUpdateEvent409ResponseError + properties: + code: + type: string + description: > + Error code: * `StateNotReady` - The event specified with request + id is not ready for updates yet. Try again. + + This error happens in rare cases when update API is called + immediately after receiving the request id on the client. In + case you need to send information right away, we recommend using + the JS agent API instead. + enum: + - StateNotReady + example: StateNotReady + message: + type: string + example: resource is not mutable yet, try again + required: + - code + - message + VelocityIntervals: + type: object + additionalProperties: false + properties: + intervals: + $ref: '#/components/schemas/VelocityIntervalResult' + VelocityIntervalResult: + type: object + description: > + Is absent if the velocity data could not be generated for the visitor + ID. + additionalProperties: false + properties: + 5m: + type: integer + example: 1 + 1h: + type: integer + example: 1 + 24h: + type: integer + description: > + The `24h` interval of `distinctIp`, `distinctLinkedId`, and + `distinctCountry` will be omitted if the number of `events`` for the + visitor ID in the last 24 hours (`events.intervals.['24h']`) is + higher than 20.000. + example: 1 + required: + - 5m + - 1h diff --git a/sync.sh b/sync.sh index 93794e02..5125b396 100755 --- a/sync.sh +++ b/sync.sh @@ -17,12 +17,29 @@ examplesList=( 'get_event_200_botd_too_many_requests_error.json' 'get_event_200_identification_failed_error.json' 'get_event_200_identification_too_many_requests_error.json' + 'update_event_400_error.json' + 'update_event_403_error.json' + 'update_event_404_error.json' + 'update_event_409_error.json' +) + +sharedExamplesList=( + '400_error_empty_visitor_id.json' + '400_error_incorrect_visitor_id.json' + '403_error_feature_not_enabled.json' + '403_error_token_not_found.json' + '403_error_token_required.json' + '403_error_wrong_region.json' + '404_error_visitor_not_found.json' + '429_error_too_many_requests.json' ) for example in ${examplesList[*]}; do curl -o ./test/mocks/"$example" https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/examples/"$example" done -cp ./test/mocks/visits_too_many_requests_error.json ./test/mocks/visits_too_many_requests_error_empty_header.json +for example in ${sharedExamplesList[*]}; do + curl -o ./test/mocks/"$example" https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/examples/shared/"$example" +done ./generate.sh diff --git a/template/README.mustache b/template/README.mustache index 40484b9a..7d2c7e75 100644 --- a/template/README.mustache +++ b/template/README.mustache @@ -101,11 +101,11 @@ from {{packageName}}.rest import ApiException, KnownApiException configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY") api_instance = {{packageName}}.FingerprintApi(configuration) -visitor_id = 'visitor_id_example' # str | -#request_id = 'request_id_example' # str | Filter events by requestId (optional) -#linked_id = 'linked_id_example' # str | Filter events by custom identifier (optional) -limit = 10 # int | Limit scanned results (optional) -#before = 56 # int | Used to paginate results (optional) +visitor_id = 'visitor_id_example' # str | Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. +#request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). +#linked_id = 'linked_id_example' # str | Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. (optional) +limit = 10 # int | Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. (optional) +#pagination_key = 'pagination_key_example' # str | Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned. (optional) try: api_response: Response = api_instance.get_visits(visitor_id, limit=2) @@ -114,7 +114,26 @@ except KnownApiException as e: structured_error = e.structured_error print("Error: %s\n" % structured_error.error) except ApiException as e: - print("Exception when calling DefaultApi->visitors_visitor_id_get: %s\n" % e) + print("Exception when calling FingerprintApi->visitors_visitor_id_get: %s\n" % e) +``` + +Delete visits using visitorId: +```python +import {{packageName}} +from {{packageName}}.rest import ApiException, KnownApiException + +configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY") +api_instance = {{packageName}}.FingerprintApi(configuration) + +visitor_id = 'visitor_id_example' # str | Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. + +try: + api_instance.delete_visitor_data(visitor_id) +except KnownApiException as e: + structured_error = e.structured_error + print("Error: %s\n" % structured_error.error) +except ApiException as e: + print("Exception when calling FingerprintApi->delete_visitor_data: %s\n" % e) ``` Fetching events for requestId: @@ -126,7 +145,7 @@ from {{packageName}}.rest import ApiException, KnownApiException configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY") api_instance = {{packageName}}.FingerprintApi(configuration) -request_id = 'request_id_example' # str +request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). try: events_response: EventResponse = api_instance.get_event(request_id) @@ -135,7 +154,31 @@ except KnownApiException as e: structured_error = e.structured_error print("Error code: %s. Error message: %s\n" % (structured_error.error.code, structured_error.error.message)) except ApiException as e: - print("Exception when calling DefaultApi->get_event: %s\n" % e) + print("Exception when calling FingerprintApi->get_event: %s\n" % e) +``` + +Update event for requestId: +```python +import {{packageName}} +from {{packageName}} import EventUpdateRequest +from {{packageName}}.rest import ApiException, KnownApiException + +configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY") +api_instance = {{packageName}}.FingerprintApi(configuration) + +request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). +body = EventUpdateRequest(linked_id='foo') # EventUpdateRequest | +# body = EventUpdateRequest(tag={'bar': 123}) +# body = EventUpdateRequest(suspect=True) +# body = EventUpdateRequest(linked_id='foo', tag={'bar': 123}, suspect=False) + +try: + api_instance.update_event(request_id, body) +except KnownApiException as e: + structured_error = e.structured_error + print("Error code: %s. Error message: %s\n" % (structured_error.error.code, structured_error.error.message)) +except ApiException as e: + print("Exception when calling FingerprintApi->update_event: %s\n" % e) ``` ## Sealed results @@ -216,4 +259,4 @@ If you need private support, you can email us at [oss-support@fingerprint.com](m ## License -This project is licensed under the [MIT License](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/blob/main/LICENSE). \ No newline at end of file +This project is licensed under the [MIT License](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/blob/main/LICENSE). diff --git a/template/api_doc.mustache b/template/api_doc.mustache index 16ee8890..5ea305ba 100644 --- a/template/api_doc.mustache +++ b/template/api_doc.mustache @@ -29,17 +29,16 @@ configuration = {{{packageName}}}.Configuration(api_key="SECRET_API_KEY") # create an instance of the API class api_instance = {{{packageName}}}.FingerprintApi(configuration) -visitor_id = 'visitor_id_example' # str | -#request_id = 'request_id_example' # str | Filter events by requestId (optional) -#linked_id = 'linked_id_example' # str | Filter events by custom identifier (optional) -limit = 10 # int | Limit scanned results (optional) -#before = 56 # int | Used to paginate results (optional) + +{{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} +{{/allParams}} try: - api_response: Response = api_instance.get_visits(visitor_id, limit=2) - print(api_response) +{{#summary}} # {{{.}}} +{{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}} + print(api_response){{/returnType}} except ApiException as e: - print("Exception when calling DefaultApi->visitors_visitor_id_get: %s\n" % e) + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) ``` ### Parameters diff --git a/template/model.mustache b/template/model.mustache index 0be26d6a..17bb18f2 100644 --- a/template/model.mustache +++ b/template/model.mustache @@ -192,6 +192,8 @@ class {{classname}}(object): if hasattr(item[1], "to_dict") else item, value.items() )) + elif value is None: + continue else: result[attr] = value if issubclass({{classname}}, dict): diff --git a/test/mocks/400_error_empty_visitor_id.json b/test/mocks/400_error_empty_visitor_id.json new file mode 100644 index 00000000..6c5801a0 --- /dev/null +++ b/test/mocks/400_error_empty_visitor_id.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "RequestCannotBeParsed", + "message": "visitor id is required" + } +} diff --git a/test/mocks/400_error_incorrect_visitor_id.json b/test/mocks/400_error_incorrect_visitor_id.json new file mode 100644 index 00000000..c204c568 --- /dev/null +++ b/test/mocks/400_error_incorrect_visitor_id.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "RequestCannotBeParsed", + "message": "invalid visitor id" + } +} diff --git a/test/mocks/403_error_feature_not_enabled.json b/test/mocks/403_error_feature_not_enabled.json new file mode 100644 index 00000000..9820a568 --- /dev/null +++ b/test/mocks/403_error_feature_not_enabled.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "FeatureNotEnabled", + "message": "feature not enabled" + } +} diff --git a/test/mocks/403_error_token_not_found.json b/test/mocks/403_error_token_not_found.json new file mode 100644 index 00000000..3936b530 --- /dev/null +++ b/test/mocks/403_error_token_not_found.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "TokenNotFound", + "message": "secret key is not found" + } +} diff --git a/test/mocks/403_error_token_required.json b/test/mocks/403_error_token_required.json new file mode 100644 index 00000000..544d8714 --- /dev/null +++ b/test/mocks/403_error_token_required.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "TokenRequired", + "message": "secret key is required" + } +} diff --git a/test/mocks/403_error_wrong_region.json b/test/mocks/403_error_wrong_region.json new file mode 100644 index 00000000..8acc9e01 --- /dev/null +++ b/test/mocks/403_error_wrong_region.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "WrongRegion", + "message": "wrong region" + } +} diff --git a/test/mocks/404_error_visitor_not_found.json b/test/mocks/404_error_visitor_not_found.json new file mode 100644 index 00000000..11da4f3d --- /dev/null +++ b/test/mocks/404_error_visitor_not_found.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "VisitorNotFound", + "message": "visitor not found" + } +} diff --git a/test/mocks/429_error_too_many_requests.json b/test/mocks/429_error_too_many_requests.json new file mode 100644 index 00000000..e38639aa --- /dev/null +++ b/test/mocks/429_error_too_many_requests.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } +} diff --git a/test/mocks/get_event_200.json b/test/mocks/get_event_200.json index 7de02fd2..0769ddb1 100644 --- a/test/mocks/get_event_200.json +++ b/test/mocks/get_event_200.json @@ -178,7 +178,8 @@ "methods": { "timezoneMismatch": false, "publicVPN": false, - "auxiliaryMobile": false + "auxiliaryMobile": false, + "osMismatch": false } } }, @@ -271,6 +272,37 @@ "data": { "result": false } + }, + "remoteControl": { + "data": { + "result": false + } + }, + "velocity": { + "data": { + "distinctIp": { + "intervals": { + "5m": 1, + "1h": 1, + "24h": 1 + } + }, + "distinctLinkedId": {}, + "distinctCountry": { + "intervals": { + "5m": 1, + "1h": 2, + "24h": 2 + } + }, + "events": { + "intervals": { + "5m": 1, + "1h": 5, + "24h": 5 + } + } + } } } -} +} \ No newline at end of file diff --git a/test/mocks/get_event_200_all_errors.json b/test/mocks/get_event_200_all_errors.json index 8245e5d2..1308990d 100644 --- a/test/mocks/get_event_200_all_errors.json +++ b/test/mocks/get_event_200_all_errors.json @@ -135,6 +135,18 @@ "code": "Failed", "message": "internal server error" } + }, + "remoteControl": { + "error": { + "code": "Failed", + "message": "internal server error" + } + }, + "velocity": { + "error": { + "code": "Failed", + "message": "internal server error" + } } } } diff --git a/test/mocks/get_event_200_extra_fields.json b/test/mocks/get_event_200_extra_fields.json index cef43a2c..c15eb568 100644 --- a/test/mocks/get_event_200_extra_fields.json +++ b/test/mocks/get_event_200_extra_fields.json @@ -45,7 +45,8 @@ "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." }, "confidence": { - "score": 0.97 + "score": 0.97, + "revision": "v1.1" }, "visitorFound": true, "firstSeenAt": { diff --git a/test/mocks/update_event_400_error.json b/test/mocks/update_event_400_error.json new file mode 100644 index 00000000..78568329 --- /dev/null +++ b/test/mocks/update_event_400_error.json @@ -0,0 +1,6 @@ +{ + "error": { + "code":"RequestCannotBeParsed", + "message":"request body is not valid" + } +} diff --git a/test/mocks/update_event_403_error.json b/test/mocks/update_event_403_error.json new file mode 100644 index 00000000..544d8714 --- /dev/null +++ b/test/mocks/update_event_403_error.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "TokenRequired", + "message": "secret key is required" + } +} diff --git a/test/mocks/update_event_404_error.json b/test/mocks/update_event_404_error.json new file mode 100644 index 00000000..389b351c --- /dev/null +++ b/test/mocks/update_event_404_error.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "RequestNotFound", + "message": "request id is not found" + } +} diff --git a/test/mocks/update_event_409_error.json b/test/mocks/update_event_409_error.json new file mode 100644 index 00000000..16ad29ae --- /dev/null +++ b/test/mocks/update_event_409_error.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "StateNotReady", + "message": "resource is not mutable yet, try again" + } +} diff --git a/test/mocks/webhook.json b/test/mocks/webhook.json index f480e3e8..781e9c78 100644 --- a/test/mocks/webhook.json +++ b/test/mocks/webhook.json @@ -123,7 +123,8 @@ "methods": { "timezoneMismatch": false, "publicVPN": false, - "auxiliaryMobile": false + "auxiliaryMobile": false, + "osMismatch": false } }, "proxy": { @@ -187,5 +188,32 @@ }, "suspectScore": { "result": 0 + }, + "remoteControl": { + "result": false + }, + "velocity": { + "distinctIp": { + "intervals": { + "5m": 1, + "1h": 1, + "24h": 1 + } + }, + "distinctLinkedId": {}, + "distinctCountry": { + "intervals": { + "5m": 1, + "1h": 2, + "24h": 2 + } + }, + "events": { + "intervals": { + "5m": 1, + "1h": 5, + "24h": 5 + } + } } } diff --git a/test/test_fingerprint_api.py b/test/test_fingerprint_api.py index b64e953c..dc5464c1 100644 --- a/test/test_fingerprint_api.py +++ b/test/test_fingerprint_api.py @@ -17,10 +17,13 @@ import urllib3 -from fingerprint_pro_server_api_sdk import Configuration, ManyRequestsResponse, ErrorVisits403, ErrorEvent403Response, \ - ErrorEvent404Response +from fingerprint_pro_server_api_sdk import (Configuration, TooManyRequestsResponse, ErrorVisits403, + ErrorCommon403Response, ErrorEvent404Response, ErrorVisitor400Response, + ErrorVisitor404Response, ErrorCommon429Response, EventUpdateRequest, + ErrorUpdateEvent400Response, ErrorUpdateEvent409Response) from fingerprint_pro_server_api_sdk.api.fingerprint_api import FingerprintApi # noqa: E501 from fingerprint_pro_server_api_sdk.rest import KnownApiException +from six.moves.urllib.parse import urlencode API_KEY = 'private_key' @@ -46,12 +49,18 @@ def request(self, *args, **kwargs): if r[1].get('status') is not None: status = r[1].get('status') r[1].pop('status') + + if r[1].get('method') != 'GET': + request_path = r[0][1].split('?')[0] + else: + request_path = r[0][1] + self._tc.maxDiff = None self._tc.assertEqual(r[0], args) self._tc.assertEqual(r[1], kwargs) # TODO Add support for more complex paths? - mock_file_by_first_argument = MockPoolManager.get_mock_from_path(r[0][1]) + mock_file_by_first_argument = MockPoolManager.get_mock_from_path(request_path) if mock_file_by_first_argument == 'bad_text_data': return urllib3.HTTPResponse(status=200, body='really bad data') @@ -59,6 +68,10 @@ def request(self, *args, **kwargs): return urllib3.HTTPResponse(status=200, body='{}') if mock_file_by_first_argument == 'empty_event_answer': return urllib3.HTTPResponse(status=200, body='{"products": {}}') + if mock_file_by_first_argument == 'delete_visitor': + return urllib3.HTTPResponse(status=200, body='OK') + if mock_file_by_first_argument == 'update_event': + return urllib3.HTTPResponse(status=200, body='OK') try: with io.open('./test/mocks/' + mock_file_by_first_argument, 'r', encoding='utf-8') as mock_file: answer_mock = mock_file.read() @@ -92,7 +105,7 @@ def tearDown(self): pass @staticmethod - def get_get_visits_method_path(visitor_id, region='us'): + def get_visitors_path(visitor_id, region='us'): domain = { "us": "api.fpjs.io", "eu": "eu.api.fpjs.io", @@ -101,7 +114,7 @@ def get_get_visits_method_path(visitor_id, region='us'): return 'https://%s/visitors/%s' % (domain, visitor_id) @staticmethod - def get_get_event_method_path(request_id, region='us'): + def get_events_path(request_id, region='us'): domain = { "us": "api.fpjs.io", "eu": "eu.api.fpjs.io", @@ -117,16 +130,16 @@ def test_get_visits_correct_data(self): mock_file2 = 'get_visits_200_limit_500.json' mock_file3 = 'get_visits_200_limit_500.json' mock_file4 = 'get_visits_200_limit_500.json' - mock_pool.expect_request('GET', TestFingerprintApi.get_get_visits_method_path(visitor_id=mock_file1), + mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=mock_file1), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) - mock_pool.expect_request('GET', TestFingerprintApi.get_get_visits_method_path(visitor_id=mock_file2), + mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=mock_file2), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) - mock_pool.expect_request('GET', TestFingerprintApi.get_get_visits_method_path(visitor_id=mock_file3), + mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=mock_file3), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) - mock_pool.expect_request('GET', TestFingerprintApi.get_get_visits_method_path(visitor_id=mock_file4), + mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=mock_file4), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) self.api.get_visits(mock_file1) @@ -137,7 +150,7 @@ def test_get_visits_error_403(self): mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool mock_file = 'get_visits_403_error.json' - mock_pool.expect_request('GET', TestFingerprintApi.get_get_visits_method_path(visitor_id=mock_file), + mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=mock_file), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None, status=403) with self.assertRaises(KnownApiException) as context: @@ -151,13 +164,13 @@ def test_get_visits_error_429(self): mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool mock_file = 'get_visits_429_too_many_requests_error.json' - mock_pool.expect_request('GET', TestFingerprintApi.get_get_visits_method_path(visitor_id=mock_file), + mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=mock_file), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None, status=429) with self.assertRaises(KnownApiException) as context: self.api.get_visits(mock_file) self.assertEqual(context.exception.status, 429) - self.assertIsInstance(context.exception.structured_error, ManyRequestsResponse) + self.assertIsInstance(context.exception.structured_error, TooManyRequestsResponse) self.assertEqual(context.exception.structured_error.retry_after, 4) def test_get_visits_error_429_empty_retry_after(self): @@ -165,13 +178,13 @@ def test_get_visits_error_429_empty_retry_after(self): mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool mock_file = 'get_visits_429_too_many_requests_error_empty_header.json' - mock_pool.expect_request('GET', TestFingerprintApi.get_get_visits_method_path(visitor_id=mock_file), + mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=mock_file), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None, status=429) with self.assertRaises(KnownApiException) as context: self.api.get_visits(mock_file) self.assertEqual(context.exception.status, 429) - self.assertIsInstance(context.exception.structured_error, ManyRequestsResponse) + self.assertIsInstance(context.exception.structured_error, TooManyRequestsResponse) self.assertEqual(context.exception.structured_error.retry_after, 1) def test_get_event_correct_data(self): @@ -179,7 +192,7 @@ def test_get_event_correct_data(self): mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool mock_file1 = 'get_event_200.json' - mock_pool.expect_request('GET', TestFingerprintApi.get_get_event_method_path(request_id=mock_file1), + mock_pool.expect_request('GET', TestFingerprintApi.get_events_path(request_id=mock_file1), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) @@ -194,21 +207,21 @@ def test_get_event_errors_200(self): mock_file_identification_fail = 'get_event_200_identification_failed_error.json' mock_file_identification_429 = 'get_event_200_identification_too_many_requests_error.json' mock_file_all_errors = 'get_event_200_all_errors.json' - mock_pool.expect_request('GET', TestFingerprintApi.get_get_event_method_path(request_id=mock_file_botd_fail), + mock_pool.expect_request('GET', TestFingerprintApi.get_events_path(request_id=mock_file_botd_fail), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) - mock_pool.expect_request('GET', TestFingerprintApi.get_get_event_method_path(request_id=mock_file_botd_429), + mock_pool.expect_request('GET', TestFingerprintApi.get_events_path(request_id=mock_file_botd_429), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) mock_pool.expect_request('GET', - TestFingerprintApi.get_get_event_method_path(request_id=mock_file_identification_fail), + TestFingerprintApi.get_events_path(request_id=mock_file_identification_fail), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) mock_pool.expect_request('GET', - TestFingerprintApi.get_get_event_method_path(request_id=mock_file_identification_429), + TestFingerprintApi.get_events_path(request_id=mock_file_identification_429), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) - mock_pool.expect_request('GET', TestFingerprintApi.get_get_event_method_path(request_id=mock_file_all_errors), + mock_pool.expect_request('GET', TestFingerprintApi.get_events_path(request_id=mock_file_all_errors), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) @@ -223,20 +236,20 @@ def test_get_event_error_403(self): mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool mock_file = 'get_event_403_error.json' - mock_pool.expect_request('GET', TestFingerprintApi.get_get_event_method_path(request_id=mock_file), + mock_pool.expect_request('GET', TestFingerprintApi.get_events_path(request_id=mock_file), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None, status=403) with self.assertRaises(KnownApiException) as context: self.api.get_event(mock_file) self.assertEqual(context.exception.status, 403) - self.assertIsInstance(context.exception.structured_error, ErrorEvent403Response) + self.assertIsInstance(context.exception.structured_error, ErrorCommon403Response) def test_get_event_error_404(self): """Test checks correct code run result in case of 403 error""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool mock_file = 'get_event_404_error.json' - mock_pool.expect_request('GET', TestFingerprintApi.get_get_event_method_path(request_id=mock_file), + mock_pool.expect_request('GET', TestFingerprintApi.get_events_path(request_id=mock_file), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None, status=404) with self.assertRaises(KnownApiException) as context: @@ -249,7 +262,7 @@ def test_get_event_empty_data(self): mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool mocked_id = 'empty_event_answer' - mock_pool.expect_request('GET', TestFingerprintApi.get_get_event_method_path(request_id=mocked_id), + mock_pool.expect_request('GET', TestFingerprintApi.get_events_path(request_id=mocked_id), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) @@ -265,7 +278,7 @@ def test_get_visits_empty_answer(self): mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool mocked_id = 'empty_answer' - mock_pool.expect_request('GET', TestFingerprintApi.get_get_visits_method_path(visitor_id=mocked_id), + mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=mocked_id), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) self.assertEqual(self.api.get_visits(mocked_id).visits, []) @@ -275,7 +288,7 @@ def test_get_visits_bad_text_data(self): mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool mocked_id = 'bad_text_data' - mock_pool.expect_request('GET', TestFingerprintApi.get_get_visits_method_path(visitor_id=mocked_id), + mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=mocked_id), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) with self.assertRaises(ValueError): @@ -286,7 +299,7 @@ def test_get_visits_bad_json_data(self): mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool mocked_id = 'bad_json_data' - mock_pool.expect_request('GET', TestFingerprintApi.get_get_visits_method_path(visitor_id=mocked_id), + mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=mocked_id), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) with self.assertRaises(ValueError): @@ -300,7 +313,7 @@ def test_init_with_us_region(self): self.api.api_client.rest_client.pool_manager = mock_pool mocked_id = 'empty_answer' mock_pool.expect_request('GET', - TestFingerprintApi.get_get_visits_method_path(visitor_id=mocked_id, region="us"), + TestFingerprintApi.get_visitors_path(visitor_id=mocked_id, region="us"), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) self.assertEqual(self.api.get_visits(mocked_id).visits, []) @@ -313,7 +326,7 @@ def test_init_with_eu_region(self): self.api.api_client.rest_client.pool_manager = mock_pool mocked_id = 'empty_answer' mock_pool.expect_request('GET', - TestFingerprintApi.get_get_visits_method_path(visitor_id=mocked_id, region="eu"), + TestFingerprintApi.get_visitors_path(visitor_id=mocked_id, region="eu"), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) self.assertEqual(self.api.get_visits(mocked_id).visits, []) @@ -326,11 +339,189 @@ def test_init_with_ap_region(self): self.api.api_client.rest_client.pool_manager = mock_pool mocked_id = 'empty_answer' mock_pool.expect_request('GET', - TestFingerprintApi.get_get_visits_method_path(visitor_id=mocked_id, region="ap"), + TestFingerprintApi.get_visitors_path(visitor_id=mocked_id, region="ap"), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) self.assertEqual(self.api.get_visits(mocked_id).visits, []) + def test_delete_visitor_data(self): + """Test that delete visit method works""" + mock_pool = MockPoolManager(self) + self.api.api_client.rest_client.pool_manager = mock_pool + mocked_id = 'delete_visitor' + mock_pool.expect_request('DELETE', + TestFingerprintApi.get_visitors_path(visitor_id=mocked_id) + '?' + urlencode( + [self.integration_info]), + body='{}', headers=self.request_headers, preload_content=True, timeout=None) + self.api.delete_visitor_data(mocked_id) + + def test_delete_visitor_data_400_error(self): + """Test that delete visit method returns 400 error""" + mock_pool = MockPoolManager(self) + self.api.api_client.rest_client.pool_manager = mock_pool + mocks = ['400_error_empty_visitor_id.json', '400_error_incorrect_visitor_id.json'] + + for mock_file in mocks: + mock_pool.expect_request('DELETE', + TestFingerprintApi.get_visitors_path(visitor_id=mock_file) + '?' + urlencode( + [self.integration_info]), + body='{}', headers=self.request_headers, preload_content=True, timeout=None, + status=400) + for mock_file in mocks: + with self.assertRaises(KnownApiException) as context: + self.api.delete_visitor_data(mock_file) + self.assertEqual(context.exception.status, 400) + self.assertIsInstance(context.exception.structured_error, ErrorVisitor400Response) + + def test_delete_visitor_data_403_error(self): + """Test that delete visit method returns 403 error""" + mock_pool = MockPoolManager(self) + self.api.api_client.rest_client.pool_manager = mock_pool + mocks = ['403_error_feature_not_enabled.json', + '403_error_token_not_found.json', + '403_error_token_required.json', + '403_error_wrong_region.json'] + + for mock_file in mocks: + mock_pool.expect_request('DELETE', + TestFingerprintApi.get_visitors_path(visitor_id=mock_file) + '?' + urlencode( + [self.integration_info]), + body='{}', headers=self.request_headers, preload_content=True, timeout=None, + status=403) + + for mock_file in mocks: + with self.assertRaises(KnownApiException) as context: + self.api.delete_visitor_data(mock_file) + self.assertEqual(context.exception.status, 403) + self.assertIsInstance(context.exception.structured_error, ErrorCommon403Response) + + def test_delete_visitor_data_404_error(self): + """Test that delete visit method returns 404 error""" + mock_pool = MockPoolManager(self) + self.api.api_client.rest_client.pool_manager = mock_pool + + mock_file = '404_error_visitor_not_found.json' + mock_pool.expect_request('DELETE', + TestFingerprintApi.get_visitors_path(visitor_id=mock_file) + '?' + urlencode( + [self.integration_info]), + body='{}', headers=self.request_headers, preload_content=True, timeout=None, + status=404) + + with self.assertRaises(KnownApiException) as context: + self.api.delete_visitor_data(mock_file) + self.assertEqual(context.exception.status, 404) + self.assertIsInstance(context.exception.structured_error, ErrorVisitor404Response) + + def test_delete_visitor_data_429_error(self): + """Test that delete visit method returns 429 error""" + mock_pool = MockPoolManager(self) + self.api.api_client.rest_client.pool_manager = mock_pool + + mock_file = '429_error_too_many_requests.json' + mock_pool.expect_request('DELETE', + TestFingerprintApi.get_visitors_path(visitor_id=mock_file) + '?' + urlencode( + [self.integration_info]), + body='{}', headers=self.request_headers, preload_content=True, timeout=None, + status=429) + + with self.assertRaises(KnownApiException) as context: + self.api.delete_visitor_data(mock_file) + self.assertEqual(context.exception.status, 429) + self.assertIsInstance(context.exception.structured_error, ErrorCommon429Response) + + def test_update_event(self): + """Test that update event method returns 200""" + test_cases = [ + (EventUpdateRequest(linked_id='qwe'), '{"linkedId": "qwe"}'), + (EventUpdateRequest(tag={'qwe': 123}), '{"tag": {"qwe": 123}}'), + (EventUpdateRequest(suspect=False), '{"suspect": false}'), + (EventUpdateRequest(suspect=True), '{"suspect": true}'), + (EventUpdateRequest(linked_id='qwe', tag={'qwe': 123}, suspect=False), + '{"linkedId": "qwe", "tag": {"qwe": 123}, "suspect": false}') + ] + + mock_pool = MockPoolManager(self) + self.api.api_client.rest_client.pool_manager = mock_pool + + mock_file = 'update_event' + + for (update_body, serialized_body) in test_cases: + mock_pool.expect_request('PUT', + TestFingerprintApi.get_events_path(request_id=mock_file) + '?' + urlencode( + [self.integration_info]), + headers=self.request_headers, preload_content=True, timeout=None, status=200, + body=serialized_body) + + self.api.update_event(update_body, mock_file) + + def test_update_event_400_error(self): + """Test that delete visit method returns 400 error""" + mock_pool = MockPoolManager(self) + self.api.api_client.rest_client.pool_manager = mock_pool + + mock_file = 'update_event_400_error.json' + mock_pool.expect_request('PUT', + TestFingerprintApi.get_events_path(request_id=mock_file) + '?' + urlencode( + [self.integration_info]), + headers=self.request_headers, preload_content=True, timeout=None, status=400, + body="{}") + + with self.assertRaises(KnownApiException) as context: + self.api.update_event({}, mock_file) + self.assertEqual(context.exception.status, 400) + self.assertIsInstance(context.exception.structured_error, ErrorUpdateEvent400Response) + + def test_update_event_403_error(self): + """Test that delete visit method returns 403 error""" + mock_pool = MockPoolManager(self) + self.api.api_client.rest_client.pool_manager = mock_pool + + mock_file = 'update_event_403_error.json' + mock_pool.expect_request('PUT', + TestFingerprintApi.get_events_path(request_id=mock_file) + '?' + urlencode( + [self.integration_info]), + headers=self.request_headers, preload_content=True, timeout=None, status=403, + body="{}") + + with self.assertRaises(KnownApiException) as context: + self.api.update_event({}, mock_file) + self.assertEqual(context.exception.status, 403) + self.assertIsInstance(context.exception.structured_error, ErrorCommon403Response) + + def test_update_event_404_error(self): + """Test that delete visit method returns 404 error""" + mock_pool = MockPoolManager(self) + self.api.api_client.rest_client.pool_manager = mock_pool + + mock_file = 'update_event_404_error.json' + mock_pool.expect_request('PUT', + TestFingerprintApi.get_events_path(request_id=mock_file) + '?' + urlencode( + [self.integration_info]), + headers=self.request_headers, preload_content=True, timeout=None, status=404, + body="{}") + + with self.assertRaises(KnownApiException) as context: + self.api.update_event({}, mock_file) + self.assertEqual(context.exception.status, 404) + self.assertIsInstance(context.exception.structured_error, ErrorEvent404Response) + + def test_update_event_409_error(self): + """Test that delete visit method returns 409 error""" + mock_pool = MockPoolManager(self) + self.api.api_client.rest_client.pool_manager = mock_pool + + mock_file = 'update_event_409_error.json' + mock_pool.expect_request('PUT', + TestFingerprintApi.get_events_path(request_id=mock_file) + '?' + urlencode( + [self.integration_info]), + headers=self.request_headers, preload_content=True, timeout=None, status=409, + body="{}") + + with self.assertRaises(KnownApiException) as context: + self.api.update_event({}, mock_file) + self.assertEqual(context.exception.status, 409) + self.assertIsInstance(context.exception.structured_error, ErrorUpdateEvent409Response) + if __name__ == '__main__': unittest.main() diff --git a/update_event_example.py b/update_event_example.py new file mode 100644 index 00000000..abbd3796 --- /dev/null +++ b/update_event_example.py @@ -0,0 +1,37 @@ +import os +import argparse + +import fingerprint_pro_server_api_sdk +from fingerprint_pro_server_api_sdk.rest import ApiException +from fingerprint_pro_server_api_sdk.models import EventUpdateRequest + +from dotenv import load_dotenv + +load_dotenv() +parser = argparse.ArgumentParser(description='Update an event in the Fingerprint Pro Server API') +parser.add_argument('--linked_id', type=str) +parser.add_argument('--tag', type=str) +parser.add_argument('--suspect', type=bool) + +args = parser.parse_args() +print(f'args: {args.linked_id}, {args.tag}, {args.suspect}') + +# configure +configuration = fingerprint_pro_server_api_sdk.Configuration( + api_key=os.environ["PRIVATE_KEY"], region=os.environ.get("REGION", "us")) + +# create an instance of the API class +api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration) +request_id = os.environ["REQUEST_ID_TO_UPDATE"] + +try: + updateBody = EventUpdateRequest(**vars(args)) + print(f'updateBody: {updateBody}') + api_instance.update_event(request_id, updateBody) +except ApiException as e: + print("Exception when calling DefaultApi->update_event: %s\n" % e) + exit(1) + +print("Visitor data updated!") + +exit(0)