Coverage for fingerprint_pro_server_api_sdk/models/visit.py: 40%

173 statements  

« prev     ^ index     » next       coverage.py v7.4.4, created at 2024-03-27 22:39 +0000

1# coding: utf-8 

2 

3""" 

4 Fingerprint Pro Server API 

5 

6 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 

7 

8 OpenAPI spec version: 3 

9 Contact: support@fingerprint.com 

10 Generated by: https://github.com/swagger-api/swagger-codegen.git 

11""" 

12 

13import pprint 

14import re # noqa: F401 

15 

16import six 

17 

18class Visit(object): 

19 """NOTE: This class is auto generated by the swagger code generator program. 

20 

21 Do not edit the class manually. 

22 """ 

23 """ 

24 Attributes: 

25 swagger_types (dict): The key is attribute name 

26 and the value is attribute type. 

27 attribute_map (dict): The key is attribute name 

28 and the value is json key in definition. 

29 """ 

30 swagger_types = { 

31 'request_id': 'str', 

32 'browser_details': 'BrowserDetails', 

33 'incognito': 'bool', 

34 'ip': 'str', 

35 'ip_location': 'DeprecatedIPLocation', 

36 'timestamp': 'int', 

37 'time': 'datetime', 

38 'url': 'str', 

39 'tag': 'dict(str, object)', 

40 'linked_id': 'str', 

41 'confidence': 'Confidence', 

42 'visitor_found': 'bool', 

43 'first_seen_at': 'SeenAt', 

44 'last_seen_at': 'SeenAt' 

45 } 

46 

47 attribute_map = { 

48 'request_id': 'requestId', 

49 'browser_details': 'browserDetails', 

50 'incognito': 'incognito', 

51 'ip': 'ip', 

52 'ip_location': 'ipLocation', 

53 'timestamp': 'timestamp', 

54 'time': 'time', 

55 'url': 'url', 

56 'tag': 'tag', 

57 'linked_id': 'linkedId', 

58 'confidence': 'confidence', 

59 'visitor_found': 'visitorFound', 

60 'first_seen_at': 'firstSeenAt', 

61 'last_seen_at': 'lastSeenAt' 

62 } 

63 

