Skip to content

Commit

Permalink
Merge pull request #70 from fingerprintjs/better-types-for-optional-f…
Browse files Browse the repository at this point in the history
…ields-INTER-821

Mark optional fields in models
  • Loading branch information
ilfa authored Aug 14, 2024
2 parents d56caca + 2c62e20 commit 826a5ef
Show file tree
Hide file tree
Showing 92 changed files with 420 additions and 416 deletions.
6 changes: 3 additions & 3 deletions fingerprint_pro_server_api_sdk/models/asn.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

import re # noqa: F401
from typing import Dict, List # noqa: F401
from typing import Dict, List, Optional # noqa: F401
from fingerprint_pro_server_api_sdk.base_model import BaseModel


Expand Down Expand Up @@ -93,7 +93,7 @@ def network(self, network: str):
self._network = network

@property
def name(self) -> str:
def name(self) -> Optional[str]:
"""Gets the name of this ASN. # noqa: E501
Expand All @@ -102,7 +102,7 @@ def name(self) -> str:
return self._name

@name.setter
def name(self, name: str):
def name(self, name: Optional[str]):
"""Sets the name of this ASN.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

import re # noqa: F401
from typing import Dict, List # noqa: F401
from typing import Dict, List, Optional # noqa: F401
from fingerprint_pro_server_api_sdk.base_model import BaseModel


Expand Down Expand Up @@ -79,7 +79,7 @@ def result(self, result: str):
self._result = result

@property
def type(self) -> str:
def type(self) -> Optional[str]:
"""Gets the type of this BotdDetectionResult. # noqa: E501
Expand All @@ -88,7 +88,7 @@ def type(self) -> str:
return self._type

@type.setter
def type(self, type: str):
def type(self, type: Optional[str]):
"""Sets the type of this BotdDetectionResult.
Expand Down
6 changes: 3 additions & 3 deletions fingerprint_pro_server_api_sdk/models/botd_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

import re # noqa: F401
from typing import Dict, List # noqa: F401
from typing import Dict, List, Optional # noqa: F401
from fingerprint_pro_server_api_sdk.base_model import BaseModel
from datetime import datetime
from fingerprint_pro_server_api_sdk.models.botd_detection_result import BotdDetectionResult
Expand Down Expand Up @@ -183,7 +183,7 @@ def request_id(self, request_id: str):
self._request_id = request_id

@property
def linked_id(self) -> str:
def linked_id(self) -> Optional[str]:
"""Gets the linked_id of this BotdResult. # noqa: E501
Expand All @@ -192,7 +192,7 @@ def linked_id(self) -> str:
return self._linked_id

@linked_id.setter
def linked_id(self, linked_id: str):
def linked_id(self, linked_id: Optional[str]):
"""Sets the linked_id of this BotdResult.
Expand Down
6 changes: 3 additions & 3 deletions fingerprint_pro_server_api_sdk/models/browser_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

import re # noqa: F401
from typing import Dict, List # noqa: F401
from typing import Dict, List, Optional # noqa: F401
from fingerprint_pro_server_api_sdk.base_model import BaseModel


Expand Down Expand Up @@ -218,7 +218,7 @@ def user_agent(self, user_agent: str):
self._user_agent = user_agent

@property
def bot_probability(self) -> int:
def bot_probability(self) -> Optional[int]:
"""Gets the bot_probability of this BrowserDetails. # noqa: E501
Expand All @@ -227,7 +227,7 @@ def bot_probability(self) -> int:
return self._bot_probability

@bot_probability.setter
def bot_probability(self, bot_probability: int):
def bot_probability(self, bot_probability: Optional[int]):
"""Sets the bot_probability of this BrowserDetails.
Expand Down
2 changes: 1 addition & 1 deletion fingerprint_pro_server_api_sdk/models/cloned_app_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

import re # noqa: F401
from typing import Dict, List # noqa: F401
from typing import Dict, List, Optional # noqa: F401
from fingerprint_pro_server_api_sdk.base_model import BaseModel


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

import re # noqa: F401
from typing import Dict, List # noqa: F401
from typing import Dict, List, Optional # noqa: F401
from fingerprint_pro_server_api_sdk.base_model import BaseModel


Expand Down
6 changes: 3 additions & 3 deletions fingerprint_pro_server_api_sdk/models/confidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

