|
23 | 23 | from fingerprint_pro_server_api_sdk.models.error_response import ErrorResponse # noqa: F401
|
24 | 24 | from fingerprint_pro_server_api_sdk.models.events_get_response import EventsGetResponse # noqa: F401
|
25 | 25 | from fingerprint_pro_server_api_sdk.models.events_update_request import EventsUpdateRequest # noqa: F401
|
| 26 | +from fingerprint_pro_server_api_sdk.models.related_visitors_response import RelatedVisitorsResponse # noqa: F401 |
26 | 27 | from fingerprint_pro_server_api_sdk.models.visitors_get_response import VisitorsGetResponse # noqa: F401
|
27 | 28 |
|
28 | 29 |
|
@@ -252,6 +253,116 @@ def get_event_with_http_info(self, request_id: str, **kwargs): # noqa: E501
|
252 | 253 | raise extend_exception(e, error)
|
253 | 254 | raise e
|
254 | 255 |
|
| 256 | + def get_related_visitors(self, visitor_id: str, **kwargs) -> Union[RelatedVisitorsResponse, AsyncResult[RelatedVisitorsResponse]]: # noqa: E501 |
| 257 | + """Get Related Visitors # noqa: E501 |
| 258 | +
|
| 259 | + Related visitors API lets you link web visits and in-app browser visits that originated from the same mobile device. It searches the past 6 months of identification events to find the visitor IDs that belong to the same mobile device as the given visitor ID. ⚠️ Please note that this API is not enabled by default and is billable separately. ⚠️ If you would like to use Related visitors API, please contact our [support team](https://fingerprint.com/support). To learn more, see [Related visitors API reference](https://dev.fingerprint.com/reference/related-visitors-api). # noqa: E501 |
| 260 | + This method makes a synchronous HTTP request by default. To make an |
| 261 | + asynchronous HTTP request, please pass async_req=True |
| 262 | + >>> thread = api.get_related_visitors(visitor_id, async_req=True) |
| 263 | + >>> result = thread.get() |
| 264 | +
|
| 265 | + :param async_req bool |
| 266 | + :param visitor_id: The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) for which you want to find the other visitor IDs that originated from the same mobile device. (required) |
| 267 | + :return: RelatedVisitorsResponse |
| 268 | + If the method is called asynchronously, |
| 269 | + returns the request thread. |
| 270 | + """ |
| 271 | + kwargs['_return_http_data_only'] = True |
| 272 | + if kwargs.get('async_req'): |
| 273 | + return self.get_related_visitors_with_http_info(visitor_id, **kwargs) # noqa: E501 |
| 274 | + else: |
| 275 | + (data) = self.get_related_visitors_with_http_info(visitor_id, **kwargs) # noqa: E501 |
| 276 | + return data |
| 277 | + |
| 278 | + def get_related_visitors_with_http_info(self, visitor_id: str, **kwargs): # noqa: E501 |
| 279 | + """Get Related Visitors # noqa: E501 |
| 280 | +
|
| 281 | + Related visitors API lets you link web visits and in-app browser visits that originated from the same mobile device. It searches the past 6 months of identification events to find the visitor IDs that belong to the same mobile device as the given visitor ID. ⚠️ Please note that this API is not enabled by default and is billable separately. ⚠️ If you would like to use Related visitors API, please contact our [support team](https://fingerprint.com/support). To learn more, see [Related visitors API reference](https://dev.fingerprint.com/reference/related-visitors-api). # noqa: E501 |
| 282 | + This method makes a synchronous HTTP request by default. To make an |
| 283 | + asynchronous HTTP request, please pass async_req=True |
| 284 | + >>> thread = api.get_related_visitors_with_http_info(visitor_id, async_req=True) |
| 285 | + >>> result = thread.get() |
| 286 | +
|
| 287 | + :param async_req bool |
| 288 | + :param str visitor_id: The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) for which you want to find the other visitor IDs that originated from the same mobile device. (required) |
| 289 | + :return: RelatedVisitorsResponse |
| 290 | + If the method is called asynchronously, |
| 291 | + returns the request thread. |
| 292 | + """ |
| 293 | + |
| 294 | + all_params = [ |
| 295 | + 'visitor_id', |
| 296 | + 'async_req', |
| 297 | + '_return_http_data_only', |
| 298 | + '_preload_content', |
| 299 | + '_request_timeout'] |
| 300 | + |
| 301 | + params = locals() |
| 302 | + for key, val in params['kwargs'].items(): |
| 303 | + if key not in all_params: |
| 304 | + raise TypeError( |
| 305 | + "Got an unexpected keyword argument '%s'" |
| 306 | + " to method get_related_visitors" % key |
| 307 | + ) |
| 308 | + params[key] = val |
| 309 | + del params['kwargs'] |
| 310 | + # verify the required parameter 'visitor_id' is set |
| 311 | + if 'visitor_id' not in params or params['visitor_id'] is None: |
| 312 | + raise ValueError("Missing the required parameter `visitor_id` when calling `get_related_visitors`") # noqa: E501 |
| 313 | + |
| 314 | + collection_formats = {} |
| 315 | + |
| 316 | + path_params = {} |
| 317 | + |
| 318 | + query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.1.0')] |
| 319 | + if 'visitor_id' in params: |
| 320 | + query_params.append(('visitor_id', params['visitor_id'])) # noqa: E501 |
| 321 | + |
| 322 | + header_params = {} |
| 323 | + |
| 324 | + form_params = [] |
| 325 | + local_var_files = {} |
| 326 | + |
| 327 | + body_params = None |
| 328 | + # HTTP header `Accept` |
| 329 | + header_params['Accept'] = self.api_client.select_header_accept( |
| 330 | + ['application/json']) # noqa: E501 |
| 331 | + |
| 332 | + # Authentication setting |
| 333 | + auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501 |
| 334 | + |
| 335 | + try: |
| 336 | + return self.api_client.call_api( |
| 337 | + '/related-visitors', 'GET', |
| 338 | + path_params, |
| 339 | + query_params, |
| 340 | + header_params, |
| 341 | + body=body_params, |
| 342 | + post_params=form_params, |
| 343 | + files=local_var_files, |
| 344 | + response_type='RelatedVisitorsResponse', # noqa: E501 |
| 345 | + auth_settings=auth_settings, |
| 346 | + async_req=params.get('async_req'), |
| 347 | + _return_http_data_only=params.get('_return_http_data_only'), |
| 348 | + _preload_content=params.get('_preload_content', True), |
| 349 | + _request_timeout=params.get('_request_timeout'), |
| 350 | + collection_formats=collection_formats) |
| 351 | + except ApiException as e: |
| 352 | + if e.status == 400: |
| 353 | + error = self.api_client.deserialize(e, 'ErrorResponse', True) |
| 354 | + raise extend_exception(e, error) |
| 355 | + if e.status == 403: |
| 356 | + error = self.api_client.deserialize(e, 'ErrorResponse', True) |
| 357 | + raise extend_exception(e, error) |
| 358 | + if e.status == 404: |
| 359 | + error = self.api_client.deserialize(e, 'ErrorResponse', True) |
| 360 | + raise extend_exception(e, error) |
| 361 | + if e.status == 429: |
| 362 | + error = self.api_client.deserialize(e, 'ErrorResponse', True) |
| 363 | + raise extend_exception(e, error) |
| 364 | + raise e |
| 365 | + |
255 | 366 | def get_visits(self, visitor_id: str, **kwargs) -> Union[VisitorsGetResponse, AsyncResult[VisitorsGetResponse]]: # noqa: E501
|
256 | 367 | """Get visits by visitor ID # noqa: E501
|
257 | 368 |
|
|
0 commit comments