64 def __init__(self, request_id=None, browser_details=None, incognito=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 

65 """Visit - a model defined in Swagger""" # noqa: E501 

66 self._request_id = None 

67 self._browser_details = None 

68 self._incognito = None 

69 self._ip = None 

70 self._ip_location = None 

71 self._timestamp = None 

72 self._time = None 

73 self._url = None 

74 self._tag = None 

75 self._linked_id = None 

76 self._confidence = None 

77 self._visitor_found = None 

78 self._first_seen_at = None 

79 self._last_seen_at = None 

80 self.discriminator = None 

81 self.request_id = request_id 

82 self.browser_details = browser_details 

83 self.incognito = incognito 

84 self.ip = ip 

85 if ip_location is not None: 

86 self.ip_location = ip_location 

87 self.timestamp = timestamp 

88 self.time = time 

89 self.url = url 

90 self.tag = tag 

91 if linked_id is not None: 

92 self.linked_id = linked_id 

93 if confidence is not None: 

94 self.confidence = confidence 

95 self.visitor_found = visitor_found 

96 self.first_seen_at = first_seen_at 

97 self.last_seen_at = last_seen_at 

98 

99 @property 

100 def request_id(self): 

101 """Gets the request_id of this Visit. # noqa: E501 

102 

103 Unique identifier of the user's identification request. # noqa: E501 

104 

105 :return: The request_id of this Visit. # noqa: E501 

106 :rtype: str 

107 """ 

108 return self._request_id 

109 

110 @request_id.setter 

111 def request_id(self, request_id): 

112 """Sets the request_id of this Visit. 

113 

114 Unique identifier of the user's identification request. # noqa: E501 

115 

116 :param request_id: The request_id of this Visit. # noqa: E501 

117 :type: str 

118 """ 

119 if request_id is None: 

120 raise ValueError("Invalid value for `request_id`, must not be `None`") # noqa: E501 

121 

122 self._request_id = request_id 

123 

124 @property 

125 def browser_details(self): 

126 """Gets the browser_details of this Visit. # noqa: E501 

127 

128 

129 :return: The browser_details of this Visit. # noqa: E501 

130 :rtype: BrowserDetails 

131 """ 

132 return self._browser_details 

133 

134 @browser_details.setter 

135 def browser_details(self, browser_details): 

136 """Sets the browser_details of this Visit. 

137 

138 

139 :param browser_details: The browser_details of this Visit. # noqa: E501 

140 :type: BrowserDetails 

141 """ 

142 if browser_details is None: 

143 raise ValueError("Invalid value for `browser_details`, must not be `None`") # noqa: E501 

144 

145 self._browser_details = browser_details 

146 

147 @property 

148 def incognito(self): 

149 """Gets the incognito of this Visit. # noqa: E501 

150 

151 Flag if user used incognito session. # noqa: E501 

152 

153 :return: The incognito of this Visit. # noqa: E501 

154 :rtype: bool 

155 """ 

156 return self._incognito 

157 

158 @incognito.setter 

159 def incognito(self, incognito): 

160 """Sets the incognito of this Visit. 

161 

162 Flag if user used incognito session. # noqa: E501 

163 

164 :param incognito: The incognito of this Visit. # noqa: E501 

165 :type: bool 

166 """ 

167 if incognito is None: 

168 raise ValueError("Invalid value for `incognito`, must not be `None`") # noqa: E501 

169 

170 self._incognito = incognito 

171 

172 @property 

173 def ip(self): 

174 """Gets the ip of this Visit. # noqa: E501 

175 

176 

177 :return: The ip of this Visit. # noqa: E501 

178 :rtype: str 

179 """ 

180 return self._ip 

181 

182 @ip.setter 

183 def ip(self, ip): 

184 """Sets the ip of this Visit. 

185 

186 

187 :param ip: The ip of this Visit. # noqa: E501 

188 :type: str 

189 """ 

190 if ip is None: 

191 raise ValueError("Invalid value for `ip`, must not be `None`") # noqa: E501 

192 

193 self._ip = ip 

194 

195 @property 

196 def ip_location(self): 

197 """Gets the ip_location of this Visit. # noqa: E501 

198 

199 

200 :return: The ip_location of this Visit. # noqa: E501 

201 :rtype: DeprecatedIPLocation 

202 """ 

203 return self._ip_location 

204 

205 @ip_location.setter 

206 def ip_location(self, ip_location): 

207 """Sets the ip_location of this Visit. 

208 

209 

210 :param ip_location: The ip_location of this Visit. # noqa: E501 

211 :type: DeprecatedIPLocation 

212 """ 

213 

214 self._ip_location = ip_location 

215 

216 @property 

217 def timestamp(self): 

218 """Gets the timestamp of this Visit. # noqa: E501 

219 

220 Timestamp of the event with millisecond precision in Unix time. # noqa: E501 

221 

222 :return: The timestamp of this Visit. # noqa: E501 

223 :rtype: int 

224 """ 

225 return self._timestamp 

226 

227 @timestamp.setter 

228 def timestamp(self, timestamp): 

229 """Sets the timestamp of this Visit. 

230 

231 Timestamp of the event with millisecond precision in Unix time. # noqa: E501 

232 

233 :param timestamp: The timestamp of this Visit. # noqa: E501 

234 :type: int 

235 """ 

236 if timestamp is None: 

237 raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 

238 

239 self._timestamp = timestamp 

240 

241 @property 

242 def time(self): 

243 """Gets the time of this Visit. # noqa: E501 

244 

245 Time expressed according to ISO 8601 in UTC format. # noqa: E501 

246 

247 :return: The time of this Visit. # noqa: E501 

248 :rtype: datetime 

249 """ 

250 return self._time 

251 

252 @time.setter 

253 def time(self, time): 

254 """Sets the time of this Visit. 

255 

256 Time expressed according to ISO 8601 in UTC format. # noqa: E501 

257 

258 :param time: The time of this Visit. # noqa: E501 

259 :type: datetime 

260 """ 

261 if time is None: 

262 raise ValueError("Invalid value for `time`, must not be `None`") # noqa: E501 

263 

264 self._time = time 

265 

266 @property 

267 def url(self): 

268 """Gets the url of this Visit. # noqa: E501 

269 

270 Page URL from which the identification request was sent. # noqa: E501 

271 

272 :return: The url of this Visit. # noqa: E501 

273 :rtype: str 

274 """ 

275 return self._url 

276 

277 @url.setter 

278 def url(self, url): 

279 """Sets the url of this Visit. 

280 

281 Page URL from which the identification request was sent. # noqa: E501 

282 

283 :param url: The url of this Visit. # noqa: E501 

284 :type: str 

285 """ 

286 if url is None: 

287 raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 

288 

289 self._url = url 

290 

291 @property 

292 def tag(self): 

293 """Gets the tag of this Visit. # noqa: E501 

294 

295 A customer-provided value or an object that was sent with identification request. # noqa: E501 

296 

297 :return: The tag of this Visit. # noqa: E501 

298 :rtype: dict(str, object) 

299 """ 

300 return self._tag 

301 

302 @tag.setter 

303 def tag(self, tag): 

304 """Sets the tag of this Visit. 

305 

306 A customer-provided value or an object that was sent with identification request. # noqa: E501 

307 

308 :param tag: The tag of this Visit. # noqa: E501 

309 :type: dict(str, object) 

310 """ 

311 if tag is None: 

312 raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 

313 

314 self._tag = tag 

315 

316 @property 

317 def linked_id(self): 

318 """Gets the linked_id of this Visit. # noqa: E501 

319 

320 A customer-provided id that was sent with identification request. # noqa: E501 

321 

322 :return: The linked_id of this Visit. # noqa: E501 

323 :rtype: str 

324 """ 

325 return self._linked_id 

326 

327 @linked_id.setter 

328 def linked_id(self, linked_id): 

329 """Sets the linked_id of this Visit. 

330 

331 A customer-provided id that was sent with identification request. # noqa: E501 

332 

333 :param linked_id: The linked_id of this Visit. # noqa: E501 

334 :type: str 

335 """ 

336 

337 self._linked_id = linked_id 

338 

339 @property 

340 def confidence(self): 

341 """Gets the confidence of this Visit. # noqa: E501 

342 

343 

344 :return: The confidence of this Visit. # noqa: E501 

345 :rtype: Confidence 

346 """ 

347 return self._confidence 

348 

349 @confidence.setter 

350 def confidence(self, confidence): 

351 """Sets the confidence of this Visit. 

352 

353 

354 :param confidence: The confidence of this Visit. # noqa: E501 

355 :type: Confidence 

356 """ 

357 

358 self._confidence = confidence 

359 

360 @property 

361 def visitor_found(self): 

362 """Gets the visitor_found of this Visit. # noqa: E501 

363 

364 Attribute represents if a visitor had been identified before. # noqa: E501 

365 

366 :return: The visitor_found of this Visit. # noqa: E501 

367 :rtype: bool 

368 """ 

369 return self._visitor_found 

370 

371 @visitor_found.setter 

372 def visitor_found(self, visitor_found): 

373 """Sets the visitor_found of this Visit. 

374 

375 Attribute represents if a visitor had been identified before. # noqa: E501 

376 

377 :param visitor_found: The visitor_found of this Visit. # noqa: E501 

378 :type: bool 

379 """ 

380 if visitor_found is None: 

381 raise ValueError("Invalid value for `visitor_found`, must not be `None`") # noqa: E501 

382 

383 self._visitor_found = visitor_found 

384 

385 @property 

386 def first_seen_at(self): 

387 """Gets the first_seen_at of this Visit. # noqa: E501 

388 

389 

390 :return: The first_seen_at of this Visit. # noqa: E501 

391 :rtype: SeenAt 

392 """ 

393 return self._first_seen_at 

394 

395 @first_seen_at.setter 

396 def first_seen_at(self, first_seen_at): 

397 """Sets the first_seen_at of this Visit. 

398 

399 

400 :param first_seen_at: The first_seen_at of this Visit. # noqa: E501 

401 :type: SeenAt 

402 """ 

403 if first_seen_at is None: 

404 raise ValueError("Invalid value for `first_seen_at`, must not be `None`") # noqa: E501 

405 

406 self._first_seen_at = first_seen_at 

407 

408 @property 

409 def last_seen_at(self): 

410 """Gets the last_seen_at of this Visit. # noqa: E501 

411 

412 

413 :return: The last_seen_at of this Visit. # noqa: E501 

414 :rtype: SeenAt 

415 """ 

416 return self._last_seen_at 

417 

418 @last_seen_at.setter 

419 def last_seen_at(self, last_seen_at): 

420 """Sets the last_seen_at of this Visit. 

421 

422 

423 :param last_seen_at: The last_seen_at of this Visit. # noqa: E501 

424 :type: SeenAt 

425 """ 

426 if last_seen_at is None: 

427 raise ValueError("Invalid value for `last_seen_at`, must not be `None`") # noqa: E501 

428 

429 self._last_seen_at = last_seen_at 

430 

431 def to_dict(self): 

432 """Returns the model properties as a dict""" 

433 result = {} 

434 

435 for attr, _ in six.iteritems(self.swagger_types): 

436 value = getattr(self, attr) 

437 if isinstance(value, list): 

438 result[attr] = list(map( 

439 lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 

440 value 

441 )) 

442 elif hasattr(value, "to_dict"): 

443 result[attr] = value.to_dict() 

444 elif isinstance(value, dict): 

445 result[attr] = dict(map( 

446 lambda item: (item[0], item[1].to_dict()) 

447 if hasattr(item[1], "to_dict") else item, 

448 value.items() 

449 )) 

450 else: 

451 result[attr] = value 

452 if issubclass(Visit, dict): 

453 for key, value in self.items(): 

454 result[key] = value 

455 

456 return result 

457 

458 def to_str(self): 

459 """Returns the string representation of the model""" 

460 return pprint.pformat(self.to_dict()) 

461 

462 def __repr__(self): 

463 """For `print` and `pprint`""" 

464 return self.to_str() 

465 

466 def __eq__(self, other): 

467 """Returns true if both objects are equal""" 

468 if not isinstance(other, Visit): 

469 return False 

470 

471 return self.to_dict() == other.to_dict() 

472 

473 def __ne__(self, other): 

474 """Returns true if both objects are not equal""" 

475 if not isinstance(other, Visit): 

476 return True 

477 

478 return self.to_dict() != other.to_dict()