Skip to content

Commit 1121a5c

Browse files
committed
feat: use inline types instead of annotations for models
1 parent 76e562c commit 1121a5c

File tree

93 files changed

+886
-1151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+886
-1151
lines changed

fingerprint_pro_server_api_sdk/models/asn.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"""
1212

1313
import re # noqa: F401
14+
from typing import Dict # noqa: F401
1415
from fingerprint_pro_server_api_sdk.base_model import BaseModel
1516

1617

@@ -50,68 +51,62 @@ def __init__(self, asn=None, network=None, name=None): # noqa: E501
5051
self.name = name
5152

5253
@property
53-
def asn(self):
54+
def asn(self) -> str:
5455
"""Gets the asn of this ASN. # noqa: E501
5556
5657
5758
:return: The asn of this ASN. # noqa: E501
58-
:rtype: str
5959
"""
6060
return self._asn
6161

6262
@asn.setter
63-
def asn(self, asn):
63+
def asn(self, asn: str):
6464
"""Sets the asn of this ASN.
6565
6666
6767
:param asn: The asn of this ASN. # noqa: E501
68-
:type: str
6968
"""
7069
if asn is None:
7170
raise ValueError("Invalid value for `asn`, must not be `None`") # noqa: E501
7271

7372
self._asn = asn
7473

7574
@property
76-
def network(self):
75+
def network(self) -> str:
7776
"""Gets the network of this ASN. # noqa: E501
7877
7978
8079
:return: The network of this ASN. # noqa: E501
81-
:rtype: str
8280
"""
8381
return self._network
8482

8583
@network.setter
86-
def network(self, network):
84+
def network(self, network: str):
8785
"""Sets the network of this ASN.
8886
8987
9088
:param network: The network of this ASN. # noqa: E501
91-
:type: str
9289
"""
9390
if network is None:
9491
raise ValueError("Invalid value for `network`, must not be `None`") # noqa: E501
9592

9693
self._network = network
9794

9895
@property
99-
def name(self):
96+
def name(self) -> str:
10097
"""Gets the name of this ASN. # noqa: E501
10198
10299
103100
:return: The name of this ASN. # noqa: E501
104-
:rtype: str
105101
"""
106102
return self._name
107103

108104
@name.setter
109-
def name(self, name):
105+
def name(self, name: str):
110106
"""Sets the name of this ASN.
111107
112108
113109
:param name: The name of this ASN. # noqa: E501
114-
:type: str
115110
"""
116111

117112
self._name = name

fingerprint_pro_server_api_sdk/models/botd_detection_result.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"""
1212

1313
import re # noqa: F401
14+
from typing import Dict # noqa: F401
1415
from fingerprint_pro_server_api_sdk.base_model import BaseModel
1516

1617

@@ -49,24 +50,22 @@ def __init__(self, result=None, type=None): # noqa: E501
4950
self.type = type
5051

5152
@property
52-
def result(self):
53+
def result(self) -> str:
5354
"""Gets the result of this BotdDetectionResult. # noqa: E501
5455
5556
Bot detection result: * `notDetected` - the visitor is not a bot * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on # noqa: E501
5657
5758
:return: The result of this BotdDetectionResult. # noqa: E501
58-
:rtype: str
5959
"""
6060
return self._result
6161

6262
@result.setter
63-
def result(self, result):
63+
def result(self, result: str):
6464
"""Sets the result of this BotdDetectionResult.
6565
6666
Bot detection result: * `notDetected` - the visitor is not a bot * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on # noqa: E501
6767
6868
:param result: The result of this BotdDetectionResult. # noqa: E501
69-
:type: str
7069
"""
7170
if result is None:
7271
raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501
@@ -80,22 +79,20 @@ def result(self, result):
8079
self._result = result
8180

8281
@property
83-
def type(self):
82+
def type(self) -> str:
8483
"""Gets the type of this BotdDetectionResult. # noqa: E501
8584
8685
8786
:return: The type of this BotdDetectionResult. # noqa: E501
88-
:rtype: str
8987
"""
9088
return self._type
9189

9290
@type.setter
93-
def type(self, type):
91+
def type(self, type: str):
9492
"""Sets the type of this BotdDetectionResult.
9593
9694
9795
:param type: The type of this BotdDetectionResult. # noqa: E501
98-
:type: str
9996
"""
10097

10198
self._type = type