import re # noqa: F401
from typing import Dict, List # noqa: F401
from typing import Dict, List, Optional # noqa: F401
from fingerprint_pro_server_api_sdk.base_model import BaseModel


Expand Down Expand Up @@ -70,7 +70,7 @@ def score(self, score: float):
self._score = score

@property
def revision(self) -> str:
def revision(self) -> Optional[str]:
"""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
Expand All @@ -80,7 +80,7 @@ def revision(self) -> str:
return self._revision

@revision.setter
def revision(self, revision: str):
def revision(self, revision: Optional[str]):
"""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
Expand Down
6 changes: 3 additions & 3 deletions fingerprint_pro_server_api_sdk/models/data_center.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

import re # noqa: F401
from typing import Dict, List # noqa: F401
from typing import Dict, List, Optional # noqa: F401
from fingerprint_pro_server_api_sdk.base_model import BaseModel


Expand Down Expand Up @@ -68,7 +68,7 @@ def result(self, result: bool):
self._result = result

@property
def name(self) -> str:
def name(self) -> Optional[str]:
"""Gets the name of this DataCenter. # noqa: E501
Expand All @@ -77,7 +77,7 @@ def name(self) -> str:
return self._name

@name.setter
def name(self, name: str):
def name(self, name: Optional[str]):
"""Sets the name of this DataCenter.
Expand Down
38 changes: 19 additions & 19 deletions fingerprint_pro_server_api_sdk/models/deprecated_ip_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

