Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/kind-walls-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fingerprint-pro-server-api-python-sdk": patch
---

Correctly serialize nullable fields to `null`
8 changes: 8 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mode": "pre",
"tag": "dev",
"initialVersions": {
"fingerprint-pro-server-api-python-sdk": "8.2.0"
},
"changesets": []
}
4 changes: 4 additions & 0 deletions fingerprint_pro_server_api_sdk/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class BaseModel:

swagger_types: Dict[str, str] = {}
attribute_map: Dict[str, str] = {}
nullable_map: Dict[str, bool] = {}

def to_dict(self) -> Dict[str, Union[list, dict]]:
"""Returns the model properties as a dict"""
Expand All @@ -28,6 +29,9 @@ def to_dict(self) -> Dict[str, Union[list, dict]]:
value.items()
))
elif value is None:
if self.nullable_map[attr]:
result[attr] = None

continue
else:
result[attr] = value
Expand Down
11 changes: 11 additions & 0 deletions fingerprint_pro_server_api_sdk/models/botd.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ class Botd(BaseModel):
'request_id': 'str'
}

nullable_map = {
'bot': False,
'meta': False,
'linked_id': False,
'url': False,
'ip': False,
'time': False,
'user_agent': False,
'request_id': False
}

attribute_map = {
'bot': 'bot',
'meta': 'meta',
Expand Down
5 changes: 5 additions & 0 deletions fingerprint_pro_server_api_sdk/models/botd_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ class BotdBot(BaseModel):
'type': 'str'
}

nullable_map = {
'result': False,
'type': False
}

attribute_map = {
'result': 'result',
'type': 'type'
Expand Down
3 changes: 3 additions & 0 deletions fingerprint_pro_server_api_sdk/models/botd_bot_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class BotdBotResult(BaseModel):
swagger_types = {
}

nullable_map = {
}

attribute_map = {
}

Expand Down
10 changes: 10 additions & 0 deletions fingerprint_pro_server_api_sdk/models/browser_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ class BrowserDetails(BaseModel):
'user_agent': 'str'
}

nullable_map = {
'browser_name': False,
'browser_major_version': False,
'browser_full_version': False,
'os': False,
'os_version': False,
'device': False,
'user_agent': False
}

attribute_map = {
'browser_name': 'browserName',
'browser_major_version': 'browserMajorVersion',
Expand Down
4 changes: 4 additions & 0 deletions fingerprint_pro_server_api_sdk/models/cloned_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class ClonedApp(BaseModel):
'result': 'bool'
}

nullable_map = {
'result': False
}

attribute_map = {
'result': 'result'
}
Expand Down
12 changes: 12 additions & 0 deletions fingerprint_pro_server_api_sdk/models/deprecated_geolocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ class DeprecatedGeolocation(BaseModel):
'subdivisions': 'GeolocationSubdivisions'
}

nullable_map = {
'accuracy_radius': False,
'latitude': False,
'longitude': False,
'postal_code': False,
'timezone': False,
'city': False,
'country': False,
'continent': False,
'subdivisions': False
}

attribute_map = {
'accuracy_radius': 'accuracyRadius',
'latitude': 'latitude',
Expand Down
4 changes: 4 additions & 0 deletions fingerprint_pro_server_api_sdk/models/developer_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class DeveloperTools(BaseModel):
'result': 'bool'
}

nullable_map = {
'result': False
}

attribute_map = {
'result': 'result'
}
Expand Down
4 changes: 4 additions & 0 deletions fingerprint_pro_server_api_sdk/models/emulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class Emulator(BaseModel):
'result': 'bool'
}

nullable_map = {
'result': False
}

attribute_map = {
'result': 'result'
}
Expand Down
5 changes: 5 additions & 0 deletions fingerprint_pro_server_api_sdk/models/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ class Error(BaseModel):
'message': 'str'
}

nullable_map = {
'code': False,
'message': False
}

attribute_map = {
'code': 'code',
'message': 'message'
Expand Down
3 changes: 3 additions & 0 deletions fingerprint_pro_server_api_sdk/models/error_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ class ErrorCode(BaseModel):
swagger_types = {
}

nullable_map = {
}

attribute_map = {
}

Expand Down
4 changes: 4 additions & 0 deletions fingerprint_pro_server_api_sdk/models/error_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class ErrorResponse(BaseModel):
'error': 'Error'
}

nullable_map = {
'error': False
}

attribute_map = {
'error': 'error'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class EventsGetResponse(BaseModel):
'products': 'Products'
}

nullable_map = {
'products': False
}

attribute_map = {
'products': 'products'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ class EventsUpdateRequest(BaseModel):
'suspect': 'bool'
}