fingerprint_pro_server_api_sdk/models/botd_result.py

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
"""
1212

1313
import re # noqa: F401
14+
from typing import Dict # noqa: F401
1415
from fingerprint_pro_server_api_sdk.base_model import BaseModel
16+
from datetime import datetime
17+
from fingerprint_pro_server_api_sdk.models.botd_detection_result import BotdDetectionResult
1518

1619

1720
class BotdResult(BaseModel):
@@ -69,164 +72,150 @@ def __init__(self, ip=None, time=None, url=None, user_agent=None, request_id=Non
6972
self.bot = bot
7073

7174
@property
72-
def ip(self):
75+
def ip(self) -> str:
7376
"""Gets the ip of this BotdResult. # noqa: E501
7477
7578
IP address of the requesting browser or bot. # noqa: E501
7679
7780
:return: The ip of this BotdResult. # noqa: E501
78-
:rtype: str
7981
"""
8082
return self._ip
8183

8284
@ip.setter
83-
def ip(self, ip):
85+
def ip(self, ip: str):
8486
"""Sets the ip of this BotdResult.
8587
8688
IP address of the requesting browser or bot. # noqa: E501
8789
8890
:param ip: The ip of this BotdResult. # noqa: E501
89-
:type: str
9091
"""
9192
if ip is None:
9293
raise ValueError("Invalid value for `ip`, must not be `None`") # noqa: E501
9394

9495
self._ip = ip
9596

9697
@property
97-
def time(self):
98+
def time(self) -> datetime:
9899
"""Gets the time of this BotdResult. # noqa: E501
99100
100101
Time in UTC when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible # noqa: E501
101102
102103
:return: The time of this BotdResult. # noqa: E501
103-
:rtype: datetime
104104
"""
105105
return self._time
106106

107107
@time.setter
108-
def time(self, time):
108+
def time(self, time: datetime):
109109
"""Sets the time of this BotdResult.
110110
111111
Time in UTC when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible # noqa: E501
112112
113113
:param time: The time of this BotdResult. # noqa: E501
114-
:type: datetime
115114
"""
116115
if time is None:
117116
raise ValueError("Invalid value for `time`, must not be `None`") # noqa: E501
118117

119118
self._time = time
120119

121120
@property
122-
def url(self):
121+
def url(self) -> str:
123122
"""Gets the url of this BotdResult. # noqa: E501
124123
125124
Page URL from which identification request was sent. # noqa: E501
126125
127126
:return: The url of this BotdResult. # noqa: E501
128-
:rtype: str
129127
"""
130128
return self._url
131129

132130
@url.setter
133-
def url(self, url):
131+
def url(self, url: str):
134132
"""Sets the url of this BotdResult.
135133
136134
Page URL from which identification request was sent. # noqa: E501
137135
138136
:param url: The url of this BotdResult. # noqa: E501
139-
:type: str
140137
"""
141138
if url is None:
142139
raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501
143140

144141
self._url = url
145142

146143
@property
147-
def user_agent(self):
144+
def user_agent(self) -> str:
148145
"""Gets the user_agent of this BotdResult. # noqa: E501
149146
150147
151148
:return: The user_agent of this BotdResult. # noqa: E501
152-
:rtype: str
153149
"""
154150
return self._user_agent
155151

156152
@user_agent.setter
157-
def user_agent(self, user_agent):
153+
def user_agent(self, user_agent: str):
158154
"""Sets the user_agent of this BotdResult.
159155
160156
161157
:param user_agent: The user_agent of this BotdResult. # noqa: E501
162-
:type: str
163158
"""
164159
if user_agent is None:
165160
raise ValueError("Invalid value for `user_agent`, must not be `None`") # noqa: E501
166161

167162
self._user_agent = user_agent
168163

169164
@property
170-
def request_id(self):
165+
def request_id(self) -> str:
171166
"""Gets the request_id of this BotdResult. # noqa: E501
172167
173168
174169
:return: The request_id of this BotdResult. # noqa: E501
175-
:rtype: str
176170
"""
177171
return self._request_id
178172

179173
@request_id.setter
180-
def request_id(self, request_id):
174+
def request_id(self, request_id: str):
181175
"""Sets the request_id of this BotdResult.
182176
183177
184178
:param request_id: The request_id of this BotdResult. # noqa: E501
185-
:type: str
186179
"""
187180
if request_id is None:
188181
raise ValueError("Invalid value for `request_id`, must not be `None`") # noqa: E501
189182

190183
self._request_id = request_id
191184

192185
@property
193-
def linked_id(self):
186+
def linked_id(self) -> str:
194187
"""Gets the linked_id of this BotdResult. # noqa: E501
195188
196189
197190
:return: The linked_id of this BotdResult. # noqa: E501
198-
:rtype: str
199191
"""
200192
return self._linked_id
201193

202194
@linked_id.setter
203-
def linked_id(self, linked_id):
195+
def linked_id(self, linked_id: str):
204196
"""Sets the linked_id of this BotdResult.
205197
206198
207199
:param linked_id: The linked_id of this BotdResult. # noqa: E501
208-
:type: str
209200
"""
210201

211202
self._linked_id = linked_id
212203

213204
@property
214-
def bot(self):
205+
def bot(self) -> BotdDetectionResult:
215206
"""Gets the bot of this BotdResult. # noqa: E501
216207
217208
218209
:return: The bot of this BotdResult. # noqa: E501
219-
:rtype: BotdDetectionResult
220210
"""
221211
return self._bot
222212

223213
@bot.setter
224-
def bot(self, bot):
214+
def bot(self, bot: BotdDetectionResult):
225215
"""Sets the bot of this BotdResult.
226216
227217
228218
:param bot: The bot of this BotdResult. # noqa: E501
229-
:type: BotdDetectionResult
230219
"""
231220
if bot is None:
232221
raise ValueError("Invalid value for `bot`, must not be `None`") # noqa: E501

0 commit comments

Comments
 (0)