import re # noqa: F401
from typing import Dict, List # noqa: F401
from typing import Dict, List, Optional # noqa: F401
from fingerprint_pro_server_api_sdk.base_model import BaseModel
from fingerprint_pro_server_api_sdk.models.deprecated_ip_location_city import DeprecatedIPLocationCity
from fingerprint_pro_server_api_sdk.models.location import Location
Expand Down Expand Up @@ -90,7 +90,7 @@ def __init__(self, accuracy_radius=None, latitude=None, longitude=None, postal_c
self.subdivisions = subdivisions

@property
def accuracy_radius(self) -> int:
def accuracy_radius(self) -> Optional[int]:
"""Gets the accuracy_radius of this DeprecatedIPLocation. # noqa: E501
The IP address is likely to be within this radius (in km) of the specified location. # noqa: E501
Expand All @@ -100,7 +100,7 @@ def accuracy_radius(self) -> int:
return self._accuracy_radius

@accuracy_radius.setter
def accuracy_radius(self, accuracy_radius: int):
def accuracy_radius(self, accuracy_radius: Optional[int]):
"""Sets the accuracy_radius of this DeprecatedIPLocation.
The IP address is likely to be within this radius (in km) of the specified location. # noqa: E501
Expand All @@ -111,7 +111,7 @@ def accuracy_radius(self, accuracy_radius: int):
self._accuracy_radius = accuracy_radius

@property
def latitude(self) -> float:
def latitude(self) -> Optional[float]:
"""Gets the latitude of this DeprecatedIPLocation. # noqa: E501
Expand All @@ -120,7 +120,7 @@ def latitude(self) -> float:
return self._latitude

@latitude.setter
def latitude(self, latitude: float):
def latitude(self, latitude: Optional[float]):
"""Sets the latitude of this DeprecatedIPLocation.
Expand All @@ -130,7 +130,7 @@ def latitude(self, latitude: float):
self._latitude = latitude

@property
def longitude(self) -> float:
def longitude(self) -> Optional[float]:
"""Gets the longitude of this DeprecatedIPLocation. # noqa: E501
Expand All @@ -139,7 +139,7 @@ def longitude(self) -> float:
return self._longitude

@longitude.setter
def longitude(self, longitude: float):
def longitude(self, longitude: Optional[float]):
"""Sets the longitude of this DeprecatedIPLocation.
Expand All @@ -149,7 +149,7 @@ def longitude(self, longitude: float):
self._longitude = longitude

@property
def postal_code(self) -> str:
def postal_code(self) -> Optional[str]:
"""Gets the postal_code of this DeprecatedIPLocation. # noqa: E501
Expand All @@ -158,7 +158,7 @@ def postal_code(self) -> str:
return self._postal_code

@postal_code.setter
def postal_code(self, postal_code: str):
def postal_code(self, postal_code: Optional[str]):
"""Sets the postal_code of this DeprecatedIPLocation.
Expand All @@ -168,7 +168,7 @@ def postal_code(self, postal_code: str):
self._postal_code = postal_code

@property
def timezone(self) -> str:
def timezone(self) -> Optional[str]:
"""Gets the timezone of this DeprecatedIPLocation. # noqa: E501
Expand All @@ -177,7 +177,7 @@ def timezone(self) -> str:
return self._timezone

@timezone.setter
def timezone(self, timezone: str):
def timezone(self, timezone: Optional[str]):
"""Sets the timezone of this DeprecatedIPLocation.
Expand All @@ -187,7 +187,7 @@ def timezone(self, timezone: str):
self._timezone = timezone

@property
def city(self) -> DeprecatedIPLocationCity:
def city(self) -> Optional[DeprecatedIPLocationCity]:
"""Gets the city of this DeprecatedIPLocation. # noqa: E501
Expand All @@ -196,7 +196,7 @@ def city(self) -> DeprecatedIPLocationCity:
return self._city

@city.setter
def city(self, city: DeprecatedIPLocationCity):
def city(self, city: Optional[DeprecatedIPLocationCity]):
"""Sets the city of this DeprecatedIPLocation.
Expand All @@ -206,7 +206,7 @@ def city(self, city: DeprecatedIPLocationCity):
self._city = city

@property
def country(self) -> Location:
def country(self) -> Optional[Location]:
"""Gets the country of this DeprecatedIPLocation. # noqa: E501
Expand All @@ -215,7 +215,7 @@ def country(self) -> Location:
return self._country

@country.setter
def country(self, country: Location):
def country(self, country: Optional[Location]):
"""Sets the country of this DeprecatedIPLocation.
Expand All @@ -225,7 +225,7 @@ def country(self, country: Location):
self._country = country

@property
def continent(self) -> Location:
def continent(self) -> Optional[Location]:
"""Gets the continent of this DeprecatedIPLocation. # noqa: E501
Expand All @@ -234,7 +234,7 @@ def continent(self) -> Location:
return self._continent

@continent.setter
def continent(self, continent: Location):
def continent(self, continent: Optional[Location]):
"""Sets the continent of this DeprecatedIPLocation.
Expand All @@ -244,7 +244,7 @@ def continent(self, continent: Location):
self._continent = continent

@property
def subdivisions(self) -> List[Subdivision]:
def subdivisions(self) -> Optional[List[Subdivision]]:
"""Gets the subdivisions of this DeprecatedIPLocation. # noqa: E501
Expand All @@ -253,7 +253,7 @@ def subdivisions(self) -> List[Subdivision]:
return self._subdivisions

@subdivisions.setter
def subdivisions(self, subdivisions: List[Subdivision]):
def subdivisions(self, subdivisions: Optional[List[Subdivision]]):
"""Sets the subdivisions of this DeprecatedIPLocation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

import re # noqa: F401
from typing import Dict, List # noqa: F401
from typing import Dict, List, Optional # noqa: F401
from fingerprint_pro_server_api_sdk.base_model import BaseModel


Expand Down Expand Up @@ -43,7 +43,7 @@ def __init__(self, name=None): # noqa: E501
self.name = name

@property
def name(self) -> str:
def name(self) -> Optional[str]:
"""Gets the name of this DeprecatedIPLocationCity. # noqa: E501
Expand All @@ -52,7 +52,7 @@ def name(self) -> str:
return self._name

@name.setter
def name(self, name: str):
def name(self, name: Optional[str]):
"""Sets the name of this DeprecatedIPLocationCity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

import re # noqa: F401
from typing import Dict, List # noqa: F401
from typing import Dict, List, Optional # noqa: F401
from fingerprint_pro_server_api_sdk.base_model import BaseModel


Expand Down
2 changes: 1 addition & 1 deletion fingerprint_pro_server_api_sdk/models/emulator_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

import re # noqa: F401
from typing import Dict, List # noqa: F401
from typing import Dict, List, Optional # noqa: F401
from fingerprint_pro_server_api_sdk.base_model import BaseModel


Expand Down
Loading

0 comments on commit 826a5ef

Please sign in to comment.