|
23 | 23 | from onfido.models.addresses_list import AddressesList |
24 | 24 | from onfido.models.applicant import Applicant |
25 | 25 | from onfido.models.applicant_builder import ApplicantBuilder |
| 26 | +from onfido.models.applicant_consent import ApplicantConsent |
26 | 27 | from onfido.models.applicant_updater import ApplicantUpdater |
27 | 28 | from onfido.models.applicants_list import ApplicantsList |
28 | 29 | from onfido.models.check import Check |
@@ -7293,6 +7294,267 @@ def _find_applicant_serialize( |
7293 | 7294 |
|
7294 | 7295 |
|
7295 | 7296 |
|
| 7297 | + @validate_call |
| 7298 | + def find_applicant_consents( |
| 7299 | + self, |
| 7300 | + applicant_id: StrictStr, |
| 7301 | + _request_timeout: Union[ |
| 7302 | + None, |
| 7303 | + Annotated[StrictFloat, Field(gt=0)], |
| 7304 | + Tuple[ |
| 7305 | + Annotated[StrictFloat, Field(gt=0)], |
| 7306 | + Annotated[StrictFloat, Field(gt=0)] |
| 7307 | + ] |
| 7308 | + ] = None, |
| 7309 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 7310 | + _content_type: Optional[StrictStr] = None, |
| 7311 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 7312 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 7313 | + ) -> List[ApplicantConsent]: |
| 7314 | + """Retrieve Applicant Consents |
| 7315 | + |
| 7316 | + Retrieves consents for single applicant. |
| 7317 | + |
| 7318 | + :param applicant_id: (required) |
| 7319 | + :type applicant_id: str |
| 7320 | + :param _request_timeout: timeout setting for this request. If one |
| 7321 | + number provided, it will be total request |
| 7322 | + timeout. It can also be a pair (tuple) of |
| 7323 | + (connection, read) timeouts. |
| 7324 | + :type _request_timeout: int, tuple(int, int), optional |
| 7325 | + :param _request_auth: set to override the auth_settings for an a single |
| 7326 | + request; this effectively ignores the |
| 7327 | + authentication in the spec for a single request. |
| 7328 | + :type _request_auth: dict, optional |
| 7329 | + :param _content_type: force content-type for the request. |
| 7330 | + :type _content_type: str, Optional |
| 7331 | + :param _headers: set to override the headers for a single |
| 7332 | + request; this effectively ignores the headers |
| 7333 | + in the spec for a single request. |
| 7334 | + :type _headers: dict, optional |
| 7335 | + :param _host_index: set to override the host_index for a single |
| 7336 | + request; this effectively ignores the host_index |
| 7337 | + in the spec for a single request. |
| 7338 | + :type _host_index: int, optional |
| 7339 | + :return: Returns the result object. |
| 7340 | + """ # noqa: E501 |
| 7341 | + |
| 7342 | + _param = self._find_applicant_consents_serialize( |
| 7343 | + applicant_id=applicant_id, |
| 7344 | + _request_auth=_request_auth, |
| 7345 | + _content_type=_content_type, |
| 7346 | + _headers=_headers, |
| 7347 | + _host_index=_host_index |
| 7348 | + ) |
| 7349 | + |
| 7350 | + _response_types_map: Dict[str, Optional[str]] = { |
| 7351 | + '200': "List[ApplicantConsent]", |
| 7352 | + } |
| 7353 | + response_data = self.api_client.call_api( |
| 7354 | + *_param, |
| 7355 | + _request_timeout=_request_timeout |
| 7356 | + ) |
| 7357 | + response_data.read() |
| 7358 | + return self.api_client.response_deserialize( |
| 7359 | + response_data=response_data, |
| 7360 | + response_types_map=_response_types_map, |
| 7361 | + ).data |
| 7362 | + |
| 7363 | + |
| 7364 | + @validate_call |
| 7365 | + def find_applicant_consents_with_http_info( |
| 7366 | + self, |
| 7367 | + applicant_id: StrictStr, |
| 7368 | + _request_timeout: Union[ |
| 7369 | + None, |
| 7370 | + Annotated[StrictFloat, Field(gt=0)], |
| 7371 | + Tuple[ |
| 7372 | + Annotated[StrictFloat, Field(gt=0)], |
| 7373 | + Annotated[StrictFloat, Field(gt=0)] |
| 7374 | + ] |
| 7375 | + ] = None, |
| 7376 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 7377 | + _content_type: Optional[StrictStr] = None, |
| 7378 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 7379 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 7380 | + ) -> ApiResponse[List[ApplicantConsent]]: |
| 7381 | + """Retrieve Applicant Consents |
| 7382 | + |
| 7383 | + Retrieves consents for single applicant. |
| 7384 | + |
| 7385 | + :param applicant_id: (required) |
| 7386 | + :type applicant_id: str |
| 7387 | + :param _request_timeout: timeout setting for this request. If one |
| 7388 | + number provided, it will be total request |
| 7389 | + timeout. It can also be a pair (tuple) of |
| 7390 | + (connection, read) timeouts. |
| 7391 | + :type _request_timeout: int, tuple(int, int), optional |
| 7392 | + :param _request_auth: set to override the auth_settings for an a single |
| 7393 | + request; this effectively ignores the |
| 7394 | + authentication in the spec for a single request. |
| 7395 | + :type _request_auth: dict, optional |
| 7396 | + :param _content_type: force content-type for the request. |
| 7397 | + :type _content_type: str, Optional |
| 7398 | + :param _headers: set to override the headers for a single |
| 7399 | + request; this effectively ignores the headers |
| 7400 | + in the spec for a single request. |
| 7401 | + :type _headers: dict, optional |
| 7402 | + :param _host_index: set to override the host_index for a single |
| 7403 | + request; this effectively ignores the host_index |
| 7404 | + in the spec for a single request. |
| 7405 | + :type _host_index: int, optional |
| 7406 | + :return: Returns the result object. |
| 7407 | + """ # noqa: E501 |
| 7408 | + |
| 7409 | + _param = self._find_applicant_consents_serialize( |
| 7410 | + applicant_id=applicant_id, |
| 7411 | + _request_auth=_request_auth, |
| 7412 | + _content_type=_content_type, |
| 7413 | + _headers=_headers, |
| 7414 | + _host_index=_host_index |
| 7415 | + ) |
| 7416 | + |
| 7417 | + _response_types_map: Dict[str, Optional[str]] = { |
| 7418 | + '200': "List[ApplicantConsent]", |
| 7419 | + } |
| 7420 | + response_data = self.api_client.call_api( |
| 7421 | + *_param, |
| 7422 | + _request_timeout=_request_timeout |
| 7423 | + ) |
| 7424 | + response_data.read() |
| 7425 | + return self.api_client.response_deserialize( |
| 7426 | + response_data=response_data, |
| 7427 | + response_types_map=_response_types_map, |
| 7428 | + ) |
| 7429 | + |
| 7430 | + |
| 7431 | + @validate_call |
| 7432 | + def find_applicant_consents_without_preload_content( |
| 7433 | + self, |
| 7434 | + applicant_id: StrictStr, |
| 7435 | + _request_timeout: Union[ |
| 7436 | + None, |
| 7437 | + Annotated[StrictFloat, Field(gt=0)], |
| 7438 | + Tuple[ |
| 7439 | + Annotated[StrictFloat, Field(gt=0)], |
| 7440 | + Annotated[StrictFloat, Field(gt=0)] |
| 7441 | + ] |
| 7442 | + ] = None, |
| 7443 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 7444 | + _content_type: Optional[StrictStr] = None, |
| 7445 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 7446 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 7447 | + ) -> RESTResponseType: |
| 7448 | + """Retrieve Applicant Consents |
| 7449 | + |
| 7450 | + Retrieves consents for single applicant. |
| 7451 | + |
| 7452 | + :param applicant_id: (required) |
| 7453 | + :type applicant_id: str |
| 7454 | + :param _request_timeout: timeout setting for this request. If one |
| 7455 | + number provided, it will be total request |
| 7456 | + timeout. It can also be a pair (tuple) of |
| 7457 | + (connection, read) timeouts. |
| 7458 | + :type _request_timeout: int, tuple(int, int), optional |
| 7459 | + :param _request_auth: set to override the auth_settings for an a single |
| 7460 | + request; this effectively ignores the |
| 7461 | + authentication in the spec for a single request. |
| 7462 | + :type _request_auth: dict, optional |
| 7463 | + :param _content_type: force content-type for the request. |
| 7464 | + :type _content_type: str, Optional |
| 7465 | + :param _headers: set to override the headers for a single |
| 7466 | + request; this effectively ignores the headers |
| 7467 | + in the spec for a single request. |
| 7468 | + :type _headers: dict, optional |
| 7469 | + :param _host_index: set to override the host_index for a single |
| 7470 | + request; this effectively ignores the host_index |
| 7471 | + in the spec for a single request. |
| 7472 | + :type _host_index: int, optional |
| 7473 | + :return: Returns the result object. |
| 7474 | + """ # noqa: E501 |
| 7475 | + |
| 7476 | + _param = self._find_applicant_consents_serialize( |
| 7477 | + applicant_id=applicant_id, |
| 7478 | + _request_auth=_request_auth, |
| 7479 | + _content_type=_content_type, |
| 7480 | + _headers=_headers, |
| 7481 | + _host_index=_host_index |
| 7482 | + ) |
| 7483 | + |
| 7484 | + _response_types_map: Dict[str, Optional[str]] = { |
| 7485 | + '200': "List[ApplicantConsent]", |
| 7486 | + } |
| 7487 | + response_data = self.api_client.call_api( |
| 7488 | + *_param, |
| 7489 | + _request_timeout=_request_timeout |
| 7490 | + ) |
| 7491 | + return response_data.response |
| 7492 | + |
| 7493 | + |
| 7494 | + def _find_applicant_consents_serialize( |
| 7495 | + self, |
| 7496 | + applicant_id, |
| 7497 | + _request_auth, |
| 7498 | + _content_type, |
| 7499 | + _headers, |
| 7500 | + _host_index, |
| 7501 | + ) -> RequestSerialized: |
| 7502 | + |
| 7503 | + _host = None |
| 7504 | + |
| 7505 | + _collection_formats: Dict[str, str] = { |
| 7506 | + } |
| 7507 | + |
| 7508 | + _path_params: Dict[str, str] = {} |
| 7509 | + _query_params: List[Tuple[str, str]] = [] |
| 7510 | + _header_params: Dict[str, Optional[str]] = _headers or {} |
| 7511 | + _form_params: List[Tuple[str, str]] = [] |
| 7512 | + _files: Dict[ |
| 7513 | + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] |
| 7514 | + ] = {} |
| 7515 | + _body_params: Optional[bytes] = None |
| 7516 | + |
| 7517 | + # process the path parameters |
| 7518 | + if applicant_id is not None: |
| 7519 | + _path_params['applicant_id'] = applicant_id |
| 7520 | + # process the query parameters |
| 7521 | + # process the header parameters |
| 7522 | + # process the form parameters |
| 7523 | + # process the body parameter |
| 7524 | + |
| 7525 | + |
| 7526 | + # set the HTTP header `Accept` |
| 7527 | + if 'Accept' not in _header_params: |
| 7528 | + _header_params['Accept'] = self.api_client.select_header_accept( |
| 7529 | + [ |
| 7530 | + 'application/json' |
| 7531 | + ] |
| 7532 | + ) |
| 7533 | + |
| 7534 | + |
| 7535 | + # authentication setting |
| 7536 | + _auth_settings: List[str] = [ |
| 7537 | + 'Token' |
| 7538 | + ] |
| 7539 | + |
| 7540 | + return self.api_client.param_serialize( |
| 7541 | + method='GET', |
| 7542 | + resource_path='/applicants/{applicant_id}/consents', |
| 7543 | + path_params=_path_params, |
| 7544 | + query_params=_query_params, |
| 7545 | + header_params=_header_params, |
| 7546 | + body=_body_params, |
| 7547 | + post_params=_form_params, |
| 7548 | + files=_files, |
| 7549 | + auth_settings=_auth_settings, |
| 7550 | + collection_formats=_collection_formats, |
| 7551 | + _host=_host, |
| 7552 | + _request_auth=_request_auth |
| 7553 | + ) |
| 7554 | + |
| 7555 | + |
| 7556 | + |
| 7557 | + |
7296 | 7558 | @validate_call |
7297 | 7559 | def find_check( |
7298 | 7560 | self, |
|
0 commit comments