nullable_map = {
'linked_id': False,
'tag': False,
'suspect': False
}

attribute_map = {
'linked_id': 'linkedId',
'tag': 'tag',
Expand Down
5 changes: 5 additions & 0 deletions fingerprint_pro_server_api_sdk/models/factory_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ class FactoryReset(BaseModel):
'timestamp': 'int'
}

nullable_map = {
'time': False,
'timestamp': False
}

attribute_map = {
'time': 'time',
'timestamp': 'timestamp'
Expand Down
4 changes: 4 additions & 0 deletions fingerprint_pro_server_api_sdk/models/frida.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class Frida(BaseModel):
'result': 'bool'
}

nullable_map = {
'result': False
}

attribute_map = {
'result': 'result'
}
Expand Down
12 changes: 12 additions & 0 deletions fingerprint_pro_server_api_sdk/models/geolocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ class Geolocation(BaseModel):
'subdivisions': 'GeolocationSubdivisions'
}

nullable_map = {
'accuracy_radius': False,
'latitude': False,
'longitude': False,
'postal_code': False,
'timezone': False,
'city': False,
'country': False,
'continent': False,
'subdivisions': False
}

attribute_map = {
'accuracy_radius': 'accuracyRadius',
'latitude': 'latitude',
Expand Down
4 changes: 4 additions & 0 deletions fingerprint_pro_server_api_sdk/models/geolocation_city.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class GeolocationCity(BaseModel):
'name': 'str'
}

nullable_map = {
'name': False
}

attribute_map = {
'name': 'name'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ class GeolocationContinent(BaseModel):
'name': 'str'
}

nullable_map = {
'code': False,
'name': False
}

attribute_map = {
'code': 'code',
'name': 'name'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ class GeolocationCountry(BaseModel):
'name': 'str'
}

nullable_map = {
'code': False,
'name': False
}

attribute_map = {
'code': 'code',
'name': 'name'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ class GeolocationSubdivision(BaseModel):
'name': 'str'
}

nullable_map = {
'iso_code': False,
'name': False
}

attribute_map = {
'iso_code': 'isoCode',
'name': 'name'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class GeolocationSubdivisions(BaseModel):
swagger_types = {
}

nullable_map = {
}

attribute_map = {
}

Expand Down
5 changes: 5 additions & 0 deletions fingerprint_pro_server_api_sdk/models/high_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ class HighActivity(BaseModel):
'daily_requests': 'int'
}

nullable_map = {
'result': False,
'daily_requests': False
}

attribute_map = {
'result': 'result',
'daily_requests': 'dailyRequests'
Expand Down
20 changes: 20 additions & 0 deletions fingerprint_pro_server_api_sdk/models/identification.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,26 @@ class Identification(BaseModel):
'components': 'RawDeviceAttributes'
}

nullable_map = {
'visitor_id': False,
'request_id': False,
'browser_details': False,
'incognito': False,
'ip': False,
'ip_location': False,
'linked_id': False,
'suspect': False,
'timestamp': False,
'time': False,
'url': False,
'tag': False,
'confidence': False,
'visitor_found': False,
'first_seen_at': False,
'last_seen_at': False,
'components': False
}

attribute_map = {
'visitor_id': 'visitorId',
'request_id': 'requestId',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ class IdentificationConfidence(BaseModel):
'comment': 'str'
}

nullable_map = {
'score': False,
'revision': False,
'comment': False
}

attribute_map = {
'score': 'score',
'revision': 'revision',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ class IdentificationSeenAt(BaseModel):
'subscription': 'datetime'
}

nullable_map = {
'_global': True,
'subscription': True
}

attribute_map = {
'_global': 'global',
'subscription': 'subscription'
Expand Down
4 changes: 4 additions & 0 deletions fingerprint_pro_server_api_sdk/models/incognito.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class Incognito(BaseModel):
'result': 'bool'
}

nullable_map = {
'result': False
}

attribute_map = {
'result': 'result'
}
Expand Down
5 changes: 5 additions & 0 deletions fingerprint_pro_server_api_sdk/models/ip_blocklist.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ class IPBlocklist(BaseModel):
'details': 'IPBlocklistDetails'
}

nullable_map = {
'result': False,
'details': False
}

attribute_map = {
'result': 'result',
'details': 'details'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ class IPBlocklistDetails(BaseModel):
'attack_source': 'bool'
}

nullable_map = {
'email_spam': False,
'attack_source': False
}

attribute_map = {
'email_spam': 'emailSpam',
'attack_source': 'attackSource'
Expand Down
Loading
Loading